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