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