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