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