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