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