bsd.README revision 1.403
1#	$NetBSD: bsd.README,v 1.403 2020/05/18 21:19:35 jmcneill 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		Default: no
1346
1347LIBISCXX	If not "no", Use ${CXX} instead of ${CC} to link
1348		shared libraries.
1349		This is useful for C++ libraries.
1350		Default: no
1351
1352LINTLIBDIR	Target directory for lint libraries.
1353
1354LIBGRP		Library group.
1355
1356LIBOWN		Library owner.
1357
1358LIBMODE		Library mode.
1359
1360LDADD		Additional loader objects.
1361
1362MAN		The manual pages to be installed (use a .1 - .9 suffix).
1363
1364NOCHECKVER_<library>
1365NOCHECKVER	If set, disables checking for installed shared object
1366		libraries with versions greater than the source.  A
1367		particular library name, without the "lib" prefix, may
1368		be appended to the variable name to disable the check for
1369		only that library.
1370
1371SRCS		List of source files to build the library.  Suffix types
1372		.s, .c, and .f are supported.  Note, .s files are preferred
1373		to .c files of the same name.  (This is not the default for
1374		versions of make.)
1375
1376LIBDPLIBS/
1377PROGDPLIBS	A list of the tuples:
1378			libname  path-to-srcdir-of-libname
1379
1380		Instead of depending on installed versions of the libraries,
1381		one can depend on their built version in the source directory.
1382		This is useful for finding private libraries (LIBISPRIVATE).
1383
1384		For each tuple;
1385		     *	LIBDO.libname contains the .OBJDIR of the library
1386			`libname', and if it is not set it is determined
1387			from the srcdir and added to MAKEOVERRIDES (the
1388			latter is to allow for build time optimization).
1389		     *	LDADD gets  -L${LIBDO.libname} -llibname    added.
1390		     *	DPADD gets  ${LIBDO.libname}/liblibname.so  or
1391				    ${LIBDO.libname}/liblibname.a   added.
1392
1393		The special value "_external" for LIBDO.lib makes the
1394		build system to assume the library comes from outside
1395		of the NetBSD source tree and only causes -llibname
1396		to be added to LDADD.
1397
1398		This variable may be used for individual libraries/programs,
1399		as well as in parent directories to cache common libraries
1400		as a build-time optimization.
1401
1402The include file <bsd.lib.mk> includes the file named "../Makefile.inc"
1403if it exists, as well as the include file <bsd.man.mk>.
1404
1405It has rules for building profiled objects; profiled libraries are
1406built by default.
1407
1408Libraries are ranlib'd when made.
1409
1410
1411=-=-=-=-=   bsd.links.mk   =-=-=-=-=
1412
1413The include file <bsd.links.mk> handles the LINKS and SYMLINKS variables
1414and is included from from <bsd.lib.mk> and <bsd.prog.mk>.
1415
1416LINKSOWN, LINKSGRP, and LINKSMODE, are relevant only if a metadata log
1417is used. The defaults may be modified by other bsd.*.mk files which
1418include bsd.links.mk.  In the future, these variables may be replaced
1419by a method for explicitly recording hard links in a metadata log.
1420
1421LINKS		The list of hard links, consisting of pairs of paths:
1422			source-file target-file
1423		${DESTDIR} is prepended to both paths before linking.
1424		For example, to link /bin/test and /bin/[, use:
1425			LINKS=/bin/test /bin/[
1426
1427CONFIGLINKS	Similar semantics to LINKS, except that the links
1428		are installed by the `configinstall' target,
1429		not the `install' target.
1430
1431SYMLINKS	The list of symbolic links, consisting of pairs of paths:
1432			source-file target-file
1433		${DESTDIR} is only prepended to target-file before linking.
1434		For example, to symlink /usr/bin/tar to /bin/tar resulting
1435		in ${DESTDIR}/usr/bin/tar -> /bin/tar:
1436			SYMLINKS=/bin/tar /usr/bin/tar
1437
1438CONFIGSYMLINKS	Similar semantics to SYMLINKS, except that the symbolic links
1439		are installed by the `configinstall' target,
1440		not the `install' target.
1441
1442LINKSOWN	Link owner.  [${BINOWN}]
1443
1444LINKSGRP	Link group.  [${BINGRP}]
1445
1446LINKSMODE	Link mode.  [${NONBINMODE}]
1447
1448LINKSOWN_<fn>	Link owner of the specific file <fn>.
1449
1450LINKSGRP_<fn>	Link group of the specific file <fn>.
1451
1452LINKSMODE_<fn>	Link mode of the specific file <fn>.
1453
1454
1455=-=-=-=-=   bsd.man.mk   =-=-=-=-=
1456
1457The include file <bsd.man.mk> handles installing manual pages and their
1458links.
1459
1460It has a three targets:
1461
1462	catinstall:
1463		Install the preformatted manual pages and their links.
1464	htmlinstall:
1465		Install the HTML manual pages and their links.
1466	maninstall:
1467		Install the manual page sources and their links.
1468
1469It sets/uses the following variables:
1470
1471MANDIR		Base path for manual installation.
1472
1473MANGRP		Manual group.
1474
1475MANOWN		Manual owner.
1476
1477MANMODE		Manual mode.
1478
1479MANSUBDIR	Subdirectory under the manual page section, i.e. "/vax"
1480		or "/tahoe" for machine specific manual pages.
1481
1482MAN		The manual pages to be installed (use a .1 - .9 suffix).
1483
1484MLINKS		List of manual page links (using a .1 - .9 suffix).  The
1485		linked-to file must come first, the linked file second,
1486		and there may be multiple pairs.
1487
1488The include file <bsd.man.mk> includes a file named "../Makefile.inc" if
1489it exists.
1490
1491
1492=-=-=-=-=   bsd.obj.mk   =-=-=-=-=
1493
1494The include file <bsd.obj.mk> defines targets related to the creation
1495and use of separated object and source directories.
1496
1497If an environment variable named MAKEOBJDIRPREFIX is set, make(1) uses
1498${MAKEOBJDIRPREFIX}${.CURDIR} as the name of the object directory if
1499it exists.  Otherwise make(1) looks for the existence of a
1500subdirectory (or a symlink to a directory) of the source directory
1501into which built targets should be placed.  If an environment variable
1502named MAKEOBJDIR is set, make(1) uses its value as the name of the
1503object directory; failing that, make first looks for a subdirectory
1504named "obj.${MACHINE}", and if that doesn't exist, it looks for "obj".
1505
1506Object directories are not created automatically by make(1) if they
1507don't exist; you need to run a separate "make obj".  (This will happen
1508during a top-level build if "MKOBJDIRS" is set to a value other than
1509"no").  When the source directory is a subdirectory of ${BSDSRCDIR} --
1510and this is determined by a simple string prefix comparison -- object
1511directories are created in a separate object directory tree, and a
1512symlink to the object directory in that tree is created in the source
1513directory; otherwise, "make obj" assumes that you're not in the main
1514source tree and that it's not safe to use a separate object tree.
1515
1516Several variables used by <bsd.obj.mk> control exactly what
1517directories and links get created during a "make obj":
1518
1519MAKEOBJDIR	If set, this is the component name of the object
1520		directory.
1521
1522OBJMACHINE	If this is set but MAKEOBJDIR is not set, creates
1523		object directories or links named "obj.${MACHINE}";
1524		otherwise, just creates ones named "obj".
1525
1526USR_OBJMACHINE  If set, and the current directory is a subdirectory of
1527		${BSDSRCDIR}, create object directory in the
1528		corresponding subdirectory of ${BSDOBJDIR}.${MACHINE};
1529		otherwise, create it in the corresponding subdirectory
1530		of ${BSDOBJDIR}
1531
1532BUILDID		If set, the contents of this variable are appended
1533		to the object directory name.  If OBJMACHINE is also
1534		set, ".${BUILDID}" is added after ".${MACHINE}".
1535
1536
1537=-=-=-=-=   bsd.prog.mk   =-=-=-=-=
1538
1539The include file <bsd.prog.mk> handles building programs from one or
1540more source files, along with their manual pages.  It has a limited number
1541of suffixes, consistent with the current needs of the BSD tree.
1542<bsd.prog.mk> includes <bsd.shlib.mk> to get shared library parameters.
1543
1544It has eight targets:
1545
1546	all:
1547		build the program and its manual page.  This also
1548		creates a GDB initialization file (.gdbinit) in
1549		the objdir.  The .gdbinit file sets the shared library
1550		prefix to ${DESTDIR} to facilitate cross-debugging.
1551	clean:
1552		remove the program, any object files and the files a.out,
1553		Errs, errs, mklog, and ${PROG}.core.
1554	cleandir:
1555		remove all of the files removed by the target clean, as
1556		well as .depend, tags, and any manual pages.
1557		`distclean' is a synonym for `cleandir'.
1558	depend:
1559		make the dependencies for the source files, and store
1560		them in the file .depend.
1561	includes:
1562		install any header files.
1563	install:
1564		install the program and its manual pages; if the Makefile
1565		does not itself define the target install, the targets
1566		beforeinstall and afterinstall may also be used to cause
1567		actions immediately before and after the install target
1568		is executed.
1569	lint:
1570		run lint on the source files
1571	tags:
1572		create a tags file for the source files.
1573
1574It sets/uses the following variables:
1575
1576BINGRP		Binary group.
1577
1578BINOWN		Binary owner.
1579
1580BINMODE		Binary mode.
1581
1582CLEANDIRFILES	Additional files to remove for the cleandir target.
1583
1584CLEANFILES	Additional files to remove for the clean and cleandir targets.
1585
1586CONFIGOPTS	Additional flags to config(1) when building kernels.
1587
1588COPTS		Additional flags to the compiler when creating C objects.
1589
1590COPTS.<fn>	Additional flags to the compiler when creating the
1591		C objects for <fn>.
1592		For <fn>.[ly], "<fn>.c" must be used.
1593
1594CPUFLAGS	Additional flags to the compiler/assembler to select
1595		CPU instruction set options, CPU tuning options, etc.
1596
1597CPUFLAGS.<fn>	Additional flags to the compiler/assembler for <fn>.
1598		For <fn>.[ly], "<fn>.c" must be used.
1599
1600CPPFLAGS	Additional flags to the C pre-processor.
1601
1602CPPFLAGS.<fn>	Additional flags to the C pre-processor for <fn>.
1603		For <fn>.[ly], "<fn>.c" must be used.
1604
1605GDBINIT		List of GDB initialization files to add to "source"
1606		directives in the .gdbinit file that is created in the
1607		objdir.
1608
1609LDADD		Additional loader objects.  Usually used for libraries.
1610		For example, to load with the compatibility and utility
1611		libraries, use:
1612
1613			LDADD+=-lutil -lcompat
1614
1615LDFLAGS		Additional linker flags (passed to ${CC} during link).
1616
1617LINKS		See <bsd.links.mk>
1618
1619OBJCOPTS	Additional flags to the compiler when creating ObjC objects.
1620
1621OBJCOPTS.<fn>	Additional flags to the compiler when creating the
1622		ObjC objects for <fn>.
1623		For <fn>.[ly], "<fn>.c" must be used.
1624
1625SYMLINKS	See <bsd.links.mk>
1626
1627MAN		Manual pages (should end in .1 - .9).  If no MAN variable is
1628		defined, "MAN=${PROG}.1" is assumed.
1629
1630PAXCTL_FLAGS	If defined, run paxctl(1) on the program binary after link
1631		time, with the value of this variable as args to paxctl(1).
1632
1633PAXCTL_FLAGS.${PROG} Custom override for PAXCTL_FLAGS.
1634
1635PROG		The name of the program to build.  If not supplied, nothing
1636		is built.
1637
1638PROG_CXX	If defined, the name of the program to build.  Also
1639		causes <bsd.prog.mk> to link the program with the C++
1640		compiler rather than the C compiler.  PROG_CXX overrides
1641		the value of PROG if PROG is also set.
1642
1643PROGNAME	The name that the above program will be installed as, if
1644		different from ${PROG}.
1645
1646SRCS		List of source files to build the program.  If SRCS is not
1647		defined, it's assumed to be ${PROG}.c.
1648
1649DPSRCS		List of source files which are needed for generating
1650		dependencies, but are not needed in ${SRCS}.
1651
1652DPADD		Additional dependencies for the program.  Usually used for
1653		libraries.  For example, to depend on the compatibility and
1654		utility libraries use:
1655
1656			DPADD+=${LIBCOMPAT} ${LIBUTIL}
1657
1658		The following system libraries are predefined for DPADD:
1659
1660		LIBARCHIVE?=		${DESTDIR}/usr/lib/libarchive.a
1661		LIBASN1?=		${DESTDIR}/usr/lib/libasn1.a
1662		LIBATF_C?=		${DESTDIR}/usr/lib/libatf-c.a
1663		LIBATF_CXX?=		${DESTDIR}/usr/lib/libatf-c++.a
1664		LIBBIND9?=		${DESTDIR}/usr/lib/libbind9.a
1665		LIBBLUETOOTH?=		${DESTDIR}/usr/lib/libbluetooth.a
1666		LIBBSDMALLOC?=		${DESTDIR}/usr/lib/libbsdmalloc.a
1667		LIBBZ2?=		${DESTDIR}/usr/lib/libbz2.a
1668		LIBC?=			${DESTDIR}/usr/lib/libc.a
1669		LIBC_PIC?=		${DESTDIR}/usr/lib/libc_pic.a
1670		LIBCBOR?=		${DESTDIR}/usr/lib/libcbor.a
1671		LIBCOMPAT?=		${DESTDIR}/usr/lib/libcompat.a
1672		LIBCOM_ERR?=		${DESTDIR}/usr/lib/libcom_err.a
1673		LIBCRYPT?=		${DESTDIR}/usr/lib/libcrypt.a
1674		LIBCRYPTO?=		${DESTDIR}/usr/lib/libcrypto.a
1675		LIBCURSES?=		${DESTDIR}/usr/lib/libcurses.a
1676		LIBCXX?=		${DESTDIR}/usr/lib/libc++.a
1677		LIBDES?=		${DESTDIR}/usr/lib/libdes.a
1678		LIBDNS?=		${DESTDIR}/usr/lib/libdns.a
1679		LIBEDIT?=		${DESTDIR}/usr/lib/libedit.a
1680		LIBEVENT?=		${DESTDIR}/usr/lib/libevent.a
1681		LIBEVENT_OPENSSL?=	${DESTDIR}/usr/lib/libevent_openssl.a
1682		LIBEVENT_PTHREADS?=	${DESTDIR}/usr/lib/libevent_pthreads.a
1683		LIBEXECINFO?=		${DESTDIR}/usr/lib/libexecinfo.a
1684		LIBEXPAT?=		${DESTDIR}/usr/lib/libexpat.a
1685		LIBFETCH?=		${DESTDIR}/usr/lib/libfetch.a
1686		LIBFIDO2?=		${DESTDIR}/usr/lib/libfido2.a
1687		LIBFL?=			${DESTDIR}/usr/lib/libfl.a
1688		LIBFORM?=		${DESTDIR}/usr/lib/libform.a
1689		LIBGCC?=		${DESTDIR}/usr/lib/libgcc.a
1690		LIBGNUCTF?=		${DESTDIR}/usr/lib/libgnuctf.a
1691		LIBGNUMALLOC?=		${DESTDIR}/usr/lib/libgnumalloc.a
1692		LIBGSSAPI?=		${DESTDIR}/usr/lib/libgssapi.a
1693		LIBHDB?=		${DESTDIR}/usr/lib/libhdb.a
1694		LIBHEIMBASE?=		${DESTDIR}/usr/lib/libheimbase.a
1695		LIBHEIMNTLM?=		${DESTDIR}/usr/lib/libheimntlm.a
1696		LIBHX500?=		${DESTDIR}/usr/lib/libhx500.a
1697		LIBINTL?=		${DESTDIR}/usr/lib/libintl.a
1698		LIBIPSEC?=		${DESTDIR}/usr/lib/libipsec.a
1699		LIBISC?=		${DESTDIR}/usr/lib/libisc.a
1700		LIBISCCC?=		${DESTDIR}/usr/lib/libisccc.a
1701		LIBISCFG?=		${DESTDIR}/usr/lib/libiscfg.a
1702		LIBKADM5CLNT?=		${DESTDIR}/usr/lib/libkadm5clnt.a
1703		LIBKADM5SRV?=		${DESTDIR}/usr/lib/libkadm5srv.a
1704		LIBKAFS?=		${DESTDIR}/usr/lib/libkafs.a
1705		LIBKRB5?=		${DESTDIR}/usr/lib/libkrb5.a
1706		LIBKVM?=		${DESTDIR}/usr/lib/libkvm.a
1707		LIBL?=			${DESTDIR}/usr/lib/libl.a
1708		LIBLBER?=		${DESTDIR}/usr/lib/liblber.a
1709		LIBLDAP?=		${DESTDIR}/usr/lib/libldap.a
1710		LIBLDAP_R?=		${DESTDIR}/usr/lib/libldap_r.a
1711		LIBLUA?=		${DESTDIR}/usr/lib/liblua.a
1712		LIBM?=			${DESTDIR}/usr/lib/libm.a
1713		LIBMAGIC?=		${DESTDIR}/usr/lib/libmagic.a
1714		LIBMENU?=		${DESTDIR}/usr/lib/libmenu.a
1715		LIBNETPGPVERIFY?=	${DESTDIR}/usr/lib/libnetpgpverify.a
1716		LIBNS?=			${DESTDIR}/usr/lib/libns.a
1717		LIBOBJC?=		${DESTDIR}/usr/lib/libobjc.a
1718		LIBOSSAUDIO?=		${DESTDIR}/usr/lib/libossaudio.a
1719		LIBPAM?=		${DESTDIR}/usr/lib/libpam.a
1720		LIBPANEL?=		${DESTDIR}/usr/lib/libpanel.a
1721		LIBPCAP?=		${DESTDIR}/usr/lib/libpcap.a
1722		LIBPCI?=		${DESTDIR}/usr/lib/libpci.a
1723		LIBPOSIX?=		${DESTDIR}/usr/lib/libposix.a
1724		LIBPTHREAD?=		${DESTDIR}/usr/lib/libpthread.a
1725		LIBPUFFS?=		${DESTDIR}/usr/lib/libpuffs.a
1726		LIBQUOTA?=		${DESTDIR}/usr/lib/libquota.a
1727		LIBRADIUS?=		${DESTDIR}/usr/lib/libradius.a
1728		LIBREFUSE?=		${DESTDIR}/usr/lib/librefuse.a
1729		LIBRESOLV?=		${DESTDIR}/usr/lib/libresolv.a
1730		LIBRMT?=		${DESTDIR}/usr/lib/librmt.a
1731		LIBROKEN?=		${DESTDIR}/usr/lib/libroken.a
1732		LIBRPCSVC?=		${DESTDIR}/usr/lib/librpcsvc.a
1733		LIBRT?=			${DESTDIR}/usr/lib/librt.a
1734		LIBRUMP?=		${DESTDIR}/usr/lib/librump.a
1735		LIBRUMPFS_CD9660?=	${DESTDIR}/usr/lib/librumpfs_cd9660.a
1736		LIBRUMPFS_EFS?=		${DESTDIR}/usr/lib/librumpfs_efs.a
1737		LIBRUMPFS_EXT2FS?=	${DESTDIR}/usr/lib/librumpfs_ext2fs.a
1738		LIBRUMPFS_FFS?=		${DESTDIR}/usr/lib/librumpfs_ffs.a
1739		LIBRUMPFS_HFS?=		${DESTDIR}/usr/lib/librumpfs_hfs.a
1740		LIBRUMPFS_LFS?=		${DESTDIR}/usr/lib/librumpfs_lfs.a
1741		LIBRUMPFS_MSDOS?=	${DESTDIR}/usr/lib/librumpfs_msdos.a
1742		LIBRUMPFS_NFS?=		${DESTDIR}/usr/lib/librumpfs_nfs.a
1743		LIBRUMPFS_NTFS?=	${DESTDIR}/usr/lib/librumpfs_ntfs.a
1744		LIBRUMPFS_SYSPUFFS?=	${DESTDIR}/usr/lib/librumpfs_syspuffs.a
1745		LIBRUMPFS_TMPFS?=	${DESTDIR}/usr/lib/librumpfs_tmpfs.a
1746		LIBRUMPFS_UDF?=		${DESTDIR}/usr/lib/librumpfs_udf.a
1747		LIBRUMPUSER?=		${DESTDIR}/usr/lib/librumpuser.a
1748		LIBSASLC?=		${DESTDIR}/usr/lib/libsaslc.a
1749		LIBSKEY?=		${DESTDIR}/usr/lib/libskey.a
1750		LIBSL?=			${DESTDIR}/usr/lib/libsl.a
1751		LIBSQLITE3?=		${DESTDIR}/usr/lib/libsqlite3.a
1752		LIBSSH?=		${DESTDIR}/usr/lib/libssh.a
1753		LIBSSL?=		${DESTDIR}/usr/lib/libssl.a
1754		LIBSTDCXX?=		${DESTDIR}/usr/lib/libstdc++.a
1755		LIBSUPCXX?=		${DESTDIR}/usr/lib/libsupc++.a
1756		LIBTERMINFO?=		${DESTDIR}/usr/lib/libterminfo.a
1757		LIBTRE?=		${DESTDIR}/usr/lib/libtre.a
1758		LIBUNBOUND?=		${DESTDIR}/usr/lib/libunbound.a
1759		LIBUSBHID?=		${DESTDIR}/usr/lib/libusbhid.a
1760		LIBUTIL?=		${DESTDIR}/usr/lib/libutil.a
1761		LIBWIND?=		${DESTDIR}/usr/lib/libwind.a
1762		LIBWRAP?=		${DESTDIR}/usr/lib/libwrap.a
1763		LIBY?=			${DESTDIR}/usr/lib/liby.a
1764		LIBZ?=			${DESTDIR}/usr/lib/libz.a
1765
1766		The following c startup files.
1767
1768		LIBCRT0?=		${DESTDIR}/usr/lib/crt0.o
1769		LIBCRTI?=		${DESTDIR}/usr/lib/crti.o
1770		LIBCRTBEGIN?=		${DESTDIR}/usr/lib/crti.o
1771		LIBCRTEND?=		${DESTDIR}/usr/lib/crtn.o
1772
1773		The following X-Windows libraries are predefined for DPADD:
1774
1775		LIBDPS?=		${DESTDIR}/usr/X11R7/lib/libdps.a
1776		LIBFNTSTUBS?=		${DESTDIR}/usr/X11R7/lib/libfntstubs.a
1777		LIBFONTCACHE?=		${DESTDIR}/usr/X11R7/lib/libfontcache.a
1778		LIBFONTCONFIG?=		${DESTDIR}/usr/X11R7/lib/libfontconfig.a
1779		LIBFONTENC?=		${DESTDIR}/usr/X11R7/lib/libfontenc.a
1780		LIBFREETYPE?=		${DESTDIR}/usr/X11R7/lib/libfreetype.a
1781		LIBFS?=			${DESTDIR}/usr/X11R7/lib/libFS.a
1782		LIBGL?=			${DESTDIR}/usr/X11R7/lib/libGL.a
1783		LIBGLU?=		${DESTDIR}/usr/X11R7/lib/libGLU.a
1784		LIBICE?=		${DESTDIR}/usr/X11R7/lib/libICE.a
1785		LIBLBXUTIL?=		${DESTDIR}/usr/X11R7/lib/liblbxutil.a
1786		LIBSM?=			${DESTDIR}/usr/X11R7/lib/libSM.a
1787		LIBX11?=		${DESTDIR}/usr/X11R7/lib/libX11.a
1788		LIBX11_XCB?=		${DESTDIR}/usr/X11R7/lib/libX11-xcb.a
1789		LIBXAU?=		${DESTDIR}/usr/X11R7/lib/libXau.a
1790		LIBXAW?=		${DESTDIR}/usr/X11R7/lib/libXaw.a
1791		LIBXCB?=		${DESTDIR}/usr/X11R7/lib/libxcb.a
1792		LIBXDMCP?=		${DESTDIR}/usr/X11R7/lib/libXdmcp.a
1793		LIBXEXT?=		${DESTDIR}/usr/X11R7/lib/libXext.a
1794		LIBXFONT2?=		${DESTDIR}/usr/X11R7/lib/libXfont2.a
1795		LIBXFONT?=		${DESTDIR}/usr/X11R7/lib/libXfont.a
1796		LIBXFT?=		${DESTDIR}/usr/X11R7/lib/libXft.a
1797		LIBXI?=			${DESTDIR}/usr/X11R7/lib/libXi.a
1798		LIBXINERAMA?=		${DESTDIR}/usr/X11R7/lib/libXinerama.a
1799		LIBXKBFILE?=		${DESTDIR}/usr/X11R7/lib/libxkbfile.a
1800		LIBXMU?=		${DESTDIR}/usr/X11R7/lib/libXmu.a
1801		LIBXMUU?=		${DESTDIR}/usr/X11R7/lib/libXmuu.a
1802		LIBXPM?=		${DESTDIR}/usr/X11R7/lib/libXpm.a
1803		LIBXRANDR?=		${DESTDIR}/usr/X11R7/lib/libXrandr.a
1804		LIBXRENDER?=		${DESTDIR}/usr/X11R7/lib/libXrender.a
1805		LIBXSS?=		${DESTDIR}/usr/X11R7/lib/libXss.a
1806		LIBXT?=			${DESTDIR}/usr/X11R7/lib/libXt.a
1807		LIBXTRAP?=		${DESTDIR}/usr/X11R7/lib/libXTrap.a
1808		LIBXTST?=		${DESTDIR}/usr/X11R7/lib/libXtst.a
1809		LIBXV?=			${DESTDIR}/usr/X11R7/lib/libXv.a
1810		LIBXXF86DGA?=		${DESTDIR}/usr/X11R7/lib/libXxf86dga.a
1811		LIBXXF86MISC?=		${DESTDIR}/usr/X11R7/lib/libXxf86misc.a
1812		LIBXXF86VM?=		${DESTDIR}/usr/X11R7/lib/libXxf86vm.a
1813
1814SHAREDSTRINGS	If defined, a new .c.o rule is used that results in shared
1815		strings, using xstr(1). Note that this will not work with
1816		parallel makes.
1817
1818STRIPFLAG	The flag passed to the install program to cause the binary
1819		to be stripped.
1820
1821SUBDIR		A list of subdirectories that should be built as well.
1822		Each of the targets will execute the same target in the
1823		subdirectories.
1824
1825SCRIPTS		A list of interpreter scripts [file.{sh,csh,pl,awk,...}].
1826		These are installed exactly like programs.
1827
1828SCRIPTSDIR	The location to install the scripts.  Each script can be
1829		installed to a separate path by setting SCRIPTSDIR_<script>.
1830
1831SCRIPTSNAME	The name that the above program will be installed as, if
1832		different from ${SCRIPTS}. These can be further specialized
1833		by setting SCRIPTSNAME_<script>.
1834
1835FILES		See description of <bsd.files.mk>.
1836
1837SHLINKDIR	Target directory for shared linker.  See description of
1838		<bsd.own.mk> for additional information about this variable.
1839
1840The include file <bsd.prog.mk> includes the file named "../Makefile.inc"
1841if it exists, as well as the include file <bsd.man.mk>.
1842
1843Some simple examples:
1844
1845To build foo from foo.c with a manual page foo.1, use:
1846
1847	PROG=	foo
1848
1849	.include <bsd.prog.mk>
1850
1851To build foo from foo.c with a manual page foo.2, add the line:
1852
1853	MAN=	foo.2
1854
1855If foo does not have a manual page at all, add the line:
1856
1857	MKMAN=	no
1858
1859If foo has multiple source files, add the line:
1860
1861	SRCS=	a.c b.c c.c d.c
1862
1863
1864=-=-=-=-=   bsd.rpc.mk   =-=-=-=-=
1865
1866The include file <bsd.rpc.mk> contains a makefile fragment used to
1867construct source files built by rpcgen.
1868
1869The following macros may be defined in makefiles which include
1870<bsd.rpc.mk> in order to control which files get built and how they
1871are to be built:
1872
1873RPC_INCS:	construct .h file from .x file
1874RPC_XDRFILES:	construct _xdr.c from .x file
1875		(for marshalling/unmarshalling data types)
1876RPC_SVCFILES:	construct _svc.c from .x file
1877		(server-side stubs)
1878RPC_SVCFLAGS:	Additional flags passed to builds of RPC_SVCFILES.
1879
1880RPC_XDIR:	Directory containing .x/.h files
1881
1882
1883=-=-=-=-=   bsd.shlib.mk   =-=-=-=-=
1884
1885The include file <bsd.shlib.mk> computes parameters for shared library
1886installation and use.  It defines no targets.  <bsd.own.mk> MUST be
1887included before <bsd.shlib.mk>.
1888
1889<bsd.own.mk> sets the following variables, if they are not already defined
1890(defaults are in brackets):
1891
1892SHLIBINSTALLDIR	If ${USE_SHLIBDIR} is not "no", use ${SHLIBINSTALLDIR}
1893		instead of ${LIBDIR} as the base path for shared library
1894		installation.  [/lib]
1895
1896SHLIBDIR	The path to USE_SHLIBDIR shared libraries to use when building
1897		a program.  [/lib for programs in /bin and /sbin, /usr/lib
1898		for all others.]
1899
1900_LIBSODIR	Set to ${SHLIBINSTALLDIR} if ${USE_SHLIBDIR} is not "no",
1901		otherwise set to ${LIBDIR}
1902
1903SHLINKINSTALLDIR Base path for shared linker.  [/libexec]
1904
1905SHLINKDIR	Path to use for shared linker when building a program.
1906		[/libexec for programs in /bin and /sbin, /usr/libexec for
1907		all others.]
1908
1909
1910=-=-=-=-=   bsd.subdir.mk   =-=-=-=-=
1911
1912The include file <bsd.subdir.mk> contains the default targets for building
1913subdirectories.  It has the same eight targets as <bsd.prog.mk>: all,
1914clean, cleandir, depend, includes, install, lint, and tags.  It uses the
1915following variables:
1916
1917NOSUBDIR	If this variable is defined, then the SUBDIR variable
1918		will be ignored and subdirectories will not be processed.
1919
1920SUBDIR		For all of the directories listed in ${SUBDIR}, the
1921		specified directory will be visited and the target made.
1922
1923		As a special case, the use of a token .WAIT as an
1924		entry in SUBDIR acts as a synchronization barrier
1925		when multiple make jobs are run; subdirs before the
1926		.WAIT must complete before any subdirs after .WAIT are
1927		started.  See make(1) for some caveats on use of .WAIT
1928		and other special sources.
1929
1930
1931=-=-=-=-=   bsd.x11.mk   =-=-=-=-=
1932
1933The include file <bsd.x11.mk> contains parameters and targets for
1934cross-building X11 from ${X11SRCDIR.<package>}.  It should be included
1935after the general Makefile contents but before the include files such as
1936<bsd.prog.mk> and <bsd.lib.mk>.
1937
1938It provides the following targets:
1939	.man.1 .man.3 .man.4 .man.5 .man.7:
1940		If ${MAN} or ${PROG} is set and ${MKMAN} != "no",
1941		these rules convert from X11's manual page source
1942		into an mdoc.old source file.
1943
1944It sets the following variables:
1945
1946BINDIR			Set to ${X11BINDIR}.
1947			To override, define after including <bsd.x11.mk>
1948
1949LIBDIR			Set to ${X11USRLIBDIR}.
1950			To override, define after including <bsd.x11.mk>
1951
1952MANDIR			Set to ${X11MANDIR}.
1953			To override, define after including <bsd.x11.mk>
1954
1955CPPFLAGS		Appended with definitions to include from
1956			${DESTDIR}${X11INCDIR}
1957
1958LDFLAGS			Appended with definitions to link from
1959			${DESTDIR}${X11USRLIBDIR}
1960
1961X11FLAGS.CONNECTION	Equivalent to X11's CONNECTION_FLAGS.
1962
1963X11FLAGS.EXTENSION	Equivalent to X11's EXT_DEFINES.
1964
1965X11FLAGS.LOADABLE	Equivalent to X11's LOADABLE.
1966
1967X11FLAGS.OS_DEFINES	Equivalent to X11's OS_DEFINES.
1968
1969X11FLAGS.SERVER		Equivalent to X11's ServerDefines.
1970
1971X11FLAGS.THREADLIB	Equivalent to X11's THREADS_DEFINES for libraries.
1972
1973X11FLAGS.THREADS	Equivalent to X11's THREADS_DEFINES.
1974
1975X11FLAGS.VERSION	cpp(1) definitions of OSMAJORVERSION and OSMINORVERSION.
1976
1977X11FLAGS.DIX		Equivalent to X11's DIX_DEFINES.
1978
1979X11TOOL_UNXCOMM		Commandline to convert `XCOMM' comments to `#'
1980
1981It uses the following variables:
1982
1983APPDEFS			List of app-default files to install.
1984
1985CPPSCRIPTS		List of files/scripts to run through cpp(1)
1986			and then ${X11TOOL_UNXCOMM}.  The source files
1987			have a `.cpp' suffix, the generated files do not.
1988
1989CPPSCRIPTFLAGS		Additional flags to cpp(1) when building CPPSCRIPTS.
1990
1991CPPSCRIPTFLAGS_<fn>	Additional flags to cpp(1) when building CPPSCRIPT <fn>.
1992
1993
1994=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
1995
1996The following files are described here for completion, but they are not
1997supposed to be included directly from other Makefiles; they are used
1998internally by other system files.
1999
2000=-=-=-=-=   bsd.sys.mk   =-=-=-=-=
2001
2002The include file <bsd.sys.mk> is used by other system mk files and
2003it is not intended to be included standalone. It contains rules and
2004system build variables. It requires bsd.own.mk to be included first.
2005It contains overrides that are used when building the NetBSD source tree.
2006
2007The following variables control how various files are compiled/built.
2008(Note that these may be overridden in <bsd.own.mk> if USETOOLS == "yes"):
2009
2010AR		Create, modify, and extract from archives.  [ar]
2011
2012ARFLAGS		Options to ${AR}.  [rl]
2013
2014ARM_ELF2AOUT	Convert ELF-format executable to a.out.  [elf2aout]
2015
2016AS		Assembler.  [as]
2017
2018AFLAGS		Options to ${CC} when compiling or linking .s or .S
2019		assembly source files.  []
2020
2021BUILDSEED	GCC uses random numbers when compiling C++ code.
2022		If this option is present, seed the random number
2023		generator based on the value, source file names and
2024		the output file name to make builds more deterministic.
2025		Additional information is available in the GCC
2026		documentation of -frandom-seed.
2027
2028CC		C compiler.  [cc]
2029
2030CFLAGS		Options to ${CC}.  [Usually -O or -O2]
2031
2032CPP		C Pre-Processor.  [cpp]
2033
2034CPPFLAGS	Options to ${CPP}.  []
2035
2036CPUFLAGS	Optimization flags for ${CC}.  []
2037
2038CXX		C++ compiler.  [c++]
2039
2040CXXFLAGS	Options to ${CXX}.  [${CFLAGS}]
2041
2042M68K_ELF2AOUT	Convert ELF-format executable to a.out.  [elf2aout]
2043
2044MIPS_ELF2ECOFF	Convert ELF-format executable to ECOFF.  [elf2ecoff]
2045
2046FC		Fortran compiler.  [f77]
2047
2048FFLAGS		Options to {$FC}.  [-O]
2049
2050HOST_SH		Shell.	This must be an absolute path, because it may be
2051		substituted into "#!" lines in scripts.	 [/bin/sh]
2052
2053INSTALL		install(1) command.  [install]
2054
2055LEX		Lexical analyzer.  [lex]
2056
2057LFLAGS		Options to ${LEX}.  []
2058
2059LPREFIX		Symbol prefix for ${LEX} (see -P option in lex(1)) [yy]
2060
2061LD		Linker.  [ld]
2062
2063LDFLAGS		Options to ${CC} during the link process.  []
2064
2065LINT		C program verifier.  [lint]
2066
2067LINTFLAGS	Options to ${LINT}.  [-chapbrxzgFS]
2068
2069LORDER		List dependencies for object files.  [lorder]
2070
2071MAKE		make(1).  [make]
2072
2073MKDEP		Construct Makefile dependency list.  [mkdep]
2074
2075MKDEPCXX	Construct Makefile dependency list for C++ files.  [mkdep]
2076
2077NM		List symbols from object files.  [nm]
2078
2079PC		Pascal compiler.  [pc]  (Not present)
2080
2081PFLAGS		Options to ${PC}.  []
2082
2083OBJC		Objective C compiler.  [${CC}]
2084
2085OBJCFLAGS	Options to ${OBJC}.  [${CFLAGS}]
2086
2087OBJCOPY		Copy and translate object files.  [objcopy]
2088
2089OBJCOPYLIBFLAGS	Flags to pass to objcopy when library objects are
2090		being built. [${.TARGET} =~ "*.po" ? -X : -x]
2091
2092OBJDUMP		Display information from object files.  [objdump]
2093
2094RANLIB		Generate index to archive.  [ranlib]
2095
2096READELF		Display information from ELF object files.  [readelf]
2097
2098SIZE		List section sizes and total size.  [size]
2099
2100STRINGS		Display printable character sequences in files.  [strings]
2101
2102STRIP		Discard symbols from object files.  [strip]
2103
2104TSORT		Topological sort of a directed graph.  [tsort -q]
2105
2106YACC		LALR(1) parser generator.  [yacc]
2107
2108YFLAGS		Options to ${YACC}.  []
2109
2110YHEADER		If defined, add "-d" to YFLAGS, and add dependencies
2111		from <file>.y to <file>.h and <file>.c, and add
2112		<foo>.h to CLEANFILES.
2113
2114YPREFIX		If defined, add "-p ${YPREFIX}" to YFLAGS.
2115
2116
2117Other variables of note (incomplete list):
2118
2119NOGCCERROR	If defined, prevents passing certain ${CFLAGS} to GCC
2120		that cause warnings to be fatal, such as:
2121			-Werror -Wa,--fatal-warnings
2122		(The latter being for as(1).)
2123
2124NOCLANGERROR	If defined and clang is used as C compiler, -Werror is not
2125		passed to it.
2126
2127WARNS		Crank up compiler warning options; the distinct levels are:
2128			WARNS=1
2129			WARNS=2
2130			WARNS=3
2131			WARNS=4
2132			WARNS=5
2133			WARNS=6
2134
2135=-=-=-=-=   bsd.host.mk  =-=-=-=-=
2136
2137This file is automatically included from bsd.own.mk. It contains settings
2138for all the HOST_* variables that are used in host programs and libraries.
2139
2140HOST_AR			The host archive processing command
2141
2142HOST_CC			The host c compiler
2143
2144HOST_CFLAGS		The host c compiler flags
2145
2146HOST_COMPILE.c		The host c compiler line with flags
2147
2148HOST_COMPILE.cc		The host c++ compiler line with flags
2149
2150HOST_CPP		The host c pre-processor
2151
2152HOST_CPPFLAGS		The host c pre-processor flags
2153
2154HOST_CXX		The host c++ compiler
2155
2156HOST_CXXFLAGS		The host c++ compiler flags
2157
2158HOST_INSTALL_DIR	The host command to install a directory
2159
2160HOST_INSTALL_FILE	The host command to install a file
2161
2162HOST_INSTALL_SYMLINK	The host command to install a symlink
2163
2164HOST_LD			The host linker command
2165
2166HOST_LDFLAGS		The host linker flags
2167
2168HOST_LINK.c		The host c linker line with flags
2169
2170HOST_LINK.cc		The host c++ linker line with flags
2171
2172HOST_LN			The host command to link two files
2173
2174HOST_MKDEP		The host command to create dependencies for c programs
2175
2176HOST_MKDEPCXX		The host command to create dependencies for c++ programs
2177
2178HOST_OSTYPE		The host OSNAME-RELEASE-ARCH tupple
2179
2180HOST_RANLIB		The host command to create random access archives
2181
2182HOST_SH			The host Bourne shell interpreter name (absolute path)
2183
2184=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
2185