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