bsd.README revision 1.202
1#	$NetBSD: bsd.README,v 1.202 2008/03/11 13:33:16 uwe 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>
629		Rename the output from the decode to the provided name.
630		
631		*NOTE: These files are simply decoded, with no install or other
632		       rule applying implicitly except being added to the clean
633		       target.
634
635=-=-=-=-=   bsd.gcc.mk   =-=-=-=-=
636
637The include file <bsd.gcc.mk> computes various parameters related to GCC
638support libraries.  It defines no targets.  <bsd.own.mk> MUST be included
639before <bsd.gcc.mk>.
640
641The primary users of <bsd.gcc.mk> are <bsd.prog.mk> and <bsd.lib.mk>, each
642of which need to know where to find certain GCC support libraries.
643
644The behavior of <bsd.gcc.mk> is influenced by the EXTERNAL_TOOLCHAIN variable,
645which is generally set by the user.  If EXTERNAL_TOOLCHAIN it set, then
646the compiler is asked where to find the support libraries, otherwise the
647support libraries are found in ${DESTDIR}/usr/lib.
648
649<bsd.gcc.mk> sets the following variables:
650
651_GCC_CRTBEGIN	The full path name to crtbegin.o.
652
653_GCC_CRTBEGINS	The full path name to crtbeginS.o.
654
655_GCC_CRTEND	The full path name to crtend.o.
656
657_GCC_CRTENDS	The full path name to crtendS.o.
658
659_GCC_LIBGCCDIR	The directory where libgcc.a is located.
660
661
662=-=-=-=-=   bsd.inc.mk   =-=-=-=-=
663
664The include file <bsd.inc.mk> defines the includes target and uses the
665variables:
666
667INCS		The list of include files.
668
669INCSDIR		The location to install the include files.
670
671INCSNAME	Target name of the include file, if only one; same as
672		FILESNAME, but for include files.
673
674INCSYMLINKS	Similar to SYMLINKS in <bsd.links.mk>, except that these
675		are installed in the 'includes' target and not the
676		(much later) 'install' target.
677
678INCSNAME_<file>	The name file <file> should be installed as, if not <file>,
679		same as FILESNAME_<file>, but for include files.
680
681
682=-=-=-=-=   bsd.info.mk   =-=-=-=-=
683
684The include file <bsd.info.mk> is used to generate and install GNU Info
685documentation from respective Texinfo source files.  It defines three
686implicit targets (.txi.info, .texi.info, and .texinfo.info), and uses the
687following variables:
688
689TEXINFO		List of Texinfo source files.  Info documentation will
690		consist of single files with the extension replaced by
691		.info.
692
693INFOFLAGS	Flags to pass to makeinfo.  []
694
695
696=-=-=-=-=   bsd.kernobj.mk   =-=-=-=-=
697
698The include file <bsd.kernobj.mk> defines variables related to the
699location of kernel sources and object directories.
700
701KERNSRCDIR	Is the location of the top of the kernel src.
702		[${_SRC_TOP_}/sys]
703
704KERNARCHDIR	Is the location of the machine dependent kernel sources.
705		[arch/${MACHINE}]
706
707KERNCONFDIR	Is where the configuration files for kernels are found.
708		[${KERNSRCDIR}/${KERNARCHDIR}/conf]
709
710KERNOBJDIR	Is the kernel build directory.  The kernel GENERIC for
711		instance will be compiled in ${KERNOBJDIR}/GENERIC.
712		The default value is
713		${MAKEOBJDIRPREFIX}${KERNSRCDIR}/${KERNARCHDIR}/compile
714		if it exists or the target 'obj' is being made.
715		Otherwise the default is
716		${KERNSRCDIR}/${KERNARCHDIR}/compile.
717
718It is important that Makefiles (such as those under src/distrib) that
719wish to find compiled kernels use <bsd.kernobj.mk> and ${KERNOBJDIR}
720rather than make assumptions about the location of the compiled kernel.
721
722
723=-=-=-=-=   bsd.kinc.mk   =-=-=-=-=
724
725The include file <bsd.kinc.mk> defines the many targets (includes,
726subdirectories, etc.), and is used by kernel makefiles to handle
727include file installation.  It is intended to be included alone, by
728kernel Makefiles.  It uses similar variables to <bsd.inc.mk>.
729Please see <bsd.kinc.mk> for more details, and keep the documentation
730in that file up to date.
731
732
733=-=-=-=-=   bsd.lib.mk   =-=-=-=-=
734
735The include file <bsd.lib.mk> has support for building libraries.  It has
736the same eight targets as <bsd.prog.mk>: all, clean, cleandir, depend,
737includes, install, lint, and tags.  Additionally, it has a checkver target
738which checks for installed shared object libraries whose version is greater
739that the version of the source. It has a limited number of suffixes,
740consistent with the current needs of the BSD tree.  <bsd.lib.mk> includes
741<bsd.shlib.mk> to get shared library parameters.
742
743It sets/uses the following variables:
744
745LIB		The name of the library to build.
746
747LIBDIR		Target directory for libraries.
748
749SHLIBINSTALLDIR	Target directory for shared libraries if ${USE_SHLIBDIR}
750		is not "no".
751
752USE_SHLIBDIR	If not "no", use ${SHLIBINSTALLDIR} instead of ${LIBDIR}
753		as the path to install shared libraries to.
754		USE_SHLIBDIR must be defined before <bsd.own.mk> is included.
755		Default: no
756
757MKPRIVATELIB	If not "no", act as "MKPROFILE=no MKPIC=no MKLINT=no",
758		and don't install the (.a) library.
759		This is useful for "build only" helper libraries.
760		Default: no
761
762LINTLIBDIR	Target directory for lint libraries.
763
764LIBGRP		Library group.
765
766LIBOWN		Library owner.
767
768LIBMODE		Library mode.
769
770LDADD		Additional loader objects.
771
772MAN		The manual pages to be installed (use a .1 - .9 suffix).
773
774NOCHECKVER_<library>
775NOCHECKVER	If set, disables checking for installed shared object
776		libraries with versions greater than the source.  A
777		particular library name, without the "lib" prefix, may
778		be appended to the variable name to disable the check for
779		only that library.
780
781SRCS		List of source files to build the library.  Suffix types
782		.s, .c, and .f are supported.  Note, .s files are preferred
783		to .c files of the same name.  (This is not the default for
784		versions of make.)
785
786LIBDPLIBS	A list of the tuples:
787			libname  path-to-srcdir-of-libname
788
789		For each tuple;
790		     *	LIBDO.libname contains the .OBJDIR of the library
791			`libname', and if it is not set it is determined
792			from the srcdir and added to MAKEOVERRIDES (the
793			latter is to allow for build time optimization).
794		     *	LDADD gets  -L${LIBDO.libname} -llibname    added.
795		     *	DPADD gets  ${LIBDO.libname}/liblibname.so  or
796				    ${LIBDO.libname}/liblibname.a   added.
797
798		This variable may be used for individual libraries, as
799		well as in parent directories to cache common libraries 
800		as a build-time optimization.
801
802The include file <bsd.lib.mk> includes the file named "../Makefile.inc"
803if it exists, as well as the include file <bsd.man.mk>.
804
805It has rules for building profiled objects; profiled libraries are
806built by default.
807
808Libraries are ranlib'd when made.
809
810
811=-=-=-=-=   bsd.links.mk   =-=-=-=-=
812
813The include file <bsd.links.mk> handles the LINKS and SYMLINKS variables
814and is included from from <bsd.lib.mk> and <bsd.prog.mk>.
815
816LINKS		The list of hard links, consisting of pairs of paths:
817			source-file target-file
818		${DESTDIR} is prepended to both paths before linking.
819		For example, to link /bin/test and /bin/[, use:
820			LINKS=/bin/test /bin/[
821
822CONFIGLINKS	Similar semantics to LINKS, except that the links
823		are installed by the `configinstall' target,
824		not the `install' target.
825
826SYMLINKS	The list of symbolic links, consisting of pairs of paths:
827			source-file target-file
828		${DESTDIR} is only prepended to target-file before linking.
829		For example, to symlink /usr/bin/tar to /bin/tar resulting
830		in ${DESTDIR}/usr/bin/tar -> /bin/tar:
831			SYMLINKS=/bin/tar /usr/bin/tar
832
833CONFIGSYMLINKS	Similar semantics to SYMLINKS, except that the symbolic links
834		are installed by the `configinstall' target,
835		not the `install' target.
836
837
838=-=-=-=-=   bsd.man.mk   =-=-=-=-=
839
840The include file <bsd.man.mk> handles installing manual pages and their
841links.
842
843It has a two targets:
844
845	maninstall:
846		Install the manual page sources and their links.
847	catinstall:
848		Install the preformatted manual pages and their links.
849
850It sets/uses the following variables:
851
852MANDIR		Base path for manual installation.
853
854MANGRP		Manual group.
855
856MANOWN		Manual owner.
857
858MANMODE		Manual mode.
859
860MANSUBDIR	Subdirectory under the manual page section, i.e. "/vax"
861		or "/tahoe" for machine specific manual pages.
862
863MAN		The manual pages to be installed (use a .1 - .9 suffix).
864
865MLINKS		List of manual page links (using a .1 - .9 suffix).  The
866		linked-to file must come first, the linked file second,
867		and there may be multiple pairs.  The files are soft-linked.
868
869The include file <bsd.man.mk> includes a file named "../Makefile.inc" if
870it exists.
871
872
873=-=-=-=-=   bsd.obj.mk   =-=-=-=-=
874
875The include file <bsd.obj.mk> defines targets related to the creation
876and use of separated object and source directories.
877
878If an environment variable named MAKEOBJDIRPREFIX is set, make(1) uses
879${MAKEOBJDIRPREFIX}${.CURDIR} as the name of the object directory if
880it exists.  Otherwise make(1) looks for the existence of a
881subdirectory (or a symlink to a directory) of the source directory
882into which built targets should be placed.  If an environment variable
883named MAKEOBJDIR is set, make(1) uses its value as the name of the
884object directory; failing that, make first looks for a subdirectory
885named "obj.${MACHINE}", and if that doesn't exist, it looks for "obj".
886
887Object directories are not created automatically by make(1) if they
888don't exist; you need to run a separate "make obj".  (This will happen
889during a top-level build if "MKOBJDIRS" is set to a value other than
890"no").  When the source directory is a subdirectory of ${BSDSRCDIR} --
891and this is determined by a simple string prefix comparison -- object
892directories are created in a separate object directory tree, and a
893symlink to the object directory in that tree is created in the source
894directory; otherwise, "make obj" assumes that you're not in the main
895source tree and that it's not safe to use a separate object tree.
896
897Several variables used by <bsd.obj.mk> control exactly what
898directories and links get created during a "make obj":
899
900MAKEOBJDIR	If set, this is the component name of the object
901		directory.
902
903OBJMACHINE	If this is set but MAKEOBJDIR is not set, creates
904		object directories or links named "obj.${MACHINE}";
905		otherwise, just creates ones named "obj".
906
907USR_OBJMACHINE  If set, and the current directory is a subdirectory of
908		${BSDSRCDIR}, create object directory in the
909		corresponding subdirectory of ${BSDOBJDIR}.${MACHINE};
910		otherwise, create it in the corresponding subdirectory
911		of ${BSDOBJDIR}
912
913BUILDID		If set, the contents of this variable are appended
914		to the object directory name.  If OBJMACHINE is also
915		set, ".${BUILDID}" is added after ".${MACHINE}".
916
917
918=-=-=-=-=   bsd.prog.mk   =-=-=-=-=
919
920The include file <bsd.prog.mk> handles building programs from one or
921more source files, along with their manual pages.  It has a limited number
922of suffixes, consistent with the current needs of the BSD tree. 
923<bsd.prog.mk> includes <bsd.shlib.mk> to get shared library parameters.
924
925It has eight targets:
926
927	all:
928		build the program and its manual page.  This also
929		creates a GDB initialization file (.gdbinit) in
930		the objdir.  The .gdbinit file sets the shared library
931		prefix to ${DESTDIR} to facilitate cross-debugging.
932	clean:
933		remove the program, any object files and the files a.out,
934		Errs, errs, mklog, and ${PROG}.core.
935	cleandir:
936		remove all of the files removed by the target clean, as
937		well as .depend, tags, and any manual pages.
938		`distclean' is a synonym for `cleandir'.
939	depend:
940		make the dependencies for the source files, and store
941		them in the file .depend.
942	includes:
943		install any header files.
944	install:
945		install the program and its manual pages; if the Makefile
946		does not itself define the target install, the targets
947		beforeinstall and afterinstall may also be used to cause
948		actions immediately before and after the install target
949		is executed.
950	lint:
951		run lint on the source files
952	tags:
953		create a tags file for the source files.
954
955It sets/uses the following variables:
956
957BINGRP		Binary group.
958
959BINOWN		Binary owner.
960
961BINMODE		Binary mode.
962
963CLEANFILES	Additional files to remove for the clean and cleandir targets.
964
965COPTS		Additional flags to the compiler when creating C objects.
966
967COPTS.<fn>	Additional flags to the compiler when creating the
968		C objects for <fn>.
969		For <fn>.[ly], "<fn>.c" must be used.
970
971CPUFLAGS	Additional flags to the compiler/assembler to select
972		CPU instruction set options, CPU tuning options, etc.
973
974CPUFLAGS.<fn>	Additional flags to the compiler/assembler for <fn>.
975		For <fn>.[ly], "<fn>.c" must be used.
976
977CPPFLAGS	Additional flags to the C pre-processor.
978
979CPPFLAGS.<fn>	Additional flags to the C pre-processor for <fn>.
980		For <fn>.[ly], "<fn>.c" must be used.
981
982GDBINIT		List of GDB initialization files to add to "source"
983		directives in the .gdbinit file that is created in the
984		objdir.
985
986LDADD		Additional loader objects.  Usually used for libraries.
987		For example, to load with the compatibility and utility
988		libraries, use:
989
990			LDADD+=-lutil -lcompat
991
992LDFLAGS		Additional linker flags (passed to ${CC} during link).
993
994LINKS		See <bsd.links.mk>
995
996OBJCOPTS	Additional flags to the compiler when creating ObjC objects.
997
998OBJCOPTS.<fn>	Additional flags to the compiler when creating the
999		ObjC objects for <fn>.
1000		For <fn>.[ly], "<fn>.c" must be used.
1001
1002SYMLINKS	See <bsd.links.mk>
1003
1004MAN		Manual pages (should end in .1 - .9).  If no MAN variable is
1005		defined, "MAN=${PROG}.1" is assumed.
1006
1007PAXCTL_FLAGS	If defined then paxctl(1) is ran on binary after link
1008		time, with the value of the variable as args to it.
1009
1010PAXCTL_FLAGS.${PROG} Custom override for PAXCTL_FLAGS.
1011
1012PROG		The name of the program to build.  If not supplied, nothing
1013		is built.
1014
1015PROG_CXX	If defined, the name of the program to build.  Also
1016		causes <bsd.prog.mk> to link the program with the C++
1017		compiler rather than the C compiler.  PROG_CXX overrides
1018		the value of PROG if PROG is also set.
1019
1020PROGNAME	The name that the above program will be installed as, if
1021		different from ${PROG}.
1022
1023SRCS		List of source files to build the program.  If SRCS is not
1024		defined, it's assumed to be ${PROG}.c.
1025
1026DPSRCS		List of source files which are needed for generating
1027		dependencies, but are not needed in ${SRCS}.
1028
1029DPADD		Additional dependencies for the program.  Usually used for
1030		libraries.  For example, to depend on the compatibility and
1031		utility libraries use:
1032
1033			DPADD+=${LIBCOMPAT} ${LIBUTIL}
1034
1035		The following libraries are predefined for DPADD:
1036
1037		LIBCRT0?=	${DESTDIR}/usr/lib/crt0.o
1038		LIBARCHIVE?=	${DESTDIR}/usr/lib/libarchive.a
1039		LIBASN1?=	${DESTDIR}/usr/lib/libasn1.a
1040		LIBBLUETOOTH?=	${DESTDIR}/usr/lib/libbluetooth.a
1041		LIBBSDMALLOC?=	${DESTDIR}/usr/lib/libbsdmalloc.a
1042		LIBBZ2?=	${DESTDIR}/usr/lib/libbz2.a
1043		LIBC?=		${DESTDIR}/usr/lib/libc.a
1044		LIBC_PIC?=	${DESTDIR}/usr/lib/libc_pic.a
1045		LIBCOM_ERR?=	${DESTDIR}/usr/lib/libcom_err.a
1046		LIBCOMPAT?=	${DESTDIR}/usr/lib/libcompat.a
1047		LIBCRYPT?=	${DESTDIR}/usr/lib/libcrypt.a
1048		LIBCRYPTO?=	${DESTDIR}/usr/lib/libcrypto.a
1049		LIBCRYPTO_IDEA?=${DESTDIR}/usr/lib/libcrypto_idea.a
1050		LIBCRYPTO_MDC2?=${DESTDIR}/usr/lib/libcrypto_mdc2.a
1051		LIBCRYPTO_RC5?=	${DESTDIR}/usr/lib/libcrypto_rc5.a
1052		LIBCURSES?=	${DESTDIR}/usr/lib/libcurses.a
1053		LIBDBM?=	${DESTDIR}/usr/lib/libdbm.a
1054		LIBDES?=	${DESTDIR}/usr/lib/libdes.a
1055		LIBEDIT?=	${DESTDIR}/usr/lib/libedit.a
1056		LIBEVENT?=	${DESTDIR}/usr/lib/libevent.a
1057		LIBFORM?=	${DESTDIR}/usr/lib/libform.a
1058		LIBGCC?=	${DESTDIR}/usr/lib/libgcc.a
1059		LIBGNUMALLOC?=	${DESTDIR}/usr/lib/libgnumalloc.a
1060		LIBGSSAPI?=	${DESTDIR}/usr/lib/libgssapi.a
1061		LIBHDB?=	${DESTDIR}/usr/lib/libhdb.a
1062		LIBINTL?=	${DESTDIR}/usr/lib/libintl.a
1063		LIBIPSEC?=	${DESTDIR}/usr/lib/libipsec.a
1064		LIBKADM5CLNT?=	${DESTDIR}/usr/lib/libkadm5clnt.a
1065		LIBKADM5SRV?=	${DESTDIR}/usr/lib/libkadm5srv.a
1066		LIBKAFS?=	${DESTDIR}/usr/lib/libkafs.a
1067		LIBKRB5?=	${DESTDIR}/usr/lib/libkrb5.a
1068		LIBKVM?=	${DESTDIR}/usr/lib/libkvm.a
1069		LIBL?=		${DESTDIR}/usr/lib/libl.a
1070		LIBM?=		${DESTDIR}/usr/lib/libm.a
1071		LIBMENU?=	${DESTDIR}/usr/lib/libmenu.a
1072		LIBOBJC?=	${DESTDIR}/usr/lib/libobjc.a
1073		LIBOSSAUDIO?=	${DESTDIR}/usr/lib/libossaudio.a
1074		LIBPAM?=	${DESTDIR}/usr/lib/libpam.a
1075		LIBPCAP?=	${DESTDIR}/usr/lib/libpcap.a
1076		LIBPCI?=	${DESTDIR}/usr/lib/libpci.a
1077		LIBPMC?=	${DESTDIR}/usr/lib/libpmc.a
1078		LIBPOSIX?=	${DESTDIR}/usr/lib/libposix.a
1079		LIBPTHREAD?=	${DESTDIR}/usr/lib/libpthread.a
1080		LIBPTHREAD_DBG?=${DESTDIR}/usr/lib/libpthread_dbg.a
1081		LIBRADIUS?=	${DESTDIR}/usr/lib/libradius.a
1082		LIBRESOLV?=	${DESTDIR}/usr/lib/libresolv.a
1083		LIBRMT?=	${DESTDIR}/usr/lib/librmt.a
1084		LIBROKEN?=	${DESTDIR}/usr/lib/libroken.a
1085		LIBRPCSVC?=	${DESTDIR}/usr/lib/librpcsvc.a
1086		LIBRT?=		${DESTDIR}/usr/lib/librt.a
1087		LIBSDP?=	${DESTDIR}/usr/lib/libsdp.a
1088		LIBSKEY?=	${DESTDIR}/usr/lib/libskey.a
1089		LIBSL?=		${DESTDIR}/usr/lib/libsl.a
1090		LIBSS?=		${DESTDIR}/usr/lib/libss.a
1091		LIBSSH?=	${DESTDIR}/usr/lib/libssh.a
1092		LIBSSL?=	${DESTDIR}/usr/lib/libssl.a
1093		LIBSSP?=	${DESTDIR}/usr/lib/libssp.a
1094		LIBSTDCXX?=	${DESTDIR}/usr/lib/libstdc++.a
1095		LIBSUPCXX?=	${DESTDIR}/usr/lib/libsupc++.a
1096		LIBTERMCAP?=	${DESTDIR}/usr/lib/libtermcap.a
1097		LIBUSBHID?=	${DESTDIR}/usr/lib/libusbhid.a
1098		LIBUTIL?=	${DESTDIR}/usr/lib/libutil.a
1099		LIBWRAP?=	${DESTDIR}/usr/lib/libwrap.a
1100		LIBY?=		${DESTDIR}/usr/lib/liby.a
1101		LIBZ?=		${DESTDIR}/usr/lib/libz.a
1102
1103SHAREDSTRINGS	If defined, a new .c.o rule is used that results in shared
1104		strings, using xstr(1). Note that this will not work with
1105		parallel makes.
1106
1107STRIPFLAG	The flag passed to the install program to cause the binary
1108		to be stripped.
1109
1110SUBDIR		A list of subdirectories that should be built as well.
1111		Each of the targets will execute the same target in the
1112		subdirectories.
1113
1114SCRIPTS		A list of interpreter scripts [file.{sh,csh,pl,awk,...}].
1115		These are installed exactly like programs.
1116
1117SCRIPTSDIR	The location to install the scripts.  Each script can be
1118		installed to a separate path by setting SCRIPTSDIR_<script>.
1119
1120SCRIPTSNAME	The name that the above program will be installed as, if
1121		different from ${SCRIPTS}. These can be further specialized
1122		by setting SCRIPTSNAME_<script>.
1123
1124FILES		See description of <bsd.files.mk>.
1125
1126SHLINKDIR	Target directory for shared linker.  See description of
1127		<bsd.own.mk> for additional information about this variable.
1128
1129The include file <bsd.prog.mk> includes the file named "../Makefile.inc"
1130if it exists, as well as the include file <bsd.man.mk>.
1131
1132Some simple examples:
1133
1134To build foo from foo.c with a manual page foo.1, use:
1135
1136	PROG=	foo
1137
1138	.include <bsd.prog.mk>
1139
1140To build foo from foo.c with a manual page foo.2, add the line:
1141
1142	MAN=	foo.2
1143
1144If foo does not have a manual page at all, add the line:
1145
1146	MKMAN=	no
1147
1148If foo has multiple source files, add the line:
1149
1150	SRCS=	a.c b.c c.c d.c
1151
1152
1153=-=-=-=-=   bsd.rpc.mk   =-=-=-=-=
1154
1155The include file <bsd.rpc.mk> contains a makefile fragment used to
1156construct source files built by rpcgen.
1157
1158The following macros may be defined in makefiles which include
1159<bsd.rpc.mk> in order to control which files get built and how they
1160are to be built:
1161
1162RPC_INCS:	construct .h file from .x file
1163RPC_XDRFILES:	construct _xdr.c from .x file
1164		(for marshalling/unmarshalling data types)
1165RPC_SVCFILES:	construct _svc.c from .x file
1166		(server-side stubs)
1167RPC_SVCFLAGS:	Additional flags passed to builds of RPC_SVCFILES.
1168
1169RPC_XDIR:	Directory containing .x/.h files
1170
1171
1172=-=-=-=-=   bsd.shlib.mk   =-=-=-=-=
1173
1174The include file <bsd.shlib.mk> computes parameters for shared library
1175installation and use.  It defines no targets.  <bsd.own.mk> MUST be
1176included before <bsd.shlib.mk>.
1177
1178<bsd.own.mk> sets the following variables, if they are not already defined
1179(defaults are in brackets):
1180
1181SHLIBINSTALLDIR	If ${USE_SHLIBDIR} is not "no", use ${SHLIBINSTALLDIR}
1182		instead of ${LIBDIR} as the base path for shared library
1183		installation.  [/lib]
1184
1185SHLIBDIR	The path to USE_SHLIBDIR shared libraries to use when building
1186		a program.  [/lib for programs in /bin and /sbin, /usr/lib
1187		for all others.]
1188
1189_LIBSODIR	Set to ${SHLIBINSTALLDIR} if ${USE_SHLIBDIR} is not "no",
1190		otherwise set to ${LIBDIR}
1191
1192SHLINKINSTALLDIR Base path for shared linker.  [/libexec]
1193
1194SHLINKDIR	Path to use for shared linker when building a program.
1195		[/libexec for programs in /bin and /sbin, /usr/libexec for
1196		all others.]
1197
1198
1199=-=-=-=-=   bsd.subdir.mk   =-=-=-=-=
1200
1201The include file <bsd.subdir.mk> contains the default targets for building
1202subdirectories.  It has the same eight targets as <bsd.prog.mk>: all,
1203clean, cleandir, depend, includes, install, lint, and tags.  For all of
1204the directories listed in ${SUBDIR}, the specified directory will be
1205visited and the target made.  There is also a default target which allows
1206the command "make subdir" where subdir is any directory listed in ${SUBDIR}.
1207
1208As a special case, the use of a token .WAIT as an entry in SUBDIR acts
1209as a synchronization barrier when multiple make jobs are run; subdirs
1210before the .WAIT must complete before any subdirs after .WAIT are
1211started.  See make(1) for some caveats on use of .WAIT and other
1212special sources.
1213
1214
1215=-=-=-=-=   bsd.sys.mk   =-=-=-=-=
1216
1217The include file <bsd.sys.mk> is used by <bsd.prog.mk> and
1218<bsd.lib.mk>.  It contains overrides that are used when building
1219the NetBSD source tree.
1220
1221The following variables control how various files are compiled/built.
1222(Note that these may be overridden in <bsd.own.mk> if USETOOLS == "yes"):
1223
1224AR		Create, modify, and extract from archives.  [ar]
1225
1226ARFLAGS		Options to ${AR}.  [rl]
1227
1228AS		Assembler.  [as]
1229
1230AFLAGS		Options to ${AS}.  []
1231
1232CC		C compiler.  [cc]
1233
1234CFLAGS		Options to ${CC}.  [Usually -O or -O2]
1235
1236CPP		C Pre-Processor.  [cpp]
1237
1238CPPFLAGS	Options to ${CPP}.  []
1239
1240CPUFLAGS	Optimization flags for ${CC}.  []
1241
1242CXX		C++ compiler.  [c++]
1243
1244CXXFLAGS	Options to ${CXX}.  [${CFLAGS}]
1245
1246ELF2ECOFF	Convert ELF-format executable to ECOFF.  [elf2ecoff]
1247
1248FC		Fortran compiler.  [f77]
1249
1250FFLAGS		Options to {$FC}.  [-O]
1251
1252INSTALL		install(1) command.  [install]
1253
1254LEX		Lexical analyzer.  [lex]
1255
1256LFLAGS		Options to ${LEX}.  []
1257
1258LPREFIX		Symbol prefix for ${LEX} (see -P option in lex(1)) [yy]
1259
1260LD		Linker.  [ld]
1261
1262LDFLAGS		Options to ${CC} during the link process.  []
1263
1264LINT		C program verifier.  [lint]
1265
1266LINTFLAGS	Options to ${LINT}.  [-chapbxzFS]
1267
1268LORDER		List dependencies for object files.  [lorder]
1269
1270MAKE		make(1).  [make]
1271
1272MKDEP		Construct Makefile dependency list.  [mkdep]
1273
1274NM		List symbols from object files.  [nm]
1275
1276PC		Pascal compiler.  [pc]  (Not present)
1277
1278PFLAGS		Options to ${PC}.  []
1279
1280OBJC		Objective C compiler.  [${CC}]
1281
1282OBJCFLAGS	Options to ${OBJC}.  [${CFLAGS}]
1283
1284OBJCOPY		Copy and translate object files.  [objcopy]
1285
1286OBJDUMP		Display information from object files.  [objdump]
1287
1288RANLIB		Generate index to archive.  [ranlib]
1289
1290SHELL		Shell.  [sh]
1291
1292SIZE		List section sizes and total size.  [size]
1293
1294STRIP		Discard symbols from object files.  [strip]
1295
1296TSORT		Topological sort of a directed graph.  [tsort -q]
1297
1298YACC		LALR(1) parser generator.  [yacc]
1299
1300YFLAGS		Options to ${YACC}.  []
1301
1302YHEADER		If defined, add "-d" to YFLAGS, and add dependencies
1303		from <file>.y to <file>.h and <file>.c, and add
1304		<foo>.h to CLEANFILES.
1305
1306YPREFIX		If defined, add "-p ${YPREFIX}" to YFLAGS.
1307
1308
1309The following variables are defined to commands to perform the
1310appropriate operation, with the default in [brackets].
1311(Note that these are overridden in <bsd.own.mk> if USETOOLS == "yes"):
1312
1313TOOL_ASN1_COMPILE	ASN1 compiler.  [asn1_compile]
1314
1315TOOL_CAP_MKDB		Create capability database.  [cap_mkdb]
1316
1317TOOL_CAT		Concatenate and print files.  [cat]
1318
1319TOOL_CKSUM		Display file checksums.  [cksum]
1320
1321TOOL_COMPILE_ET		Error table compiler.  [compile_et]
1322
1323TOOL_CONFIG		Build kernel compilation directories.  [config]
1324
1325TOOL_CRUNCHGEN		Generate crunched binary build environment.  [crunchgen]
1326
1327TOOL_CTAGS		Create a tags file.  [ctags]
1328
1329TOOL_DB			Manipulate db(3) databases.  [db]
1330
1331TOOL_EQN		Format equations for groff.  [eqn]
1332
1333TOOL_FGEN		IEEE 1275 Open Firmware FCode Tokenizer.  [fgen]
1334
1335TOOL_GENASSYM		Generate constants for assembly files.  [genassym]
1336
1337TOOL_GENCAT		Generate NLS message catalogs.  [gencat]
1338
1339TOOL_GROFF		Front end for groff document formatting system.  [groff]
1340
1341TOOL_HEXDUMP		Ascii, decimal, hexadecimal, octal dump.  [hexdump]
1342
1343TOOL_INDXBIB		Make bibliographic database's inverted index.  [indxbib]
1344
1345TOOL_INSTALLBOOT	Install disk bootstrap software.  [installboot]
1346
1347TOOL_INSTALL_INFO	Update info/dir entries.  [install-info]
1348
1349TOOL_JOIN		Relational database operator.  [join]
1350
1351TOOL_M4			M4 macro language processor.  [m4]
1352
1353TOOL_MAKEFS		Create file system image from directory tree.  [makefs]
1354
1355TOOL_MAKEINFO		Translate Texinfo documents.  [makeinfo]
1356
1357TOOL_MAKEWHATIS		Create a whatis.db database.  [makewhatis]
1358
1359TOOL_MDSETIMAGE		Set kernel RAM disk image.  [mdsetimage]
1360
1361TOOL_MENUC		Menu compiler.  [menuc]
1362
1363TOOL_MKCSMAPPER		Make charset mapping table.  [mkcsmapper]
1364
1365TOOL_MKESDB		Make encoding scheme database.  [mkesdb]
1366
1367TOOL_MKLOCALE		Make LC_CTYPE locale files.  [mklocale]
1368
1369TOOL_MKMAGIC		Create database for file(1).  [file]
1370
1371TOOL_MKTEMP		Make (unique) temporary file name.  [mktemp]
1372
1373TOOL_MSGC		Simple message list compiler.  [msgc]
1374
1375TOOL_MTREE		Map a directory hierarchy.  [mtree]
1376
1377TOOL_PAX		Manipulate file archives and copy directories.  [pax]
1378
1379TOOL_PIC		Compile pictures for groff.  [pic]
1380
1381TOOL_PREPMKBOOTIMAGE	prep-mkbootimage (XXXBUILDSH).  [prep-mkbootimage]
1382
1383TOOL_PWD_MKDB		Generate the password databases.  [pwd_mkdb]
1384
1385TOOL_REFER		Preprocess bibliographic references for groff.  [refer]
1386
1387TOOL_ROFF_ASCII		Generate ASCII groff output.  [nroff]
1388
1389TOOL_ROFF_DVI		Generate DVI groff output.  [${TOOL_GROFF} -Tdvi]
1390
1391TOOL_ROFF_HTML		Generate HTML groff output.
1392			[${TOOL_GROFF} -Tlatin1 -mdoc2html]
1393
1394TOOL_ROFF_PS		Generate PS groff output.  [${TOOL_GROFF} -Tps]
1395
1396TOOL_ROFF_RAW		Generate "raw" groff output.  [${TOOL_GROFF} -Z]
1397
1398TOOL_RPCGEN		Remote Procedure Call (RPC) protocol compiler.  [rpcgen]
1399
1400TOOL_SOELIM		Eliminate .so's from groff input.  [soelim]
1401
1402TOOL_STAT		Display file status.  [stat]
1403
1404TOOL_SUNLABEL		Read or modify a SunOS disk label.  [sunlabel]
1405
1406TOOL_TBL		Format tables for groff.  [tbl]
1407
1408TOOL_UUDECODE		Uudecode a binary file.  [uudecode]
1409
1410TOOL_VGRIND		Grind nice listings of programs.  [vgrind -f]
1411
1412TOOL_ZIC		Time zone compiler.  [zic]
1413
1414
1415Other variables of note (incomplete list):
1416
1417WARNS		Crank up gcc warning options; the distinct levels are:
1418			WARNS=1
1419			WARNS=2
1420			WARNS=3
1421			WARNS=4
1422
1423=-=-=-=-=   bsd.x11.mk   =-=-=-=-=
1424
1425The include file <bsd.x11.mk> contains parameters and targets for
1426cross-building X11R6 from ${X11SRCDIR.xc}.
1427It should be included after the general Makefile contents but before
1428the include files such as <bsd.prog.mk> and <bsd.lib.mk>.
1429
1430It provides the following targets:
1431	.man.1 .man.3 .man.4 .man.5 .man.7:
1432		If ${MAN} or ${PROG} is set and ${MKMAN} != "no",
1433		these rules convert from X11R6's manual page source
1434		into an mdoc.old source file.
1435	cleanx11man:
1436		Clean up the mdoc.old files generated by the above.
1437
1438It sets the following variables:
1439
1440BINDIR			Set to ${X11BINDIR}.
1441			To override, define after including <bsd.x11.mk>
1442
1443LIBDIR			Set to ${X11USRLIBDIR}.
1444			To override, define after including <bsd.x11.mk>
1445
1446MANDIR			Set to ${X11MANDIR}.
1447			To override, define after including <bsd.x11.mk>
1448
1449CPPFLAGS		Appended with definitions to include from
1450			${DESTDIR}${X11INCDIR}
1451
1452LDFLAGS			Appended with definitions to link from
1453			${DESTDIR}${X11USRLIBDIR}
1454
1455X11FLAGS.CONNECTION	Equivalent to X11R6's CONNECTION_FLAGS.
1456
1457X11FLAGS.EXTENSION	Equivalent to X11R6's EXT_DEFINES.
1458
1459X11FLAGS.LOADABLE	Equivalent to X11R6's LOADABLE.
1460
1461X11FLAGS.OS_DEFINES	Equivalent to X11R6's OS_DEFINES.
1462
1463X11FLAGS.SERVER		Equivalent to X11R6's ServerDefines.
1464
1465X11FLAGS.THREADLIB	Equivalent to X11R6's THREADS_DEFINES for libraries.
1466
1467X11FLAGS.THREADS	Equivalent to X11R6's THREADS_DEFINES.
1468
1469X11FLAGS.VERSION	cpp(1) definitions of OSMAJORVERSION and OSMINORVERSION.
1470
1471X11TOOL_UNXCOMM		Commandline to convert `XCOMM' comments to `#'
1472
1473It uses the following variables:
1474
1475APPDEFS			List of app-default files to install.
1476
1477CPPSCRIPTS		List of files/scripts to run through cpp(1)
1478			and then ${X11TOOL_UNXCOMM}.  The source files
1479			have a `.cpp' suffix, the generated files do not.
1480
1481CPPSCRIPTFLAGS		Additional flags to cpp(1) when building CPPSCRIPTS.
1482
1483CPPSCRIPTFLAGS_<fn>	Additional flags to cpp(1) when building CPPSCRIPT <fn>.
1484
1485
1486=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
1487