bsd.README revision 1.242
1#	$NetBSD: bsd.README,v 1.242 2008/11/15 11:27:49 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
791
792BUILDSYMLINKS	List of two word items:
793			lnsrc lntgt
794		For each lnsrc item, create a symlink named lntgt.
795		The lntgt symlinks are removed by the cleandir target.
796
797UUDECODE_FILES	List of files which are stored as <file>.uue in the source
798		tree. Each one will be decoded with ${TOOL_UUDECODE}.
799		The source files have a `.uue' suffix, the generated files do 
800		not.
801
802UUDECODE_FILES_RENAME_<fn>
803		Rename the output from the decode to the provided name.
804		
805		*NOTE: These files are simply decoded, with no install or other
806		       rule applying implicitly except being added to the clean
807		       target.
808
809=-=-=-=-=   bsd.gcc.mk   =-=-=-=-=
810
811The include file <bsd.gcc.mk> computes various parameters related to GCC
812support libraries.  It defines no targets.  <bsd.own.mk> MUST be included
813before <bsd.gcc.mk>.
814
815The primary users of <bsd.gcc.mk> are <bsd.prog.mk> and <bsd.lib.mk>, each
816of which need to know where to find certain GCC support libraries.
817
818The behavior of <bsd.gcc.mk> is influenced by the EXTERNAL_TOOLCHAIN variable,
819which is generally set by the user.  If EXTERNAL_TOOLCHAIN it set, then
820the compiler is asked where to find the support libraries, otherwise the
821support libraries are found in ${DESTDIR}/usr/lib.
822
823<bsd.gcc.mk> sets the following variables:
824
825_GCC_CRTBEGIN	The full path name to crtbegin.o.
826
827_GCC_CRTBEGINS	The full path name to crtbeginS.o.
828
829_GCC_CRTEND	The full path name to crtend.o.
830
831_GCC_CRTENDS	The full path name to crtendS.o.
832
833_GCC_LIBGCCDIR	The directory where libgcc.a is located.
834
835
836=-=-=-=-=   bsd.inc.mk   =-=-=-=-=
837
838The include file <bsd.inc.mk> defines the includes target and uses the
839variables:
840
841INCS		The list of include files.
842
843INCSDIR		The location to install the include files.
844
845INCSNAME	Target name of the include file, if only one; same as
846		FILESNAME, but for include files.
847
848INCSYMLINKS	Similar to SYMLINKS in <bsd.links.mk>, except that these
849		are installed in the 'includes' target and not the
850		(much later) 'install' target.
851
852INCSNAME_<file>	The name file <file> should be installed as, if not <file>,
853		same as FILESNAME_<file>, but for include files.
854
855
856=-=-=-=-=   bsd.info.mk   =-=-=-=-=
857
858The include file <bsd.info.mk> is used to generate and install GNU Info
859documentation from respective Texinfo source files.  It defines three
860implicit targets (.txi.info, .texi.info, and .texinfo.info), and uses the
861following variables:
862
863TEXINFO		List of Texinfo source files.  Info documentation will
864		consist of single files with the extension replaced by
865		.info.
866
867INFOFLAGS	Flags to pass to makeinfo.  []
868
869
870=-=-=-=-=   bsd.kernobj.mk   =-=-=-=-=
871
872The include file <bsd.kernobj.mk> defines variables related to the
873location of kernel sources and object directories.
874
875KERNSRCDIR	Is the location of the top of the kernel src.
876		[${_SRC_TOP_}/sys]
877
878KERNARCHDIR	Is the location of the machine dependent kernel sources.
879		[arch/${MACHINE}]
880
881KERNCONFDIR	Is where the configuration files for kernels are found.
882		[${KERNSRCDIR}/${KERNARCHDIR}/conf]
883
884KERNOBJDIR	Is the kernel build directory.  The kernel GENERIC for
885		instance will be compiled in ${KERNOBJDIR}/GENERIC.
886		The default value is
887		${MAKEOBJDIRPREFIX}${KERNSRCDIR}/${KERNARCHDIR}/compile
888		if it exists or the target 'obj' is being made.
889		Otherwise the default is
890		${KERNSRCDIR}/${KERNARCHDIR}/compile.
891
892It is important that Makefiles (such as those under src/distrib) that
893wish to find compiled kernels use <bsd.kernobj.mk> and ${KERNOBJDIR}
894rather than make assumptions about the location of the compiled kernel.
895
896
897=-=-=-=-=   bsd.kinc.mk   =-=-=-=-=
898
899The include file <bsd.kinc.mk> defines the many targets (includes,
900subdirectories, etc.), and is used by kernel makefiles to handle
901include file installation.  It is intended to be included alone, by
902kernel Makefiles.  It uses similar variables to <bsd.inc.mk>.
903Please see <bsd.kinc.mk> for more details, and keep the documentation
904in that file up to date.
905
906
907=-=-=-=-=   bsd.lib.mk   =-=-=-=-=
908
909The include file <bsd.lib.mk> has support for building libraries.  It has
910the same eight targets as <bsd.prog.mk>: all, clean, cleandir, depend,
911includes, install, lint, and tags.  Additionally, it has a checkver target
912which checks for installed shared object libraries whose version is greater
913that the version of the source. It has a limited number of suffixes,
914consistent with the current needs of the BSD tree.  <bsd.lib.mk> includes
915<bsd.shlib.mk> to get shared library parameters.
916
917It sets/uses the following variables:
918
919LIB		The name of the library to build.
920
921LIBDIR		Target directory for libraries.
922
923SHLIBINSTALLDIR	Target directory for shared libraries if ${USE_SHLIBDIR}
924		is not "no".
925
926USE_SHLIBDIR	If not "no", use ${SHLIBINSTALLDIR} instead of ${LIBDIR}
927		as the path to install shared libraries to.
928		USE_SHLIBDIR must be defined before <bsd.own.mk> is included.
929		Default: no
930
931LIBISMODULE	If not "no", install as ${LIB}.so (without the "lib" prefix),
932		and act as "MKDEBUGLIB=no MKLINT=no MKPICINSTALL=no
933		MKPROFILE=no MKSTATICLIB=no".
934		Default: no
935
936LIBISPRIVATE	If not "no", act as "MKDEBUGLIB=no MKLINT=no MKPIC=no
937		MKPROFILE=no", and don't install the (.a) library.
938		This is useful for "build only" helper libraries.
939		Default: no
940
941LINTLIBDIR	Target directory for lint libraries.
942
943LIBGRP		Library group.
944
945LIBOWN		Library owner.
946
947LIBMODE		Library mode.
948
949LDADD		Additional loader objects.
950
951MAN		The manual pages to be installed (use a .1 - .9 suffix).
952
953NOCHECKVER_<library>
954NOCHECKVER	If set, disables checking for installed shared object
955		libraries with versions greater than the source.  A
956		particular library name, without the "lib" prefix, may
957		be appended to the variable name to disable the check for
958		only that library.
959
960SRCS		List of source files to build the library.  Suffix types
961		.s, .c, and .f are supported.  Note, .s files are preferred
962		to .c files of the same name.  (This is not the default for
963		versions of make.)
964
965LIBDPLIBS	A list of the tuples:
966			libname  path-to-srcdir-of-libname
967
968		For each tuple;
969		     *	LIBDO.libname contains the .OBJDIR of the library
970			`libname', and if it is not set it is determined
971			from the srcdir and added to MAKEOVERRIDES (the
972			latter is to allow for build time optimization).
973		     *	LDADD gets  -L${LIBDO.libname} -llibname    added.
974		     *	DPADD gets  ${LIBDO.libname}/liblibname.so  or
975				    ${LIBDO.libname}/liblibname.a   added.
976
977		This variable may be used for individual libraries, as
978		well as in parent directories to cache common libraries 
979		as a build-time optimization.
980
981The include file <bsd.lib.mk> includes the file named "../Makefile.inc"
982if it exists, as well as the include file <bsd.man.mk>.
983
984It has rules for building profiled objects; profiled libraries are
985built by default.
986
987Libraries are ranlib'd when made.
988
989
990=-=-=-=-=   bsd.links.mk   =-=-=-=-=
991
992The include file <bsd.links.mk> handles the LINKS and SYMLINKS variables
993and is included from from <bsd.lib.mk> and <bsd.prog.mk>.
994
995LINKS		The list of hard links, consisting of pairs of paths:
996			source-file target-file
997		${DESTDIR} is prepended to both paths before linking.
998		For example, to link /bin/test and /bin/[, use:
999			LINKS=/bin/test /bin/[
1000
1001CONFIGLINKS	Similar semantics to LINKS, except that the links
1002		are installed by the `configinstall' target,
1003		not the `install' target.
1004
1005SYMLINKS	The list of symbolic links, consisting of pairs of paths:
1006			source-file target-file
1007		${DESTDIR} is only prepended to target-file before linking.
1008		For example, to symlink /usr/bin/tar to /bin/tar resulting
1009		in ${DESTDIR}/usr/bin/tar -> /bin/tar:
1010			SYMLINKS=/bin/tar /usr/bin/tar
1011
1012CONFIGSYMLINKS	Similar semantics to SYMLINKS, except that the symbolic links
1013		are installed by the `configinstall' target,
1014		not the `install' target.
1015
1016
1017=-=-=-=-=   bsd.man.mk   =-=-=-=-=
1018
1019The include file <bsd.man.mk> handles installing manual pages and their
1020links.
1021
1022It has a three targets:
1023
1024	catinstall:
1025		Install the preformatted manual pages and their links.
1026	htmlinstall:
1027		Install the HTML manual pages and their links.
1028	maninstall:
1029		Install the manual page sources and their links.
1030
1031It sets/uses the following variables:
1032
1033MANDIR		Base path for manual installation.
1034
1035MANGRP		Manual group.
1036
1037MANOWN		Manual owner.
1038
1039MANMODE		Manual mode.
1040
1041MANSUBDIR	Subdirectory under the manual page section, i.e. "/vax"
1042		or "/tahoe" for machine specific manual pages.
1043
1044MAN		The manual pages to be installed (use a .1 - .9 suffix).
1045
1046MLINKS		List of manual page links (using a .1 - .9 suffix).  The
1047		linked-to file must come first, the linked file second,
1048		and there may be multiple pairs.  The files are soft-linked.
1049
1050The include file <bsd.man.mk> includes a file named "../Makefile.inc" if
1051it exists.
1052
1053
1054=-=-=-=-=   bsd.obj.mk   =-=-=-=-=
1055
1056The include file <bsd.obj.mk> defines targets related to the creation
1057and use of separated object and source directories.
1058
1059If an environment variable named MAKEOBJDIRPREFIX is set, make(1) uses
1060${MAKEOBJDIRPREFIX}${.CURDIR} as the name of the object directory if
1061it exists.  Otherwise make(1) looks for the existence of a
1062subdirectory (or a symlink to a directory) of the source directory
1063into which built targets should be placed.  If an environment variable
1064named MAKEOBJDIR is set, make(1) uses its value as the name of the
1065object directory; failing that, make first looks for a subdirectory
1066named "obj.${MACHINE}", and if that doesn't exist, it looks for "obj".
1067
1068Object directories are not created automatically by make(1) if they
1069don't exist; you need to run a separate "make obj".  (This will happen
1070during a top-level build if "MKOBJDIRS" is set to a value other than
1071"no").  When the source directory is a subdirectory of ${BSDSRCDIR} --
1072and this is determined by a simple string prefix comparison -- object
1073directories are created in a separate object directory tree, and a
1074symlink to the object directory in that tree is created in the source
1075directory; otherwise, "make obj" assumes that you're not in the main
1076source tree and that it's not safe to use a separate object tree.
1077
1078Several variables used by <bsd.obj.mk> control exactly what
1079directories and links get created during a "make obj":
1080
1081MAKEOBJDIR	If set, this is the component name of the object
1082		directory.
1083
1084OBJMACHINE	If this is set but MAKEOBJDIR is not set, creates
1085		object directories or links named "obj.${MACHINE}";
1086		otherwise, just creates ones named "obj".
1087
1088USR_OBJMACHINE  If set, and the current directory is a subdirectory of
1089		${BSDSRCDIR}, create object directory in the
1090		corresponding subdirectory of ${BSDOBJDIR}.${MACHINE};
1091		otherwise, create it in the corresponding subdirectory
1092		of ${BSDOBJDIR}
1093
1094BUILDID		If set, the contents of this variable are appended
1095		to the object directory name.  If OBJMACHINE is also
1096		set, ".${BUILDID}" is added after ".${MACHINE}".
1097
1098
1099=-=-=-=-=   bsd.prog.mk   =-=-=-=-=
1100
1101The include file <bsd.prog.mk> handles building programs from one or
1102more source files, along with their manual pages.  It has a limited number
1103of suffixes, consistent with the current needs of the BSD tree. 
1104<bsd.prog.mk> includes <bsd.shlib.mk> to get shared library parameters.
1105
1106It has eight targets:
1107
1108	all:
1109		build the program and its manual page.  This also
1110		creates a GDB initialization file (.gdbinit) in
1111		the objdir.  The .gdbinit file sets the shared library
1112		prefix to ${DESTDIR} to facilitate cross-debugging.
1113	clean:
1114		remove the program, any object files and the files a.out,
1115		Errs, errs, mklog, and ${PROG}.core.
1116	cleandir:
1117		remove all of the files removed by the target clean, as
1118		well as .depend, tags, and any manual pages.
1119		`distclean' is a synonym for `cleandir'.
1120	depend:
1121		make the dependencies for the source files, and store
1122		them in the file .depend.
1123	includes:
1124		install any header files.
1125	install:
1126		install the program and its manual pages; if the Makefile
1127		does not itself define the target install, the targets
1128		beforeinstall and afterinstall may also be used to cause
1129		actions immediately before and after the install target
1130		is executed.
1131	lint:
1132		run lint on the source files
1133	tags:
1134		create a tags file for the source files.
1135
1136It sets/uses the following variables:
1137
1138BINGRP		Binary group.
1139
1140BINOWN		Binary owner.
1141
1142BINMODE		Binary mode.
1143
1144CLEANFILES	Additional files to remove for the clean and cleandir targets.
1145
1146COPTS		Additional flags to the compiler when creating C objects.
1147
1148COPTS.<fn>	Additional flags to the compiler when creating the
1149		C objects for <fn>.
1150		For <fn>.[ly], "<fn>.c" must be used.
1151
1152CPUFLAGS	Additional flags to the compiler/assembler to select
1153		CPU instruction set options, CPU tuning options, etc.
1154
1155CPUFLAGS.<fn>	Additional flags to the compiler/assembler for <fn>.
1156		For <fn>.[ly], "<fn>.c" must be used.
1157
1158CPPFLAGS	Additional flags to the C pre-processor.
1159
1160CPPFLAGS.<fn>	Additional flags to the C pre-processor for <fn>.
1161		For <fn>.[ly], "<fn>.c" must be used.
1162
1163GDBINIT		List of GDB initialization files to add to "source"
1164		directives in the .gdbinit file that is created in the
1165		objdir.
1166
1167LDADD		Additional loader objects.  Usually used for libraries.
1168		For example, to load with the compatibility and utility
1169		libraries, use:
1170
1171			LDADD+=-lutil -lcompat
1172
1173LDFLAGS		Additional linker flags (passed to ${CC} during link).
1174
1175LINKS		See <bsd.links.mk>
1176
1177OBJCOPTS	Additional flags to the compiler when creating ObjC objects.
1178
1179OBJCOPTS.<fn>	Additional flags to the compiler when creating the
1180		ObjC objects for <fn>.
1181		For <fn>.[ly], "<fn>.c" must be used.
1182
1183SYMLINKS	See <bsd.links.mk>
1184
1185MAN		Manual pages (should end in .1 - .9).  If no MAN variable is
1186		defined, "MAN=${PROG}.1" is assumed.
1187
1188PAXCTL_FLAGS	If defined, run paxctl(1) on the program binary after link
1189		time, with the value of this variable as args to paxctl(1).
1190
1191PAXCTL_FLAGS.${PROG} Custom override for PAXCTL_FLAGS.
1192
1193PROG		The name of the program to build.  If not supplied, nothing
1194		is built.
1195
1196PROG_CXX	If defined, the name of the program to build.  Also
1197		causes <bsd.prog.mk> to link the program with the C++
1198		compiler rather than the C compiler.  PROG_CXX overrides
1199		the value of PROG if PROG is also set.
1200
1201PROGNAME	The name that the above program will be installed as, if
1202		different from ${PROG}.
1203
1204SRCS		List of source files to build the program.  If SRCS is not
1205		defined, it's assumed to be ${PROG}.c.
1206
1207DPSRCS		List of source files which are needed for generating
1208		dependencies, but are not needed in ${SRCS}.
1209
1210DPADD		Additional dependencies for the program.  Usually used for
1211		libraries.  For example, to depend on the compatibility and
1212		utility libraries use:
1213
1214			DPADD+=${LIBCOMPAT} ${LIBUTIL}
1215
1216		The following libraries are predefined for DPADD:
1217
1218		LIBCRT0?=	${DESTDIR}/usr/lib/crt0.o
1219		LIBARCHIVE?=	${DESTDIR}/usr/lib/libarchive.a
1220		LIBASN1?=	${DESTDIR}/usr/lib/libasn1.a
1221		LIBBLUETOOTH?=	${DESTDIR}/usr/lib/libbluetooth.a
1222		LIBBSDMALLOC?=	${DESTDIR}/usr/lib/libbsdmalloc.a
1223		LIBBZ2?=	${DESTDIR}/usr/lib/libbz2.a
1224		LIBC?=		${DESTDIR}/usr/lib/libc.a
1225		LIBC_PIC?=	${DESTDIR}/usr/lib/libc_pic.a
1226		LIBCOM_ERR?=	${DESTDIR}/usr/lib/libcom_err.a
1227		LIBCOMPAT?=	${DESTDIR}/usr/lib/libcompat.a
1228		LIBCRYPT?=	${DESTDIR}/usr/lib/libcrypt.a
1229		LIBCRYPTO?=	${DESTDIR}/usr/lib/libcrypto.a
1230		LIBCRYPTO_IDEA?=${DESTDIR}/usr/lib/libcrypto_idea.a
1231		LIBCRYPTO_MDC2?=${DESTDIR}/usr/lib/libcrypto_mdc2.a
1232		LIBCRYPTO_RC5?=	${DESTDIR}/usr/lib/libcrypto_rc5.a
1233		LIBCURSES?=	${DESTDIR}/usr/lib/libcurses.a
1234		LIBDBM?=	${DESTDIR}/usr/lib/libdbm.a
1235		LIBDES?=	${DESTDIR}/usr/lib/libdes.a
1236		LIBEDIT?=	${DESTDIR}/usr/lib/libedit.a
1237		LIBEVENT?=	${DESTDIR}/usr/lib/libevent.a
1238		LIBFETCH?=	${DESTDIR}/usr/lib/libfetch.a
1239		LIBFORM?=	${DESTDIR}/usr/lib/libform.a
1240		LIBGCC?=	${DESTDIR}/usr/lib/libgcc.a
1241		LIBGNUMALLOC?=	${DESTDIR}/usr/lib/libgnumalloc.a
1242		LIBGSSAPI?=	${DESTDIR}/usr/lib/libgssapi.a
1243		LIBHDB?=	${DESTDIR}/usr/lib/libhdb.a
1244		LIBINTL?=	${DESTDIR}/usr/lib/libintl.a
1245		LIBIPSEC?=	${DESTDIR}/usr/lib/libipsec.a
1246		LIBKADM5CLNT?=	${DESTDIR}/usr/lib/libkadm5clnt.a
1247		LIBKADM5SRV?=	${DESTDIR}/usr/lib/libkadm5srv.a
1248		LIBKAFS?=	${DESTDIR}/usr/lib/libkafs.a
1249		LIBKRB5?=	${DESTDIR}/usr/lib/libkrb5.a
1250		LIBKVM?=	${DESTDIR}/usr/lib/libkvm.a
1251		LIBL?=		${DESTDIR}/usr/lib/libl.a
1252		LIBLBER?=	${DESTDIR}/usr/lib/liblber.a
1253		LIBLDAP?=	${DESTDIR}/usr/lib/libldap.a
1254		LIBLDAP_R?=	${DESTDIR}/usr/lib/libldap_r.a
1255		LIBM?=		${DESTDIR}/usr/lib/libm.a
1256		LIBMENU?=	${DESTDIR}/usr/lib/libmenu.a
1257		LIBOBJC?=	${DESTDIR}/usr/lib/libobjc.a
1258		LIBOSSAUDIO?=	${DESTDIR}/usr/lib/libossaudio.a
1259		LIBPAM?=	${DESTDIR}/usr/lib/libpam.a
1260		LIBPCAP?=	${DESTDIR}/usr/lib/libpcap.a
1261		LIBPCI?=	${DESTDIR}/usr/lib/libpci.a
1262		LIBPMC?=	${DESTDIR}/usr/lib/libpmc.a
1263		LIBPOSIX?=	${DESTDIR}/usr/lib/libposix.a
1264		LIBPTHREAD?=	${DESTDIR}/usr/lib/libpthread.a
1265		LIBPTHREAD_DBG?=${DESTDIR}/usr/lib/libpthread_dbg.a
1266		LIBRADIUS?=	${DESTDIR}/usr/lib/libradius.a
1267		LIBRESOLV?=	${DESTDIR}/usr/lib/libresolv.a
1268		LIBRMT?=	${DESTDIR}/usr/lib/librmt.a
1269		LIBROKEN?=	${DESTDIR}/usr/lib/libroken.a
1270		LIBRPCSVC?=	${DESTDIR}/usr/lib/librpcsvc.a
1271		LIBRT?=		${DESTDIR}/usr/lib/librt.a
1272		LIBSDP?=	${DESTDIR}/usr/lib/libsdp.a
1273		LIBSKEY?=	${DESTDIR}/usr/lib/libskey.a
1274		LIBSL?=		${DESTDIR}/usr/lib/libsl.a
1275		LIBSS?=		${DESTDIR}/usr/lib/libss.a
1276		LIBSSH?=	${DESTDIR}/usr/lib/libssh.a
1277		LIBSSL?=	${DESTDIR}/usr/lib/libssl.a
1278		LIBSSP?=	${DESTDIR}/usr/lib/libssp.a
1279		LIBSTDCXX?=	${DESTDIR}/usr/lib/libstdc++.a
1280		LIBSUPCXX?=	${DESTDIR}/usr/lib/libsupc++.a
1281		LIBTERMCAP?=	${DESTDIR}/usr/lib/libtermcap.a
1282		LIBUSBHID?=	${DESTDIR}/usr/lib/libusbhid.a
1283		LIBUTIL?=	${DESTDIR}/usr/lib/libutil.a
1284		LIBWRAP?=	${DESTDIR}/usr/lib/libwrap.a
1285		LIBY?=		${DESTDIR}/usr/lib/liby.a
1286		LIBZ?=		${DESTDIR}/usr/lib/libz.a
1287
1288SHAREDSTRINGS	If defined, a new .c.o rule is used that results in shared
1289		strings, using xstr(1). Note that this will not work with
1290		parallel makes.
1291
1292STRIPFLAG	The flag passed to the install program to cause the binary
1293		to be stripped.
1294
1295SUBDIR		A list of subdirectories that should be built as well.
1296		Each of the targets will execute the same target in the
1297		subdirectories.
1298
1299SCRIPTS		A list of interpreter scripts [file.{sh,csh,pl,awk,...}].
1300		These are installed exactly like programs.
1301
1302SCRIPTSDIR	The location to install the scripts.  Each script can be
1303		installed to a separate path by setting SCRIPTSDIR_<script>.
1304
1305SCRIPTSNAME	The name that the above program will be installed as, if
1306		different from ${SCRIPTS}. These can be further specialized
1307		by setting SCRIPTSNAME_<script>.
1308
1309FILES		See description of <bsd.files.mk>.
1310
1311SHLINKDIR	Target directory for shared linker.  See description of
1312		<bsd.own.mk> for additional information about this variable.
1313
1314The include file <bsd.prog.mk> includes the file named "../Makefile.inc"
1315if it exists, as well as the include file <bsd.man.mk>.
1316
1317Some simple examples:
1318
1319To build foo from foo.c with a manual page foo.1, use:
1320
1321	PROG=	foo
1322
1323	.include <bsd.prog.mk>
1324
1325To build foo from foo.c with a manual page foo.2, add the line:
1326
1327	MAN=	foo.2
1328
1329If foo does not have a manual page at all, add the line:
1330
1331	MKMAN=	no
1332
1333If foo has multiple source files, add the line:
1334
1335	SRCS=	a.c b.c c.c d.c
1336
1337
1338=-=-=-=-=   bsd.rpc.mk   =-=-=-=-=
1339
1340The include file <bsd.rpc.mk> contains a makefile fragment used to
1341construct source files built by rpcgen.
1342
1343The following macros may be defined in makefiles which include
1344<bsd.rpc.mk> in order to control which files get built and how they
1345are to be built:
1346
1347RPC_INCS:	construct .h file from .x file
1348RPC_XDRFILES:	construct _xdr.c from .x file
1349		(for marshalling/unmarshalling data types)
1350RPC_SVCFILES:	construct _svc.c from .x file
1351		(server-side stubs)
1352RPC_SVCFLAGS:	Additional flags passed to builds of RPC_SVCFILES.
1353
1354RPC_XDIR:	Directory containing .x/.h files
1355
1356
1357=-=-=-=-=   bsd.shlib.mk   =-=-=-=-=
1358
1359The include file <bsd.shlib.mk> computes parameters for shared library
1360installation and use.  It defines no targets.  <bsd.own.mk> MUST be
1361included before <bsd.shlib.mk>.
1362
1363<bsd.own.mk> sets the following variables, if they are not already defined
1364(defaults are in brackets):
1365
1366SHLIBINSTALLDIR	If ${USE_SHLIBDIR} is not "no", use ${SHLIBINSTALLDIR}
1367		instead of ${LIBDIR} as the base path for shared library
1368		installation.  [/lib]
1369
1370SHLIBDIR	The path to USE_SHLIBDIR shared libraries to use when building
1371		a program.  [/lib for programs in /bin and /sbin, /usr/lib
1372		for all others.]
1373
1374_LIBSODIR	Set to ${SHLIBINSTALLDIR} if ${USE_SHLIBDIR} is not "no",
1375		otherwise set to ${LIBDIR}
1376
1377SHLINKINSTALLDIR Base path for shared linker.  [/libexec]
1378
1379SHLINKDIR	Path to use for shared linker when building a program.
1380		[/libexec for programs in /bin and /sbin, /usr/libexec for
1381		all others.]
1382
1383
1384=-=-=-=-=   bsd.subdir.mk   =-=-=-=-=
1385
1386The include file <bsd.subdir.mk> contains the default targets for building
1387subdirectories.  It has the same eight targets as <bsd.prog.mk>: all,
1388clean, cleandir, depend, includes, install, lint, and tags.  It uses the
1389following variables:
1390
1391NOSUBDIR	If this variable is defined, then the SUBDIR variable
1392		will be ignored and subdirectories will not be processed.
1393
1394SUBDIR		For all of the directories listed in ${SUBDIR}, the
1395		specified directory will be visited and the target made.
1396		There is also a default target which allows the command
1397		"make subdir" where subdir is any directory listed in
1398		${SUBDIR}.
1399
1400		As a special case, the use of a token .WAIT as an
1401		entry in SUBDIR acts as a synchronization barrier
1402		when multiple make jobs are run; subdirs before the
1403		.WAIT must complete before any subdirs after .WAIT are
1404		started.  See make(1) for some caveats on use of .WAIT
1405		and other special sources.
1406
1407
1408=-=-=-=-=   bsd.sys.mk   =-=-=-=-=
1409
1410The include file <bsd.sys.mk> is used by <bsd.prog.mk> and
1411<bsd.lib.mk>.  It contains overrides that are used when building
1412the NetBSD source tree.
1413
1414The following variables control how various files are compiled/built.
1415(Note that these may be overridden in <bsd.own.mk> if USETOOLS == "yes"):
1416
1417AR		Create, modify, and extract from archives.  [ar]
1418
1419ARFLAGS		Options to ${AR}.  [rl]
1420
1421AS		Assembler.  [as]
1422
1423AFLAGS		Options to ${CC} when compiling or linking .s or .S
1424		assembly source files.  []
1425
1426BUILDSEED	GCC uses random numbers when compiling C++ code.
1427		If this option is present, seed the random number
1428		generator based on the value, source file names and
1429		the output file name to make builds more deterministic.
1430		Additional information is available in the GCC
1431		documentation of -frandom-seed.
1432
1433CC		C compiler.  [cc]
1434
1435CFLAGS		Options to ${CC}.  [Usually -O or -O2]
1436
1437CPP		C Pre-Processor.  [cpp]
1438
1439CPPFLAGS	Options to ${CPP}.  []
1440
1441CPUFLAGS	Optimization flags for ${CC}.  []
1442
1443CXX		C++ compiler.  [c++]
1444
1445CXXFLAGS	Options to ${CXX}.  [${CFLAGS}]
1446
1447ELF2ECOFF	Convert ELF-format executable to ECOFF.  [elf2ecoff]
1448
1449FC		Fortran compiler.  [f77]
1450
1451FFLAGS		Options to {$FC}.  [-O]
1452
1453HOST_SH		Shell.	This must be an absolute path, because it may be
1454		substituted into "#!" lines in scripts.	 [/bin/sh]
1455
1456INSTALL		install(1) command.  [install]
1457
1458LEX		Lexical analyzer.  [lex]
1459
1460LFLAGS		Options to ${LEX}.  []
1461
1462LPREFIX		Symbol prefix for ${LEX} (see -P option in lex(1)) [yy]
1463
1464LD		Linker.  [ld]
1465
1466LDFLAGS		Options to ${CC} during the link process.  []
1467
1468LINT		C program verifier.  [lint]
1469
1470LINTFLAGS	Options to ${LINT}.  [-chapbxzFS]
1471
1472LORDER		List dependencies for object files.  [lorder]
1473
1474MAKE		make(1).  [make]
1475
1476MKDEP		Construct Makefile dependency list.  [mkdep]
1477
1478NM		List symbols from object files.  [nm]
1479
1480PC		Pascal compiler.  [pc]  (Not present)
1481
1482PFLAGS		Options to ${PC}.  []
1483
1484OBJC		Objective C compiler.  [${CC}]
1485
1486OBJCFLAGS	Options to ${OBJC}.  [${CFLAGS}]
1487
1488OBJCOPY		Copy and translate object files.  [objcopy]
1489
1490OBJDUMP		Display information from object files.  [objdump]
1491
1492RANLIB		Generate index to archive.  [ranlib]
1493
1494SIZE		List section sizes and total size.  [size]
1495
1496STRIP		Discard symbols from object files.  [strip]
1497
1498TSORT		Topological sort of a directed graph.  [tsort -q]
1499
1500YACC		LALR(1) parser generator.  [yacc]
1501
1502YFLAGS		Options to ${YACC}.  []
1503
1504YHEADER		If defined, add "-d" to YFLAGS, and add dependencies
1505		from <file>.y to <file>.h and <file>.c, and add
1506		<foo>.h to CLEANFILES.
1507
1508YPREFIX		If defined, add "-p ${YPREFIX}" to YFLAGS.
1509
1510
1511Other variables of note (incomplete list):
1512
1513NOGCCERROR	If defined, prevents passing certain ${CFLAGS} to GCC
1514		that cause warnings to be fatal, such as:
1515			-Werror -Wa,--fatal-warnings
1516		(The latter being for as(1).)
1517
1518WARNS		Crank up GCC warning options; the distinct levels are:
1519			WARNS=1
1520			WARNS=2
1521			WARNS=3
1522			WARNS=4
1523
1524=-=-=-=-=   bsd.x11.mk   =-=-=-=-=
1525
1526The include file <bsd.x11.mk> contains parameters and targets for
1527cross-building X11 from ${X11SRCDIR.xc} / ${X11MITSRCDIR.*}.
1528It should be included after the general Makefile contents but before
1529the include files such as <bsd.prog.mk> and <bsd.lib.mk>.
1530
1531It provides the following targets:
1532	.man.1 .man.3 .man.4 .man.5 .man.7:
1533		If ${MAN} or ${PROG} is set and ${MKMAN} != "no",
1534		these rules convert from X11's manual page source
1535		into an mdoc.old source file.
1536	cleanx11man:
1537		Clean up the mdoc.old files generated by the above.
1538
1539It sets the following variables:
1540
1541BINDIR			Set to ${X11BINDIR}.
1542			To override, define after including <bsd.x11.mk>
1543
1544LIBDIR			Set to ${X11USRLIBDIR}.
1545			To override, define after including <bsd.x11.mk>
1546
1547MANDIR			Set to ${X11MANDIR}.
1548			To override, define after including <bsd.x11.mk>
1549
1550CPPFLAGS		Appended with definitions to include from
1551			${DESTDIR}${X11INCDIR}
1552
1553LDFLAGS			Appended with definitions to link from
1554			${DESTDIR}${X11USRLIBDIR}
1555
1556X11FLAGS.CONNECTION	Equivalent to X11's CONNECTION_FLAGS.
1557
1558X11FLAGS.EXTENSION	Equivalent to X11's EXT_DEFINES.
1559
1560X11FLAGS.LOADABLE	Equivalent to X11's LOADABLE.
1561
1562X11FLAGS.OS_DEFINES	Equivalent to X11's OS_DEFINES.
1563
1564X11FLAGS.SERVER		Equivalent to X11's ServerDefines.
1565
1566X11FLAGS.THREADLIB	Equivalent to X11's THREADS_DEFINES for libraries.
1567
1568X11FLAGS.THREADS	Equivalent to X11's THREADS_DEFINES.
1569
1570X11FLAGS.VERSION	cpp(1) definitions of OSMAJORVERSION and OSMINORVERSION.
1571
1572X11FLAGS.DIX		Equivalent to X11's DIX_DEFINES.
1573
1574X11TOOL_UNXCOMM		Commandline to convert `XCOMM' comments to `#'
1575
1576It uses the following variables:
1577
1578APPDEFS			List of app-default files to install.
1579
1580CPPSCRIPTS		List of files/scripts to run through cpp(1)
1581			and then ${X11TOOL_UNXCOMM}.  The source files
1582			have a `.cpp' suffix, the generated files do not.
1583
1584CPPSCRIPTFLAGS		Additional flags to cpp(1) when building CPPSCRIPTS.
1585
1586CPPSCRIPTFLAGS_<fn>	Additional flags to cpp(1) when building CPPSCRIPT <fn>.
1587
1588
1589=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
1590