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