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