bsd.README revision 1.448
1#	$NetBSD: bsd.README,v 1.448 2024/06/28 20:45:26 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 overriden by Makefiles
332
333MAKESTATICLIB	Defaults to ${MKSTATICLIB} but can be overriden 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_VGRIND		Grind nice listings of programs.  [vgrind -f]
655
656TOOL_ZIC		Time zone compiler.  [zic]
657
658For each possible value of MACHINE_CPU, MACHINES.${MACHINE_CPU} contain a
659list of what ports can be built for it.  This keeps those definitions in
660centralized place.
661
662<bsd.own.mk> is generally useful when building your own Makefiles so that
663they use the same default owners etc. as the rest of the tree.
664
665
666=-=-=-=-=   bsd.clean.mk   =-=-=-=-=
667
668The include file <bsd.clean.mk> defines the clean and cleandir
669targets.  It uses the following variables:
670
671CLEANFILES	Files to remove for both the clean and cleandir targets.
672
673CLEANDIRFILES	Files to remove for the cleandir target, but not for
674		the clean target.
675
676MKCLEANSRC	Controls whether or not the clean and cleandir targets
677		will delete files from both the object directory,
678		${.OBJDIR}, and the source directory, ${.CURDIR}.
679
680		If MKCLEANSRC is set to "no", then the file names in
681		CLEANFILES or CLEANDIRFILES are interpreted relative
682		to the object directory, ${.OBJDIR}.  This is the
683		traditional behaviour.
684
685		If MKCLEANSRC is set to "yes", then the file deletion
686		is performed relative to both the object directory,
687		${.OBJDIR}, and the source directory, ${.CURDIR}.  (This
688		has no effect if ${.OBJDIR} is the same as ${.CURDIR}.)
689		Deleting files from ${.CURDIR} is intended to remove
690		stray output files that had been left in the source
691		directory by an earlier build that did not use object
692		directories.
693
694		The default is MKCLEANSRC=yes.  If you always build with
695		separate object directories, and you are sure that there
696		are no stray files in the source directories, then you
697		may set MKCLEANSRC=no to save some time.
698
699MKCLEANVERIFY	Controls whether or not the clean and cleandir targets
700		will verify that files have been deleted.
701
702		If MKCLEANVERIFY is set to "no", then the files will
703		be deleted using a "rm -f" command, and its success or
704		failure will be ignored.
705
706		If MKCLEANVERIFY is set to "yes", then the success of
707		the "rm -f" command will be verified using an "ls"
708		command.
709
710		The default is MKCLEANVERIFY=yes.  If you are sure that
711		there will be no problems caused by file permissions,
712		read-only file systems, or the like, then you may set
713		MKCLEANVERIFY=no to save some time.
714
715To use the clean and cleandir targets defined in <bsd.clean.mk>, other
716Makefiles or bsd.*.mk files should append file names to the CLEANFILES
717or CLEANDIRFILES variables.  For example:
718
719	    CLEANFILES+= a.out
720	    CLEANDIRFILES+= .depend
721
722	    .include <bsd.clean.mk>
723
724The files listed in CLEANFILES and CLEANDIRFILES must not be
725directories, because the potential risk from running "rm -rf" commands
726in bsd.clean.mk is considered too great.  If you want to recursively
727delete a directory as part of "make clean" or "make cleandir" then you
728need to provide your own target.
729
730=-=-=-=-=   bsd.dep.mk   =-=-=-=-=
731
732The include file <bsd.dep.mk> contains the default targets for building
733.depend files.  It creates .d files from entries in SRCS and DPSRCS
734that are C, C++, or Objective C source files, and builds .depend from the
735.d files.  All other files in SRCS and all of DPSRCS will be used as
736dependencies for the .d files.  In order for this to function correctly,
737it should be .included after all other .mk files and directives that may
738modify SRCS or DPSRCS.  It uses the following variables:
739
740SRCS		List of source files to build the program.
741
742DPSRCS		List of source files which are needed for generating
743		dependencies, but are not needed in ${SRCS}.
744
745NODPSRCS	TODO
746
747=-=-=-=-=   bsd.files.mk   =-=-=-=-=
748
749The include file <bsd.files.mk> handles the FILES variables and is included
750from <bsd.lib.mk> and <bsd.prog.mk>, and uses the following variables:
751
752FILES		The list of files to install.
753
754CONFIGFILES	Similar semantics to FILES, except that the files
755		are installed by the `configinstall' target,
756		not the `install' target.
757		The FILES* variables documented below also apply.
758
759FILESOWN	File owner.  [${BINOWN}]
760
761FILESGRP	File group.  [${BINGRP}]
762
763FILESMODE	File mode.  [${NONBINMODE}]
764
765FILESDIR	The location to install the files.
766
767FILESNAME	Optional name to install each file as.
768
769FILESOWN_<fn>	File owner of the specific file <fn>.
770
771FILESGRP_<fn>	File group of the specific file <fn>.
772
773FILESMODE_<fn>	File mode of the specific file <fn>.
774
775FILESDIR_<fn>	The location to install the specific file <fn>.
776
777FILESNAME_<fn>	Optional name to install <fn> as.
778
779FILESBUILD	If this variable is defined, then its value will be
780		used as the default for all FILESBUILD_<fn> variables.
781		Otherwise, the default will be "no".
782
783FILESBUILD_<fn> A value different from "no" will add the file to the list of
784		targets to be built by `realall'.  Users of that variable
785		should provide a target to build the file.
786
787
788BUILDSYMLINKS	List of two word items:
789			lnsrc lntgt
790		For each lnsrc item, create a symlink named lntgt.
791		The lntgt symlinks are removed by the cleandir target.
792
793UUDECODE_FILES	List of files which are stored as <file>.uue in the source
794		tree. Each one will be decoded with ${TOOL_UUDECODE}.
795		The source files have a `.uue' suffix, the generated files do
796		not.
797
798UUDECODE_FILES_RENAME_<fn>
799		Rename the output from the decode to the provided name.
800
801		Note: These files are simply decoded, with no install or other
802		rule applying implicitly except being added to the clean
803		target.
804
805=-=-=-=-=   bsd.gcc.mk   =-=-=-=-=
806
807The include file <bsd.gcc.mk> computes various parameters related to GCC
808support libraries.  It defines no targets.  <bsd.own.mk> MUST be included
809before <bsd.gcc.mk>.
810
811The primary users of <bsd.gcc.mk> are <bsd.prog.mk> and <bsd.lib.mk>, each
812of which need to know where to find certain GCC support libraries.
813
814The behavior of <bsd.gcc.mk> is influenced by the EXTERNAL_TOOLCHAIN variable,
815which is generally set by the user.  If EXTERNAL_TOOLCHAIN it set, then
816the compiler is asked where to find the support libraries, otherwise the
817support libraries are found in ${DESTDIR}/usr/lib.
818
819<bsd.gcc.mk> sets the following variables:
820
821_GCC_CRTBEGIN	The full path name to crtbegin.o.
822
823_GCC_CRTBEGINS	The full path name to crtbeginS.o.
824
825_GCC_CRTEND	The full path name to crtend.o.
826
827_GCC_CRTENDS	The full path name to crtendS.o.
828
829_GCC_LIBGCCDIR	The directory where libgcc.a is located.
830
831
832=-=-=-=-=   bsd.inc.mk   =-=-=-=-=
833
834The include file <bsd.inc.mk> defines the includes target and uses the
835variables:
836
837INCS		The list of include files.
838
839INCSDIR		The location to install the include files.
840
841INCSNAME	Target name of the include file, if only one; same as
842		FILESNAME, but for include files.
843
844INCSYMLINKS	Similar to SYMLINKS in <bsd.links.mk>, except that these
845		are installed in the 'includes' target and not the
846		(much later) 'install' target.
847
848INCSNAME_<file> The name file <file> should be installed as, if not <file>,
849		same as FILESNAME_<file>, but for include files.
850
851
852=-=-=-=-=   bsd.info.mk   =-=-=-=-=
853
854The include file <bsd.info.mk> is used to generate and install GNU Info
855documentation from respective Texinfo source files.  It defines three
856implicit targets (.txi.info, .texi.info, and .texinfo.info), and uses the
857following variables:
858
859TEXINFO		List of Texinfo source files.  Info documentation will
860		consist of single files with the extension replaced by
861		.info.
862
863INFOFLAGS	Options to pass to makeinfo.  []
864
865
866=-=-=-=-=   bsd.kernobj.mk   =-=-=-=-=
867
868The include file <bsd.kernobj.mk> defines variables related to the
869location of kernel sources and object directories.
870
871KERNSRCDIR	Directory at the top of the kernel source..
872		[${NETBSDSRCDIR}/sys]
873
874KERNARCHDIR	Directory under KERNSRCDIR containing the machine
875		dependent kernel sources.
876		[arch/${MACHINE}]
877
878KERNCONFDIR	Directory containing the kernel configuration files.
879		[${KERNSRCDIR}/${KERNARCHDIR}/conf]
880
881KERNOBJDIR	Directory for kernel builds.  For example, the kernel
882		GENERIC will be compiled in KERNOBJDIR/GENERIC.
883		Default:
884		${MAKEOBJDIRPREFIX}${KERNSRCDIR}/${KERNARCHDIR}/compile
885		if it exists or the make(1) target 'obj' is being made;
886		otherwise ${KERNSRCDIR}/${KERNARCHDIR}/compile.
887
888It is important that Makefiles (such as those under src/distrib) that
889wish to find compiled kernels use <bsd.kernobj.mk> and ${KERNOBJDIR}
890rather than make assumptions about the location of the compiled kernel.
891
892
893=-=-=-=-=   bsd.kinc.mk   =-=-=-=-=
894
895The include file <bsd.kinc.mk> defines the many targets (includes,
896subdirectories, etc.), and is used by kernel makefiles to handle
897include file installation.  It is intended to be included alone, by
898kernel Makefiles.  It uses similar variables to <bsd.inc.mk>.
899Please see <bsd.kinc.mk> for more details, and keep the documentation
900in that file up to date.
901
902=-=-=-=-=   bsd.syscall.mk =-=-=-=-=
903
904The include file <bsd.syscall.mk> contains the logic to create syscall
905files for various emulations. It includes <bsd.kinc.mk> to handle the
906rest of the targets.
907
908=-=-=-=-=   bsd.lib.mk   =-=-=-=-=
909
910The include file <bsd.lib.mk> has support for building libraries.  It has
911the same eight targets as <bsd.prog.mk>: all, clean, cleandir, depend,
912includes, install, lint, and tags.  Additionally, it has a checkver target
913which checks for installed shared object libraries whose version is greater
914that the version of the source. It has a limited number of suffixes,
915consistent with the current needs of the BSD tree.  <bsd.lib.mk> includes
916<bsd.shlib.mk> to get shared library parameters.
917
918It sets/uses the following variables:
919
920LIB		The name of the library to build.
921
922LIBDIR		Target directory for libraries.
923
924SHLIBINSTALLDIR Target directory for shared libraries if ${USE_SHLIBDIR}
925		is not "no".
926
927SHLIB_MAJOR
928SHLIB_MINOR
929SHLIB_TEENY	Major, minor, and teeny version numbers of shared library
930
931USE_SHLIBDIR	If not "no", use ${SHLIBINSTALLDIR} instead of ${LIBDIR}
932		as the path to install shared libraries to.
933		USE_SHLIBDIR must be defined before <bsd.own.mk> is included.
934		Default: no
935
936LIBISMODULE	If not "no", install as ${LIB}.so (without the "lib" prefix),
937		and act as "MKDEBUGLIB=no MKPICINSTALL=no MKPROFILE=no
938		MKSTATICLIB=no". Also do not install the lint library.
939		Default: no
940
941LIBISPRIVATE	If not "no", act as "MKDEBUGLIB=no MKPIC=no MKPROFILE=no",
942		and don't install the (.a) library or the lint library.
943		This is useful for "build only" helper libraries.
944		If set to "pic", then a _pic.a library is also produced,
945		so that it can be incorporated into other shared objects.
946		Default: no
947
948LIBISCXX	If not "no", Use ${CXX} instead of ${CC} to link
949		shared libraries.
950		This is useful for C++ libraries.
951		Default: no
952
953LINTLIBDIR	Target directory for lint libraries.
954
955LIBGRP		Library group.
956
957LIBOWN		Library owner.
958
959LIBMODE		Library mode.
960
961LDADD		Additional loader objects.
962
963MAN		The manual pages to be installed (use a .1 - .9 suffix).
964
965NOCHECKVER_<library>
966NOCHECKVER	If set, disables checking for installed shared object
967		libraries with versions greater than the source.  A
968		particular library name, without the "lib" prefix, may
969		be appended to the variable name to disable the check for
970		only that library.
971
972SRCS		List of source files to build the library.  Suffix types
973		.s, .c, and .f are supported.  Note, .s files are preferred
974		to .c files of the same name.  (This is not the default for
975		versions of make.)
976
977LIBDPLIBS/
978PROGDPLIBS	A list of the tuples:
979			libname	 path-to-srcdir-of-libname
980
981		Instead of depending on installed versions of the libraries,
982		one can depend on their built version in the source directory.
983		This is useful for finding private libraries (LIBISPRIVATE).
984
985		For each tuple;
986		     *	LIBDO.libname contains the .OBJDIR of the library
987			`libname', and if it is not set it is determined
988			from the srcdir and added to MAKEOVERRIDES (the
989			latter is to allow for build time optimization).
990		     *	LDADD gets  -L${LIBDO.libname} -llibname    added.
991		     *	DPADD gets  ${LIBDO.libname}/liblibname.so  or
992				    ${LIBDO.libname}/liblibname.a   added.
993
994		The special value "_external" for LIBDO.lib makes the
995		build system to assume the library comes from outside
996		of the NetBSD source tree and only causes -llibname
997		to be added to LDADD.
998
999		This variable may be used for individual libraries/programs,
1000		as well as in parent directories to cache common libraries
1001		as a build-time optimization.
1002
1003LIB_EXPSYM	File listing all symbols expected to be defined by the
1004		library.  Each line has a single symbol.  If the symbol
1005		is versioned, it is followed by `@@', if it is the
1006		default version, or `@', if not, and the symbol
1007		version.  The lines must be sorted in LANG=C.
1008
1009		bsd.lib.mk checks to make sure exactly the set of
1010		symbols in this file is defined when the library is
1011		built; if not, the build will fail and print a diff
1012		from the expected symbols to the actual symbols.
1013		During development, you can update the expected symbols
1014		from the actual ones with `make update-symbols'.
1015
1016VERSION_MAP	Path to an ld version script to use when linking the
1017		library.  If a relative path, interpreted relative to
1018		the object directory; use ${.CURDIR}/foo.map if foo.map
1019		is in the source directory.  Interpretation of relative
1020		path may be changed later to search .PATH like target
1021		prerequisites.
1022
1023
1024The include file <bsd.lib.mk> includes the file named "../Makefile.inc"
1025if it exists, as well as the include file <bsd.man.mk>.
1026
1027It has rules for building profiled objects; profiled libraries are
1028built by default.
1029
1030Libraries are ranlib'd when made.
1031
1032
1033=-=-=-=-=   bsd.links.mk   =-=-=-=-=
1034
1035The include file <bsd.links.mk> handles the LINKS and SYMLINKS variables
1036and is included from <bsd.lib.mk> and <bsd.prog.mk>.
1037
1038LINKSOWN, LINKSGRP, and LINKSMODE, are relevant only if a metadata log
1039is used. The defaults may be modified by other bsd.*.mk files which
1040include bsd.links.mk.  In the future, these variables may be replaced
1041by a method for explicitly recording hard links in a metadata log.
1042
1043LINKS		The list of hard links, consisting of pairs of paths:
1044			source-file target-file
1045		${DESTDIR} is prepended to both paths before linking.
1046		For example, to link /bin/test and /bin/[, use:
1047			LINKS=/bin/test /bin/[
1048
1049CONFIGLINKS	Similar semantics to LINKS, except that the links
1050		are installed by the `configinstall' target,
1051		not the `install' target.
1052
1053SYMLINKS	The list of symbolic links, consisting of pairs of paths:
1054			source-file target-file
1055		${DESTDIR} is only prepended to target-file before linking.
1056		For example, to symlink /usr/bin/tar to /bin/tar resulting
1057		in ${DESTDIR}/usr/bin/tar -> /bin/tar:
1058			SYMLINKS=/bin/tar /usr/bin/tar
1059
1060CONFIGSYMLINKS	Similar semantics to SYMLINKS, except that the symbolic links
1061		are installed by the `configinstall' target,
1062		not the `install' target.
1063
1064LINKSOWN	Link owner.  [${BINOWN}]
1065
1066LINKSGRP	Link group.  [${BINGRP}]
1067
1068LINKSMODE	Link mode.  [${NONBINMODE}]
1069
1070LINKSOWN_<fn>	Link owner of the specific file <fn>.
1071
1072LINKSGRP_<fn>	Link group of the specific file <fn>.
1073
1074LINKSMODE_<fn>	Link mode of the specific file <fn>.
1075
1076
1077=-=-=-=-=   bsd.man.mk   =-=-=-=-=
1078
1079The include file <bsd.man.mk> handles installing manual pages and their
1080links.
1081
1082It has a three targets:
1083
1084	catinstall:
1085		Install the preformatted manual pages and their links.
1086	htmlinstall:
1087		Install the HTML manual pages and their links.
1088	maninstall:
1089		Install the manual page sources and their links.
1090
1091It sets/uses the following variables:
1092
1093MANDIR		Base path for manual installation.
1094
1095MANGRP		Manual group.
1096
1097MANOWN		Manual owner.
1098
1099MANMODE		Manual mode.
1100
1101MANSUBDIR	Subdirectory under the manual page section, i.e. "/vax"
1102		or "/tahoe" for machine specific manual pages.
1103
1104MAN		The manual pages to be installed (use a .1 - .9 suffix).
1105
1106MLINKS		List of manual page links (using a .1 - .9 suffix).  The
1107		linked-to file must come first, the linked file second,
1108		and there may be multiple pairs.
1109
1110The include file <bsd.man.mk> includes a file named "../Makefile.inc" if
1111it exists.
1112
1113
1114=-=-=-=-=   bsd.obj.mk   =-=-=-=-=
1115
1116The include file <bsd.obj.mk> defines targets related to the creation
1117and use of separated object and source directories.
1118
1119If an environment variable named MAKEOBJDIRPREFIX is set, make(1) uses
1120${MAKEOBJDIRPREFIX}${.CURDIR} as the name of the object directory if
1121it exists.  Otherwise make(1) looks for the existence of a
1122subdirectory (or a symlink to a directory) of the source directory
1123into which built targets should be placed.  If an environment variable
1124named MAKEOBJDIR is set, make(1) uses its value as the name of the
1125object directory; failing that, make first looks for a subdirectory
1126named "obj.${MACHINE}", and if that doesn't exist, it looks for "obj".
1127
1128Object directories are not created automatically by make(1) if they
1129don't exist; you need to run a separate "make obj".  (This will happen
1130during a top-level build if "MKOBJDIRS" is set to a value other than
1131"no").  When the source directory is a subdirectory of ${BSDSRCDIR} --
1132and this is determined by a simple string prefix comparison -- object
1133directories are created in a separate object directory tree, and a
1134symlink to the object directory in that tree is created in the source
1135directory; otherwise, "make obj" assumes that you're not in the main
1136source tree and that it's not safe to use a separate object tree.
1137
1138Several variables used by <bsd.obj.mk> control exactly what
1139directories and links get created during a "make obj":
1140
1141MAKEOBJDIR	If set, this is the component name of the object
1142		directory.
1143
1144OBJMACHINE	If this is set but MAKEOBJDIR is not set, creates
1145		object directories or links named "obj.${MACHINE}";
1146		otherwise, just creates ones named "obj".
1147
1148OBJMACHINE_ARCH If set with OBJMACHINE, creates object directories or
1149		links named "obj.${MACHINE}-${MACHINE_ARCH}".
1150
1151USR_OBJMACHINE	If set, and the current directory is a subdirectory of
1152		${BSDSRCDIR}, create object directory in the
1153		corresponding subdirectory of ${BSDOBJDIR}.${MACHINE};
1154		otherwise, create it in the corresponding subdirectory
1155		of ${BSDOBJDIR}
1156
1157BUILDID		Identifier for the build.  If set, this should be a short
1158		string that is suitable for use as part of a file or
1159		directory name.  The identifier will be appended to
1160		object directory names; if OBJMACHINE is also set, then
1161		.BUILDID is appended after .MACHINE.  The identifier will
1162		also be used as part of the kernel version string, which
1163		can be shown by “uname -v”.
1164
1165		Default: Unset.
1166
1167
1168=-=-=-=-=   bsd.prog.mk   =-=-=-=-=
1169
1170The include file <bsd.prog.mk> handles building programs from one or
1171more source files, along with their manual pages.  It has a limited number
1172of suffixes, consistent with the current needs of the BSD tree.
1173<bsd.prog.mk> includes <bsd.shlib.mk> to get shared library parameters.
1174
1175It has eight targets:
1176
1177	all:
1178		build the program and its manual page.  This also
1179		creates a GDB initialization file (.gdbinit) in
1180		the objdir.  The .gdbinit file sets the shared library
1181		prefix to ${DESTDIR} to facilitate cross-debugging.
1182	clean:
1183		remove the program, any object files and the files a.out,
1184		Errs, errs, mklog, and ${PROG}.core.
1185	cleandir:
1186		remove all of the files removed by the target clean, as
1187		well as .depend, tags, and any manual pages.
1188		`distclean' is a synonym for `cleandir'.
1189	depend:
1190		make the dependencies for the source files, and store
1191		them in the file .depend.
1192	includes:
1193		install any header files.
1194	install:
1195		install the program and its manual pages; if the Makefile
1196		does not itself define the target install, the targets
1197		beforeinstall and afterinstall may also be used to cause
1198		actions immediately before and after the install target
1199		is executed.
1200	lint:
1201		run lint on the source files
1202	tags:
1203		create a tags file for the source files.
1204
1205It sets/uses the following variables:
1206
1207BINGRP		Binary group.
1208
1209BINOWN		Binary owner.
1210
1211BINMODE		Binary mode.
1212
1213CLEANDIRFILES	Additional files to remove for the cleandir target.
1214
1215CLEANFILES	Additional files to remove for the clean and cleandir targets.
1216
1217CONFIGOPTS	Additional options to config(1) when building kernels.
1218
1219		Default: Unset.
1220
1221COPTS		Extra options for the C compiler.  Should be appended to
1222		(e.g., COPTS+=-g), rather than explicitly set.
1223
1224		Note: CPUFLAGS, not COPTS, should be used for compiler
1225		options that select CPU-related options.
1226
1227COPTS.<fn>	Extra options for the C compiler when creating the
1228		C objects for <fn>.
1229		For <fn>.[ly], "<fn>.c" must be used.
1230
1231CPUFLAGS	Additional options passed to the compiler/assembler to
1232		select CPU instruction set options, CPU tuning options,
1233		etc.
1234
1235		Note: Such options should not be specified in COPTS,
1236		because some parts of the build process need to override
1237		CPU-related compiler options.
1238
1239		Default: Unset.
1240
1241CPUFLAGS.<fn>	Additional options to the compiler/assembler for <fn>.
1242		For <fn>.[ly], "<fn>.c" must be used.
1243
1244CPPFLAGS	Additional options to the C pre-processor.
1245
1246CPPFLAGS.<fn>	Additional options to the C pre-processor for <fn>.
1247		For <fn>.[ly], "<fn>.c" must be used.
1248
1249GDBINIT		List of GDB initialization files to add to "source"
1250		directives in the .gdbinit file that is created in the
1251		objdir.
1252
1253LDADD		Additional loader objects.  Usually used for libraries.
1254		For example, to load with the compatibility and utility
1255		libraries, use:
1256
1257			LDADD+=-lutil -lcompat
1258
1259LDFLAGS		Additional linker options (passed to ${CC} during link).
1260
1261LINKS		See <bsd.links.mk>
1262
1263OBJCOPTS	Additional options to the compiler when creating ObjC objects.
1264
1265OBJCOPTS.<fn>	Additional options to the compiler when creating the
1266		ObjC objects for <fn>.
1267		For <fn>.[ly], "<fn>.c" must be used.
1268
1269SYMLINKS	See <bsd.links.mk>
1270
1271MAN		Manual pages (should end in .1 - .9).  If no MAN variable is
1272		defined, "MAN=${PROG}.1" is assumed.
1273
1274PAXCTL_FLAGS	If defined, run paxctl(1) on the program binary after link
1275		time, with the value of this variable as options to paxctl(1).
1276
1277PAXCTL_FLAGS.${PROG} Custom override for PAXCTL_FLAGS.
1278
1279PROG		The name of the program to build.  If not supplied, nothing
1280		is built.
1281
1282PROG_CXX	If defined, the name of the program to build.  Also
1283		causes <bsd.prog.mk> to link the program with the C++
1284		compiler rather than the C compiler.  PROG_CXX overrides
1285		the value of PROG if PROG is also set.
1286
1287PROGNAME	The name that the above program will be installed as, if
1288		different from ${PROG}.
1289
1290PROGS		Multiple programs to build from a single directory.
1291		Defaults to PROG. For each program ${_P} in ${PROGS},
1292		uses SRCS.${_P}, defaulting to ${_P}.c.
1293
1294PROGS_CXX	Multiple C++ programs to build from a single directory.
1295		Defaults to PROG_CXX. For each program ${_P} in ${PROGS_CXX},
1296		uses SRCS.${_P}, defaulting to ${_P}.cc.
1297
1298SRCS		List of source files to build the program.  If SRCS is not
1299		defined, it's assumed to be ${PROG}.c or ${PROG_CXX}.cc.
1300
1301DPSRCS		List of source files which are needed for generating
1302		dependencies, but are not needed in ${SRCS}.
1303
1304DPADD		Additional dependencies for the program.  Usually used for
1305		libraries.  For example, to depend on the compatibility and
1306		utility libraries use:
1307
1308			DPADD+=${LIBCOMPAT} ${LIBUTIL}
1309
1310		The following system libraries are predefined for DPADD:
1311
1312		LIBARCHIVE?=		${DESTDIR}/usr/lib/libarchive.a
1313		LIBASN1?=		${DESTDIR}/usr/lib/libasn1.a
1314		LIBATF_C?=		${DESTDIR}/usr/lib/libatf-c.a
1315		LIBATF_CXX?=		${DESTDIR}/usr/lib/libatf-c++.a
1316		LIBBIND9?=		${DESTDIR}/usr/lib/libbind9.a
1317		LIBBLOCKLIST?=		${DESTDIR}/usr/lib/libblocklist.a
1318		LIBBLUETOOTH?=		${DESTDIR}/usr/lib/libbluetooth.a
1319		LIBBSDMALLOC?=		${DESTDIR}/usr/lib/libbsdmalloc.a
1320		LIBBZ2?=		${DESTDIR}/usr/lib/libbz2.a
1321		LIBC?=			${DESTDIR}/usr/lib/libc.a
1322		LIBC_PIC?=		${DESTDIR}/usr/lib/libc_pic.a
1323		LIBCBOR?=		${DESTDIR}/usr/lib/libcbor.a
1324		LIBCOMPAT?=		${DESTDIR}/usr/lib/libcompat.a
1325		LIBCOM_ERR?=		${DESTDIR}/usr/lib/libcom_err.a
1326		LIBCRYPT?=		${DESTDIR}/usr/lib/libcrypt.a
1327		LIBCRYPTO?=		${DESTDIR}/usr/lib/libcrypto.a
1328		LIBCURSES?=		${DESTDIR}/usr/lib/libcurses.a
1329		LIBCXX?=		${DESTDIR}/usr/lib/libc++.a
1330		LIBDES?=		${DESTDIR}/usr/lib/libdes.a
1331		LIBDNS?=		${DESTDIR}/usr/lib/libdns.a
1332		LIBEDIT?=		${DESTDIR}/usr/lib/libedit.a
1333		LIBEVENT?=		${DESTDIR}/usr/lib/libevent.a
1334		LIBEVENT_OPENSSL?=	${DESTDIR}/usr/lib/libevent_openssl.a
1335		LIBEVENT_PTHREADS?=	${DESTDIR}/usr/lib/libevent_pthreads.a
1336		LIBEXECINFO?=		${DESTDIR}/usr/lib/libexecinfo.a
1337		LIBEXPAT?=		${DESTDIR}/usr/lib/libexpat.a
1338		LIBFETCH?=		${DESTDIR}/usr/lib/libfetch.a
1339		LIBFIDO2?=		${DESTDIR}/usr/lib/libfido2.a
1340		LIBFL?=			${DESTDIR}/usr/lib/libfl.a
1341		LIBFORM?=		${DESTDIR}/usr/lib/libform.a
1342		LIBGCC?=		${DESTDIR}/usr/lib/libgcc.a
1343		LIBGNUCTF?=		${DESTDIR}/usr/lib/libgnuctf.a
1344		LIBGNUMALLOC?=		${DESTDIR}/usr/lib/libgnumalloc.a
1345		LIBGSSAPI?=		${DESTDIR}/usr/lib/libgssapi.a
1346		LIBHDB?=		${DESTDIR}/usr/lib/libhdb.a
1347		LIBHEIMBASE?=		${DESTDIR}/usr/lib/libheimbase.a
1348		LIBHEIMNTLM?=		${DESTDIR}/usr/lib/libheimntlm.a
1349		LIBHX500?=		${DESTDIR}/usr/lib/libhx500.a
1350		LIBINTL?=		${DESTDIR}/usr/lib/libintl.a
1351		LIBIPSEC?=		${DESTDIR}/usr/lib/libipsec.a
1352		LIBISC?=		${DESTDIR}/usr/lib/libisc.a
1353		LIBISCCC?=		${DESTDIR}/usr/lib/libisccc.a
1354		LIBISCFG?=		${DESTDIR}/usr/lib/libiscfg.a
1355		LIBKADM5CLNT?=		${DESTDIR}/usr/lib/libkadm5clnt.a
1356		LIBKADM5SRV?=		${DESTDIR}/usr/lib/libkadm5srv.a
1357		LIBKAFS?=		${DESTDIR}/usr/lib/libkafs.a
1358		LIBKRB5?=		${DESTDIR}/usr/lib/libkrb5.a
1359		LIBKVM?=		${DESTDIR}/usr/lib/libkvm.a
1360		LIBL?=			${DESTDIR}/usr/lib/libl.a
1361		LIBLBER?=		${DESTDIR}/usr/lib/liblber.a
1362		LIBLDAP?=		${DESTDIR}/usr/lib/libldap.a
1363		LIBLDAP_R?=		${DESTDIR}/usr/lib/libldap_r.a
1364		LIBLUA?=		${DESTDIR}/usr/lib/liblua.a
1365		LIBM?=			${DESTDIR}/usr/lib/libm.a
1366		LIBMAGIC?=		${DESTDIR}/usr/lib/libmagic.a
1367		LIBMENU?=		${DESTDIR}/usr/lib/libmenu.a
1368		LIBNETPGPVERIFY?=	${DESTDIR}/usr/lib/libnetpgpverify.a
1369		LIBNS?=			${DESTDIR}/usr/lib/libns.a
1370		LIBOBJC?=		${DESTDIR}/usr/lib/libobjc.a
1371		LIBOSSAUDIO?=		${DESTDIR}/usr/lib/libossaudio.a
1372		LIBPAM?=		${DESTDIR}/usr/lib/libpam.a
1373		LIBPANEL?=		${DESTDIR}/usr/lib/libpanel.a
1374		LIBPCAP?=		${DESTDIR}/usr/lib/libpcap.a
1375		LIBPCI?=		${DESTDIR}/usr/lib/libpci.a
1376		LIBPOSIX?=		${DESTDIR}/usr/lib/libposix.a
1377		LIBPTHREAD?=		${DESTDIR}/usr/lib/libpthread.a
1378		LIBPUFFS?=		${DESTDIR}/usr/lib/libpuffs.a
1379		LIBQUOTA?=		${DESTDIR}/usr/lib/libquota.a
1380		LIBRADIUS?=		${DESTDIR}/usr/lib/libradius.a
1381		LIBREFUSE?=		${DESTDIR}/usr/lib/librefuse.a
1382		LIBRESOLV?=		${DESTDIR}/usr/lib/libresolv.a
1383		LIBRMT?=		${DESTDIR}/usr/lib/librmt.a
1384		LIBROKEN?=		${DESTDIR}/usr/lib/libroken.a
1385		LIBRPCSVC?=		${DESTDIR}/usr/lib/librpcsvc.a
1386		LIBRT?=			${DESTDIR}/usr/lib/librt.a
1387		LIBRUMP?=		${DESTDIR}/usr/lib/librump.a
1388		LIBRUMPFS_CD9660?=	${DESTDIR}/usr/lib/librumpfs_cd9660.a
1389		LIBRUMPFS_EFS?=		${DESTDIR}/usr/lib/librumpfs_efs.a
1390		LIBRUMPFS_EXT2FS?=	${DESTDIR}/usr/lib/librumpfs_ext2fs.a
1391		LIBRUMPFS_FFS?=		${DESTDIR}/usr/lib/librumpfs_ffs.a
1392		LIBRUMPFS_HFS?=		${DESTDIR}/usr/lib/librumpfs_hfs.a
1393		LIBRUMPFS_LFS?=		${DESTDIR}/usr/lib/librumpfs_lfs.a
1394		LIBRUMPFS_MSDOS?=	${DESTDIR}/usr/lib/librumpfs_msdos.a
1395		LIBRUMPFS_NFS?=		${DESTDIR}/usr/lib/librumpfs_nfs.a
1396		LIBRUMPFS_NTFS?=	${DESTDIR}/usr/lib/librumpfs_ntfs.a
1397		LIBRUMPFS_SYSPUFFS?=	${DESTDIR}/usr/lib/librumpfs_syspuffs.a
1398		LIBRUMPFS_TMPFS?=	${DESTDIR}/usr/lib/librumpfs_tmpfs.a
1399		LIBRUMPFS_UDF?=		${DESTDIR}/usr/lib/librumpfs_udf.a
1400		LIBRUMPUSER?=		${DESTDIR}/usr/lib/librumpuser.a
1401		LIBSASLC?=		${DESTDIR}/usr/lib/libsaslc.a
1402		LIBSKEY?=		${DESTDIR}/usr/lib/libskey.a
1403		LIBSL?=			${DESTDIR}/usr/lib/libsl.a
1404		LIBSQLITE3?=		${DESTDIR}/usr/lib/libsqlite3.a
1405		LIBSSH?=		${DESTDIR}/usr/lib/libssh.a
1406		LIBSSL?=		${DESTDIR}/usr/lib/libssl.a
1407		LIBSTDCXX?=		${DESTDIR}/usr/lib/libstdc++.a
1408		LIBSUPCXX?=		${DESTDIR}/usr/lib/libsupc++.a
1409		LIBTERMINFO?=		${DESTDIR}/usr/lib/libterminfo.a
1410		LIBTRE?=		${DESTDIR}/usr/lib/libtre.a
1411		LIBUNBOUND?=		${DESTDIR}/usr/lib/libunbound.a
1412		LIBUSBHID?=		${DESTDIR}/usr/lib/libusbhid.a
1413		LIBUTIL?=		${DESTDIR}/usr/lib/libutil.a
1414		LIBWIND?=		${DESTDIR}/usr/lib/libwind.a
1415		LIBWRAP?=		${DESTDIR}/usr/lib/libwrap.a
1416		LIBY?=			${DESTDIR}/usr/lib/liby.a
1417		LIBZ?=			${DESTDIR}/usr/lib/libz.a
1418
1419		The following c startup files.
1420
1421		LIBCRT0?=		${DESTDIR}/usr/lib/crt0.o
1422		LIBCRTI?=		${DESTDIR}/usr/lib/crti.o
1423		LIBCRTBEGIN?=		${DESTDIR}/usr/lib/crti.o
1424		LIBCRTEND?=		${DESTDIR}/usr/lib/crtn.o
1425
1426		The following X-Windows libraries are predefined for DPADD:
1427
1428		LIBDPS?=		${DESTDIR}/usr/X11R7/lib/libdps.a
1429		LIBFNTSTUBS?=		${DESTDIR}/usr/X11R7/lib/libfntstubs.a
1430		LIBFONTCACHE?=		${DESTDIR}/usr/X11R7/lib/libfontcache.a
1431		LIBFONTCONFIG?=		${DESTDIR}/usr/X11R7/lib/libfontconfig.a
1432		LIBFONTENC?=		${DESTDIR}/usr/X11R7/lib/libfontenc.a
1433		LIBFREETYPE?=		${DESTDIR}/usr/X11R7/lib/libfreetype.a
1434		LIBFS?=			${DESTDIR}/usr/X11R7/lib/libFS.a
1435		LIBGL?=			${DESTDIR}/usr/X11R7/lib/libGL.a
1436		LIBGLU?=		${DESTDIR}/usr/X11R7/lib/libGLU.a
1437		LIBICE?=		${DESTDIR}/usr/X11R7/lib/libICE.a
1438		LIBLBXUTIL?=		${DESTDIR}/usr/X11R7/lib/liblbxutil.a
1439		LIBSM?=			${DESTDIR}/usr/X11R7/lib/libSM.a
1440		LIBX11?=		${DESTDIR}/usr/X11R7/lib/libX11.a
1441		LIBX11_XCB?=		${DESTDIR}/usr/X11R7/lib/libX11-xcb.a
1442		LIBXAU?=		${DESTDIR}/usr/X11R7/lib/libXau.a
1443		LIBXAW?=		${DESTDIR}/usr/X11R7/lib/libXaw.a
1444		LIBXCB?=		${DESTDIR}/usr/X11R7/lib/libxcb.a
1445		LIBXCOMPOSITE?=		${DESTDIR}/usr/X11R7/lib/libXcomposite.a
1446		LIBXCVT?=		${DESTDIR}/usr/X11R7/lib/libxcvt.a
1447		LIBXDAMAGE?=		${DESTDIR}/usr/X11R7/lib/libXdamage.a
1448		LIBXDMCP?=		${DESTDIR}/usr/X11R7/lib/libXdmcp.a
1449		LIBXEXT?=		${DESTDIR}/usr/X11R7/lib/libXext.a
1450		LIBXFIXES?=		${DESTDIR}/usr/X11R7/lib/libXfixes.a
1451		LIBXFONT2?=		${DESTDIR}/usr/X11R7/lib/libXfont2.a
1452		LIBXFONT?=		${DESTDIR}/usr/X11R7/lib/libXfont.a
1453		LIBXFT?=		${DESTDIR}/usr/X11R7/lib/libXft.a
1454		LIBXI?=			${DESTDIR}/usr/X11R7/lib/libXi.a
1455		LIBXINERAMA?=		${DESTDIR}/usr/X11R7/lib/libXinerama.a
1456		LIBXKBFILE?=		${DESTDIR}/usr/X11R7/lib/libxkbfile.a
1457		LIBXMU?=		${DESTDIR}/usr/X11R7/lib/libXmu.a
1458		LIBXMUU?=		${DESTDIR}/usr/X11R7/lib/libXmuu.a
1459		LIBXPM?=		${DESTDIR}/usr/X11R7/lib/libXpm.a
1460		LIBXRANDR?=		${DESTDIR}/usr/X11R7/lib/libXrandr.a
1461		LIBXRENDER?=		${DESTDIR}/usr/X11R7/lib/libXrender.a
1462		LIBXSS?=		${DESTDIR}/usr/X11R7/lib/libXss.a
1463		LIBXT?=			${DESTDIR}/usr/X11R7/lib/libXt.a
1464		LIBXTRAP?=		${DESTDIR}/usr/X11R7/lib/libXTrap.a
1465		LIBXTST?=		${DESTDIR}/usr/X11R7/lib/libXtst.a
1466		LIBXV?=			${DESTDIR}/usr/X11R7/lib/libXv.a
1467		LIBXXF86DGA?=		${DESTDIR}/usr/X11R7/lib/libXxf86dga.a
1468		LIBXXF86MISC?=		${DESTDIR}/usr/X11R7/lib/libXxf86misc.a
1469		LIBXXF86VM?=		${DESTDIR}/usr/X11R7/lib/libXxf86vm.a
1470
1471STRIPFLAG	The option passed to the install program to cause the binary
1472		to be stripped.
1473
1474SUBDIR		A list of subdirectories that should be built as well.
1475		Each of the targets will execute the same target in the
1476		subdirectories.
1477
1478SCRIPTS		A list of interpreter scripts [file.{sh,csh,pl,awk,...}].
1479		These are installed exactly like programs.
1480
1481SCRIPTSDIR	The location to install the scripts.  Each script can be
1482		installed to a separate path by setting SCRIPTSDIR_<script>.
1483
1484SCRIPTSNAME	The name that the above program will be installed as, if
1485		different from ${SCRIPTS}. These can be further specialized
1486		by setting SCRIPTSNAME_<script>.
1487
1488FILES		See description of <bsd.files.mk>.
1489
1490SHLINKDIR	Target directory for shared linker.  See description of
1491		<bsd.own.mk> for additional information about this variable.
1492
1493The include file <bsd.prog.mk> includes the file named "../Makefile.inc"
1494if it exists, as well as the include file <bsd.man.mk>.
1495
1496Some simple examples:
1497
1498To build foo from foo.c with a manual page foo.1, use:
1499
1500	PROG=	foo
1501
1502	.include <bsd.prog.mk>
1503
1504To build foo from foo.c with a manual page foo.2, add the line:
1505
1506	MAN=	foo.2
1507
1508If foo does not have a manual page at all, add the line
1509before any make(1) .include directives:
1510
1511	NOMAN=
1512
1513If foo has multiple source files, add the line:
1514
1515	SRCS=	a.c b.c c.c d.c
1516
1517
1518=-=-=-=-=   bsd.rpc.mk   =-=-=-=-=
1519
1520The include file <bsd.rpc.mk> contains a makefile fragment used to
1521construct source files built by rpcgen.
1522
1523The following macros may be defined in makefiles which include
1524<bsd.rpc.mk> in order to control which files get built and how they
1525are to be built:
1526
1527RPC_INCS	construct .h file from .x file
1528RPC_XDRFILES	construct _xdr.c from .x file
1529		(for marshalling/unmarshalling data types)
1530RPC_SVCFILES	construct _svc.c from .x file
1531		(server-side stubs)
1532RPC_SVCFLAGS	Additional options passed to builds of RPC_SVCFILES.
1533
1534RPC_XDIR	Directory containing .x/.h files
1535
1536
1537=-=-=-=-=   bsd.shlib.mk   =-=-=-=-=
1538
1539The include file <bsd.shlib.mk> computes parameters for shared library
1540installation and use.  It defines no targets.  <bsd.own.mk> MUST be
1541included before <bsd.shlib.mk>.
1542
1543<bsd.own.mk> sets the following variables, if they are not already defined
1544(defaults are in brackets):
1545
1546SHLIBINSTALLDIR If ${USE_SHLIBDIR} is not "no", use ${SHLIBINSTALLDIR}
1547		instead of ${LIBDIR} as the base path for shared library
1548		installation.  [/lib]
1549
1550SHLIBDIR	The path to USE_SHLIBDIR shared libraries to use when building
1551		a program.  [/lib for programs in /bin and /sbin, /usr/lib
1552		for all others.]
1553
1554_LIBSODIR	Set to ${SHLIBINSTALLDIR} if ${USE_SHLIBDIR} is not "no",
1555		otherwise set to ${LIBDIR}
1556
1557SHLINKINSTALLDIR Base path for shared linker.  [/libexec]
1558
1559SHLINKDIR	Path to use for shared linker when building a program.
1560		[/libexec for programs in /bin and /sbin, /usr/libexec for
1561		all others.]
1562
1563
1564=-=-=-=-=   bsd.subdir.mk   =-=-=-=-=
1565
1566The include file <bsd.subdir.mk> contains the default targets for building
1567subdirectories.  It has the same eight targets as <bsd.prog.mk>: all,
1568clean, cleandir, depend, includes, install, lint, and tags.  It uses the
1569following variables:
1570
1571NOSUBDIR	If this variable is defined, then the SUBDIR variable
1572		will be ignored and subdirectories will not be processed.
1573
1574SUBDIR		For all of the directories listed in ${SUBDIR}, the
1575		specified directory will be visited and the target made.
1576
1577		As a special case, the use of a token .WAIT as an
1578		entry in SUBDIR acts as a synchronization barrier
1579		when multiple make jobs are run; subdirs before the
1580		.WAIT must complete before any subdirs after .WAIT are
1581		started.  See make(1) for some caveats on use of .WAIT
1582		and other special sources.
1583
1584
1585=-=-=-=-=   bsd.x11.mk   =-=-=-=-=
1586
1587The include file <bsd.x11.mk> contains parameters and targets for
1588cross-building X11 from ${X11SRCDIR.<package>}.  It should be included
1589after the general Makefile contents but before the include files such as
1590<bsd.prog.mk> and <bsd.lib.mk>.
1591
1592It provides the following targets:
1593	.man.1 .man.3 .man.4 .man.5 .man.7:
1594		If ${MAN} or ${PROG} is set and ${MKMAN} != "no",
1595		these rules convert from X11's manual page source
1596		into an mdoc.old source file.
1597
1598It sets the following variables:
1599
1600BINDIR			Set to ${X11BINDIR}.
1601			To override, define after including <bsd.x11.mk>
1602
1603LIBDIR			Set to ${X11USRLIBDIR}.
1604			To override, define after including <bsd.x11.mk>
1605
1606MANDIR			Set to ${X11MANDIR}.
1607			To override, define after including <bsd.x11.mk>
1608
1609CPPFLAGS		Appended with definitions to include from
1610			${DESTDIR}${X11INCDIR}
1611
1612LDFLAGS			Appended with definitions to link from
1613			${DESTDIR}${X11USRLIBDIR}
1614
1615X11FLAGS.CONNECTION	Equivalent to X11's CONNECTION_FLAGS.
1616
1617X11FLAGS.EXTENSION	Equivalent to X11's EXT_DEFINES.
1618
1619X11FLAGS.LOADABLE	Equivalent to X11's LOADABLE.
1620
1621X11FLAGS.OS_DEFINES	Equivalent to X11's OS_DEFINES.
1622
1623X11FLAGS.SERVER		Equivalent to X11's ServerDefines.
1624
1625X11FLAGS.THREADLIB	Equivalent to X11's THREADS_DEFINES for libraries.
1626
1627X11FLAGS.THREADS	Equivalent to X11's THREADS_DEFINES.
1628
1629X11FLAGS.VERSION	cpp(1) definitions of OSMAJORVERSION and OSMINORVERSION.
1630
1631X11FLAGS.DIX		Equivalent to X11's DIX_DEFINES.
1632
1633X11TOOL_UNXCOMM		Commandline to convert `XCOMM' comments to `#'
1634
1635It uses the following variables:
1636
1637APPDEFS			List of app-default files to install.
1638
1639CPPSCRIPTS		List of files/scripts to run through cpp(1)
1640			and then ${X11TOOL_UNXCOMM}.  The source files
1641			have a `.cpp' suffix, the generated files do not.
1642
1643CPPSCRIPTFLAGS		Additional options to cpp(1) when building CPPSCRIPTS.
1644
1645CPPSCRIPTFLAGS_<fn>	Additional options to cpp(1) when building CPPSCRIPT <fn>.
1646
1647
1648=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
1649
1650The following files are described here for completion, but they are not
1651supposed to be included directly from other Makefiles; they are used
1652internally by other system files.
1653
1654=-=-=-=-=   bsd.sys.mk   =-=-=-=-=
1655
1656The include file <bsd.sys.mk> is used by other system mk files and
1657it is not intended to be included standalone. It contains rules and
1658system build variables. It requires bsd.own.mk to be included first.
1659It contains overrides that are used when building the NetBSD source tree.
1660
1661The following variables control how various files are compiled/built.
1662(Note that these may be overridden in <bsd.own.mk> if USETOOLS == "yes"):
1663
1664AR		Create, modify, and extract from archives.  [ar]
1665
1666ARFLAGS		Options to ${AR}.  [rl]
1667
1668ARM_ELF2AOUT	Convert ELF-format executable to a.out.  [elf2aout]
1669
1670AS		Assembler.  [as]
1671
1672AFLAGS		Options to ${CC} when compiling or linking .s or .S
1673		assembly source files.  []
1674
1675BUILDSEED	g++(1) uses random numbers when compiling C++ code.  This
1676		variable seeds the g++(1) random number generator using
1677		-frandom-seed with this value.  By default, it is set to
1678		"NetBSD-(majorversion)".  Using a fixed value causes C++
1679		binaries to be the same when built from the same sources,
1680		resulting in identical (reproducible) builds.  Additional
1681		information is available in the g++(1) documentation of
1682		-frandom-seed.
1683
1684		Default: Unset.
1685
1686CC		C compiler.  [cc]
1687
1688CFLAGS		Options to ${CC}.  [Usually -O or -O2]
1689		Note: CFLAGS should never be set in mk.conf(5).
1690
1691CPP		C Pre-Processor.  [cpp]
1692
1693CPPFLAGS	Options to ${CPP}.  []
1694
1695CPUFLAGS	Optimization options for ${CC}.  []
1696
1697CXX		C++ compiler.  [c++]
1698
1699CXXFLAGS	Options to ${CXX}.  [${CFLAGS}]
1700
1701M68K_ELF2AOUT	Convert ELF-format executable to a.out.  [elf2aout]
1702
1703MIPS_ELF2ECOFF	Convert ELF-format executable to ECOFF.  [elf2ecoff]
1704
1705FC		Fortran compiler.  [f77]
1706
1707FFLAGS		Options to {$FC}.  [-O]
1708
1709HOST_SH		Shell.  This must be an absolute path, because it may be
1710		substituted into "#!" lines in scripts.  [/bin/sh]
1711
1712INSTALL		install(1) command.  [install]
1713
1714LEX		Lexical analyzer.  [lex]
1715
1716LFLAGS		Options to ${LEX}.  []
1717
1718LPREFIX		Symbol prefix for ${LEX} (see -P option in lex(1)) [yy]
1719
1720LD		Linker.  [ld]
1721
1722LDFLAGS		Options to ${CC} during the link process.  []
1723
1724LINT		C program verifier.  [lint]
1725
1726LINTFLAGS	Options to ${LINT}.  [-chapbrxzgFS]
1727
1728LORDER		List dependencies for object files.  [lorder]
1729
1730MAKE		make(1).  [make]
1731
1732MKDEP		Construct Makefile dependency list.  [mkdep]
1733
1734MKDEPCXX	Construct Makefile dependency list for C++ files.  [mkdep]
1735
1736NM		List symbols from object files.  [nm]
1737
1738PC		Pascal compiler.  [pc]	(Not present)
1739
1740PFLAGS		Options to ${PC}.  []
1741
1742OBJC		Objective C compiler.  [${CC}]
1743
1744OBJCFLAGS	Options to ${OBJC}.  [${CFLAGS}]
1745
1746OBJCOPY		Copy and translate object files.  [objcopy]
1747
1748OBJCOPYLIBFLAGS Options to pass to objcopy when library objects are
1749		being built. [${.TARGET} =~ "*.po" ? -X : -x]
1750
1751OBJDUMP		Display information from object files.  [objdump]
1752
1753RANLIB		Generate index to archive.  [ranlib]
1754
1755READELF		Display information from ELF object files.  [readelf]
1756
1757SIZE		List section sizes and total size.  [size]
1758
1759STRINGS		Display printable character sequences in files.  [strings]
1760
1761STRIP		Discard symbols from object files.  [strip]
1762
1763TSORT		Topological sort of a directed graph.  [tsort -q]
1764
1765YACC		LALR(1) parser generator.  [yacc]
1766
1767YFLAGS		Options to ${YACC}.  []
1768
1769YHEADER		If defined, add "-d" to YFLAGS, and add dependencies
1770		from <file>.y to <file>.h and <file>.c, and add
1771		<foo>.h to CLEANFILES.
1772
1773YPREFIX		If defined, add "-p ${YPREFIX}" to YFLAGS.
1774
1775
1776Other variables of note (incomplete list):
1777
1778NOCLANGERROR	If defined and clang is used as C compiler, -Werror is not
1779		passed to it.
1780
1781NOGCCERROR	If defined, prevents passing certain ${CFLAGS} to GCC
1782		that cause warnings to be fatal, such as:
1783			-Werror -Wa,--fatal-warnings
1784		(The latter being for as(1).)
1785
1786WARNS		Crank up compiler warning options; the distinct levels are:
1787			WARNS=1
1788			WARNS=2
1789			WARNS=3
1790			WARNS=4
1791			WARNS=5
1792			WARNS=6
1793
1794=-=-=-=-=   bsd.host.mk   =-=-=-=-=
1795
1796This file is automatically included from bsd.own.mk. It contains settings
1797for all the HOST_* variables that are used in host programs and libraries.
1798
1799HOST_AR			The host archive processing command
1800
1801HOST_CC			The host c compiler
1802
1803HOST_CFLAGS		The host c compiler options
1804
1805HOST_COMPILE.c		The host c compiler line with options
1806
1807HOST_COMPILE.cc		The host c++ compiler line with options
1808
1809HOST_CPP		The host c pre-processor
1810
1811HOST_CPPFLAGS		The host c pre-processor options
1812
1813HOST_CXX		The host c++ compiler
1814
1815HOST_CXXFLAGS		The host c++ compiler options
1816
1817HOST_INSTALL_DIR	The host command to install a directory
1818
1819HOST_INSTALL_FILE	The host command to install a file
1820
1821HOST_INSTALL_SYMLINK	The host command to install a symlink
1822
1823HOST_LD			The host linker command
1824
1825HOST_LDFLAGS		The host linker options
1826
1827HOST_LINK.c		The host c linker line with options
1828
1829HOST_LINK.cc		The host c++ linker line with options
1830
1831HOST_LN			The host command to link two files
1832
1833HOST_MKDEP		The host command to create dependencies for c programs
1834
1835HOST_MKDEPCXX		The host command to create dependencies for c++ programs
1836
1837HOST_OSTYPE		The host OSNAME-RELEASE-ARCH tupple
1838
1839HOST_RANLIB		The host command to create random access archives
1840
1841HOST_SH			The host Bourne shell interpreter name (absolute path)
1842
1843=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
1844