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