bsd.README revision 1.201
1#	$NetBSD: bsd.README,v 1.201 2008/02/27 00:36:00 lukem Exp $
2#	@(#)bsd.README	8.2 (Berkeley) 4/2/94
3
4This is the README file for the new (as of 1993) make "include" files
5for the BSD source tree.  The files are installed in /usr/share/mk, and
6are, by convention, named with the suffix ".mk".
7
8Note, this file is not intended to replace reading through the .mk
9files for anything tricky.
10
11=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
12
13RANDOM THINGS WORTH KNOWING:
14
15The files are simply C-style #include files, and pretty much behave like
16you'd expect.  The syntax is slightly different in that a single '.' is
17used instead of the hash mark, i.e. ".include <bsd.prog.mk>".
18
19One difference that will save you lots of debugging time is that inclusion
20of the file is normally done at the *end* of the Makefile.  The reason for
21this is because .mk files often modify variables and behavior based on the
22values of variables set in the Makefile.  To make this work, remember that
23the FIRST target found is the target that is used, i.e. if the Makefile has:
24
25	a:
26		echo a
27	a:
28		echo a number two
29
30the command "make a" will echo "a".  To make things confusing, the SECOND
31variable assignment is the overriding one, i.e. if the Makefile has:
32
33	a=	foo
34	a=	bar
35
36	b:
37		echo ${a}
38
39the command "make b" will echo "bar".  This is for compatibility with the
40way the V7 make behaved.
41
42It's fairly difficult to make the BSD .mk files work when you're building
43multiple programs in a single directory.  It's a lot easier to split up the
44programs than to deal with the problem.  Most of the agony comes from making
45the "obj" directory stuff work right, not because we switched to a new version
46of make.  So, don't get mad at us, figure out a better way to handle multiple
47architectures so we can quit using the symbolic link stuff.  (Imake doesn't
48count.)
49
50The file .depend in the source directory is expected to contain dependencies
51for the source files.  This file is read automatically by make after reading
52the Makefile.
53
54The variable DESTDIR works as before.  It's not set anywhere but will change
55the tree where the file gets installed.
56
57The profiled libraries are no longer built in a different directory than
58the regular libraries.  A new suffix, ".po", is used to denote a profiled
59object, and ".so" denotes a shared (position-independent) object.
60
61There are various make variables used during the build.
62
63Many variables support a (case sensitive) value of "no" or "yes",
64and are tested with  ${VAR} == "no"  and  ${VAR} != "no" .
65
66
67The basic rule for the variable naming scheme is as follows:
68
69MKxxx		Can be set to "no" to disable functionality, or
70		"yes" to enable it.
71		Usually defaults to "yes", although some variables
72		default to "no".
73		Due to make(1) implementation issues, if a temporary
74		command-line override of a mk.conf or <bsd.own.mk>
75		setting is required whilst still honouring a particular
76		Makefile's setting of MKxxx, use
77			env MKxxx=value make
78		instead of
79			make MKxxx=value
80
81NOxxx		If defined, disables a feature.
82		Not intended for users.
83		This is to allow Makefiles to disable functionality
84		that they don't support (such as missing man pages).
85		NOxxx variables must be defined before <bsd.own.mk>
86		is included.
87
88The following variables that control how things are made/installed that
89are not set by default. These should not be set by Makefiles; they're for
90the user to define in MAKECONF (see <bsd.own.mk>, below) or on the make(1)
91command line:
92
93BUILD 		If defined, 'make install' checks that the targets in the
94		source directories are up-to-date and remakes them if they
95                are out of date, instead of blindly trying to install
96                out of date or non-existent targets.
97
98MAKEVERBOSE	Control how "verbose" the standard make(1) rules are.
99		Default: 2
100		Supported values:
101		    0	Minimal output ("quiet")
102		    1	Describe what is occurring
103		    2	Describe what is occurring and echo the actual command
104
105
106MKBFD		If "no", don't build libbfd, libiberty, or any of the things
107		that depend on them (binutils/gas/ld, gdb, dbsym, mdsetimage).
108		Default: yes
109
110MKCATPAGES	If "no", don't build or install the catman pages.
111		Default: yes
112
113MKCRYPTO	If "no", no cryptography support will be built into the system,
114		and also acts as "MKKERBEROS=no".
115		Default: yes
116
117MKCRYPTO_IDEA	If not "no", IDEA support will be built into libcrypto_idea.a.
118		Default: no
119
120MKCRYPTO_MDC2	If not "no", MDC2 support will be built into libcrypto_mdc2.a
121		Default: no
122
123MKCRYPTO_RC5	If not "no", RC5 support will be built into libcrypto_rc5.a.
124		Default: no
125
126MKCVS		If "no", don't build or install cvs(1).
127		Default: yes
128
129MKDEBUG		If "no", don't build and install separate debugging symbols
130		into /usr/libdata/debug.
131		Default: no
132
133MKDEBUGLIB	Build debugging libraries.
134		Default: no
135
136MKDOC		If "no", don't build or install the documentation.
137		Default: yes
138
139MKDYNAMICROOT	If "no", build programs in /bin and /sbin statically,
140		don't install certain libraries in /lib, and don't
141		install the shared linker into /libexec.
142		Default: yes
143
144MKGCC		If "no", don't build gcc(1) or any of the GCC-related
145		libraries (libgcc, libobjc, libstdc++).
146		Default: yes
147
148MKGCCCMDS	If "no", don't build gcc(1), but do build the GCC-related
149		libraries (libgcc, libobjc, libstdc++).
150		Default: yes
151
152MKGDB		If "no", don't build gdb(1).
153		Default: yes
154
155MKHESIOD	If "no", disables building of Hesiod infrastructure
156		(libraries and support programs).
157		Default: yes
158
159MKHOSTOBJ	If not "no", for programs intended to be run on the compile
160		host, the name, release, and architecture of the host
161		operating system will be suffixed to the name of the object
162		directory created by "make obj".
163		Default: no
164
165MKHTML		If "no", don't build or install the html man pages.
166		Default: no
167
168MKIEEEFP	If "no", don't add code for IEEE754/IEC60559 conformance.
169		Has no effect on most platforms.
170		Default: yes
171
172MKINET6		If "no", disables building of INET6 (IPv6) infrastructure
173		(libraries and support programs).
174		Default: yes
175
176MKINFO		If "no", don't build or install Info documentation from
177		Texinfo source files.
178		Default: yes
179
180MKIPFILTER	If "no", don't build or install the IP Filter programs and LKM.
181		Default: yes
182
183MKISCSI		If "no", don't build or install iscsi library or applications
184		(depends on libpthread.)
185		Default: yes
186
187MKKERBEROS	If "no", disables building of Kerberos v5
188		infrastructure (libraries and support programs).
189		Default: yes
190
191MKLINKLIB	If "no", act as "MKPICINSTALL=no MKPROFILE=no".
192		Also:
193			- don't install the .a libraries
194			- don't install _pic.a libraries on PIC systems
195			- don't build .a libraries on PIC systems
196			- don't install the .so symlink on ELF systems
197		I.e, only install the shared library (and the .so.major
198		symlink on ELF).
199		Default: yes
200
201MKLINT		If "no", don't build or install the lint libraries.
202		Default: yes
203
204MKMAN		If "no", don't build or install the man or catman pages,
205		and also acts as "MKCATPAGES=no MKHTML=no".
206		Default: yes
207
208MKMANZ		If not "no", compress manual pages at installation time.
209		Default: no
210
211MKMODULAR	If "no", don't build the versions of modload(8), modstat(8)
212		and modunload(8) that use the new modules framework present
213		in the kernel (enabled separately using 'options MODULAR'
214		int the configuration file).  Also don't build any other
215		stuff that may rely on this support, such as tests or kernel
216		modules.
217		Note: This flag will disappear when the new modules framework
218		is complete enough to replace the old LKM, effectively
219		switching it to "yes" by default.
220		Default: no
221
222MKNLS		If "no", don't build or install the NLS files and locale
223		definition files.
224		Default: yes
225
226MKOBJ		If "no", don't enable the rule which creates objdirs,
227		and also acts as "MKOBJDIRS=no".
228		Default: yes
229
230MKOBJDIRS	If "no", don't create objdirs during a "make build".
231		Default: no
232
233MKPAM		If "no", disables building of PAM authentication
234		infrastructure (libraries and support programs).
235		Default: yes
236
237MKPF		If "no", don't build or install the pf programs and LKM.
238		Default: yes
239
240MKPIC		If "no", don't build or install shared libraries, and
241		also acts as "MKPICLIB=no"
242		Default: yes (for MACHINE_ARCHs that support it) 
243
244MKPICINSTALL	If "no", don't install the *_pic.a libraries.
245		Default: yes
246
247MKPICLIB	If "no", don't build *_pic.a libraries, and build the
248		shared object libraries from the .a libraries.
249		A symlink is installed in ${DESTDIR}/usr/lib for the
250		_pic.a library pointing to the .a library.
251		Default: yes
252
253MKPIE		If "no", create regular executables. Otherwise create
254		PIE (Position Independent Executables).
255		Default: no
256
257MKPOSTFIX	If "no", don't build or install postfix(1).
258		Default: yes
259
260MKPROFILE	If "no", don't build or install the profiling (*_p.a) libraries.
261		Default: yes
262
263MKPUFFS		If "no", don't build librefuse (lib/librefuse) or
264		puffs applications (usr.sbin/puffs).  NOTE: libpuffs
265		is always built due to historic reasons.  This flag will
266		disappear once puffs is no longer considered experimental,
267		i.e. it will effectively default to "yes".
268		Default: no
269
270MKSHARE		If "no", act as "MKCATPAGES=no MKDOC=no MKHTML=no MKINFO=no
271		MKMAN=no MKNLS=no".
272		I.e, don't build catman pages, documentation, Info
273		documentation, man pages, NLS files, ...
274		Default: yes
275
276MKSKEY		If "no", disables building of S/key authentication
277		infrastructure (libraries and support programs).
278		Default: yes
279
280MKSOFTFLOAT	If not "no", build with options to enable the compiler to
281		generate output containing library calls for floating
282		point and possibly soft-float library support.
283		Default: no
284
285MKSTATICLIB	If "no", don't build or install the normal static (*.a)
286		libraries.
287		Default: yes
288
289MKUNPRIVED	If not "no", don't set the owner/group/mode when installing
290		files or directories, and keep a metadata log of what
291		the owner/group/mode should be.  This allows a
292		non-root "make install".
293		Default: no
294
295MKUPDATE 	If not "no", 'make install' only installs targets that are
296		more recently modified in the source directories that their
297		installed counterparts.
298		Default: no
299
300MKX11		If not "no", 'make build' also descends into src/x11
301		to cross build X11R6 and automatically enables creation
302		of X sets.
303		Default: no
304
305MKYP		If "no", disables building of YP (NIS)
306		infrastructure (libraries and support programs).
307		Default: yes
308
309USE_HESIOD	If "no", disables building Hesiod support into
310		various system utilities/libraries that support it.
311		If ${MKHESIOD} is "no", USE_HESIOD will also be
312		forced to "no".
313
314USE_INET6	If "no", disables building INET6 (IPv6) support into
315		various system utilities/libraries that support it.
316		If ${MKINET6} is "no", USE_INET6 will also be
317		forced to "no".
318
319USE_JEMALLOC	If "no", disables building the "jemalloc" allocator
320		designed for improved performance with threaded
321		applications.  The "phkmalloc" allocator as used up
322		before NetBSD-5.0 will be substituted.
323
324USE_KERBEROS	If "no", disables building Kerberos v5
325		support into various system utilities/libraries that
326		support it.  If ${MKKERBEROS} is "no", USE_KERBEROS
327		will also be forced to "no".
328
329USE_PAM		If "no", disables building PAM authentication support
330		into various system utilities/libraries that support it.
331		If ${MKPAM} is "no", USE_PAM will also be forced to "no".
332
333USE_SKEY	If "no", disables building S/key authentication
334		support into various system utilities/libraries that
335		support it.  If ${MKSKEY} is "no", USE_SKEY will
336		also be forced to "no".
337
338USE_SSP		If "no", disables GCC stack protection code, which
339		detects stack overflows and aborts the program. This
340		imposes some performance penalty.
341		Default: no
342
343USE_YP		If "no", disables building YP (NIS) support into
344		various system utilities/libraries that support it.
345		If ${MKYP} is "no", USE_YP will also be forced to "no".
346
347COPTS.lib<lib>
348OBJCOPTS.lib<lib>
349LDADD.lib<lib>
350CPPFLAGS.lib<lib>
351CXXFLAGS.lib<lib>
352COPTS.<prog>
353OBJCCOPTS.<prog>
354LDADD.<prog>
355CPPFLAGS.<prog>
356CXXFLAGS.<prog>	These provide a way to specify additions to the associated
357		variables in a way that applies only to a particular library
358		or program.  <lib> corresponds to the LIB variable set in
359		the library's makefile.  <prog> corresponds to either PROG
360		or PROG_CXX (if set).  For example, if COPTS.libcrypto is
361		set to "-g", "-g" will be added to COPTS only when compiling
362		the crypto library.
363
364=-=-=-=-=   sys.mk   =-=-=-=-=
365
366The include file <sys.mk> has the default rules for all makes, in the BSD
367environment or otherwise.  You probably don't want to touch this file.
368
369=-=-=-=-=   bsd.own.mk   =-=-=-=-=
370
371The include file <bsd.own.mk> contains source tree configuration parameters,
372such as the owners, groups, etc. for both manual pages and binaries, and
373a few global "feature configuration" parameters.
374
375It has no targets.
376
377To get system-specific configuration parameters, <bsd.own.mk> will try to
378include the file specified by the "MAKECONF" variable.  If MAKECONF is not
379set, or no such file exists, the system make configuration file, /etc/mk.conf
380is included.  These files may define any of the variables described below.
381
382<bsd.own.mk> sets the following variables, if they are not already defined
383(defaults are in brackets):
384
385NETBSDSRCDIR	Top of the NetBSD source tree.
386		If _SRC_TOP_ != "", that will be used as the default,
387		otherwise BSDSRCDIR will be used as the default.
388		Various makefiles within the NetBSD source tree will
389		use this to reference the top level of the source tree.
390
391_SRC_TOP_	Top of the system source tree, as determined by <bsd.own.mk>
392		based on the presence of tools/ and build.sh.  This variable
393		is "internal" to <bsd.own.mk>, although its value is only
394		determined once and then propagated to all sub-makes.
395
396BSDSRCDIR	The real path to the system sources, so that 'make obj'
397		will work correctly.  [/usr/src]
398
399BSDOBJDIR	The real path to the system 'obj' tree, so that 'make obj'
400		will work correctly.  [/usr/obj]
401
402BINGRP		Binary group.  [wheel]
403
404BINOWN		Binary owner.  [root]
405
406BINMODE		Binary mode.  [555]
407
408NONBINMODE	Mode for non-executable files.  [444]
409
410MANDIR		Base path for manual installation.  [/usr/share/man/cat]
411
412MANGRP		Manual group.  [wheel]
413
414MANOWN		Manual owner.  [root]
415
416MANMODE		Manual mode.  [${NONBINMODE}]
417
418MANINSTALL	Manual installation type: maninstall, catinstall, or both
419		[maninstall catinstall]
420
421LDSTATIC	Control program linking; if set blank, link everything
422		dynamically.  If set to "-static", link everything statically.
423		If not set, programs link according to their makefile.
424
425LIBDIR		Base path for library installation.  [/usr/lib]
426
427LINTLIBDIR	Base path for lint(1) library installation.  [/usr/libdata/lint]
428
429LIBGRP		Library group.  [${BINGRP}]
430
431LIBOWN		Library owner.  [${BINOWN}]
432
433LIBMODE		Library mode.  [${NONBINMODE}]
434
435DOCDIR		Base path for system documentation (e.g. PSD, USD, etc.)
436	        installation.  [/usr/share/doc]
437
438HTMLDOCDIR	Base path for html system documentation installation.
439		[/usr/share/doc/html]
440
441DOCGRP		Documentation group.  [wheel]
442
443DOCOWN		Documentation owner.  [root]
444
445DOCMODE		Documentation mode.  [${NONBINMODE}]
446
447NLSDIR		Base path for Native Language Support files installation.
448		[/usr/share/nls]
449
450NLSGRP		Native Language Support files group.  [wheel]
451
452NLSOWN		Native Language Support files owner.  [root]
453
454NLSMODE		Native Language Support files mode.  [${NONBINMODE}]
455
456X11SRCDIR	The path to the xsrc tree.  [/usr/xsrc]
457
458X11SRCDIR.xc	The path to the X11R6 xc src tree.  [${X11SRCDIR}/xfree/xc]
459
460X11SRCDIR.local	The path to the local X11R6 src tree.  [${X11SRCDIR}/local]
461
462X11ROOTDIR	Root directory of the X11 installation.  [/usr/X11R6]
463
464X11BINDIR	X11 bin directory.  [${X11ROOTDIR}/bin]
465
466X11FONTDIR	X11 font directory.  [${X11ROOTDIR}/lib/X11/fonts]
467
468X11INCDIR	X11 include directory.  [${X11ROOTDIR}/include]
469
470X11LIBDIR	X11 lib/x11 (config) directory.  [${X11ROOTDIR}/lib/X11]
471
472X11MANDIR	X11 manual directory.  [${X11ROOTDIR}/man]
473
474X11USRLIBDIR	X11 library directory.  [${X11ROOTDIR}/lib]
475
476STRIPFLAG	The flag passed to the install program to cause the binary
477		to be stripped.  This is to be used when building your
478		own install script so that the entire system can be made
479		stripped/not-stripped using a single knob.  []
480
481COPY		The flag passed to the install program to cause the binary
482		to be copied rather than moved.  This is to be used when
483		building our own install script so that the entire system
484		can either be installed with copies, or with moves using
485		a single knob.  [-c]
486
487MAKEDIRTARGET dir target [params]
488		Runs "cd $${dir} && ${MAKE} [params] $${target}",
489		displaying a "pretty" message whilst doing so.
490
491RELEASEMACHINEDIR
492		Subdirectory used below RELEASEDIR when building
493		a release.  [${MACHINE}]
494
495RELEASEMACHINE	Subdirectory or path component used for the following
496		paths:
497			distrib/${RELEASEMACHINE}
498			distrib/notes/${RELEASEMACHINE}
499			etc/etc.${RELEASEMACHINE}
500		Used when building a release.  [${MACHINE}]
501
502Additionally, the following variables may be set by <bsd.own.mk> or in a
503make configuration file to modify the behaviour of the system build
504process (default values are in brackets along with comments, if set by
505<bsd.own.mk>):
506
507USETOOLS	Indicates whether the tools specified by ${TOOLDIR} should
508		be used as part of a build in progress.
509		Supported values:
510
511		yes	Use the tools from TOOLDIR.
512			Must be set to this if cross-compiling.
513
514		no	Do not use the tools from TOOLDIR, but refuse to
515			build native compilation tool components that are
516			version-specific for that tool.
517
518		never	Do not use the tools from TOOLDIR, even when
519			building native tool components.  This is similar to
520			the traditional NetBSD build method, but does not
521			verify that the compilation tools in use are
522			up-to-date enough in order to build the tree
523			successfully.  This may cause build or runtime
524			problems when building the whole NetBSD source tree.
525
526		Default: "yes" if building all or part of a whole NetBSD
527		source tree (detected automatically); "no" otherwise
528		(to preserve traditional semantics of the <bsd.*.mk>
529		make(1) include files).
530
531OBJECT_FMT	Object file format.  [set to "ELF" on architectures that
532		use ELF -- currently all architectures].
533
534TOOLCHAIN_MISSING
535		If not "no", this indicates that the platform being built
536		does not have a working in-tree toolchain.  If the
537		${MACHINE_ARCH} in question falls into this category,
538		TOOLCHAIN_MISSING is conditionally assigned the value "yes". 
539		Otherwise, the variable is unconditionally assigned the
540		value "no".
541		If not "no", ${MKBFD}, ${MKGCC}, and ${MKGDB} are
542		unconditionally assigned the value "no".
543
544EXTERNAL_TOOLCHAIN
545		This variable is not directly set by <bsd.own.mk>, but
546		including <bsd.own.mk> is the canonical way to gain
547		access to this variable.  The variable should be defined
548		either in the user's environment or in the user's mk.conf
549		file.  If defined, this variable indicates the root of
550		an external toolchain which will be used to build the
551		tree.  For example, if a platform is a ${TOOLCHAIN_MISSING}
552		platform, EXTERNAL_TOOLCHAIN can be used to re-enable the
553		cross-compile framework.
554
555		If EXTERNAL_TOOLCHAIN is defined, ${MKGCC} is unconditionally
556		assigned the value "no", since the external version of the
557		compiler may not be able to build the library components of
558		the in-tree compiler.
559
560		NOTE: This variable is not yet used in as many places as
561		it should be.  Expect the exact semantics of this variable
562		to change in the short term as parts of the cross-compile
563		framework continue to be cleaned up.
564
565<bsd.own.mk> is generally useful when building your own Makefiles so that
566they use the same default owners etc. as the rest of the tree.
567
568
569=-=-=-=-=   bsd.dep.mk   =-=-=-=-=
570
571The include file <bsd.dep.mk> contains the default targets for building
572.depend files.  It creates .d files from entries in SRCS and DPSRCS
573that are C, C++, or Objective C source files, and builds .depend from the
574.d files.  All other files in SRCS and all of DPSRCS will be used as
575dependencies for the .d files.  In order for this to function correctly,
576it should be .included after all other .mk files and directives that may
577modify SRCS or DPSRCS.  It uses the following variables:
578
579SRCS		List of source files to build the program.
580
581DPSRCS		List of source files which are needed for generating
582		dependencies, but are not needed in ${SRCS}.
583
584
585=-=-=-=-=   bsd.files.mk   =-=-=-=-=
586
587The include file <bsd.files.mk> handles the FILES variables and is included
588from <bsd.lib.mk> and <bsd.prog.mk>, and uses the following variables:
589
590FILES		The list of files to install.
591
592CONFIGFILES	Similar semantics to FILES, except that the files
593		are installed by the `configinstall' target,
594		not the `install' target.
595		The FILES* variables documented below also apply.
596
597FILESOWN	File owner.  [${BINOWN}]
598
599FILESGRP	File group.  [${BINGRP}]
600
601FILESMODE	File mode.  [${BINMODE}]
602
603FILESDIR	The location to install the files.
604
605FILESNAME	Optional name to install each file as.
606
607FILESOWN_<fn>	File owner of the specific file <fn>.
608
609FILESGRP_<fn>	File group of the specific file <fn>.
610
611FILESMODE_<fn>	File mode of the specific file <fn>.
612
613FILESDIR_<fn>	The location to install the specific file <fn>>
614
615FILESNAME_<fn>	Optional name to install <fn> as.
616
617
618BUILDSYMLINKS	List of two word items:
619			lnsrc lntgt
620		For each lnsrc item, create a symlink named lntgt.
621		The lntgt symlinks are removed by the cleandir target.
622
623UUDECODE_FILES	List of files which are stored as <file>.uue in the source
624		tree. Each one will be decoded with ${TOOL_UUDECODE}.
625		The source files have a `.uue' suffix, the generated files do 
626		not.
627
628UUDECODE_FILES_RENAME_fn Rename the output from the decode to the provided name.
629		
630		*NOTE: These files are simply decoded, with no install or other
631		       rule applying implicitly except being added to the clean
632		       target.
633
634=-=-=-=-=   bsd.gcc.mk   =-=-=-=-=
635
636The include file <bsd.gcc.mk> computes various parameters related to GCC
637support libraries.  It defines no targets.  <bsd.own.mk> MUST be included
638before <bsd.gcc.mk>.
639
640The primary users of <bsd.gcc.mk> are <bsd.prog.mk> and <bsd.lib.mk>, each
641of which need to know where to find certain GCC support libraries.
642
643The behavior of <bsd.gcc.mk> is influenced by the EXTERNAL_TOOLCHAIN variable,
644which is generally set by the user.  If EXTERNAL_TOOLCHAIN it set, then
645the compiler is asked where to find the support libraries, otherwise the
646support libraries are found in ${DESTDIR}/usr/lib.
647
648<bsd.gcc.mk> sets the following variables:
649
650_GCC_CRTBEGIN	The full path name to crtbegin.o.
651
652_GCC_CRTBEGINS	The full path name to crtbeginS.o.
653
654_GCC_CRTEND	The full path name to crtend.o.
655
656_GCC_CRTENDS	The full path name to crtendS.o.
657
658_GCC_LIBGCCDIR	The directory where libgcc.a is located.
659
660
661=-=-=-=-=   bsd.inc.mk   =-=-=-=-=
662
663The include file <bsd.inc.mk> defines the includes target and uses the
664variables:
665
666INCS		The list of include files.
667
668INCSDIR		The location to install the include files.
669
670INCSNAME	Target name of the include file, if only one; same as
671		FILESNAME, but for include files.
672
673INCSYMLINKS	Similar to SYMLINKS in <bsd.links.mk>, except that these
674		are installed in the 'includes' target and not the
675		(much later) 'install' target.
676
677INCSNAME_<file>	The name file <file> should be installed as, if not <file>,
678		same as FILESNAME_<file>, but for include files.
679
680
681=-=-=-=-=   bsd.info.mk   =-=-=-=-=
682
683The include file <bsd.info.mk> is used to generate and install GNU Info
684documentation from respective Texinfo source files.  It defines three
685implicit targets (.txi.info, .texi.info, and .texinfo.info), and uses the
686following variables:
687
688TEXINFO		List of Texinfo source files.  Info documentation will
689		consist of single files with the extension replaced by
690		.info.
691
692INFOFLAGS	Flags to pass to makeinfo.  []
693
694
695=-=-=-=-=   bsd.kernobj.mk   =-=-=-=-=
696
697The include file <bsd.kernobj.mk> defines variables related to the
698location of kernel sources and object directories.
699
700KERNSRCDIR	Is the location of the top of the kernel src.
701		[${_SRC_TOP_}/sys]
702
703KERNARCHDIR	Is the location of the machine dependent kernel sources.
704		[arch/${MACHINE}]
705
706KERNCONFDIR	Is where the configuration files for kernels are found.
707		[${KERNSRCDIR}/${KERNARCHDIR}/conf]
708
709KERNOBJDIR	Is the kernel build directory.  The kernel GENERIC for
710		instance will be compiled in ${KERNOBJDIR}/GENERIC.
711		The default value is
712		${MAKEOBJDIRPREFIX}${KERNSRCDIR}/${KERNARCHDIR}/compile
713		if it exists or the target 'obj' is being made.
714		Otherwise the default is
715		${KERNSRCDIR}/${KERNARCHDIR}/compile.
716
717It is important that Makefiles (such as those under src/distrib) that
718wish to find compiled kernels use <bsd.kernobj.mk> and ${KERNOBJDIR}
719rather than make assumptions about the location of the compiled kernel.
720
721
722=-=-=-=-=   bsd.kinc.mk   =-=-=-=-=
723
724The include file <bsd.kinc.mk> defines the many targets (includes,
725subdirectories, etc.), and is used by kernel makefiles to handle
726include file installation.  It is intended to be included alone, by
727kernel Makefiles.  It uses similar variables to <bsd.inc.mk>.
728Please see <bsd.kinc.mk> for more details, and keep the documentation
729in that file up to date.
730
731
732=-=-=-=-=   bsd.lib.mk   =-=-=-=-=
733
734The include file <bsd.lib.mk> has support for building libraries.  It has
735the same eight targets as <bsd.prog.mk>: all, clean, cleandir, depend,
736includes, install, lint, and tags.  Additionally, it has a checkver target
737which checks for installed shared object libraries whose version is greater
738that the version of the source. It has a limited number of suffixes,
739consistent with the current needs of the BSD tree.  <bsd.lib.mk> includes
740<bsd.shlib.mk> to get shared library parameters.
741
742It sets/uses the following variables:
743
744LIB		The name of the library to build.
745
746LIBDIR		Target directory for libraries.
747
748SHLIBINSTALLDIR	Target directory for shared libraries if ${USE_SHLIBDIR}
749		is not "no".
750
751USE_SHLIBDIR	If not "no", use ${SHLIBINSTALLDIR} instead of ${LIBDIR}
752		as the path to install shared libraries to.
753		USE_SHLIBDIR must be defined before <bsd.own.mk> is included.
754		Default: no
755
756MKPRIVATELIB	If not "no", act as "MKPROFILE=no MKPIC=no MKLINT=no",
757		and don't install the (.a) library.
758		This is useful for "build only" helper libraries.
759		Default: no
760
761LINTLIBDIR	Target directory for lint libraries.
762
763LIBGRP		Library group.
764
765LIBOWN		Library owner.
766
767LIBMODE		Library mode.
768
769LDADD		Additional loader objects.
770
771MAN		The manual pages to be installed (use a .1 - .9 suffix).
772
773NOCHECKVER_<library>
774NOCHECKVER	If set, disables checking for installed shared object
775		libraries with versions greater than the source.  A
776		particular library name, without the "lib" prefix, may
777		be appended to the variable name to disable the check for
778		only that library.
779
780SRCS		List of source files to build the library.  Suffix types
781		.s, .c, and .f are supported.  Note, .s files are preferred
782		to .c files of the same name.  (This is not the default for
783		versions of make.)
784
785LIBDPLIBS	A list of the tuples:
786			libname  path-to-srcdir-of-libname
787
788		For each tuple;
789		     *	LIBDO.libname contains the .OBJDIR of the library
790			`libname', and if it is not set it is determined
791			from the srcdir and added to MAKEOVERRIDES (the
792			latter is to allow for build time optimization).
793		     *	LDADD gets  -L${LIBDO.libname} -llibname    added.
794		     *	DPADD gets  ${LIBDO.libname}/liblibname.so  or
795				    ${LIBDO.libname}/liblibname.a   added.
796
797		This variable may be used for individual libraries, as
798		well as in parent directories to cache common libraries 
799		as a build-time optimization.
800
801The include file <bsd.lib.mk> includes the file named "../Makefile.inc"
802if it exists, as well as the include file <bsd.man.mk>.
803
804It has rules for building profiled objects; profiled libraries are
805built by default.
806
807Libraries are ranlib'd when made.
808
809
810=-=-=-=-=   bsd.links.mk   =-=-=-=-=
811
812The include file <bsd.links.mk> handles the LINKS and SYMLINKS variables
813and is included from from <bsd.lib.mk> and <bsd.prog.mk>.
814
815LINKS		The list of hard links, consisting of pairs of paths:
816			source-file target-file
817		${DESTDIR} is prepended to both paths before linking.
818		For example, to link /bin/test and /bin/[, use:
819			LINKS=/bin/test /bin/[
820
821CONFIGLINKS	Similar semantics to LINKS, except that the links
822		are installed by the `configinstall' target,
823		not the `install' target.
824
825SYMLINKS	The list of symbolic links, consisting of pairs of paths:
826			source-file target-file
827		${DESTDIR} is only prepended to target-file before linking.
828		For example, to symlink /usr/bin/tar to /bin/tar resulting
829		in ${DESTDIR}/usr/bin/tar -> /bin/tar:
830			SYMLINKS=/bin/tar /usr/bin/tar
831
832CONFIGSYMLINKS	Similar semantics to SYMLINKS, except that the symbolic links
833		are installed by the `configinstall' target,
834		not the `install' target.
835
836
837=-=-=-=-=   bsd.man.mk   =-=-=-=-=
838
839The include file <bsd.man.mk> handles installing manual pages and their
840links.
841
842It has a two targets:
843
844	maninstall:
845		Install the manual page sources and their links.
846	catinstall:
847		Install the preformatted manual pages and their links.
848
849It sets/uses the following variables:
850
851MANDIR		Base path for manual installation.
852
853MANGRP		Manual group.
854
855MANOWN		Manual owner.
856
857MANMODE		Manual mode.
858
859MANSUBDIR	Subdirectory under the manual page section, i.e. "/vax"
860		or "/tahoe" for machine specific manual pages.
861
862MAN		The manual pages to be installed (use a .1 - .9 suffix).
863
864MLINKS		List of manual page links (using a .1 - .9 suffix).  The
865		linked-to file must come first, the linked file second,
866		and there may be multiple pairs.  The files are soft-linked.
867
868The include file <bsd.man.mk> includes a file named "../Makefile.inc" if
869it exists.
870
871
872=-=-=-=-=   bsd.obj.mk   =-=-=-=-=
873
874The include file <bsd.obj.mk> defines targets related to the creation
875and use of separated object and source directories.
876
877If an environment variable named MAKEOBJDIRPREFIX is set, make(1) uses
878${MAKEOBJDIRPREFIX}${.CURDIR} as the name of the object directory if
879it exists.  Otherwise make(1) looks for the existence of a
880subdirectory (or a symlink to a directory) of the source directory
881into which built targets should be placed.  If an environment variable
882named MAKEOBJDIR is set, make(1) uses its value as the name of the
883object directory; failing that, make first looks for a subdirectory
884named "obj.${MACHINE}", and if that doesn't exist, it looks for "obj".
885
886Object directories are not created automatically by make(1) if they
887don't exist; you need to run a separate "make obj".  (This will happen
888during a top-level build if "MKOBJDIRS" is set to a value other than
889"no").  When the source directory is a subdirectory of ${BSDSRCDIR} --
890and this is determined by a simple string prefix comparison -- object
891directories are created in a separate object directory tree, and a
892symlink to the object directory in that tree is created in the source
893directory; otherwise, "make obj" assumes that you're not in the main
894source tree and that it's not safe to use a separate object tree.
895
896Several variables used by <bsd.obj.mk> control exactly what
897directories and links get created during a "make obj":
898
899MAKEOBJDIR	If set, this is the component name of the object
900		directory.
901
902OBJMACHINE	If this is set but MAKEOBJDIR is not set, creates
903		object directories or links named "obj.${MACHINE}";
904		otherwise, just creates ones named "obj".
905
906USR_OBJMACHINE  If set, and the current directory is a subdirectory of
907		${BSDSRCDIR}, create object directory in the
908		corresponding subdirectory of ${BSDOBJDIR}.${MACHINE};
909		otherwise, create it in the corresponding subdirectory
910		of ${BSDOBJDIR}
911
912BUILDID		If set, the contents of this variable are appended
913		to the object directory name.  If OBJMACHINE is also
914		set, ".${BUILDID}" is added after ".${MACHINE}".
915
916
917=-=-=-=-=   bsd.prog.mk   =-=-=-=-=
918
919The include file <bsd.prog.mk> handles building programs from one or
920more source files, along with their manual pages.  It has a limited number
921of suffixes, consistent with the current needs of the BSD tree. 
922<bsd.prog.mk> includes <bsd.shlib.mk> to get shared library parameters.
923
924It has eight targets:
925
926	all:
927		build the program and its manual page.  This also
928		creates a GDB initialization file (.gdbinit) in
929		the objdir.  The .gdbinit file sets the shared library
930		prefix to ${DESTDIR} to facilitate cross-debugging.
931	clean:
932		remove the program, any object files and the files a.out,
933		Errs, errs, mklog, and ${PROG}.core.
934	cleandir:
935		remove all of the files removed by the target clean, as
936		well as .depend, tags, and any manual pages.
937		`distclean' is a synonym for `cleandir'.
938	depend:
939		make the dependencies for the source files, and store
940		them in the file .depend.
941	includes:
942		install any header files.
943	install:
944		install the program and its manual pages; if the Makefile
945		does not itself define the target install, the targets
946		beforeinstall and afterinstall may also be used to cause
947		actions immediately before and after the install target
948		is executed.
949	lint:
950		run lint on the source files
951	tags:
952		create a tags file for the source files.
953
954It sets/uses the following variables:
955
956BINGRP		Binary group.
957
958BINOWN		Binary owner.
959
960BINMODE		Binary mode.
961
962CLEANFILES	Additional files to remove for the clean and cleandir targets.
963
964COPTS		Additional flags to the compiler when creating C objects.
965
966COPTS.<fn>	Additional flags to the compiler when creating the
967		C objects for <fn>.
968		For <fn>.[ly], "<fn>.c" must be used.
969
970CPUFLAGS	Additional flags to the compiler/assembler to select
971		CPU instruction set options, CPU tuning options, etc.
972
973CPUFLAGS.<fn>	Additional flags to the compiler/assembler for <fn>.
974		For <fn>.[ly], "<fn>.c" must be used.
975
976CPPFLAGS	Additional flags to the C pre-processor.
977
978CPPFLAGS.<fn>	Additional flags to the C pre-processor for <fn>.
979		For <fn>.[ly], "<fn>.c" must be used.
980
981GDBINIT		List of GDB initialization files to add to "source"
982		directives in the .gdbinit file that is created in the
983		objdir.
984
985LDADD		Additional loader objects.  Usually used for libraries.
986		For example, to load with the compatibility and utility
987		libraries, use:
988
989			LDADD+=-lutil -lcompat
990
991LDFLAGS		Additional linker flags (passed to ${CC} during link).
992
993LINKS		See <bsd.links.mk>
994
995OBJCOPTS	Additional flags to the compiler when creating ObjC objects.
996
997OBJCOPTS.<fn>	Additional flags to the compiler when creating the
998		ObjC objects for <fn>.
999		For <fn>.[ly], "<fn>.c" must be used.
1000
1001SYMLINKS	See <bsd.links.mk>
1002
1003MAN		Manual pages (should end in .1 - .9).  If no MAN variable is
1004		defined, "MAN=${PROG}.1" is assumed.
1005
1006PAXCTL_FLAGS	If defined then paxctl(1) is ran on binary after link
1007		time, with the value of the variable as args to it.
1008
1009PAXCTL_FLAGS.${PROG} Custom override for PAXCTL_FLAGS.
1010
1011PROG		The name of the program to build.  If not supplied, nothing
1012		is built.
1013
1014PROG_CXX	If defined, the name of the program to build.  Also
1015		causes <bsd.prog.mk> to link the program with the C++
1016		compiler rather than the C compiler.  PROG_CXX overrides
1017		the value of PROG if PROG is also set.
1018
1019PROGNAME	The name that the above program will be installed as, if
1020		different from ${PROG}.
1021
1022SRCS		List of source files to build the program.  If SRCS is not
1023		defined, it's assumed to be ${PROG}.c.
1024
1025DPSRCS		List of source files which are needed for generating
1026		dependencies, but are not needed in ${SRCS}.
1027
1028DPADD		Additional dependencies for the program.  Usually used for
1029		libraries.  For example, to depend on the compatibility and
1030		utility libraries use:
1031
1032			DPADD+=${LIBCOMPAT} ${LIBUTIL}
1033
1034		The following libraries are predefined for DPADD:
1035
1036		LIBCRT0?=	${DESTDIR}/usr/lib/crt0.o
1037		LIBARCHIVE?=	${DESTDIR}/usr/lib/libarchive.a
1038		LIBASN1?=	${DESTDIR}/usr/lib/libasn1.a
1039		LIBBLUETOOTH?=	${DESTDIR}/usr/lib/libbluetooth.a
1040		LIBBSDMALLOC?=	${DESTDIR}/usr/lib/libbsdmalloc.a
1041		LIBBZ2?=	${DESTDIR}/usr/lib/libbz2.a
1042		LIBC?=		${DESTDIR}/usr/lib/libc.a
1043		LIBC_PIC?=	${DESTDIR}/usr/lib/libc_pic.a
1044		LIBCOM_ERR?=	${DESTDIR}/usr/lib/libcom_err.a
1045		LIBCOMPAT?=	${DESTDIR}/usr/lib/libcompat.a
1046		LIBCRYPT?=	${DESTDIR}/usr/lib/libcrypt.a
1047		LIBCRYPTO?=	${DESTDIR}/usr/lib/libcrypto.a
1048		LIBCRYPTO_IDEA?=${DESTDIR}/usr/lib/libcrypto_idea.a
1049		LIBCRYPTO_MDC2?=${DESTDIR}/usr/lib/libcrypto_mdc2.a
1050		LIBCRYPTO_RC5?=	${DESTDIR}/usr/lib/libcrypto_rc5.a
1051		LIBCURSES?=	${DESTDIR}/usr/lib/libcurses.a
1052		LIBDBM?=	${DESTDIR}/usr/lib/libdbm.a
1053		LIBDES?=	${DESTDIR}/usr/lib/libdes.a
1054		LIBEDIT?=	${DESTDIR}/usr/lib/libedit.a
1055		LIBEVENT?=	${DESTDIR}/usr/lib/libevent.a
1056		LIBFORM?=	${DESTDIR}/usr/lib/libform.a
1057		LIBGCC?=	${DESTDIR}/usr/lib/libgcc.a
1058		LIBGNUMALLOC?=	${DESTDIR}/usr/lib/libgnumalloc.a
1059		LIBGSSAPI?=	${DESTDIR}/usr/lib/libgssapi.a
1060		LIBHDB?=	${DESTDIR}/usr/lib/libhdb.a
1061		LIBINTL?=	${DESTDIR}/usr/lib/libintl.a
1062		LIBIPSEC?=	${DESTDIR}/usr/lib/libipsec.a
1063		LIBKADM5CLNT?=	${DESTDIR}/usr/lib/libkadm5clnt.a
1064		LIBKADM5SRV?=	${DESTDIR}/usr/lib/libkadm5srv.a
1065		LIBKAFS?=	${DESTDIR}/usr/lib/libkafs.a
1066		LIBKRB5?=	${DESTDIR}/usr/lib/libkrb5.a
1067		LIBKVM?=	${DESTDIR}/usr/lib/libkvm.a
1068		LIBL?=		${DESTDIR}/usr/lib/libl.a
1069		LIBM?=		${DESTDIR}/usr/lib/libm.a
1070		LIBMENU?=	${DESTDIR}/usr/lib/libmenu.a
1071		LIBOBJC?=	${DESTDIR}/usr/lib/libobjc.a
1072		LIBOSSAUDIO?=	${DESTDIR}/usr/lib/libossaudio.a
1073		LIBPAM?=	${DESTDIR}/usr/lib/libpam.a
1074		LIBPCAP?=	${DESTDIR}/usr/lib/libpcap.a
1075		LIBPCI?=	${DESTDIR}/usr/lib/libpci.a
1076		LIBPMC?=	${DESTDIR}/usr/lib/libpmc.a
1077		LIBPOSIX?=	${DESTDIR}/usr/lib/libposix.a
1078		LIBPTHREAD?=	${DESTDIR}/usr/lib/libpthread.a
1079		LIBPTHREAD_DBG?=${DESTDIR}/usr/lib/libpthread_dbg.a
1080		LIBRADIUS?=	${DESTDIR}/usr/lib/libradius.a
1081		LIBRESOLV?=	${DESTDIR}/usr/lib/libresolv.a
1082		LIBRMT?=	${DESTDIR}/usr/lib/librmt.a
1083		LIBROKEN?=	${DESTDIR}/usr/lib/libroken.a
1084		LIBRPCSVC?=	${DESTDIR}/usr/lib/librpcsvc.a
1085		LIBRT?=		${DESTDIR}/usr/lib/librt.a
1086		LIBSDP?=	${DESTDIR}/usr/lib/libsdp.a
1087		LIBSKEY?=	${DESTDIR}/usr/lib/libskey.a
1088		LIBSL?=		${DESTDIR}/usr/lib/libsl.a
1089		LIBSS?=		${DESTDIR}/usr/lib/libss.a
1090		LIBSSH?=	${DESTDIR}/usr/lib/libssh.a
1091		LIBSSL?=	${DESTDIR}/usr/lib/libssl.a
1092		LIBSSP?=	${DESTDIR}/usr/lib/libssp.a
1093		LIBSTDCXX?=	${DESTDIR}/usr/lib/libstdc++.a
1094		LIBSUPCXX?=	${DESTDIR}/usr/lib/libsupc++.a
1095		LIBTERMCAP?=	${DESTDIR}/usr/lib/libtermcap.a
1096		LIBUSBHID?=	${DESTDIR}/usr/lib/libusbhid.a
1097		LIBUTIL?=	${DESTDIR}/usr/lib/libutil.a
1098		LIBWRAP?=	${DESTDIR}/usr/lib/libwrap.a
1099		LIBY?=		${DESTDIR}/usr/lib/liby.a
1100		LIBZ?=		${DESTDIR}/usr/lib/libz.a
1101
1102SHAREDSTRINGS	If defined, a new .c.o rule is used that results in shared
1103		strings, using xstr(1). Note that this will not work with
1104		parallel makes.
1105
1106STRIPFLAG	The flag passed to the install program to cause the binary
1107		to be stripped.
1108
1109SUBDIR		A list of subdirectories that should be built as well.
1110		Each of the targets will execute the same target in the
1111		subdirectories.
1112
1113SCRIPTS		A list of interpreter scripts [file.{sh,csh,pl,awk,...}].
1114		These are installed exactly like programs.
1115
1116SCRIPTSDIR	The location to install the scripts.  Each script can be
1117		installed to a separate path by setting SCRIPTSDIR_<script>.
1118
1119SCRIPTSNAME	The name that the above program will be installed as, if
1120		different from ${SCRIPTS}. These can be further specialized
1121		by setting SCRIPTSNAME_<script>.
1122
1123FILES		See description of <bsd.files.mk>.
1124
1125SHLINKDIR	Target directory for shared linker.  See description of
1126		<bsd.own.mk> for additional information about this variable.
1127
1128The include file <bsd.prog.mk> includes the file named "../Makefile.inc"
1129if it exists, as well as the include file <bsd.man.mk>.
1130
1131Some simple examples:
1132
1133To build foo from foo.c with a manual page foo.1, use:
1134
1135	PROG=	foo
1136
1137	.include <bsd.prog.mk>
1138
1139To build foo from foo.c with a manual page foo.2, add the line:
1140
1141	MAN=	foo.2
1142
1143If foo does not have a manual page at all, add the line:
1144
1145	MKMAN=	no
1146
1147If foo has multiple source files, add the line:
1148
1149	SRCS=	a.c b.c c.c d.c
1150
1151
1152=-=-=-=-=   bsd.rpc.mk   =-=-=-=-=
1153
1154The include file <bsd.rpc.mk> contains a makefile fragment used to
1155construct source files built by rpcgen.
1156
1157The following macros may be defined in makefiles which include
1158<bsd.rpc.mk> in order to control which files get built and how they
1159are to be built:
1160
1161RPC_INCS:	construct .h file from .x file
1162RPC_XDRFILES:	construct _xdr.c from .x file
1163		(for marshalling/unmarshalling data types)
1164RPC_SVCFILES:	construct _svc.c from .x file
1165		(server-side stubs)
1166RPC_SVCFLAGS:	Additional flags passed to builds of RPC_SVCFILES.
1167
1168RPC_XDIR:	Directory containing .x/.h files
1169
1170
1171=-=-=-=-=   bsd.shlib.mk   =-=-=-=-=
1172
1173The include file <bsd.shlib.mk> computes parameters for shared library
1174installation and use.  It defines no targets.  <bsd.own.mk> MUST be
1175included before <bsd.shlib.mk>.
1176
1177<bsd.own.mk> sets the following variables, if they are not already defined
1178(defaults are in brackets):
1179
1180SHLIBINSTALLDIR	If ${USE_SHLIBDIR} is not "no", use ${SHLIBINSTALLDIR}
1181		instead of ${LIBDIR} as the base path for shared library
1182		installation.  [/lib]
1183
1184SHLIBDIR	The path to USE_SHLIBDIR shared libraries to use when building
1185		a program.  [/lib for programs in /bin and /sbin, /usr/lib
1186		for all others.]
1187
1188_LIBSODIR	Set to ${SHLIBINSTALLDIR} if ${USE_SHLIBDIR} is not "no",
1189		otherwise set to ${LIBDIR}
1190
1191SHLINKINSTALLDIR Base path for shared linker.  [/libexec]
1192
1193SHLINKDIR	Path to use for shared linker when building a program.
1194		[/libexec for programs in /bin and /sbin, /usr/libexec for
1195		all others.]
1196
1197
1198=-=-=-=-=   bsd.subdir.mk   =-=-=-=-=
1199
1200The include file <bsd.subdir.mk> contains the default targets for building
1201subdirectories.  It has the same eight targets as <bsd.prog.mk>: all,
1202clean, cleandir, depend, includes, install, lint, and tags.  For all of
1203the directories listed in ${SUBDIR}, the specified directory will be
1204visited and the target made.  There is also a default target which allows
1205the command "make subdir" where subdir is any directory listed in ${SUBDIR}.
1206
1207As a special case, the use of a token .WAIT as an entry in SUBDIR acts
1208as a synchronization barrier when multiple make jobs are run; subdirs
1209before the .WAIT must complete before any subdirs after .WAIT are
1210started.  See make(1) for some caveats on use of .WAIT and other
1211special sources.
1212
1213
1214=-=-=-=-=   bsd.sys.mk   =-=-=-=-=
1215
1216The include file <bsd.sys.mk> is used by <bsd.prog.mk> and
1217<bsd.lib.mk>.  It contains overrides that are used when building
1218the NetBSD source tree.
1219
1220The following variables control how various files are compiled/built.
1221(Note that these may be overridden in <bsd.own.mk> if USETOOLS == "yes"):
1222
1223AR		Create, modify, and extract from archives.  [ar]
1224
1225ARFLAGS		Options to ${AR}.  [rl]
1226
1227AS		Assembler.  [as]
1228
1229AFLAGS		Options to ${AS}.  []
1230
1231CC		C compiler.  [cc]
1232
1233CFLAGS		Options to ${CC}.  [Usually -O or -O2]
1234
1235CPP		C Pre-Processor.  [cpp]
1236
1237CPPFLAGS	Options to ${CPP}.  []
1238
1239CPUFLAGS	Optimization flags for ${CC}.  []
1240
1241CXX		C++ compiler.  [c++]
1242
1243CXXFLAGS	Options to ${CXX}.  [${CFLAGS}]
1244
1245ELF2ECOFF	Convert ELF-format executable to ECOFF.  [elf2ecoff]
1246
1247FC		Fortran compiler.  [f77]
1248
1249FFLAGS		Options to {$FC}.  [-O]
1250
1251INSTALL		install(1) command.  [install]
1252
1253LEX		Lexical analyzer.  [lex]
1254
1255LFLAGS		Options to ${LEX}.  []
1256
1257LPREFIX		Symbol prefix for ${LEX} (see -P option in lex(1)) [yy]
1258
1259LD		Linker.  [ld]
1260
1261LDFLAGS		Options to ${CC} during the link process.  []
1262
1263LINT		C program verifier.  [lint]
1264
1265LINTFLAGS	Options to ${LINT}.  [-chapbxzFS]
1266
1267LORDER		List dependencies for object files.  [lorder]
1268
1269MAKE		make(1).  [make]
1270
1271MKDEP		Construct Makefile dependency list.  [mkdep]
1272
1273NM		List symbols from object files.  [nm]
1274
1275PC		Pascal compiler.  [pc]  (Not present)
1276
1277PFLAGS		Options to ${PC}.  []
1278
1279OBJC		Objective C compiler.  [${CC}]
1280
1281OBJCFLAGS	Options to ${OBJC}.  [${CFLAGS}]
1282
1283OBJCOPY		Copy and translate object files.  [objcopy]
1284
1285OBJDUMP		Display information from object files.  [objdump]
1286
1287RANLIB		Generate index to archive.  [ranlib]
1288
1289SHELL		Shell.  [sh]
1290
1291SIZE		List section sizes and total size.  [size]
1292
1293STRIP		Discard symbols from object files.  [strip]
1294
1295TSORT		Topological sort of a directed graph.  [tsort -q]
1296
1297YACC		LALR(1) parser generator.  [yacc]
1298
1299YFLAGS		Options to ${YACC}.  []
1300
1301YHEADER		If defined, add "-d" to YFLAGS, and add dependencies
1302		from <file>.y to <file>.h and <file>.c, and add
1303		<foo>.h to CLEANFILES.
1304
1305YPREFIX		If defined, add "-p ${YPREFIX}" to YFLAGS.
1306
1307
1308The following variables are defined to commands to perform the
1309appropriate operation, with the default in [brackets].
1310(Note that these are overridden in <bsd.own.mk> if USETOOLS == "yes"):
1311
1312TOOL_ASN1_COMPILE	ASN1 compiler.  [asn1_compile]
1313
1314TOOL_CAP_MKDB		Create capability database.  [cap_mkdb]
1315
1316TOOL_CAT		Concatenate and print files.  [cat]
1317
1318TOOL_CKSUM		Display file checksums.  [cksum]
1319
1320TOOL_COMPILE_ET		Error table compiler.  [compile_et]
1321
1322TOOL_CONFIG		Build kernel compilation directories.  [config]
1323
1324TOOL_CRUNCHGEN		Generate crunched binary build environment.  [crunchgen]
1325
1326TOOL_CTAGS		Create a tags file.  [ctags]
1327
1328TOOL_DB			Manipulate db(3) databases.  [db]
1329
1330TOOL_EQN		Format equations for groff.  [eqn]
1331
1332TOOL_FGEN		IEEE 1275 Open Firmware FCode Tokenizer.  [fgen]
1333
1334TOOL_GENASSYM		Generate constants for assembly files.  [genassym]
1335
1336TOOL_GENCAT		Generate NLS message catalogs.  [gencat]
1337
1338TOOL_GROFF		Front end for groff document formatting system.  [groff]
1339
1340TOOL_HEXDUMP		Ascii, decimal, hexadecimal, octal dump.  [hexdump]
1341
1342TOOL_INDXBIB		Make bibliographic database's inverted index.  [indxbib]
1343
1344TOOL_INSTALLBOOT	Install disk bootstrap software.  [installboot]
1345
1346TOOL_INSTALL_INFO	Update info/dir entries.  [install-info]
1347
1348TOOL_JOIN		Relational database operator.  [join]
1349
1350TOOL_M4			M4 macro language processor.  [m4]
1351
1352TOOL_MAKEFS		Create file system image from directory tree.  [makefs]
1353
1354TOOL_MAKEINFO		Translate Texinfo documents.  [makeinfo]
1355
1356TOOL_MAKEWHATIS		Create a whatis.db database.  [makewhatis]
1357
1358TOOL_MDSETIMAGE		Set kernel RAM disk image.  [mdsetimage]
1359
1360TOOL_MENUC		Menu compiler.  [menuc]
1361
1362TOOL_MKCSMAPPER		Make charset mapping table.  [mkcsmapper]
1363
1364TOOL_MKESDB		Make encoding scheme database.  [mkesdb]
1365
1366TOOL_MKLOCALE		Make LC_CTYPE locale files.  [mklocale]
1367
1368TOOL_MKMAGIC		Create database for file(1).  [file]
1369
1370TOOL_MKTEMP		Make (unique) temporary file name.  [mktemp]
1371
1372TOOL_MSGC		Simple message list compiler.  [msgc]
1373
1374TOOL_MTREE		Map a directory hierarchy.  [mtree]
1375
1376TOOL_PAX		Manipulate file archives and copy directories.  [pax]
1377
1378TOOL_PIC		Compile pictures for groff.  [pic]
1379
1380TOOL_PREPMKBOOTIMAGE	prep-mkbootimage (XXXBUILDSH).  [prep-mkbootimage]
1381
1382TOOL_PWD_MKDB		Generate the password databases.  [pwd_mkdb]
1383
1384TOOL_REFER		Preprocess bibliographic references for groff.  [refer]
1385
1386TOOL_ROFF_ASCII		Generate ASCII groff output.  [nroff]
1387
1388TOOL_ROFF_DVI		Generate DVI groff output.  [${TOOL_GROFF} -Tdvi]
1389
1390TOOL_ROFF_HTML		Generate HTML groff output.
1391			[${TOOL_GROFF} -Tlatin1 -mdoc2html]
1392
1393TOOL_ROFF_PS		Generate PS groff output.  [${TOOL_GROFF} -Tps]
1394
1395TOOL_ROFF_RAW		Generate "raw" groff output.  [${TOOL_GROFF} -Z]
1396
1397TOOL_RPCGEN		Remote Procedure Call (RPC) protocol compiler.  [rpcgen]
1398
1399TOOL_SOELIM		Eliminate .so's from groff input.  [soelim]
1400
1401TOOL_STAT		Display file status.  [stat]
1402
1403TOOL_SUNLABEL		Read or modify a SunOS disk label.  [sunlabel]
1404
1405TOOL_TBL		Format tables for groff.  [tbl]
1406
1407TOOL_UUDECODE		Uudecode a binary file.  [uudecode]
1408
1409TOOL_VGRIND		Grind nice listings of programs.  [vgrind -f]
1410
1411TOOL_ZIC		Time zone compiler.  [zic]
1412
1413
1414Other variables of note (incomplete list):
1415
1416WARNS		Crank up gcc warning options; the distinct levels are:
1417			WARNS=1
1418			WARNS=2
1419			WARNS=3
1420			WARNS=4
1421
1422=-=-=-=-=   bsd.x11.mk   =-=-=-=-=
1423
1424The include file <bsd.x11.mk> contains parameters and targets for
1425cross-building X11R6 from ${X11SRCDIR.xc}.
1426It should be included after the general Makefile contents but before
1427the include files such as <bsd.prog.mk> and <bsd.lib.mk>.
1428
1429It provides the following targets:
1430	.man.1 .man.3 .man.4 .man.5 .man.7:
1431		If ${MAN} or ${PROG} is set and ${MKMAN} != "no",
1432		these rules convert from X11R6's manual page source
1433		into an mdoc.old source file.
1434	cleanx11man:
1435		Clean up the mdoc.old files generated by the above.
1436
1437It sets the following variables:
1438
1439BINDIR			Set to ${X11BINDIR}.
1440			To override, define after including <bsd.x11.mk>
1441
1442LIBDIR			Set to ${X11USRLIBDIR}.
1443			To override, define after including <bsd.x11.mk>
1444
1445MANDIR			Set to ${X11MANDIR}.
1446			To override, define after including <bsd.x11.mk>
1447
1448CPPFLAGS		Appended with definitions to include from
1449			${DESTDIR}${X11INCDIR}
1450
1451LDFLAGS			Appended with definitions to link from
1452			${DESTDIR}${X11USRLIBDIR}
1453
1454X11FLAGS.CONNECTION	Equivalent to X11R6's CONNECTION_FLAGS.
1455
1456X11FLAGS.EXTENSION	Equivalent to X11R6's EXT_DEFINES.
1457
1458X11FLAGS.LOADABLE	Equivalent to X11R6's LOADABLE.
1459
1460X11FLAGS.OS_DEFINES	Equivalent to X11R6's OS_DEFINES.
1461
1462X11FLAGS.SERVER		Equivalent to X11R6's ServerDefines.
1463
1464X11FLAGS.THREADLIB	Equivalent to X11R6's THREADS_DEFINES for libraries.
1465
1466X11FLAGS.THREADS	Equivalent to X11R6's THREADS_DEFINES.
1467
1468X11FLAGS.VERSION	cpp(1) definitions of OSMAJORVERSION and OSMINORVERSION.
1469
1470X11TOOL_UNXCOMM		Commandline to convert `XCOMM' comments to `#'
1471
1472It uses the following variables:
1473
1474APPDEFS			List of app-default files to install.
1475
1476CPPSCRIPTS		List of files/scripts to run through cpp(1)
1477			and then ${X11TOOL_UNXCOMM}.  The source files
1478			have a `.cpp' suffix, the generated files do not.
1479
1480CPPSCRIPTFLAGS		Additional flags to cpp(1) when building CPPSCRIPTS.
1481
1482CPPSCRIPTFLAGS_<fn>	Additional flags to cpp(1) when building CPPSCRIPT <fn>.
1483
1484
1485=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
1486