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