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