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