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