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