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