NameDateSize

..Today4 KiB

bsd.buildinstall.mkH A D25-Aug-2025782

bsd.clang-analyze.mkH A D04-Apr-20121.2 KiB

bsd.clean.mkH A D03-Jun-20233 KiB

bsd.dep.mkH A D03-Jun-20233.2 KiB

bsd.doc.mkH A D11-Apr-20255.6 KiB

bsd.dtb.mkH A D15-Oct-20252.5 KiB

bsd.endian.mkH A D20-Oct-20251.1 KiB

bsd.files.mkH A D06-Apr-20133.6 KiB

bsd.gcc.mkH A D09-May-2018654

bsd.host.mkH A D20-Dec-20212.1 KiB

bsd.hostinit.mkH A D01-May-2018296

bsd.hostlib.mkH A D12-Apr-20241.2 KiB

bsd.hostprog.mkH A D02-Nov-20244.9 KiB

bsd.inc.mkH A D29-Mar-20221.4 KiB

bsd.info.mkH A D18-Aug-20242.3 KiB

bsd.init.mkH A D28-Jul-2003355

bsd.ioconf.mkH A D30-Nov-20141.1 KiB

bsd.kernobj.mkH A D03-Jun-20131.2 KiB

bsd.kinc.mkH A D29-Mar-20222.1 KiB

bsd.klinks.mkH A D25-Apr-20201.4 KiB

bsd.kmodule.mkH A D18-Dec-20258 KiB

bsd.lib.mkH A D19-Dec-202528.6 KiB

bsd.links.mkH A D29-Mar-20222.3 KiB

bsd.lua.mkH A D03-Jun-20234.3 KiB

bsd.man.mkH A D10-Nov-20208.6 KiB

bsd.nls.mkH A D10-Sep-20111.3 KiB

bsd.obj.mkH A D03-Jun-20232.7 KiB

bsd.own.mkH A DToday53 KiB

bsd.prog.mkH A D18-Dec-202517.1 KiB

bsd.READMEH A D16-Dec-202563.6 KiB

bsd.rpc.mkH A D15-Dec-20131.5 KiB

bsd.sanitizer.mkH A D27-Aug-2019797

bsd.shlib.mkH A D23-Aug-2012834

bsd.subdir.mkH A D10-Jul-2022917

bsd.sys.mkH A D15-Nov-202511.2 KiB

bsd.syscall.mkH A D16-Jan-2014419

bsd.test.mkH A D21-Jan-20195.7 KiB

bsd.x11.mkH A D09-Dec-202514.5 KiB

compare-lib-listsH A D18-Nov-20191.2 KiB

MakefileH A D18-May-2020767

sys.mkH A D20-Oct-20256.3 KiB

bsd.README

1#	$NetBSD: bsd.README,v 1.457 2025/12/16 04:21:03 riastradh Exp $
2#	@(#)bsd.README	8.2 (Berkeley) 4/2/94
3
4This is the README file for the make "include" files for the NetBSD
5source tree.  The files are installed in /usr/share/mk, and are,
6by convention, named with the suffix ".mk".
7
8Other sources of relevant documentation are BUILDING in the top
9level of the NetBSD source tree, and the mk.conf(5) man page.
10
11Note: this file is not intended to replace reading through the .mk
12files for anything tricky.
13
14=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
15
16RANDOM THINGS WORTH KNOWING:
17
18The files are simply C-style #include files, and pretty much behave like
19you'd expect.  The syntax is slightly different in that a single '.' is
20used instead of the hash mark, i.e. ".include <bsd.prog.mk>".
21
22One difference that will save you lots of debugging time is that inclusion
23of the file is normally done at the *end* of the Makefile.  The reason for
24this is because .mk files often modify variables and behavior based on the
25values of variables set in the Makefile.  To make this work, remember that
26the FIRST target found is the target that is used, i.e. if the Makefile has:
27
28	a:
29		echo a
30	a:
31		echo a number two
32
33the command "make a" will echo "a".  To make things confusing, the SECOND
34variable assignment is the overriding one, i.e. if the Makefile has:
35
36	a=	foo
37	a=	bar
38
39	b:
40		echo ${a}
41
42the command "make b" will echo "bar".  This is for compatibility with the
43way the V7 make behaved.
44
45It's fairly difficult to make the BSD .mk files work when you're building
46multiple programs in a single directory.  It's a lot easier to split up the
47programs than to deal with the problem.  Most of the agony comes from making
48the "obj" directory stuff work right, not because we switched to a new version
49of make.  So, don't get mad at us, figure out a better way to handle multiple
50architectures so we can quit using the symbolic link stuff.  (Imake doesn't
51count.)
52
53The file .depend in the source directory is expected to contain dependencies
54for the source files.  This file is read automatically by make after reading
55the Makefile.
56
57The variable DESTDIR works as before.  It's not set anywhere but will change
58the tree where the file gets installed.
59
60The profiled libraries are no longer built in a different directory than
61the regular libraries.  A new suffix, ".po", is used to denote a profiled
62object, and ".pico" denotes a shared (position-independent) object.
63
64There are various make variables used during the build.
65
66Many variables support a (case sensitive) value of "no" or "yes",
67and are tested with  ${VAR} == "no"  and  ${VAR} != "no" .
68
69
70The basic rule for the variable naming scheme is as follows:
71
72HOST_<cmd>	A command that runs on the host machine regardless of
73		whether or not the system is being cross compiled, or
74		options for such a command.
75
76MK<feature>	Can be set to "no" to disable feature <feature>,
77		or "yes" to enable feature <feature>.
78		Usually defaults to "yes", although some variables
79		default to "no".
80		Due to make(1) implementation issues, if a temporary
81		command-line override of a mk.conf(5) or <bsd.own.mk>
82		setting is required whilst still honoring a particular
83		Makefile's setting of MK<feature>, use
84			env MK<feature>=value make
85		instead of
86			make MK<feature>=value
87
88NO<feature>	If defined, disables feature <feature>, overriding
89		a user's MK<feature>=yes configuration.
90		Not intended for users.
91		This is to allow Makefiles to disable functionality
92		that they don't support (such as missing man pages).
93		NO<feature> variables must be defined before <bsd.own.mk>
94		is included, which generally means define before
95		any <*.mk> is included.
96		See "Variables for a Makefile".
97
98TOOL_<tool>	A tool that is provided as part of the USETOOLS
99		framework.  When not using the USETOOLS framework,
100		TOOL_<tool> variables should refer to tools that are
101		already installed on the host system.
102
103Various mk.conf(5) variables control the NetBSD system build.
104These should not be set by Makefiles; they're for the user to define
105in MAKECONF (see mk.conf(5) or <bsd.own.mk> documented below) or on
106the make(1) command line.
107
108The supported mk.conf(5) make variables are:
109
110	BSDOBJDIR, BSDSRCDIR, BUILD, BUILDID, BUILDINFO, BUILDSEED,
111	CDEXTRA, CONFIGOPTS, COPTS, CPUFLAGS, DESTDIR, EXTERNAL_TOOLCHAIN,
112	INSTALLBOOT_BOARDS, INSTALLWORLDDIR, KERNARCHDIR, KERNCONFDIR,
113	KERNEL_DIR, KERNOBJDIR, KERNSRCDIR, LOCALTIME, MAKEVERBOSE,
114	MKAMDGPUFIRMWARE, MKARGON2, MKARZERO, MKATF, MKBINUTILS, MKBSDGREP,
115	MKBSDTAR, MKCATPAGES, MKCLEANSRC, MKCLEANVERIFY, MKCOMPAT,
116	MKCOMPATMODULES, MKCOMPATTESTS, MKCOMPATX11, MKCOMPLEX, MKCROSSGDB,
117	MKCTF, MKCVS, MKCXX, MKDEBUG, MKDEBUGKERNEL, MKDEBUGLIB,
118	MKDEBUGTOOLS, MKDEPINCLUDES, MKDOC, MKDTB, MKDTC, MKDTRACE,
119	MKDYNAMICROOT, MKFIRMWARE, MKGCC, MKGCCCMDS, MKGDB, MKGROFF,
120	MKGROFFHTMLDOC, MKHESIOD, MKHOSTOBJ, MKHTML, MKIEEEFP, MKINET6,
121	MKINFO, MKIPFILTER, MKISCSI, MKKERBEROS, MKKMOD, MKKYUA, MKLDAP,
122	MKLIBCSANITIZER, MKLIBCXX, MKLIBSTDCXX, MKLINKLIB, MKLINT, MKLLVM,
123	MKLLVMRT, MKLVM, MKMAKEMANDB, MKMAN, MKMANDOC, MKMANZ, MKMDNS,
124	MKNLS, MKNOUVEAUFIRMWARE, MKNPF, MKNSD, MKOBJ, MKOBJDIRS, MKPAM,
125	MKPCC, MKPF, MKPIC, MKPICINSTALL, MKPICLIB, MKPIE, MKPIGZGZIP,
126	MKPOSTFIX, MKPROFILE, MKRADEONFIRMWARE, MKRELRO, MKREPRO,
127	MKREPRO_TIMESTAMP, MKRUMP, MKSANITIZER, MKSHARE, MKSKEY, MKSLJIT,
128	MKSOFTFLOAT, MKSTATICLIB, MKSTATICPIE, MKSTRIPIDENT, MKSTRIPSYM,
129	MKTEGRAFIRMWARE, MKTPM, MKUNBOUND, MKUNPRIVED, MKUPDATE, MKX11,
130	MKX11FONTS, MKX11MOTIF, MKXORG_SERVER, MKYP, MKZFS, NETBSDSRCDIR,
131	NETBSD_OFFICIAL_RELEASE, NOCLEANDIR, NODISTRIBDIRS, NOINCLUDES,
132	OBJMACHINE, RELEASEDIR, RUMPUSER_THREADS, RUMP_CURLWP, RUMP_DEBUG,
133	RUMP_DIAGNOSTIC, RUMP_KTRACE, RUMP_LOCKDEBUG, RUMP_LOCKS_UP,
134	RUMP_NBCOMPAT, RUMP_VIRTIF, RUMP_VNODE_LOCKDEBUG,
135	TOOLCHAIN_MISSING, TOOLDIR, USETOOLS, USE_FORT, USE_HESIOD,
136	USE_INET6, USE_JEMALLOC, USE_KERBEROS, USE_LDAP, USE_LIBCSANITIZER,
137	USE_PAM, USE_PIGZGZIP, USE_SANITIZER, USE_SKEY, USE_SSP,
138	USE_XZ_SETS, USE_YP, X11MOTIFPATH, X11SRCDIR.
139
140The obsolete mk.conf(5) make variables are:
141
142	EXTSRCSRCDIR, MKBFD, MKCRYPTO, MKEXTSRC, MKKDEBUG, MKKERBEROS4,
143	MKLLD, MKLLDB, MKMCLINKER, MKPERFUSE, MKTOOLSDEBUG, NBUILDJOBS,
144	SHAREDSTRINGS, USE_COMBINE, USE_NEW_TOOLCHAIN.
145
146Notable variables documented in mk.conf(5) and duplicated here:
147
148DESTDIR		Directory to contain the built NetBSD system.  If set,
149		special options are passed to the compilation tools to
150		prevent their default use of the host system's
151		/usr/include, /usr/lib, and so forth.  This pathname must
152		be an absolute path, and should not end with a slash (/)
153		character.  (For installation into the system's root
154		directory, set DESTDIR to an empty string, not to "/").
155		The directory must reside on a file system which supports
156		long file names and hard links.
157
158		Note: build.sh will provide a default of
159		"destdir.MACHINE" (in the top-level .OBJDIR) unless run
160		in `expert' mode with the -E option.
161
162		Default: Empty string if USETOOLS=yes; otherwise unset.
163
164RELEASEDIR	If set, specifies the directory to which a release(7)
165		layout will be written at the end of a "make release".
166		If specified, must be an absolute path.
167
168		Note: build.sh will provide a default of "releasedir" (in
169		the top-level .OBJDIR) unless run in `expert' mode with
170		the -E option.
171
172		Default: Unset.
173
174COPTS.lib<lib>
175OBJCOPTS.lib<lib>
176LDADD.lib<lib>
177CPPFLAGS.lib<lib>
178CXXFLAGS.lib<lib>
179COPTS.<prog>
180OBJCOPTS.<prog>
181LDADD.<prog>
182CPPFLAGS.<prog>
183CXXFLAGS.<prog> These provide a way to specify additions to the associated
184		variables in a way that applies only to a particular library
185		or program.  <lib> corresponds to the LIB variable set in
186		the library's makefile.  <prog> corresponds to either PROG
187		or PROG_CXX (if set).  For example, if COPTS.libcrypto is
188		set to "-g", "-g" will be added to COPTS only when compiling
189		the crypto library.
190		See bsd.prog.mk below for more details about these variables.
191
192The active compiler is selected using the following variables:
193AVAILABLE_COMPILER
194		List of available compiler suites.  Processed in order
195		for selecting the active compiler for each frontend.
196HAVE_PCC	If defined, PCC is present and enabled.
197HAVE_LLVM	If defined, LLVM/Clang is present and enabled.
198UNSUPPORTED_COMPILER.<comp>
199		If defined, the support for compiler <comp> is disabled.
200
201For the frontends (CC, CPP, CXX, FC and OBJC) the following variables exist:
202ACTIVE_CC	Active compile suite for the CC frontend.
203SUPPORTED_CC	Compile suite with support for the CC frontend.
204TOOL_CC.<comp>	Path to the CC frontend for compiler <comp>.
205
206
207=-=-=-=-=   Variables for a Makefile   =-=-=-=-=
208
209If the following varialbes are defined in the Makefile before
210any make(1) .include directives, they force the specific behavior.
211
212NOCOMPAT	Force MKCOMPAT=no.
213NOCTF		Force MKCTF=no.
214NODEBUG		Force MKDEBUG=no.
215NODEBUGLIB	Force MKDEBUGLIB=no.
216NODOC		Force MKDOC=no.
217NOFORT		Force USE_FORT=no.
218NOHTML		Force MKHTML=no.
219NOINFO		Force MKINFO=no.
220NOLIBCSANITIZER Force MKLIBCSANITIZER=no (and USE_LIBCSANITIZER=no)
221NOLINKLIB	Force MKLINKLIB=no.
222NOLINT		Force MKLINT=no.
223NOMAN		Force MKMAN=no.
224NOMANDOC	Force MKMANDOC=no.
225NONLS		Force MKNLS=no.
226NOOBJ		Force MKOBJ=no.
227NOPIC		Force MKPIC=no.
228NOPICINSTALL	Force MKPICINSTALL=no.
229NOPIE		Force MKPIE=no.
230NOPROFILE	Force MKPROFILE=no.
231NORELRO		Force MKREPRO=no.
232NOSANITIZER	Force MKSANITIZER=no (and USE_SANITIZER=no)
233NOSHARE		Force MKSHARE=no.
234NOSSP		Force USE_SSP=no.
235NOSTATICLIB	Force MKSTATICLIB=no.
236
237Special variations:
238
239NOFULLRELRO!=no Force MKRELRO=no if MKRELRO=full
240
241TODO: NOFULLRELRO should just be a defined test for consistency.
242
243
244=-=-=-=-=   sys.mk   =-=-=-=-=
245
246The include file <sys.mk> has the default rules for all makes, in the BSD
247environment or otherwise.  You probably don't want to touch this file.
248
249=-=-=-=-=   bsd.own.mk   =-=-=-=-=
250
251The include file <bsd.own.mk> contains source tree configuration parameters,
252such as the owners, groups, etc. for both manual pages and binaries, and
253a few global "feature configuration" parameters.
254
255It has no targets.
256
257To get system-specific configuration parameters, <bsd.own.mk> will try to
258include the mk.conf(5) file specified by the MAKECONF variable, which may
259be either set in the environment or provided on the make(1) command line.
260MAKECONF defaults to /etc/mk.conf.  mk.conf(5) may define any of the
261variables described below.
262
263<bsd.own.mk> sets the following variables, if they are not already defined
264(defaults are in brackets):
265
266NETBSDSRCDIR	The path to the top level of the NetBSD sources.
267		If _SRC_TOP_ != "", that will be used as the default,
268		otherwise BSDSRCDIR will be used as the default.
269		Various makefiles within the NetBSD source tree will
270		use this to reference the top level of the source tree.
271		Default: Top level of the NetBSD source tree (as
272		determined by the presence of build.sh and tools/) if
273		make(1) is run from within that tree; otherwise BSDSRCDIR
274		will be used.
275
276_SRC_TOP_	Top of the system source tree, as determined by <bsd.own.mk>
277		based on the presence of tools/ and build.sh.  This variable
278		is "internal" to <bsd.own.mk>, although its value is only
279		determined once and then propagated to all sub-makes.
280
281_NETBSD_VERSION_DEPENDS
282		A list of files which contain information about
283		the version of the NetBSD being built.  This is
284		defined only if the current directory appears
285		to be inside a NetBSD source tree.  The list of
286		files includes ${NETBSDSRCDIR}/sys/sys/param.h
287		(which contains the kernel version number),
288		${NETBSDSRCDIR}/sys/conf/newvers.sh and
289		${NETBSDSRCDIR}/sys/conf/osrelease.sh (which
290		interpret the information in sys/sys/param.h), and
291		${_SRC_TOP_OBJ_}/params (which is an optional file,
292		created by "make build" in ${_SRC_TOP_}/Makefile,
293		containing all the variables that may influence the
294		build).
295
296		Targets that depend on the NetBSD version, or on
297		variables defined at build time, can declare a
298		dependency on ${_NETBSD_VERSION_DEPENDS}, like this:
299
300			version.c: ${_NETBSD_VERSION_DEPENDS}
301				commands to create version.c
302
303BSDSRCDIR	The real path to the NetBSD source tree, if NETBSDSRCDIR
304		isn't defined.
305		Default: "/usr/src".
306
307BSDOBJDIR	The real path to the object directory tree for the NetBSD
308		source tree.
309		Default: "/usr/obj".
310
311BINGRP		Binary group.  [wheel]
312
313BINOWN		Binary owner.  [root]
314
315BINMODE		Binary mode.  [555]
316
317NONBINMODE	Mode for non-executable files.  [444]
318
319MANDIR		Base path for manual installation.  [/usr/share/man/cat]
320
321MANGRP		Manual group.  [wheel]
322
323MANOWN		Manual owner.  [root]
324
325MANMODE		Manual mode.  [${NONBINMODE}]
326
327MANINSTALL	Manual installation type.  Space separated list:
328			catinstall, htmlinstall, maninstall
329		Default value derived from MKCATPAGES and MKHTML.
330
331MAKELINKLIB	Defaults to ${MKLINKLIB} but can be overridden by Makefiles
332
333MAKESTATICLIB	Defaults to ${MKSTATICLIB} but can be overridden by Makefiles
334
335LDSTATIC	Control program linking; if set blank, link everything
336		dynamically.  If set to "-static", link everything statically.
337		If not set, programs link according to their makefile.
338
339LIBDIR		Base path for library installation.  [/usr/lib]
340
341LINTLIBDIR	Base path for lint(1) library installation.  [/usr/libdata/lint]
342
343LIBGRP		Library group.  [${BINGRP}]
344
345LIBOWN		Library owner.  [${BINOWN}]
346
347LIBMODE		Library mode.  [${NONBINMODE}]
348
349LINKINSTALL	Install libraries used by users to link against (.a/.so)
350		defaults to ${MAKELINKLIB}
351
352DOCDIR		Base path for system documentation (e.g. PSD, USD, etc.)
353		installation.  [/usr/share/doc]
354
355DOCGRP		Documentation group.  [wheel]
356
357DOCOWN		Documentation owner.  [root]
358
359DOCMODE		Documentation mode.  [${NONBINMODE}]
360
361GZIP_N_FLAG	Options to pass to TOOL_GZIP to prevent it from inserting
362		file names or timestamps in the compressed output.
363		[-n, or -nT when TOOL_GZIP is really TOOL_PIGZ]
364
365NLSDIR		Base path for Native Language Support files installation.
366		[/usr/share/nls]
367
368NLSGRP		Native Language Support files group.  [wheel]
369
370NLSOWN		Native Language Support files owner.  [root]
371
372NLSMODE		Native Language Support files mode.  [${NONBINMODE}]
373
374X11SRCDIR	Directory containing the modular Xorg source.  If
375		specified, must be an absolute path.  The main modular
376		Xorg source is found in ${X11SRCDIR}/external/mit.
377
378		Default: ${NETBSDSRCDIR}/../xsrc, if that exists; otherwise
379		"/usr/xsrc".
380
381X11SRCDIR.local The path to the local X11 src tree.  [${X11SRCDIR}/local]
382
383X11SRCDIR.lib<package>
384X11SRCDIR.<package>
385		The path to the xorg src tree for the specified package>.
386		[${X11SRCDIR}/external/mit/xorg/<package>/dist]
387
388X11ROOTDIR	Root directory of the X11 installation.  [/usr/X11R7]
389
390X11BINDIR	X11 bin directory.  [${X11ROOTDIR}/bin]
391
392X11FONTDIR	X11 font directory.  [${X11ROOTDIR}/lib/X11/fonts]
393
394X11INCDIR	X11 include directory.  [${X11ROOTDIR}/include]
395
396X11LIBDIR	X11 lib/x11 (config) directory.  [${X11ROOTDIR}/lib/X11]
397
398X11MANDIR	X11 manual directory.  [${X11ROOTDIR}/man]
399
400X11USRLIBDIR	X11 library directory.  [${X11ROOTDIR}/lib]
401
402STRIPFLAG	The option passed to the install program to cause the binary
403		to be stripped.  This is to be used when building your
404		own install script so that the entire system can be made
405		stripped/not-stripped using a single knob.  []
406
407COPY		The option passed to the install program to cause the binary
408		to be copied rather than moved.  This is to be used when
409		building our own install script so that the entire system
410		can either be installed with copies, or with moves using
411		a single knob.  [-c]
412
413MAKEDIRTARGETENV
414		Environment variables passed to the child make process
415		invoked by MAKEDIRTARGET.
416
417MAKEDIRTARGET dir target [params]
418		Runs "cd $${dir} && ${MAKE} [params] $${target}",
419		displaying a "pretty" message whilst doing so.
420
421RELEASEMACHINEDIR
422		Subdirectory used below RELEASEDIR when building
423		a release.  [${MACHINE},
424		or ${MACHINE}-${MACHINE_ARCH} for evb{arm,mips,sh3}*]
425
426RELEASEMACHINE	Subdirectory or path component used for the following
427		paths:
428			distrib/${RELEASEMACHINE}
429			distrib/notes/${RELEASEMACHINE}
430			etc/etc.${RELEASEMACHINE}
431		Used when building a release.  [${MACHINE}]
432
433Additionally, the following variables may be set by <bsd.own.mk> or in a
434make configuration file to modify the behavior of the system build
435process (default values are in brackets along with comments, if set by
436<bsd.own.mk>):
437
438USETOOLS	Can be set to "yes" or "no".  Indicates whether the tools
439		specified by ${TOOLDIR} should be used as part of a build in
440		progress. Must be set to "yes" if cross-compiling.
441		Supported values:
442
443		yes	Use the tools from TOOLDIR.
444
445		no	Do not use the tools from TOOLDIR, but refuse to
446			build native compilation tool components that are
447			version-specific for that tool.
448
449		never	Do not use the tools from TOOLDIR, even when
450			building native tool components.  This is similar to
451			the traditional NetBSD build method, but does not
452			verify that the compilation tools in use are
453			up-to-date enough in order to build the tree
454			successfully.  This may cause build or runtime
455			problems when building the whole NetBSD source tree.
456
457		Default: "no" when using <bsd.*.mk> outside the NetBSD
458		source tree (detected automatically) or if
459		TOOLCHAIN_MISSING=yes; otherwise "yes".
460
461OBJECT_FMT	Object file format.  [set to "ELF" on architectures that
462		use ELF -- currently all architectures].
463
464TOOLCHAIN_MISSING
465		Can be set to "yes" or "no".  If not "no", this
466		indicates that the platform "MACHINE_ARCH" being built
467		does not have a working in-tree toolchain.
468		If the ${MACHINE_ARCH} in question falls into this category,
469		TOOLCHAIN_MISSING is conditionally assigned the value "yes".
470		Otherwise, the variable is unconditionally assigned the
471		value "no".
472
473		If not "no", acts as MKBINUTILS=no MKGCC=no MKGDB=no.
474
475		Default: "no".
476
477EXTERNAL_TOOLCHAIN
478		This variable is not directly set by <bsd.own.mk>, but
479		including <bsd.own.mk> is the canonical way to gain
480		access to this variable.  The variable should be defined
481		either in the user's environment or in the user's mk.conf(5)
482		file.
483
484		If defined, this variable indicates the root directory of
485		an external toolchain which will be used to build the
486		tree.  For example, if a platform is a ${TOOLCHAIN_MISSING}
487		platform, EXTERNAL_TOOLCHAIN can be used to re-enable the
488		cross-compile framework.
489
490		If EXTERNAL_TOOLCHAIN is defined, act as MKGCC=no, since
491		the external version of the compiler may not be able to build
492		the library components of the in-tree compiler.
493
494		This variable should be used in conjunction with an
495		appropriate HAVE_GCC or HAVE_LLVM setting to control the
496		compiler options.
497
498		Note: This variable is not yet used in as many places as
499		it should be.  Expect the exact semantics of this variable
500		to change in the short term as parts of the cross-compile
501		framework continue to be cleaned up.
502
503The following variables are defined to commands to perform the
504appropriate operation, with the default in [brackets].  Note that
505the defaults change if USETOOLS == "yes":
506
507TOOL_AMIGAAOUT2BB	aout to Amiga bootblock converter.  [amiga-aout2bb]
508
509TOOL_AMIGAELF2BB	ELF to Amiga bootblock converter.  [amiga-elf2bb]
510
511TOOL_AMIGATXLT		Amiga assembly language format translator.  [amiga-txlt]
512
513TOOL_ARMELF2AOUT	ELF to a.out executable converter [arm-elf2aout}
514
515TOOL_ASN1_COMPILE	ASN1 compiler.  [asn1_compile]
516
517TOOL_AWK		Pattern-directed scanning/processing language.  [awk]
518
519TOOL_CAP_MKDB		Create capability database.  [cap_mkdb]
520
521TOOL_CAT		Concatenate and print files.  [cat]
522
523TOOL_CKSUM		Display file checksums.  [cksum]
524
525TOOL_COMPILE_ET		Error table compiler.  [compile_et]
526
527TOOL_CONFIG		Build kernel compilation directories.  [config]
528
529TOOL_CRUNCHGEN		Generate crunched binary build environment.  [crunchgen]
530
531TOOL_CTAGS		Create a tags file.  [ctags]
532
533TOOL_DB			Manipulate db(3) databases.  [db]
534
535TOOL_DISKLABEL		Read and write disk pack label.  [disklabel]
536
537TOOL_EQN		Format equations for groff.  [eqn]
538
539TOOL_FDISK		MS-DOS partition maintenance program.  [fdisk]
540
541TOOL_FGEN		IEEE 1275 Open Firmware FCode Tokenizer.  [fgen]
542
543TOOL_GENASSYM		Generate constants for assembly files.  [genassym]
544
545TOOL_GENCAT		Generate NLS message catalogs.  [gencat]
546
547TOOL_GMAKE		GNU make utility.  [gmake]
548
549TOOL_GREP		Print lines matching a pattern.  [grep]
550
551TOOL_GROFF		Front end for groff document formatting system.  [groff]
552
553TOOL_GZIP		Compression/decompression tool.  [gzip]
554
555TOOL_GZIP_N		Same as TOOL_GZIP, plus a command line option to
556			prevent it from inserting file names or timestamps
557			into the compressed output.
558			[${TOOL_GZIP} ${GZIP_N_FLAG}]
559
560TOOL_HEXDUMP		Ascii, decimal, hexadecimal, octal dump.  [hexdump]
561
562TOOL_HP300MKBOOT	Make bootable image for hp300.  [hp300-mkboot]
563
564TOOL_HPPAMKBOOT		Make bootable image for hppa.  [hppa-mkboot]
565
566TOOL_INDXBIB		Make bibliographic database's inverted index.  [indxbib]
567
568TOOL_INSTALLBOOT	Install disk bootstrap software.  [installboot]
569
570TOOL_INSTALL_INFO	Update info/dir entries.  [install-info]
571
572TOOL_JOIN		Relational database operator.  [join]
573
574TOOL_M4			M4 macro language processor.  [m4]
575
576TOOL_M68KELF2AOUT	ELF to a.out executable converter [m68k-elf2aout}
577
578TOOL_MACPPCFIXCOFF	Fix up xcoff headers for macppc.  [macppc-fixcoff]
579
580TOOL_MAKEFS		Create file system image from directory tree.  [makefs]
581
582TOOL_MAKEINFO		Translate Texinfo documents.  [makeinfo]
583
584TOOL_MAKEWHATIS		Create a whatis.db database.  [makewhatis]
585
586TOOL_MDSETIMAGE		Set kernel RAM disk image.  [mdsetimage]
587
588TOOL_MENUC		Menu compiler.  [menuc]
589
590TOOL_MIPSELF2ECOFF	Convert ELF-format executable to ECOFF for mips.
591			[mips-elf2ecoff]
592
593TOOL_MKCSMAPPER		Make charset mapping table.  [mkcsmapper]
594
595TOOL_MKESDB		Make encoding scheme database.  [mkesdb]
596
597TOOL_MKLOCALE		Make LC_CTYPE locale files.  [mklocale]
598
599TOOL_MKMAGIC		Create database for file(1).  [file]
600
601TOOL_MKNOD		Make device special file.  [mknod]
602
603TOOL_MKTEMP		Make (unique) temporary file name.  [mktemp]
604
605TOOL_MSGC		Simple message list compiler.  [msgc]
606
607TOOL_MTREE		Map a directory hierarchy.  [mtree]
608
609TOOL_NCDCS		Turn ELF kernel into a NCD firmware image. [ncdcs]
610
611TOOL_PAX		Manipulate file archives and copy directories.  [pax]
612
613TOOL_PIC		Compile pictures for groff.  [pic]
614
615TOOL_PIGZ		Parallel compressor.  [pigz]
616
617TOOL_POWERPCMKBOOTIMAGE Make bootable image for powerpc.  [powerpc-mkbootimage]
618
619TOOL_PWD_MKDB		Generate the password databases.  [pwd_mkdb]
620
621TOOL_REFER		Preprocess bibliographic references for groff.  [refer]
622
623TOOL_ROFF_ASCII		Generate ASCII groff output.  [nroff]
624
625TOOL_ROFF_DVI		Generate DVI groff output.  [${TOOL_GROFF} -Tdvi]
626
627TOOL_ROFF_HTML		Generate HTML groff output.
628			[${TOOL_GROFF} -Tlatin1 -mdoc2html]
629
630TOOL_ROFF_PS		Generate PS groff output.  [${TOOL_GROFF} -Tps]
631
632TOOL_ROFF_RAW		Generate "raw" groff output.  [${TOOL_GROFF} -Z]
633
634TOOL_RPCGEN		Remote Procedure Call (RPC) protocol compiler.  [rpcgen]
635
636TOOL_SED		Stream editor.  [sed]
637
638TOOL_SOELIM		Eliminate .so's from groff input.  [soelim]
639
640TOOL_SPARKCRC		Generate a crc suitable for use in a sparkive file.
641			[sparkcrc]
642
643TOOL_STAT		Display file status.  [stat]
644
645TOOL_STRFILE		Create a random access file for storing strings.
646			[strfile]
647
648TOOL_SUNLABEL		Read or modify a SunOS disk label.  [sunlabel]
649
650TOOL_TBL		Format tables for groff.  [tbl]
651
652TOOL_UUDECODE		Uudecode a binary file.  [uudecode]
653
654TOOL_VAXMOPCOPY		Creates a MOP image from another executable format.
655			[vax-mopcopy]
656
657TOOL_VGRIND		Grind nice listings of programs.  [vgrind -f]
658
659TOOL_ZIC		Time zone compiler.  [zic]
660
661For each possible value of MACHINE_CPU, MACHINES.${MACHINE_CPU} contain a
662list of what ports can be built for it.  This keeps those definitions in
663centralized place.
664
665<bsd.own.mk> is generally useful when building your own Makefiles so that
666they use the same default owners etc. as the rest of the tree.
667
668
669=-=-=-=-=   bsd.clean.mk   =-=-=-=-=
670
671The include file <bsd.clean.mk> defines the clean and cleandir
672targets.  It uses the following variables:
673
674CLEANFILES	Files to remove for both the clean and cleandir targets.
675
676CLEANDIRFILES	Files to remove for the cleandir target, but not for
677		the clean target.
678
679MKCLEANSRC	Controls whether or not the clean and cleandir targets
680		will delete files from both the object directory,
681		${.OBJDIR}, and the source directory, ${.CURDIR}.
682
683		If MKCLEANSRC is set to "no", then the file names in
684		CLEANFILES or CLEANDIRFILES are interpreted relative
685		to the object directory, ${.OBJDIR}.  This is the
686		traditional behaviour.
687
688		If MKCLEANSRC is set to "yes", then the file deletion
689		is performed relative to both the object directory,
690		${.OBJDIR}, and the source directory, ${.CURDIR}.  (This
691		has no effect if ${.OBJDIR} is the same as ${.CURDIR}.)
692		Deleting files from ${.CURDIR} is intended to remove
693		stray output files that had been left in the source
694		directory by an earlier build that did not use object
695		directories.
696
697		The default is MKCLEANSRC=yes.  If you always build with
698		separate object directories, and you are sure that there
699		are no stray files in the source directories, then you
700		may set MKCLEANSRC=no to save some time.
701
702MKCLEANVERIFY	Controls whether or not the clean and cleandir targets
703		will verify that files have been deleted.
704
705		If MKCLEANVERIFY is set to "no", then the files will
706		be deleted using a "rm -f" command, and its success or
707		failure will be ignored.
708
709		If MKCLEANVERIFY is set to "yes", then the success of
710		the "rm -f" command will be verified using an "ls"
711		command.
712
713		The default is MKCLEANVERIFY=yes.  If you are sure that
714		there will be no problems caused by file permissions,
715		read-only file systems, or the like, then you may set
716		MKCLEANVERIFY=no to save some time.
717
718To use the clean and cleandir targets defined in <bsd.clean.mk>, other
719Makefiles or bsd.*.mk files should append file names to the CLEANFILES
720or CLEANDIRFILES variables.  For example:
721
722	    CLEANFILES+= a.out
723	    CLEANDIRFILES+= .depend
724
725	    .include <bsd.clean.mk>
726
727The files listed in CLEANFILES and CLEANDIRFILES must not be
728directories, because the potential risk from running "rm -rf" commands
729in bsd.clean.mk is considered too great.  If you want to recursively
730delete a directory as part of "make clean" or "make cleandir" then you
731need to provide your own target.
732
733=-=-=-=-=   bsd.dep.mk   =-=-=-=-=
734
735The include file <bsd.dep.mk> contains the default targets for building
736.depend files.  It creates .d files from entries in SRCS and DPSRCS
737that are C, C++, or Objective C source files, and builds .depend from the
738.d files.  All other files in SRCS and all of DPSRCS will be used as
739dependencies for the .d files.  In order for this to function correctly,
740it should be .included after all other .mk files and directives that may
741modify SRCS or DPSRCS.  It uses the following variables:
742
743SRCS		List of source files to build the program.
744
745DPSRCS		List of source files which are needed for generating
746		dependencies, but are not needed in ${SRCS}.
747
748NODPSRCS	TODO
749
750=-=-=-=-=   bsd.files.mk   =-=-=-=-=
751
752The include file <bsd.files.mk> handles the FILES variables and is included
753from <bsd.lib.mk> and <bsd.prog.mk>, and uses the following variables:
754
755FILES		The list of files to install.
756
757CONFIGFILES	Similar semantics to FILES, except that the files
758		are installed by the `configinstall' target,
759		not the `install' target.
760		The FILES* variables documented below also apply.
761
762FILESOWN	File owner.  [${BINOWN}]
763
764FILESGRP	File group.  [${BINGRP}]
765
766FILESMODE	File mode.  [${NONBINMODE}]
767
768FILESDIR	The location to install the files.
769
770FILESNAME	Optional name to install each file as.
771
772FILESOWN_<fn>	File owner of the specific file <fn>.
773
774FILESGRP_<fn>	File group of the specific file <fn>.
775
776FILESMODE_<fn>	File mode of the specific file <fn>.
777
778FILESDIR_<fn>	The location to install the specific file <fn>.
779
780FILESNAME_<fn>	Optional name to install <fn> as.
781
782FILESBUILD	If this variable is defined, then its value will be
783		used as the default for all FILESBUILD_<fn> variables.
784		Otherwise, the default will be "no".
785
786FILESBUILD_<fn> A value different from "no" will add the file to the list of
787		targets to be built by `realall'.  Users of that variable
788		should provide a target to build the file.
789
790
791BUILDSYMLINKS	List of two word items:
792			lnsrc lntgt
793		For each lnsrc item, create a symlink named lntgt.
794		The lntgt symlinks are removed by the cleandir target.
795
796UUDECODE_FILES	List of files which are stored as <file>.uue in the source
797		tree. Each one will be decoded with ${TOOL_UUDECODE}.
798		The source files have a `.uue' suffix, the generated files do
799		not.
800
801UUDECODE_FILES_RENAME_<fn>
802		Rename the output from the decode to the provided name.
803
804		Note: These files are simply decoded, with no install or other
805		rule applying implicitly except being added to the clean
806		target.
807
808=-=-=-=-=   bsd.gcc.mk   =-=-=-=-=
809
810The include file <bsd.gcc.mk> computes various parameters related to GCC
811support libraries.  It defines no targets.  <bsd.own.mk> MUST be included
812before <bsd.gcc.mk>.
813
814The primary users of <bsd.gcc.mk> are <bsd.prog.mk> and <bsd.lib.mk>, each
815of which need to know where to find certain GCC support libraries.
816
817The behavior of <bsd.gcc.mk> is influenced by the EXTERNAL_TOOLCHAIN variable,
818which is generally set by the user.  If EXTERNAL_TOOLCHAIN it set, then
819the compiler is asked where to find the support libraries, otherwise the
820support libraries are found in ${DESTDIR}/usr/lib.
821
822<bsd.gcc.mk> sets the following variables:
823
824_GCC_CRTBEGIN	The full path name to crtbegin.o.
825
826_GCC_CRTBEGINS	The full path name to crtbeginS.o.
827
828_GCC_CRTEND	The full path name to crtend.o.
829
830_GCC_CRTENDS	The full path name to crtendS.o.
831
832_GCC_LIBGCCDIR	The directory where libgcc.a is located.
833
834
835=-=-=-=-=   bsd.inc.mk   =-=-=-=-=
836
837The include file <bsd.inc.mk> defines the includes target and uses the
838variables:
839
840INCS		The list of include files.
841
842INCSDIR		The location to install the include files.
843
844INCSNAME	Target name of the include file, if only one; same as
845		FILESNAME, but for include files.
846
847INCSYMLINKS	Similar to SYMLINKS in <bsd.links.mk>, except that these
848		are installed in the 'includes' target and not the
849		(much later) 'install' target.
850
851INCSNAME_<file> The name file <file> should be installed as, if not <file>,
852		same as FILESNAME_<file>, but for include files.
853
854
855=-=-=-=-=   bsd.info.mk   =-=-=-=-=
856
857The include file <bsd.info.mk> is used to generate and install GNU Info
858documentation from respective Texinfo source files.  It defines three
859implicit targets (.txi.info, .texi.info, and .texinfo.info), and uses the
860following variables:
861
862TEXINFO		List of Texinfo source files.  Info documentation will
863		consist of single files with the extension replaced by
864		.info.
865
866INFOFLAGS	Options to pass to makeinfo.  []
867
868
869=-=-=-=-=   bsd.kernobj.mk   =-=-=-=-=
870
871The include file <bsd.kernobj.mk> defines variables related to the
872location of kernel sources and object directories.
873
874KERNSRCDIR	Directory at the top of the kernel source..
875		[${NETBSDSRCDIR}/sys]
876
877KERNARCHDIR	Directory under KERNSRCDIR containing the machine
878		dependent kernel sources.
879		[arch/${MACHINE}]
880
881KERNCONFDIR	Directory containing the kernel configuration files.
882		[${KERNSRCDIR}/${KERNARCHDIR}/conf]
883
884KERNOBJDIR	Directory for kernel builds.  For example, the kernel
885		GENERIC will be compiled in KERNOBJDIR/GENERIC.
886		Default:
887		${MAKEOBJDIRPREFIX}${KERNSRCDIR}/${KERNARCHDIR}/compile
888		if it exists or the make(1) target 'obj' is being made;
889		otherwise ${KERNSRCDIR}/${KERNARCHDIR}/compile.
890
891It is important that Makefiles (such as those under src/distrib) that
892wish to find compiled kernels use <bsd.kernobj.mk> and ${KERNOBJDIR}
893rather than make assumptions about the location of the compiled kernel.
894
895
896=-=-=-=-=   bsd.kinc.mk   =-=-=-=-=
897
898The include file <bsd.kinc.mk> defines the many targets (includes,
899subdirectories, etc.), and is used by kernel makefiles to handle
900include file installation.  It is intended to be included alone, by
901kernel Makefiles.  It uses similar variables to <bsd.inc.mk>.
902Please see <bsd.kinc.mk> for more details, and keep the documentation
903in that file up to date.
904
905=-=-=-=-=   bsd.syscall.mk =-=-=-=-=
906
907The include file <bsd.syscall.mk> contains the logic to create syscall
908files for various emulations. It includes <bsd.kinc.mk> to handle the
909rest of the targets.
910
911=-=-=-=-=   bsd.lib.mk   =-=-=-=-=
912
913The include file <bsd.lib.mk> has support for building libraries.  It has
914the same eight targets as <bsd.prog.mk>: all, clean, cleandir, depend,
915includes, install, lint, and tags.  Additionally, it has a checkver target
916which checks for installed shared object libraries whose version is greater
917that the version of the source. It has a limited number of suffixes,
918consistent with the current needs of the BSD tree.  <bsd.lib.mk> includes
919<bsd.shlib.mk> to get shared library parameters.
920
921It sets/uses the following variables:
922
923LIB		The name of the library to build.
924
925LIBDIR		Target directory for libraries.
926
927SHLIBINSTALLDIR Target directory for shared libraries if ${USE_SHLIBDIR}
928		is not "no".
929
930LIBSUBDIR	If nonempty, subdirectory of LIBDIR where this library
931		is installed.
932		Default: Empty.
933
934SHLIB_MAJOR
935SHLIB_MINOR
936SHLIB_TEENY	Major, minor, and teeny version numbers of shared library
937
938USE_SHLIBDIR	If not "no", use ${SHLIBINSTALLDIR} instead of ${LIBDIR}
939		as the path to install shared libraries to.
940		USE_SHLIBDIR must be defined before <bsd.own.mk> is included.
941		Default: no
942
943LIBISMODULE	If not "no", install as ${LIB}.so (without the "lib" prefix),
944		and act as "MKDEBUGLIB=no MKPICINSTALL=no MKPROFILE=no
945		MKSTATICLIB=no". Also do not install the lint library.
946		Default: no
947
948LIBISPRIVATE	If not "no", act as "MKDEBUGLIB=no MKPIC=no MKPROFILE=no",
949		and don't install the (.a) library or the lint library.
950		This is useful for "build only" helper libraries.
951		If set to "pic", then a _pic.a library is also produced,
952		so that it can be incorporated into other shared objects.
953		Default: no
954
955LIBISCXX	If not "no", Use ${CXX} instead of ${CC} to link
956		shared libraries.
957		This is useful for C++ libraries.
958		Default: no
959
960LINTLIBDIR	Target directory for lint libraries.
961
962LIBGRP		Library group.
963
964LIBOWN		Library owner.
965
966LIBMODE		Library mode.
967
968LDADD		Additional loader objects.
969
970MAN		The manual pages to be installed (use a .1 - .9 suffix).
971
972NOCHECKVER_<library>
973NOCHECKVER	If set, disables checking for installed shared object
974		libraries with versions greater than the source.  A
975		particular library name, without the "lib" prefix, may
976		be appended to the variable name to disable the check for
977		only that library.
978
979SRCS		List of source files to build the library.  Suffix types
980		.s, .c, and .f are supported.  Note, .s files are preferred
981		to .c files of the same name.  (This is not the default for
982		versions of make.)
983
984LIBDPLIBS/
985PROGDPLIBS	A list of the tuples:
986			libname	 path-to-srcdir-of-libname
987
988		Instead of depending on installed versions of the libraries,
989		one can depend on their built version in the source directory.
990		This is useful for finding private libraries (LIBISPRIVATE).
991
992		For each tuple;
993		     *	LIBDO.libname contains the .OBJDIR of the library
994			`libname', and if it is not set it is determined
995			from the srcdir and added to MAKEOVERRIDES (the
996			latter is to allow for build time optimization).
997		     *	LDADD gets  -L${LIBDO.libname} -llibname    added.
998		     *	DPADD gets  ${LIBDO.libname}/liblibname.so  or
999				    ${LIBDO.libname}/liblibname.a   added.
1000
1001		The special value "_external" for LIBDO.lib makes the
1002		build system to assume the library comes from outside
1003		of the NetBSD source tree and only causes -llibname
1004		to be added to LDADD.
1005
1006		This variable may be used for individual libraries/programs,
1007		as well as in parent directories to cache common libraries
1008		as a build-time optimization.
1009
1010LIBDPSUBDIRS/
1011PROGDPSUBDIRS/	A list of subdirectory paths _subdir_ for which the
1012		ldflags
1013
1014			-L${SHLIBDIR}/${_subdir_}
1015			-Wl,-rpath,${SHLIBDIR}/${_subdir_}
1016
1017		should be added, for libraries or programs that depend
1018		on libraries which are installed in nonstandard
1019		locations like /usr/lib/private.
1020		Default: Empty.
1021
1022LIB_EXPSYM	File listing all symbols expected to be defined by the
1023		library.  Each line has a single symbol.  If the symbol
1024		is versioned, it is followed by `@@', if it is the
1025		default version, or `@', if not, and the symbol
1026		version.  The lines must be sorted in LANG=C.
1027
1028		bsd.lib.mk checks to make sure exactly the set of
1029		symbols in this file is defined when the library is
1030		built; if not, the build will fail and print a diff
1031		from the expected symbols to the actual symbols.
1032		During development, you can update the expected symbols
1033		from the actual ones with `make update-symbols'.
1034
1035VERSION_MAP	Path to an ld version script to use when linking the
1036		library.  Resolved from .PATH like a target
1037		prerequisite.
1038
1039
1040The include file <bsd.lib.mk> includes the file named "../Makefile.inc"
1041if it exists, as well as the include file <bsd.man.mk>.
1042
1043It has rules for building profiled objects; profiled libraries are
1044built by default.
1045
1046Libraries are ranlib'd when made.
1047
1048
1049=-=-=-=-=   bsd.links.mk   =-=-=-=-=
1050
1051The include file <bsd.links.mk> handles the LINKS and SYMLINKS variables
1052and is included from <bsd.lib.mk> and <bsd.prog.mk>.
1053
1054LINKSOWN, LINKSGRP, and LINKSMODE, are relevant only if a metadata log
1055is used. The defaults may be modified by other bsd.*.mk files which
1056include bsd.links.mk.  In the future, these variables may be replaced
1057by a method for explicitly recording hard links in a metadata log.
1058
1059LINKS		The list of hard links, consisting of pairs of paths:
1060			source-file target-file
1061		${DESTDIR} is prepended to both paths before linking.
1062		For example, to link /bin/test and /bin/[, use:
1063			LINKS=/bin/test /bin/[
1064
1065CONFIGLINKS	Similar semantics to LINKS, except that the links
1066		are installed by the `configinstall' target,
1067		not the `install' target.
1068
1069SYMLINKS	The list of symbolic links, consisting of pairs of paths:
1070			source-file target-file
1071		${DESTDIR} is only prepended to target-file before linking.
1072		For example, to symlink /usr/bin/tar to /bin/tar resulting
1073		in ${DESTDIR}/usr/bin/tar -> /bin/tar:
1074			SYMLINKS=/bin/tar /usr/bin/tar
1075
1076CONFIGSYMLINKS	Similar semantics to SYMLINKS, except that the symbolic links
1077		are installed by the `configinstall' target,
1078		not the `install' target.
1079
1080LINKSOWN	Link owner.  [${BINOWN}]
1081
1082LINKSGRP	Link group.  [${BINGRP}]
1083
1084LINKSMODE	Link mode.  [${NONBINMODE}]
1085
1086LINKSOWN_<fn>	Link owner of the specific file <fn>.
1087
1088LINKSGRP_<fn>	Link group of the specific file <fn>.
1089
1090LINKSMODE_<fn>	Link mode of the specific file <fn>.
1091
1092
1093=-=-=-=-=   bsd.man.mk   =-=-=-=-=
1094
1095The include file <bsd.man.mk> handles installing manual pages and their
1096links.
1097
1098It has a three targets:
1099
1100	catinstall:
1101		Install the preformatted manual pages and their links.
1102	htmlinstall:
1103		Install the HTML manual pages and their links.
1104	maninstall:
1105		Install the manual page sources and their links.
1106
1107It sets/uses the following variables:
1108
1109MANDIR		Base path for manual installation.
1110
1111MANGRP		Manual group.
1112
1113MANOWN		Manual owner.
1114
1115MANMODE		Manual mode.
1116
1117MANSUBDIR	Subdirectory under the manual page section, i.e. "/vax"
1118		or "/tahoe" for machine specific manual pages.
1119
1120MAN		The manual pages to be installed (use a .1 - .9 suffix).
1121
1122MLINKS		List of manual page links (using a .1 - .9 suffix).  The
1123		linked-to file must come first, the linked file second,
1124		and there may be multiple pairs.
1125
1126The include file <bsd.man.mk> includes a file named "../Makefile.inc" if
1127it exists.
1128
1129
1130=-=-=-=-=   bsd.obj.mk   =-=-=-=-=
1131
1132The include file <bsd.obj.mk> defines targets related to the creation
1133and use of separated object and source directories.
1134
1135If an environment variable named MAKEOBJDIRPREFIX is set, make(1) uses
1136${MAKEOBJDIRPREFIX}${.CURDIR} as the name of the object directory if
1137it exists.  Otherwise make(1) looks for the existence of a
1138subdirectory (or a symlink to a directory) of the source directory
1139into which built targets should be placed.  If an environment variable
1140named MAKEOBJDIR is set, make(1) uses its value as the name of the
1141object directory; failing that, make first looks for a subdirectory
1142named "obj.${MACHINE}", and if that doesn't exist, it looks for "obj".
1143
1144Object directories are not created automatically by make(1) if they
1145don't exist; you need to run a separate "make obj".  (This will happen
1146during a top-level build if "MKOBJDIRS" is set to a value other than
1147"no").  When the source directory is a subdirectory of ${BSDSRCDIR} --
1148and this is determined by a simple string prefix comparison -- object
1149directories are created in a separate object directory tree, and a
1150symlink to the object directory in that tree is created in the source
1151directory; otherwise, "make obj" assumes that you're not in the main
1152source tree and that it's not safe to use a separate object tree.
1153
1154Several variables used by <bsd.obj.mk> control exactly what
1155directories and links get created during a "make obj":
1156
1157MAKEOBJDIR	If set, this is the component name of the object
1158		directory.
1159
1160OBJMACHINE	If this is set but MAKEOBJDIR is not set, creates
1161		object directories or links named "obj.${MACHINE}";
1162		otherwise, just creates ones named "obj".
1163
1164OBJMACHINE_ARCH If set with OBJMACHINE, creates object directories or
1165		links named "obj.${MACHINE}-${MACHINE_ARCH}".
1166
1167USR_OBJMACHINE	If set, and the current directory is a subdirectory of
1168		${BSDSRCDIR}, create object directory in the
1169		corresponding subdirectory of ${BSDOBJDIR}.${MACHINE};
1170		otherwise, create it in the corresponding subdirectory
1171		of ${BSDOBJDIR}
1172
1173BUILDID		Identifier for the build.  If set, this should be a short
1174		string that is suitable for use as part of a file or
1175		directory name.  The identifier will be appended to
1176		object directory names; if OBJMACHINE is also set, then
1177		.BUILDID is appended after .MACHINE.  The identifier will
1178		also be used as part of the kernel version string, which
1179		can be shown by “uname -v”.
1180
1181		Default: Unset.
1182
1183
1184=-=-=-=-=   bsd.prog.mk   =-=-=-=-=
1185
1186The include file <bsd.prog.mk> handles building programs from one or
1187more source files, along with their manual pages.  It has a limited number
1188of suffixes, consistent with the current needs of the BSD tree.
1189<bsd.prog.mk> includes <bsd.shlib.mk> to get shared library parameters.
1190
1191It has eight targets:
1192
1193	all:
1194		build the program and its manual page.  This also
1195		creates a GDB initialization file (.gdbinit) in
1196		the objdir.  The .gdbinit file sets the shared library
1197		prefix to ${DESTDIR} to facilitate cross-debugging.
1198	clean:
1199		remove the program, any object files and the files a.out,
1200		Errs, errs, mklog, and ${PROG}.core.
1201	cleandir:
1202		remove all of the files removed by the target clean, as
1203		well as .depend, tags, and any manual pages.
1204		`distclean' is a synonym for `cleandir'.
1205	depend:
1206		make the dependencies for the source files, and store
1207		them in the file .depend.
1208	includes:
1209		install any header files.
1210	install:
1211		install the program and its manual pages; if the Makefile
1212		does not itself define the target install, the targets
1213		beforeinstall and afterinstall may also be used to cause
1214		actions immediately before and after the install target
1215		is executed.
1216	lint:
1217		run lint on the source files
1218	tags:
1219		create a tags file for the source files.
1220
1221It sets/uses the following variables:
1222
1223BINGRP		Binary group.
1224
1225BINOWN		Binary owner.
1226
1227BINMODE		Binary mode.
1228
1229CLEANDIRFILES	Additional files to remove for the cleandir target.
1230
1231CLEANFILES	Additional files to remove for the clean and cleandir targets.
1232
1233CONFIGOPTS	Additional options to config(1) when building kernels.
1234
1235		Default: Unset.
1236
1237COPTS		Extra options for the C compiler.  Should be appended to
1238		(e.g., COPTS+=-g), rather than explicitly set.
1239
1240		Note: CPUFLAGS, not COPTS, should be used for compiler
1241		options that select CPU-related options.
1242
1243COPTS.<fn>	Extra options for the C compiler when creating the
1244		C objects for <fn>.
1245		For <fn>.[ly], "<fn>.c" must be used.
1246
1247CPUFLAGS	Additional options passed to the compiler/assembler to
1248		select CPU instruction set options, CPU tuning options,
1249		etc.
1250
1251		Note: Such options should not be specified in COPTS,
1252		because some parts of the build process need to override
1253		CPU-related compiler options.
1254
1255		Default: Unset.
1256
1257CPUFLAGS.<fn>	Additional options to the compiler/assembler for <fn>.
1258		For <fn>.[ly], "<fn>.c" must be used.
1259
1260CPPFLAGS	Additional options to the C pre-processor.
1261
1262CPPFLAGS.<fn>	Additional options to the C pre-processor for <fn>.
1263		For <fn>.[ly], "<fn>.c" must be used.
1264
1265GDBINIT		List of GDB initialization files to add to "source"
1266		directives in the .gdbinit file that is created in the
1267		objdir.
1268
1269LDADD		Additional loader objects.  Usually used for libraries.
1270		For example, to load with the compatibility and utility
1271		libraries, use:
1272
1273			LDADD+=-lutil -lcompat
1274
1275LDFLAGS		Additional linker options (passed to ${CC} during link).
1276
1277LINKS		See <bsd.links.mk>
1278
1279OBJCOPTS	Additional options to the compiler when creating ObjC objects.
1280
1281OBJCOPTS.<fn>	Additional options to the compiler when creating the
1282		ObjC objects for <fn>.
1283		For <fn>.[ly], "<fn>.c" must be used.
1284
1285SYMLINKS	See <bsd.links.mk>
1286
1287MAN		Manual pages (should end in .1 - .9).  If no MAN variable is
1288		defined, "MAN=${PROG}.1" is assumed.
1289
1290PAXCTL_FLAGS	If defined, run paxctl(1) on the program binary after link
1291		time, with the value of this variable as options to paxctl(1).
1292
1293PAXCTL_FLAGS.${PROG} Custom override for PAXCTL_FLAGS.
1294
1295PROG		The name of the program to build.  If not supplied, nothing
1296		is built.
1297
1298PROG_CXX	If defined, the name of the program to build.  Also
1299		causes <bsd.prog.mk> to link the program with the C++
1300		compiler rather than the C compiler.  PROG_CXX overrides
1301		the value of PROG if PROG is also set.
1302
1303PROGNAME	The name that the above program will be installed as, if
1304		different from ${PROG}.
1305
1306PROGS		Multiple programs to build from a single directory.
1307		Defaults to PROG. For each program ${_P} in ${PROGS},
1308		uses SRCS.${_P}, defaulting to ${_P}.c.
1309
1310PROGS_CXX	Multiple C++ programs to build from a single directory.
1311		Defaults to PROG_CXX. For each program ${_P} in ${PROGS_CXX},
1312		uses SRCS.${_P}, defaulting to ${_P}.cc.
1313
1314SRCS		List of source files to build the program.  If SRCS is not
1315		defined, it's assumed to be ${PROG}.c or ${PROG_CXX}.cc.
1316
1317DPSRCS		List of source files which are needed for generating
1318		dependencies, but are not needed in ${SRCS}.
1319
1320DPADD		Additional dependencies for the program.  Usually used for
1321		libraries.  For example, to depend on the compatibility and
1322		utility libraries use:
1323
1324			DPADD+=${LIBCOMPAT} ${LIBUTIL}
1325
1326		The following system libraries are predefined for DPADD:
1327
1328		LIBARCHIVE?=		${DESTDIR}/usr/lib/libarchive.a
1329		LIBASN1?=		${DESTDIR}/usr/lib/libasn1.a
1330		LIBATF_C?=		${DESTDIR}/usr/lib/libatf-c.a
1331		LIBATF_CXX?=		${DESTDIR}/usr/lib/libatf-c++.a
1332		LIBBLOCKLIST?=		${DESTDIR}/usr/lib/libblocklist.a
1333		LIBBLUETOOTH?=		${DESTDIR}/usr/lib/libbluetooth.a
1334		LIBBSDMALLOC?=		${DESTDIR}/usr/lib/libbsdmalloc.a
1335		LIBBZ2?=		${DESTDIR}/usr/lib/libbz2.a
1336		LIBC?=			${DESTDIR}/usr/lib/libc.a
1337		LIBC_PIC?=		${DESTDIR}/usr/lib/libc_pic.a
1338		LIBCBOR?=		${DESTDIR}/usr/lib/libcbor.a
1339		LIBCOMPAT?=		${DESTDIR}/usr/lib/libcompat.a
1340		LIBCOM_ERR?=		${DESTDIR}/usr/lib/libcom_err.a
1341		LIBCRYPT?=		${DESTDIR}/usr/lib/libcrypt.a
1342		LIBCRYPTO?=		${DESTDIR}/usr/lib/libcrypto.a
1343		LIBCURSES?=		${DESTDIR}/usr/lib/libcurses.a
1344		LIBCXX?=		${DESTDIR}/usr/lib/libc++.a
1345		LIBDES?=		${DESTDIR}/usr/lib/libdes.a
1346		LIBDNS?=		${DESTDIR}/usr/lib/libdns.a
1347		LIBEDIT?=		${DESTDIR}/usr/lib/libedit.a
1348		LIBEVENT?=		${DESTDIR}/usr/lib/libevent.a
1349		LIBEVENT_OPENSSL?=	${DESTDIR}/usr/lib/libevent_openssl.a
1350		LIBEVENT_PTHREADS?=	${DESTDIR}/usr/lib/libevent_pthreads.a
1351		LIBEXECINFO?=		${DESTDIR}/usr/lib/libexecinfo.a
1352		LIBEXPAT?=		${DESTDIR}/usr/lib/libexpat.a
1353		LIBFETCH?=		${DESTDIR}/usr/lib/libfetch.a
1354		LIBFIDO2?=		${DESTDIR}/usr/lib/libfido2.a
1355		LIBFL?=			${DESTDIR}/usr/lib/libfl.a
1356		LIBFORM?=		${DESTDIR}/usr/lib/libform.a
1357		LIBGCC?=		${DESTDIR}/usr/lib/libgcc.a
1358		LIBGNUCTF?=		${DESTDIR}/usr/lib/libgnuctf.a
1359		LIBGNUMALLOC?=		${DESTDIR}/usr/lib/libgnumalloc.a
1360		LIBGSSAPI?=		${DESTDIR}/usr/lib/libgssapi.a
1361		LIBHDB?=		${DESTDIR}/usr/lib/libhdb.a
1362		LIBHEIMBASE?=		${DESTDIR}/usr/lib/libheimbase.a
1363		LIBHEIMNTLM?=		${DESTDIR}/usr/lib/libheimntlm.a
1364		LIBHX500?=		${DESTDIR}/usr/lib/libhx500.a
1365		LIBINTL?=		${DESTDIR}/usr/lib/libintl.a
1366		LIBIPSEC?=		${DESTDIR}/usr/lib/libipsec.a
1367		LIBISC?=		${DESTDIR}/usr/lib/libisc.a
1368		LIBISCCC?=		${DESTDIR}/usr/lib/libisccc.a
1369		LIBISCFG?=		${DESTDIR}/usr/lib/libiscfg.a
1370		LIBKADM5CLNT?=		${DESTDIR}/usr/lib/libkadm5clnt.a
1371		LIBKADM5SRV?=		${DESTDIR}/usr/lib/libkadm5srv.a
1372		LIBKAFS?=		${DESTDIR}/usr/lib/libkafs.a
1373		LIBKRB5?=		${DESTDIR}/usr/lib/libkrb5.a
1374		LIBKVM?=		${DESTDIR}/usr/lib/libkvm.a
1375		LIBL?=			${DESTDIR}/usr/lib/libl.a
1376		LIBLBER?=		${DESTDIR}/usr/lib/liblber.a
1377		LIBLDAP?=		${DESTDIR}/usr/lib/libldap.a
1378		LIBLDAP_R?=		${DESTDIR}/usr/lib/libldap_r.a
1379		LIBLUA?=		${DESTDIR}/usr/lib/liblua.a
1380		LIBM?=			${DESTDIR}/usr/lib/libm.a
1381		LIBMAGIC?=		${DESTDIR}/usr/lib/libmagic.a
1382		LIBMENU?=		${DESTDIR}/usr/lib/libmenu.a
1383		LIBNETPGPVERIFY?=	${DESTDIR}/usr/lib/libnetpgpverify.a
1384		LIBNS?=			${DESTDIR}/usr/lib/libns.a
1385		LIBOBJC?=		${DESTDIR}/usr/lib/libobjc.a
1386		LIBOSSAUDIO?=		${DESTDIR}/usr/lib/libossaudio.a
1387		LIBPAM?=		${DESTDIR}/usr/lib/libpam.a
1388		LIBPANEL?=		${DESTDIR}/usr/lib/libpanel.a
1389		LIBPCAP?=		${DESTDIR}/usr/lib/libpcap.a
1390		LIBPCI?=		${DESTDIR}/usr/lib/libpci.a
1391		LIBPOSIX?=		${DESTDIR}/usr/lib/libposix.a
1392		LIBPTHREAD?=		${DESTDIR}/usr/lib/libpthread.a
1393		LIBPUFFS?=		${DESTDIR}/usr/lib/libpuffs.a
1394		LIBQUOTA?=		${DESTDIR}/usr/lib/libquota.a
1395		LIBRADIUS?=		${DESTDIR}/usr/lib/libradius.a
1396		LIBREFUSE?=		${DESTDIR}/usr/lib/librefuse.a
1397		LIBRESOLV?=		${DESTDIR}/usr/lib/libresolv.a
1398		LIBRMT?=		${DESTDIR}/usr/lib/librmt.a
1399		LIBROKEN?=		${DESTDIR}/usr/lib/libroken.a
1400		LIBRPCSVC?=		${DESTDIR}/usr/lib/librpcsvc.a
1401		LIBRT?=			${DESTDIR}/usr/lib/librt.a
1402		LIBRUMP?=		${DESTDIR}/usr/lib/librump.a
1403		LIBRUMPFS_CD9660?=	${DESTDIR}/usr/lib/librumpfs_cd9660.a
1404		LIBRUMPFS_EFS?=		${DESTDIR}/usr/lib/librumpfs_efs.a
1405		LIBRUMPFS_EXT2FS?=	${DESTDIR}/usr/lib/librumpfs_ext2fs.a
1406		LIBRUMPFS_FFS?=		${DESTDIR}/usr/lib/librumpfs_ffs.a
1407		LIBRUMPFS_HFS?=		${DESTDIR}/usr/lib/librumpfs_hfs.a
1408		LIBRUMPFS_LFS?=		${DESTDIR}/usr/lib/librumpfs_lfs.a
1409		LIBRUMPFS_MSDOS?=	${DESTDIR}/usr/lib/librumpfs_msdos.a
1410		LIBRUMPFS_NFS?=		${DESTDIR}/usr/lib/librumpfs_nfs.a
1411		LIBRUMPFS_NTFS?=	${DESTDIR}/usr/lib/librumpfs_ntfs.a
1412		LIBRUMPFS_SYSPUFFS?=	${DESTDIR}/usr/lib/librumpfs_syspuffs.a
1413		LIBRUMPFS_TMPFS?=	${DESTDIR}/usr/lib/librumpfs_tmpfs.a
1414		LIBRUMPFS_UDF?=		${DESTDIR}/usr/lib/librumpfs_udf.a
1415		LIBRUMPUSER?=		${DESTDIR}/usr/lib/librumpuser.a
1416		LIBSASLC?=		${DESTDIR}/usr/lib/libsaslc.a
1417		LIBSKEY?=		${DESTDIR}/usr/lib/libskey.a
1418		LIBSL?=			${DESTDIR}/usr/lib/libsl.a
1419		LIBSQLITE3?=		${DESTDIR}/usr/lib/libsqlite3.a
1420		LIBSSH?=		${DESTDIR}/usr/lib/libssh.a
1421		LIBSSL?=		${DESTDIR}/usr/lib/libssl.a
1422		LIBSTDCXX?=		${DESTDIR}/usr/lib/libstdc++.a
1423		LIBSUPCXX?=		${DESTDIR}/usr/lib/libsupc++.a
1424		LIBTERMINFO?=		${DESTDIR}/usr/lib/libterminfo.a
1425		LIBTRE?=		${DESTDIR}/usr/lib/libtre.a
1426		LIBUNBOUND?=		${DESTDIR}/usr/lib/libunbound.a
1427		LIBUSBHID?=		${DESTDIR}/usr/lib/libusbhid.a
1428		LIBUTIL?=		${DESTDIR}/usr/lib/libutil.a
1429		LIBWIND?=		${DESTDIR}/usr/lib/libwind.a
1430		LIBWRAP?=		${DESTDIR}/usr/lib/libwrap.a
1431		LIBY?=			${DESTDIR}/usr/lib/liby.a
1432		LIBZ?=			${DESTDIR}/usr/lib/libz.a
1433
1434		The following c startup files.
1435
1436		LIBCRT0?=		${DESTDIR}/usr/lib/crt0.o
1437		LIBCRTI?=		${DESTDIR}/usr/lib/crti.o
1438		LIBCRTBEGIN?=		${DESTDIR}/usr/lib/crti.o
1439		LIBCRTEND?=		${DESTDIR}/usr/lib/crtn.o
1440
1441		The following X-Windows libraries are predefined for DPADD:
1442
1443		LIBDPS?=		${DESTDIR}/usr/X11R7/lib/libdps.a
1444		LIBEGL?=		${DESTDIR}/usr/X11R7/lib/libEGL.a
1445		LIBFNTSTUBS?=		${DESTDIR}/usr/X11R7/lib/libfntstubs.a
1446		LIBFONTCACHE?=		${DESTDIR}/usr/X11R7/lib/libfontcache.a
1447		LIBFONTCONFIG?=		${DESTDIR}/usr/X11R7/lib/libfontconfig.a
1448		LIBFONTENC?=		${DESTDIR}/usr/X11R7/lib/libfontenc.a
1449		LIBFREETYPE?=		${DESTDIR}/usr/X11R7/lib/libfreetype.a
1450		LIBFS?=			${DESTDIR}/usr/X11R7/lib/libFS.a
1451		LIBGL?=			${DESTDIR}/usr/X11R7/lib/libGL.a
1452		LIBGLU?=		${DESTDIR}/usr/X11R7/lib/libGLU.a
1453		LIBGLW?=		${DESTDIR}/usr/X11R7/lib/libGLw.a
1454		LIBI810XVMC		4{DESTDIR}/usr/X11R7/lib/libI810XvMC.a
1455		LIBICE?=		${DESTDIR}/usr/X11R7/lib/libICE.a
1456		LIBINTELXVMC		${DESTDIR}/usr/X11R7/lib/libIntelXvMC.a
1457		LIBLBXUTIL?=		${DESTDIR}/usr/X11R7/lib/liblbxutil.a
1458		LIBSM?=			${DESTDIR}/usr/X11R7/lib/libSM.a
1459		LIBX11_XCB?=		${DESTDIR}/usr/X11R7/lib/libX11-xcb.a
1460		LIBX11?=		${DESTDIR}/usr/X11R7/lib/libX11.a
1461		LIBXRES?=		${DESTDIR}/usr/X11R7/lib/libXres.a
1462		LIBXAU?=		${DESTDIR}/usr/X11R7/lib/libXau.a
1463		LIBXAU7?=		${DESTDIR}/usr/X11R7/lib/libXau7.a
1464		LIBXAW?=		${DESTDIR}/usr/X11R7/lib/libXaw.a
1465		LIBXCB?=		${DESTDIR}/usr/X11R7/lib/libxcb.a
1466		LIBXCOMPOSITE?=		${DESTDIR}/usr/X11R7/lib/libXcomposite.a
1467		LIBXCURSOR?=		${DESTDIR}/usr/X11R7/lib/libXcursor.a
1468		LIBXCVT?=		${DESTDIR}/usr/X11R7/lib/libxcvt.a
1469		LIBXDAMAGE?=		${DESTDIR}/usr/X11R7/lib/libXdamage.a
1470		LIBXDMCP?=		${DESTDIR}/usr/X11R7/lib/libXdmcp.a
1471		LIBXEXT?=		${DESTDIR}/usr/X11R7/lib/libXext.a
1472		LIBXFIXES?=		${DESTDIR}/usr/X11R7/lib/libXfixes.a
1473		LIBXFONT2?=		${DESTDIR}/usr/X11R7/lib/libXfont2.a
1474		LIBXFONT?=		${DESTDIR}/usr/X11R7/lib/libXfont.a
1475		LIBXFT?=		${DESTDIR}/usr/X11R7/lib/libXft.a
1476		LIBXI?=			${DESTDIR}/usr/X11R7/lib/libXi.a
1477		LIBXINERAMA?=		${DESTDIR}/usr/X11R7/lib/libXinerama.a
1478		LIBXKBFILE?=		${DESTDIR}/usr/X11R7/lib/libxkbfile.a
1479		LIBXMU?=		${DESTDIR}/usr/X11R7/lib/libXmu.a
1480		LIBXMUU?=		${DESTDIR}/usr/X11R7/lib/libXmuu.a
1481		LIBXPM?=		${DESTDIR}/usr/X11R7/lib/libXpm.a
1482		LIBXRANDR?=		${DESTDIR}/usr/X11R7/lib/libXrandr.a
1483		LIBXRENDER?=		${DESTDIR}/usr/X11R7/lib/libXrender.a
1484		LIBXSS?=		${DESTDIR}/usr/X11R7/lib/libXss.a
1485		LIBXT?=			${DESTDIR}/usr/X11R7/lib/libXt.a
1486		LIBXTRAP?=		${DESTDIR}/usr/X11R7/lib/libXTrap.a
1487		LIBXTST?=		${DESTDIR}/usr/X11R7/lib/libXtst.a
1488		LIBXV?=			${DESTDIR}/usr/X11R7/lib/libXv.a
1489		LIBXXF86DGA?=		${DESTDIR}/usr/X11R7/lib/libXxf86dga.a
1490		LIBXXF86MISC?=		${DESTDIR}/usr/X11R7/lib/libXxf86misc.a
1491		LIBXXF86VM?=		${DESTDIR}/usr/X11R7/lib/libXxf86vm.a
1492
1493STRIPFLAG	The option passed to the install program to cause the binary
1494		to be stripped.
1495
1496SUBDIR		A list of subdirectories that should be built as well.
1497		Each of the targets will execute the same target in the
1498		subdirectories.
1499
1500SCRIPTS		A list of interpreter scripts [file.{sh,csh,pl,awk,...}].
1501		These are installed exactly like programs.
1502
1503SCRIPTSDIR	The location to install the scripts.  Each script can be
1504		installed to a separate path by setting SCRIPTSDIR_<script>.
1505
1506SCRIPTSNAME	The name that the above program will be installed as, if
1507		different from ${SCRIPTS}. These can be further specialized
1508		by setting SCRIPTSNAME_<script>.
1509
1510FILES		See description of <bsd.files.mk>.
1511
1512SHLINKDIR	Target directory for shared linker.  See description of
1513		<bsd.own.mk> for additional information about this variable.
1514
1515The include file <bsd.prog.mk> includes the file named "../Makefile.inc"
1516if it exists, as well as the include file <bsd.man.mk>.
1517
1518Some simple examples:
1519
1520To build foo from foo.c with a manual page foo.1, use:
1521
1522	PROG=	foo
1523
1524	.include <bsd.prog.mk>
1525
1526To build foo from foo.c with a manual page foo.2, add the line:
1527
1528	MAN=	foo.2
1529
1530If foo does not have a manual page at all, add the line
1531before any make(1) .include directives:
1532
1533	NOMAN=
1534
1535If foo has multiple source files, add the line:
1536
1537	SRCS=	a.c b.c c.c d.c
1538
1539
1540=-=-=-=-=   bsd.rpc.mk   =-=-=-=-=
1541
1542The include file <bsd.rpc.mk> contains a makefile fragment used to
1543construct source files built by rpcgen.
1544
1545The following macros may be defined in makefiles which include
1546<bsd.rpc.mk> in order to control which files get built and how they
1547are to be built:
1548
1549RPC_INCS	construct .h file from .x file
1550RPC_XDRFILES	construct _xdr.c from .x file
1551		(for marshalling/unmarshalling data types)
1552RPC_SVCFILES	construct _svc.c from .x file
1553		(server-side stubs)
1554RPC_SVCFLAGS	Additional options passed to builds of RPC_SVCFILES.
1555
1556RPC_XDIR	Directory containing .x/.h files
1557
1558
1559=-=-=-=-=   bsd.shlib.mk   =-=-=-=-=
1560
1561The include file <bsd.shlib.mk> computes parameters for shared library
1562installation and use.  It defines no targets.  <bsd.own.mk> MUST be
1563included before <bsd.shlib.mk>.
1564
1565<bsd.own.mk> sets the following variables, if they are not already defined
1566(defaults are in brackets):
1567
1568SHLIBINSTALLDIR If ${USE_SHLIBDIR} is not "no", use ${SHLIBINSTALLDIR}
1569		instead of ${LIBDIR} as the base path for shared library
1570		installation.  [/lib]
1571
1572SHLIBDIR	The path to USE_SHLIBDIR shared libraries to use when building
1573		a program.  [/lib for programs in /bin and /sbin, /usr/lib
1574		for all others.]
1575
1576_LIBSODIR	Set to ${SHLIBINSTALLDIR} if ${USE_SHLIBDIR} is not "no",
1577		otherwise set to ${LIBDIR}
1578
1579SHLINKINSTALLDIR Base path for shared linker.  [/libexec]
1580
1581SHLINKDIR	Path to use for shared linker when building a program.
1582		[/libexec for programs in /bin and /sbin, /usr/libexec for
1583		all others.]
1584
1585
1586=-=-=-=-=   bsd.subdir.mk   =-=-=-=-=
1587
1588The include file <bsd.subdir.mk> contains the default targets for building
1589subdirectories.  It has the same eight targets as <bsd.prog.mk>: all,
1590clean, cleandir, depend, includes, install, lint, and tags.  It uses the
1591following variables:
1592
1593NOSUBDIR	If this variable is defined, then the SUBDIR variable
1594		will be ignored and subdirectories will not be processed.
1595
1596SUBDIR		For all of the directories listed in ${SUBDIR}, the
1597		specified directory will be visited and the target made.
1598
1599		As a special case, the use of a token .WAIT as an
1600		entry in SUBDIR acts as a synchronization barrier
1601		when multiple make jobs are run; subdirs before the
1602		.WAIT must complete before any subdirs after .WAIT are
1603		started.  See make(1) for some caveats on use of .WAIT
1604		and other special sources.
1605
1606
1607=-=-=-=-=   bsd.x11.mk   =-=-=-=-=
1608
1609The include file <bsd.x11.mk> contains parameters and targets for
1610cross-building X11 from ${X11SRCDIR.<package>}.  It should be included
1611after the general Makefile contents but before the include files such as
1612<bsd.prog.mk> and <bsd.lib.mk>.
1613
1614It provides the following targets:
1615	.man.1 .man.3 .man.4 .man.5 .man.7 .man.8:
1616		If ${MAN} or ${PROG} is set and ${MKMAN} != "no",
1617		these rules convert from X11's manual page source
1618		into an mdoc.old source file.
1619
1620It sets the following variables:
1621
1622BINDIR			Set to ${X11BINDIR}.
1623			To override, define after including <bsd.x11.mk>
1624
1625LIBDIR			Set to ${X11USRLIBDIR}.
1626			To override, define after including <bsd.x11.mk>
1627
1628MANDIR			Set to ${X11MANDIR}.
1629			To override, define after including <bsd.x11.mk>
1630
1631CPPFLAGS		Appended with definitions to include from
1632			${DESTDIR}${X11INCDIR}
1633
1634LDFLAGS			Appended with definitions to link from
1635			${DESTDIR}${X11USRLIBDIR}
1636
1637X11FLAGS.CONNECTION	Equivalent to X11's CONNECTION_FLAGS.
1638
1639X11FLAGS.EXTENSION	Equivalent to X11's EXT_DEFINES.
1640
1641X11FLAGS.LOADABLE	Equivalent to X11's LOADABLE.
1642
1643X11FLAGS.OS_DEFINES	Equivalent to X11's OS_DEFINES.
1644
1645X11FLAGS.SERVER		Equivalent to X11's ServerDefines.
1646
1647X11FLAGS.THREADLIB	Equivalent to X11's THREADS_DEFINES for libraries.
1648
1649X11FLAGS.THREADS	Equivalent to X11's THREADS_DEFINES.
1650
1651X11FLAGS.VERSION	cpp(1) definitions of OSMAJORVERSION and OSMINORVERSION.
1652
1653X11FLAGS.DIX		Equivalent to X11's DIX_DEFINES.
1654
1655X11TOOL_UNXCOMM		Command line to convert `XCOMM' comments to `#'
1656
1657It uses the following variables:
1658
1659APPDEFS			List of app-default files to install.
1660
1661CPPSCRIPTS		List of files/scripts to run through cpp(1)
1662			and then ${X11TOOL_UNXCOMM}.  The source files
1663			have a `.cpp' suffix, the generated files do not.
1664
1665CPPSCRIPTFLAGS		Additional options to cpp(1) when building CPPSCRIPTS.
1666
1667CPPSCRIPTFLAGS_<fn>	Additional options to cpp(1) when building CPPSCRIPT <fn>.
1668
1669
1670=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
1671
1672The following files are described here for completion, but they are not
1673supposed to be included directly from other Makefiles; they are used
1674internally by other system files.
1675
1676=-=-=-=-=   bsd.sys.mk   =-=-=-=-=
1677
1678The include file <bsd.sys.mk> is used by other system mk files and
1679it is not intended to be included standalone. It contains rules and
1680system build variables. It requires bsd.own.mk to be included first.
1681It contains overrides that are used when building the NetBSD source tree.
1682
1683The following variables control how various files are compiled/built.
1684(Note that these may be overridden in <bsd.own.mk> if USETOOLS == "yes"):
1685
1686AR		Create, modify, and extract from archives.  [ar]
1687
1688ARFLAGS		Options to ${AR}.  [rl]
1689
1690ARM_ELF2AOUT	Convert ELF-format executable to a.out.  [elf2aout]
1691
1692AS		Assembler.  [as]
1693
1694AFLAGS		Options to ${CC} when compiling or linking .s or .S
1695		assembly source files.  []
1696
1697BUILDSEED	g++(1) uses random numbers when compiling C++ code.  This
1698		variable seeds the g++(1) random number generator using
1699		-frandom-seed with this value.  By default, it is set to
1700		"NetBSD-(majorversion)".  Using a fixed value causes C++
1701		binaries to be the same when built from the same sources,
1702		resulting in identical (reproducible) builds.  Additional
1703		information is available in the g++(1) documentation of
1704		-frandom-seed.
1705
1706		Default: Unset.
1707
1708CC		C compiler.  [cc]
1709
1710CFLAGS		Options to ${CC}.  [Usually -O or -O2]
1711		Note: CFLAGS should never be set in mk.conf(5).
1712
1713CPP		C Pre-Processor.  [cpp]
1714
1715CPPFLAGS	Options to ${CPP}.  []
1716
1717CPUFLAGS	Optimization options for ${CC}.  []
1718
1719CXX		C++ compiler.  [c++]
1720
1721CXXFLAGS	Options to ${CXX}.  [${CFLAGS}]
1722
1723M68K_ELF2AOUT	Convert ELF-format executable to a.out.  [elf2aout]
1724
1725MIPS_ELF2ECOFF	Convert ELF-format executable to ECOFF.  [elf2ecoff]
1726
1727FC		Fortran compiler.  [f77]
1728
1729FFLAGS		Options to {$FC}.  [-O]
1730
1731HOST_SH		Shell.  This must be an absolute path, because it may be
1732		substituted into "#!" lines in scripts.  [/bin/sh]
1733
1734INSTALL		install(1) command.  [install]
1735
1736LEX		Lexical analyzer.  [lex]
1737
1738LFLAGS		Options to ${LEX}.  []
1739
1740LPREFIX		Symbol prefix for ${LEX} (see -P option in lex(1)) [yy]
1741
1742LD		Linker.  [ld]
1743
1744LDFLAGS		Options to ${CC} during the link process.  []
1745
1746LINT		C program verifier.  [lint]
1747
1748LINTFLAGS	Options to ${LINT}.  [-chapbrxzgFS]
1749
1750LORDER		List dependencies for object files.  [lorder]
1751
1752MAKE		make(1).  [make]
1753
1754MKDEP		Construct Makefile dependency list.  [mkdep]
1755
1756MKDEPCXX	Construct Makefile dependency list for C++ files.  [mkdep]
1757
1758NM		List symbols from object files.  [nm]
1759
1760PC		Pascal compiler.  [pc]	(Not present)
1761
1762PFLAGS		Options to ${PC}.  []
1763
1764OBJC		Objective C compiler.  [${CC}]
1765
1766OBJCFLAGS	Options to ${OBJC}.  [${CFLAGS}]
1767
1768OBJCOPY		Copy and translate object files.  [objcopy]
1769
1770OBJCOPYLIBFLAGS Options to pass to objcopy when library objects are
1771		being built. [${.TARGET} =~ "*.po" ? -X : -x]
1772
1773OBJDUMP		Display information from object files.  [objdump]
1774
1775RANLIB		Generate index to archive.  [ranlib]
1776
1777READELF		Display information from ELF object files.  [readelf]
1778
1779SIZE		List section sizes and total size.  [size]
1780
1781STRINGS		Display printable character sequences in files.  [strings]
1782
1783STRIP		Discard symbols from object files.  [strip]
1784
1785TSORT		Topological sort of a directed graph.  [tsort -q]
1786
1787YACC		LALR(1) parser generator.  [yacc]
1788
1789YFLAGS		Options to ${YACC}.  []
1790
1791YHEADER		If defined, add "-d" to YFLAGS, and add dependencies
1792		from <file>.y to <file>.h and <file>.c, and add
1793		<foo>.h to CLEANFILES.
1794
1795YPREFIX		If defined, add "-p ${YPREFIX}" to YFLAGS.
1796
1797
1798Other variables of note (incomplete list):
1799
1800NOCLANGERROR	If defined and clang is used as C compiler, -Werror is not
1801		passed to it.
1802
1803NOGCCERROR	If defined, prevents passing certain ${CFLAGS} to GCC
1804		that cause warnings to be fatal, such as:
1805			-Werror -Wa,--fatal-warnings
1806		(The latter being for as(1).)
1807
1808WARNS		Crank up compiler warning options; the distinct levels are:
1809			WARNS=1
1810			WARNS=2
1811			WARNS=3
1812			WARNS=4
1813			WARNS=5
1814			WARNS=6
1815
1816=-=-=-=-=   bsd.host.mk   =-=-=-=-=
1817
1818This file is automatically included from bsd.own.mk. It contains settings
1819for all the HOST_* variables that are used in host programs and libraries.
1820
1821HOST_AR			The host archive processing command
1822
1823HOST_CC			The host c compiler
1824
1825HOST_CFLAGS		The host c compiler options
1826
1827HOST_COMPILE.c		The host c compiler line with options
1828
1829HOST_COMPILE.cc		The host c++ compiler line with options
1830
1831HOST_CPP		The host c pre-processor
1832
1833HOST_CPPFLAGS		The host c pre-processor options
1834
1835HOST_CXX		The host c++ compiler
1836
1837HOST_CXXFLAGS		The host c++ compiler options
1838
1839HOST_INSTALL_DIR	The host command to install a directory
1840
1841HOST_INSTALL_FILE	The host command to install a file
1842
1843HOST_INSTALL_SYMLINK	The host command to install a symlink
1844
1845HOST_LD			The host linker command
1846
1847HOST_LDFLAGS		The host linker options
1848
1849HOST_LINK.c		The host c linker line with options
1850
1851HOST_LINK.cc		The host c++ linker line with options
1852
1853HOST_LN			The host command to link two files
1854
1855HOST_MKDEP		The host command to create dependencies for c programs
1856
1857HOST_MKDEPCXX		The host command to create dependencies for c++ programs
1858
1859HOST_OSTYPE		The host OSNAME-RELEASE-ARCH tupple
1860
1861HOST_RANLIB		The host command to create random access archives
1862
1863HOST_SH			The host Bourne shell interpreter name (absolute path)
1864
1865=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
1866