xref: /netbsd-src/share/mk/bsd.README (revision 962766853c385b86328bab806c19ccdf4e22f287)
1#	$NetBSD: bsd.README,v 1.248 2009/03/13 16:23:31 perry 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 ".so" 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 libatf-c, libatf-c++ libraries associated
117		with the Automated Testing Framework (ATF).
118		Default: yes
119
120MKBFD		If "no", don't build libbfd, libiberty, or any of the things
121		that depend on them (binutils/gas/ld, gdb, dbsym, mdsetimage).
122		Default: yes
123
124MKCATPAGES	If "no", don't build or install the catman pages.
125		Default: yes
126
127MKCOMPAT  	If "no", don't build or install the src/compat.
128		Default: yes on amd64/sparc64, no elsewhere.
129
130MKCOMPLEX	If "no", don't build libm support for <complex.h>
131		Default: yes
132
133MKCRYPTO	If "no", no cryptography support will be built into the system,
134		and also acts as "MKKERBEROS=no".
135		Default: yes
136
137MKCRYPTO_IDEA	If not "no", IDEA support will be built into libcrypto_idea.a.
138		Default: no
139
140MKCRYPTO_MDC2	If not "no", MDC2 support will be built into libcrypto_mdc2.a
141		Default: no
142
143MKCRYPTO_RC5	If not "no", RC5 support will be built into libcrypto_rc5.a.
144		Default: no
145
146MKCVS		If "no", don't build or install cvs(1).
147		Default: yes
148
149MKDEBUG		If "no", don't build and install separate debugging symbols
150		into /usr/libdata/debug.
151		Default: no
152
153MKDEBUGLIB	Build *_g.a debugging libraries, which are compiled
154		with -DDEBUG.
155		Default: no
156
157MKDOC		If "no", don't build or install the documentation.
158		Default: yes
159
160MKDYNAMICROOT	If "no", build programs in /bin and /sbin statically,
161		don't install certain libraries in /lib, and don't
162		install the shared linker into /libexec.
163		Default: yes
164
165MKGCC		If "no", don't build gcc(1) or any of the GCC-related
166		libraries (libgcc, libobjc, libstdc++).
167		Default: yes
168
169MKGCCCMDS	If "no", don't build gcc(1), but do build the GCC-related
170		libraries (libgcc, libobjc, libstdc++).
171		Default: yes
172
173MKGDB		If "no", don't build gdb(1).
174		Default: yes
175
176MKHESIOD	If "no", disables building of Hesiod infrastructure
177		(libraries and support programs).
178		Default: yes
179
180MKHOSTOBJ	If not "no", for programs intended to be run on the compile
181		host, the name, release, and architecture of the host
182		operating system will be suffixed to the name of the object
183		directory created by "make obj".
184		Default: no
185
186MKHTML		If "no", don't build or install the HTML man pages.
187		Default: yes
188
189MKIEEEFP	If "no", don't add code for IEEE754/IEC60559 conformance.
190		Has no effect on most platforms.
191		Default: yes
192
193MKSTRIPIDENT	Strip the RCS IDs from program binaries and shared libraries.
194		Default: no
195
196MKINET6		If "no", disables building of INET6 (IPv6) infrastructure
197		(libraries and support programs).
198		Default: yes
199
200MKINFO		If "no", don't build or install Info documentation from
201		Texinfo source files.
202		Default: yes
203
204MKIPFILTER	If "no", don't build or install the IP Filter programs and LKM.
205		Default: yes
206
207MKISCSI		If "no", don't build or install iSCSI library or applications
208		(depends on libpthread.)
209		Default: yes
210
211MKKERBEROS	If "no", disables building of Kerberos v5
212		infrastructure (libraries and support programs).
213		Default: yes
214
215MKLDAP		If "no", disables building of LDAP infrastructure
216		(libraries and support programs).
217		Default: yes
218
219MKLINKLIB	If "no", act as "MKLINT=no MKPICINSTALL=no MKPROFILE=no".
220		Also:
221			- don't install the .a libraries
222			- don't install _pic.a libraries on PIC systems
223			- don't build .a libraries on PIC systems
224			- don't install the .so symlink on ELF systems
225		I.e, only install the shared library (and the .so.major
226		symlink on ELF).
227		Default: yes
228
229MKLINT		If "no", don't build or install the lint libraries.
230		Default: yes
231
232MKLVM		If "no", don't build or install teh logical volume manager
233		and device mapper tools and libraries
234		Default: no
235
236MKMAN		If "no", don't build or install the man or catman pages,
237		and also acts as "MKCATPAGES=no MKHTML=no".
238		Default: yes
239
240MKMANZ		If not "no", compress manual pages at installation time.
241		Default: no
242
243MKNLS		If "no", don't build or install the NLS files and locale
244		definition files.
245		Default: yes
246
247MKOBJ		If "no", don't enable the rule which creates objdirs,
248		and also acts as "MKOBJDIRS=no".
249		Default: yes
250
251MKOBJDIRS	If "no", don't create objdirs during a "make build".
252		Default: no
253
254MKPAM		If "no", disables building of PAM authentication
255		infrastructure (libraries and support programs).
256		Default: yes
257
258MKPCC		If "no", don't build pcc(1) or any of the PCC-related
259		libraries (libpcc, libpccsoftfloat).
260		Default: no
261
262MKPCCCMDS	If "no", don't build pcc(1), but do build the PCC-related
263		libraries (libpcc, libpccsoftfloat).
264		Default: no
265
266MKPF		If "no", don't build or install the pf programs and LKM.
267		Default: yes
268
269MKPIC		If "no", don't build or install shared libraries, and
270		also acts as "MKPICLIB=no"
271		Default: yes (for MACHINE_ARCHs that support it)
272
273MKPICINSTALL	If "no", don't install the *_pic.a libraries.
274		Default: yes
275
276MKPICLIB	If "no", don't build *_pic.a libraries, and build the
277		shared object libraries from the .a libraries.
278		A symlink is installed in ${DESTDIR}/usr/lib for the
279		_pic.a library pointing to the .a library.
280		Default: yes
281
282MKPIE		If "no", create regular executables. Otherwise create
283		PIE (Position Independent Executables).
284		Default: no
285
286MKPOSTFIX	If "no", don't build or install postfix(1).
287		Default: yes
288
289MKPROFILE	If "no", don't build or install the profiling (*_p.a) libraries.
290		Default: yes
291
292MKSHARE		If "no", act as "MKCATPAGES=no MKDOC=no MKHTML=no MKINFO=no
293		MKMAN=no MKNLS=no".
294		I.e, don't build catman pages, documentation, Info
295		documentation, man pages, NLS files, ...
296		Default: yes
297
298MKSKEY		If "no", disables building of S/key authentication
299		infrastructure (libraries and support programs).
300		Default: yes
301
302MKSOFTFLOAT	If not "no", build with options to enable the compiler to
303		generate output containing library calls for floating
304		point and possibly soft-float library support.
305		Default: no
306
307MKSTATICLIB	If "no", don't build or install the normal static (*.a)
308		libraries.
309		Default: yes
310
311MKUNPRIVED	If not "no", don't set the owner/group/mode when installing
312		files or directories, and keep a metadata log of what
313		the owner/group/mode should be.  This allows a
314		non-root "make install".
315		Default: no
316
317MKUPDATE 	If not "no", 'make install' only installs targets that are
318		more recently modified in the source directories that their
319		installed counterparts.
320		Default: no
321
322MKX11		If not "no", depending on the value of ${X11FLAVOUR},
323		'make build' also descends into either src/x11 (XFree86) or
324		src/external/mit/xorg (modular Xorg) to cross-build X11 and
325		automatically enables creation of X sets.
326		Default: no
327
328MKYP		If "no", disables building of YP (NIS)
329		infrastructure (libraries and support programs).
330		Default: yes
331
332USE_HESIOD	If "no", disables building Hesiod support into
333		various system utilities/libraries that support it.
334		If ${MKHESIOD} is "no", USE_HESIOD will also be
335		forced to "no".
336
337USE_INET6	If "no", disables building INET6 (IPv6) support into
338		various system utilities/libraries that support it.
339		If ${MKINET6} is "no", USE_INET6 will also be
340		forced to "no".
341
342USE_JEMALLOC	If "no", disables building the "jemalloc" allocator
343		designed for improved performance with threaded
344		applications.  The "phkmalloc" allocator as used up
345		before NetBSD-5.0 will be substituted.
346
347USE_KERBEROS	If "no", disables building Kerberos v5
348		support into various system utilities/libraries that
349		support it.  If ${MKKERBEROS} is "no", USE_KERBEROS
350		will also be forced to "no".
351
352USE_LDAP	If "no", disables building LDAP support into various
353		system utilities/libraries that support it.
354		If ${MKLDAP} is "no", USE_LDAP will also be forced to "no".
355
356USE_PAM		If "no", disables building PAM authentication support
357		into various system utilities/libraries that support it.
358		If ${MKPAM} is "no", USE_PAM will also be forced to "no".
359
360USE_SKEY	If "no", disables building S/key authentication
361		support into various system utilities/libraries that
362		support it.  If ${MKSKEY} is "no", USE_SKEY will
363		also be forced to "no".
364		Default: no
365
366USE_SSP		If "no", disables GCC stack protection code, which
367		detects stack overflows and aborts the program. This
368		imposes some performance penalty.
369		Default: no
370
371USE_FORT 	If "yes" turns on substitute wrappers for commonly used
372		functions that do not do bounds checking regularly, but
373		they could in some cases by using the gcc
374		__builtin_object_size() function to determine the buffer
375		size where it is known and detect buffer overflows.
376		These substitute functions are in /usr/include/ssp.
377		Default: no
378
379USE_YP		If "no", disables building YP (NIS) support into
380		various system utilities/libraries that support it.
381		If ${MKYP} is "no", USE_YP will also be forced to "no".
382
383X11FLAVOUR	Set to "Xorg" or "XFree86", depending on whether to build
384		XFree86 or modular Xorg.  Only matters if MKX11!=no.
385		Default: "Xorg" on amd64, i386, macppc, shark and sparc64,
386		"XFree86" on everything else.
387
388COPTS.lib<lib>
389OBJCOPTS.lib<lib>
390LDADD.lib<lib>
391CPPFLAGS.lib<lib>
392CXXFLAGS.lib<lib>
393COPTS.<prog>
394OBJCCOPTS.<prog>
395LDADD.<prog>
396CPPFLAGS.<prog>
397CXXFLAGS.<prog>	These provide a way to specify additions to the associated
398		variables in a way that applies only to a particular library
399		or program.  <lib> corresponds to the LIB variable set in
400		the library's makefile.  <prog> corresponds to either PROG
401		or PROG_CXX (if set).  For example, if COPTS.libcrypto is
402		set to "-g", "-g" will be added to COPTS only when compiling
403		the crypto library.
404
405=-=-=-=-=   sys.mk   =-=-=-=-=
406
407The include file <sys.mk> has the default rules for all makes, in the BSD
408environment or otherwise.  You probably don't want to touch this file.
409
410=-=-=-=-=   bsd.own.mk   =-=-=-=-=
411
412The include file <bsd.own.mk> contains source tree configuration parameters,
413such as the owners, groups, etc. for both manual pages and binaries, and
414a few global "feature configuration" parameters.
415
416It has no targets.
417
418To get system-specific configuration parameters, <bsd.own.mk> will try to
419include the file specified by the "MAKECONF" variable.  If MAKECONF is not
420set, or no such file exists, the system make configuration file, /etc/mk.conf
421is included.  These files may define any of the variables described below.
422
423<bsd.own.mk> sets the following variables, if they are not already defined
424(defaults are in brackets):
425
426NETBSDSRCDIR	Top of the NetBSD source tree.
427		If _SRC_TOP_ != "", that will be used as the default,
428		otherwise BSDSRCDIR will be used as the default.
429		Various makefiles within the NetBSD source tree will
430		use this to reference the top level of the source tree.
431
432_SRC_TOP_	Top of the system source tree, as determined by <bsd.own.mk>
433		based on the presence of tools/ and build.sh.  This variable
434		is "internal" to <bsd.own.mk>, although its value is only
435		determined once and then propagated to all sub-makes.
436
437BSDSRCDIR	The real path to the system sources, so that 'make obj'
438		will work correctly.  [/usr/src]
439
440BSDOBJDIR	The real path to the system 'obj' tree, so that 'make obj'
441		will work correctly.  [/usr/obj]
442
443BINGRP		Binary group.  [wheel]
444
445BINOWN		Binary owner.  [root]
446
447BINMODE		Binary mode.  [555]
448
449NONBINMODE	Mode for non-executable files.  [444]
450
451MANDIR		Base path for manual installation.  [/usr/share/man/cat]
452
453MANGRP		Manual group.  [wheel]
454
455MANOWN		Manual owner.  [root]
456
457MANMODE		Manual mode.  [${NONBINMODE}]
458
459MANINSTALL	Manual installation type.  Space separated list:
460			catinstall, htmlinstall, maninstall
461		[catinstall maninstall htmlinstall]
462
463LDSTATIC	Control program linking; if set blank, link everything
464		dynamically.  If set to "-static", link everything statically.
465		If not set, programs link according to their makefile.
466
467LIBDIR		Base path for library installation.  [/usr/lib]
468
469LINTLIBDIR	Base path for lint(1) library installation.  [/usr/libdata/lint]
470
471LIBGRP		Library group.  [${BINGRP}]
472
473LIBOWN		Library owner.  [${BINOWN}]
474
475LIBMODE		Library mode.  [${NONBINMODE}]
476
477DOCDIR		Base path for system documentation (e.g. PSD, USD, etc.)
478	        installation.  [/usr/share/doc]
479
480HTMLDOCDIR	Base path for html system documentation installation.
481		[/usr/share/doc/html]
482
483DOCGRP		Documentation group.  [wheel]
484
485DOCOWN		Documentation owner.  [root]
486
487DOCMODE		Documentation mode.  [${NONBINMODE}]
488
489NLSDIR		Base path for Native Language Support files installation.
490		[/usr/share/nls]
491
492NLSGRP		Native Language Support files group.  [wheel]
493
494NLSOWN		Native Language Support files owner.  [root]
495
496NLSMODE		Native Language Support files mode.  [${NONBINMODE}]
497
498X11SRCDIR	The path to the xsrc tree.  [/usr/xsrc]
499
500X11SRCDIR.xc	The path to the (old) X11 xc src tree.  [${X11SRCDIR}/xfree/xc]
501
502X11SRCDIR.local	The path to the local X11 src tree.  [${X11SRCDIR}/local]
503
504X11SRCDIR.lib<package>
505X11SRCDIR.<package>
506		The path to the xorg src tree for the specificed package>.
507		[${X11SRCDIR}/external/mit/xorg/<package>/dist]
508
509X11ROOTDIR	Root directory of the X11 installation.  [/usr/X11R6 or
510		[/usr/X11R7]
511
512X11BINDIR	X11 bin directory.  [${X11ROOTDIR}/bin]
513
514X11FONTDIR	X11 font directory.  [${X11ROOTDIR}/lib/X11/fonts]
515
516X11INCDIR	X11 include directory.  [${X11ROOTDIR}/include]
517
518X11LIBDIR	X11 lib/x11 (config) directory.  [${X11ROOTDIR}/lib/X11]
519
520X11MANDIR	X11 manual directory.  [${X11ROOTDIR}/man]
521
522X11USRLIBDIR	X11 library directory.  [${X11ROOTDIR}/lib]
523
524STRIPFLAG	The flag passed to the install program to cause the binary
525		to be stripped.  This is to be used when building your
526		own install script so that the entire system can be made
527		stripped/not-stripped using a single knob.  []
528
529COPY		The flag passed to the install program to cause the binary
530		to be copied rather than moved.  This is to be used when
531		building our own install script so that the entire system
532		can either be installed with copies, or with moves using
533		a single knob.  [-c]
534
535MAKEDIRTARGET dir target [params]
536		Runs "cd $${dir} && ${MAKE} [params] $${target}",
537		displaying a "pretty" message whilst doing so.
538
539RELEASEMACHINEDIR
540		Subdirectory used below RELEASEDIR when building
541		a release.  [${MACHINE}]
542
543RELEASEMACHINE	Subdirectory or path component used for the following
544		paths:
545			distrib/${RELEASEMACHINE}
546			distrib/notes/${RELEASEMACHINE}
547			etc/etc.${RELEASEMACHINE}
548		Used when building a release.  [${MACHINE}]
549
550Additionally, the following variables may be set by <bsd.own.mk> or in a
551make configuration file to modify the behavior of the system build
552process (default values are in brackets along with comments, if set by
553<bsd.own.mk>):
554
555USETOOLS	Indicates whether the tools specified by ${TOOLDIR} should
556		be used as part of a build in progress.
557		Supported values:
558
559		yes	Use the tools from TOOLDIR.
560			Must be set to this if cross-compiling.
561
562		no	Do not use the tools from TOOLDIR, but refuse to
563			build native compilation tool components that are
564			version-specific for that tool.
565
566		never	Do not use the tools from TOOLDIR, even when
567			building native tool components.  This is similar to
568			the traditional NetBSD build method, but does not
569			verify that the compilation tools in use are
570			up-to-date enough in order to build the tree
571			successfully.  This may cause build or runtime
572			problems when building the whole NetBSD source tree.
573
574		Default: "yes" if building all or part of a whole NetBSD
575		source tree (detected automatically); "no" otherwise
576		(to preserve traditional semantics of the <bsd.*.mk>
577		make(1) include files).
578
579OBJECT_FMT	Object file format.  [set to "ELF" on architectures that
580		use ELF -- currently all architectures].
581
582TOOLCHAIN_MISSING
583		If not "no", this indicates that the platform being built
584		does not have a working in-tree toolchain.  If the
585		${MACHINE_ARCH} in question falls into this category,
586		TOOLCHAIN_MISSING is conditionally assigned the value "yes".
587		Otherwise, the variable is unconditionally assigned the
588		value "no".
589		If not "no", ${MKBFD}, ${MKGCC}, and ${MKGDB} are
590		unconditionally assigned the value "no".
591
592EXTERNAL_TOOLCHAIN
593		This variable is not directly set by <bsd.own.mk>, but
594		including <bsd.own.mk> is the canonical way to gain
595		access to this variable.  The variable should be defined
596		either in the user's environment or in the user's mk.conf
597		file.  If defined, this variable indicates the root of
598		an external toolchain which will be used to build the
599		tree.  For example, if a platform is a ${TOOLCHAIN_MISSING}
600		platform, EXTERNAL_TOOLCHAIN can be used to re-enable the
601		cross-compile framework.
602
603		If EXTERNAL_TOOLCHAIN is defined, ${MKGCC} is unconditionally
604		assigned the value "no", since the external version of the
605		compiler may not be able to build the library components of
606		the in-tree compiler.
607
608		NOTE: This variable is not yet used in as many places as
609		it should be.  Expect the exact semantics of this variable
610		to change in the short term as parts of the cross-compile
611		framework continue to be cleaned up.
612
613The following variables are defined to commands to perform the
614appropriate operation, with the default in [brackets].  Note that
615the defaults change if USETOOLS == "yes":
616
617TOOL_AMIGAAOUT2BB	aout to Amiga bootblock converter.  [amiga-aout2bb]
618
619TOOL_AMIGAELF2BB	ELF to Amiga bootblock converter.  [amiga-elf2bb]
620
621TOOL_AMIGATXLT		Amige assembly language format translator.  [amiga-txlt]
622
623TOOL_ASN1_COMPILE	ASN1 compiler.  [asn1_compile]
624
625TOOL_ATF_COMPILE	Generate POSIX shell test programs.  [atf-compile]
626
627TOOL_AWK		Pattern-directed scanning/processing language.  [awk]
628
629TOOL_CAP_MKDB		Create capability database.  [cap_mkdb]
630
631TOOL_CAT		Concatenate and print files.  [cat]
632
633TOOL_CKSUM		Display file checksums.  [cksum]
634
635TOOL_COMPILE_ET		Error table compiler.  [compile_et]
636
637TOOL_CONFIG		Build kernel compilation directories.  [config]
638
639TOOL_CRUNCHGEN		Generate crunched binary build environment.  [crunchgen]
640
641TOOL_CTAGS		Create a tags file.  [ctags]
642
643TOOL_DB			Manipulate db(3) databases.  [db]
644
645TOOL_DISKLABEL		Read and write disk pack label.  [disklabel]
646
647TOOL_EQN		Format equations for groff.  [eqn]
648
649TOOL_FDISK		MS-DOS partition maintenance program.  [fdisk]
650
651TOOL_FGEN		IEEE 1275 Open Firmware FCode Tokenizer.  [fgen]
652
653TOOL_GENASSYM		Generate constants for assembly files.  [genassym]
654
655TOOL_GENCAT		Generate NLS message catalogs.  [gencat]
656
657TOOL_GMAKE		GNU make utility.  [gmake]
658
659TOOL_GREP		Print lines matching a pattern.  [grep]
660
661TOOL_GROFF		Front end for groff document formatting system.  [groff]
662
663TOOL_HEXDUMP		Ascii, decimal, hexadecimal, octal dump.  [hexdump]
664
665TOOL_HP300MKBOOT	Make bootable image for hp300.  [hp300-mkboot]
666
667TOOL_HP700MKBOOT	Make bootable image for hp700.  [hp700-mkboot]
668
669TOOL_INDXBIB		Make bibliographic database's inverted index.  [indxbib]
670
671TOOL_INSTALLBOOT	Install disk bootstrap software.  [installboot]
672
673TOOL_INSTALL_INFO	Update info/dir entries.  [install-info]
674
675TOOL_JOIN		Relational database operator.  [join]
676
677TOOL_M4			M4 macro language processor.  [m4]
678
679TOOL_MACPPCFIXCOFF	Fix up xcoff headers for macppc.  [macppc-fixcoff]
680
681TOOL_MAKEFS		Create file system image from directory tree.  [makefs]
682
683TOOL_MAKEINFO		Translate Texinfo documents.  [makeinfo]
684
685TOOL_MAKEWHATIS		Create a whatis.db database.  [makewhatis]
686
687TOOL_MDSETIMAGE		Set kernel RAM disk image.  [mdsetimage]
688
689TOOL_MENUC		Menu compiler.  [menuc]
690
691TOOL_MIPSELF2ECOFF	Convert ELF-format executable to ECOFF for mips.
692			[mips-elf2ecoff]
693
694TOOL_MKCSMAPPER		Make charset mapping table.  [mkcsmapper]
695
696TOOL_MKESDB		Make encoding scheme database.  [mkesdb]
697
698TOOL_MKLOCALE		Make LC_CTYPE locale files.  [mklocale]
699
700TOOL_MKMAGIC		Create database for file(1).  [file]
701
702TOOL_MKTEMP		Make (unique) temporary file name.  [mktemp]
703
704TOOL_MSGC		Simple message list compiler.  [msgc]
705
706TOOL_MTREE		Map a directory hierarchy.  [mtree]
707
708TOOL_PAX		Manipulate file archives and copy directories.  [pax]
709
710TOOL_PIC		Compile pictures for groff.  [pic]
711
712TOOL_POWERPCMKBOOTIMAGE	Make bootable image for powerpc.  [powerpc-mkbootimage]
713
714TOOL_PWD_MKDB		Generate the password databases.  [pwd_mkdb]
715
716TOOL_REFER		Preprocess bibliographic references for groff.  [refer]
717
718TOOL_ROFF_ASCII		Generate ASCII groff output.  [nroff]
719
720TOOL_ROFF_DVI		Generate DVI groff output.  [${TOOL_GROFF} -Tdvi]
721
722TOOL_ROFF_HTML		Generate HTML groff output.
723			[${TOOL_GROFF} -Tlatin1 -mdoc2html]
724
725TOOL_ROFF_PS		Generate PS groff output.  [${TOOL_GROFF} -Tps]
726
727TOOL_ROFF_RAW		Generate "raw" groff output.  [${TOOL_GROFF} -Z]
728
729TOOL_RPCGEN		Remote Procedure Call (RPC) protocol compiler.  [rpcgen]
730
731TOOL_SED		Stream editor.  [sed]
732
733TOOL_SOELIM		Eliminate .so's from groff input.  [soelim]
734
735TOOL_SPARKCRC		Generate a crc suitable for use in a sparkive file.
736			[sparkcrc]
737
738TOOL_STAT		Display file status.  [stat]
739
740TOOL_STRFILE		Create a random access file for storing strings.
741			[strfile]
742
743TOOL_SUNLABEL		Read or modify a SunOS disk label.  [sunlabel]
744
745TOOL_TBL		Format tables for groff.  [tbl]
746
747TOOL_UUDECODE		Uudecode a binary file.  [uudecode]
748
749TOOL_VGRIND		Grind nice listings of programs.  [vgrind -f]
750
751TOOL_ZIC		Time zone compiler.  [zic]
752
753<bsd.own.mk> is generally useful when building your own Makefiles so that
754they use the same default owners etc. as the rest of the tree.
755
756
757=-=-=-=-=   bsd.dep.mk   =-=-=-=-=
758
759The include file <bsd.dep.mk> contains the default targets for building
760.depend files.  It creates .d files from entries in SRCS and DPSRCS
761that are C, C++, or Objective C source files, and builds .depend from the
762.d files.  All other files in SRCS and all of DPSRCS will be used as
763dependencies for the .d files.  In order for this to function correctly,
764it should be .included after all other .mk files and directives that may
765modify SRCS or DPSRCS.  It uses the following variables:
766
767SRCS		List of source files to build the program.
768
769DPSRCS		List of source files which are needed for generating
770		dependencies, but are not needed in ${SRCS}.
771
772
773=-=-=-=-=   bsd.files.mk   =-=-=-=-=
774
775The include file <bsd.files.mk> handles the FILES variables and is included
776from <bsd.lib.mk> and <bsd.prog.mk>, and uses the following variables:
777
778FILES		The list of files to install.
779
780CONFIGFILES	Similar semantics to FILES, except that the files
781		are installed by the `configinstall' target,
782		not the `install' target.
783		The FILES* variables documented below also apply.
784
785FILESOWN	File owner.  [${BINOWN}]
786
787FILESGRP	File group.  [${BINGRP}]
788
789FILESMODE	File mode.  [${NONBINMODE}]
790
791FILESDIR	The location to install the files.
792
793FILESNAME	Optional name to install each file as.
794
795FILESOWN_<fn>	File owner of the specific file <fn>.
796
797FILESGRP_<fn>	File group of the specific file <fn>.
798
799FILESMODE_<fn>	File mode of the specific file <fn>.
800
801FILESDIR_<fn>	The location to install the specific file <fn>.
802
803FILESNAME_<fn>	Optional name to install <fn> as.
804
805FILESBUILD_<fn>	A value different from "no" will add the file to the list of
806		targets to be built by `realall'.  Users of that variable
807		should provide a target to build the file.
808
809
810BUILDSYMLINKS	List of two word items:
811			lnsrc lntgt
812		For each lnsrc item, create a symlink named lntgt.
813		The lntgt symlinks are removed by the cleandir target.
814
815UUDECODE_FILES	List of files which are stored as <file>.uue in the source
816		tree. Each one will be decoded with ${TOOL_UUDECODE}.
817		The source files have a `.uue' suffix, the generated files do
818		not.
819
820UUDECODE_FILES_RENAME_<fn>
821		Rename the output from the decode to the provided name.
822
823		*NOTE: These files are simply decoded, with no install or other
824		       rule applying implicitly except being added to the clean
825		       target.
826
827=-=-=-=-=   bsd.gcc.mk   =-=-=-=-=
828
829The include file <bsd.gcc.mk> computes various parameters related to GCC
830support libraries.  It defines no targets.  <bsd.own.mk> MUST be included
831before <bsd.gcc.mk>.
832
833The primary users of <bsd.gcc.mk> are <bsd.prog.mk> and <bsd.lib.mk>, each
834of which need to know where to find certain GCC support libraries.
835
836The behavior of <bsd.gcc.mk> is influenced by the EXTERNAL_TOOLCHAIN variable,
837which is generally set by the user.  If EXTERNAL_TOOLCHAIN it set, then
838the compiler is asked where to find the support libraries, otherwise the
839support libraries are found in ${DESTDIR}/usr/lib.
840
841<bsd.gcc.mk> sets the following variables:
842
843_GCC_CRTBEGIN	The full path name to crtbegin.o.
844
845_GCC_CRTBEGINS	The full path name to crtbeginS.o.
846
847_GCC_CRTEND	The full path name to crtend.o.
848
849_GCC_CRTENDS	The full path name to crtendS.o.
850
851_GCC_LIBGCCDIR	The directory where libgcc.a is located.
852
853
854=-=-=-=-=   bsd.inc.mk   =-=-=-=-=
855
856The include file <bsd.inc.mk> defines the includes target and uses the
857variables:
858
859INCS		The list of include files.
860
861INCSDIR		The location to install the include files.
862
863INCSNAME	Target name of the include file, if only one; same as
864		FILESNAME, but for include files.
865
866INCSYMLINKS	Similar to SYMLINKS in <bsd.links.mk>, except that these
867		are installed in the 'includes' target and not the
868		(much later) 'install' target.
869
870INCSNAME_<file>	The name file <file> should be installed as, if not <file>,
871		same as FILESNAME_<file>, but for include files.
872
873
874=-=-=-=-=   bsd.info.mk   =-=-=-=-=
875
876The include file <bsd.info.mk> is used to generate and install GNU Info
877documentation from respective Texinfo source files.  It defines three
878implicit targets (.txi.info, .texi.info, and .texinfo.info), and uses the
879following variables:
880
881TEXINFO		List of Texinfo source files.  Info documentation will
882		consist of single files with the extension replaced by
883		.info.
884
885INFOFLAGS	Flags to pass to makeinfo.  []
886
887
888=-=-=-=-=   bsd.kernobj.mk   =-=-=-=-=
889
890The include file <bsd.kernobj.mk> defines variables related to the
891location of kernel sources and object directories.
892
893KERNSRCDIR	Is the location of the top of the kernel src.
894		[${_SRC_TOP_}/sys]
895
896KERNARCHDIR	Is the location of the machine dependent kernel sources.
897		[arch/${MACHINE}]
898
899KERNCONFDIR	Is where the configuration files for kernels are found.
900		[${KERNSRCDIR}/${KERNARCHDIR}/conf]
901
902KERNOBJDIR	Is the kernel build directory.  The kernel GENERIC for
903		instance will be compiled in ${KERNOBJDIR}/GENERIC.
904		The default value is
905		${MAKEOBJDIRPREFIX}${KERNSRCDIR}/${KERNARCHDIR}/compile
906		if it exists or the target 'obj' is being made.
907		Otherwise the default is
908		${KERNSRCDIR}/${KERNARCHDIR}/compile.
909
910It is important that Makefiles (such as those under src/distrib) that
911wish to find compiled kernels use <bsd.kernobj.mk> and ${KERNOBJDIR}
912rather than make assumptions about the location of the compiled kernel.
913
914
915=-=-=-=-=   bsd.kinc.mk   =-=-=-=-=
916
917The include file <bsd.kinc.mk> defines the many targets (includes,
918subdirectories, etc.), and is used by kernel makefiles to handle
919include file installation.  It is intended to be included alone, by
920kernel Makefiles.  It uses similar variables to <bsd.inc.mk>.
921Please see <bsd.kinc.mk> for more details, and keep the documentation
922in that file up to date.
923
924
925=-=-=-=-=   bsd.lib.mk   =-=-=-=-=
926
927The include file <bsd.lib.mk> has support for building libraries.  It has
928the same eight targets as <bsd.prog.mk>: all, clean, cleandir, depend,
929includes, install, lint, and tags.  Additionally, it has a checkver target
930which checks for installed shared object libraries whose version is greater
931that the version of the source. It has a limited number of suffixes,
932consistent with the current needs of the BSD tree.  <bsd.lib.mk> includes
933<bsd.shlib.mk> to get shared library parameters.
934
935It sets/uses the following variables:
936
937LIB		The name of the library to build.
938
939LIBDIR		Target directory for libraries.
940
941MKARZERO	Normally, ar(1) sets the timestamps, uid, gid and
942		permissions in files inside its archives to those of
943		the file it was fed. This leads to non-reproduceable
944		builds. If MKARZERO is set to "yes" (default is "no")
945		then the "D" flag is passed to ar, causing the
946		timestamp, uid and gid to be zeroed and the file
947		permissions to be set to 644. This allows .a files
948		from different builds to be bit identical.
949
950SHLIBINSTALLDIR	Target directory for shared libraries if ${USE_SHLIBDIR}
951		is not "no".
952
953USE_SHLIBDIR	If not "no", use ${SHLIBINSTALLDIR} instead of ${LIBDIR}
954		as the path to install shared libraries to.
955		USE_SHLIBDIR must be defined before <bsd.own.mk> is included.
956		Default: no
957
958LIBISMODULE	If not "no", install as ${LIB}.so (without the "lib" prefix),
959		and act as "MKDEBUGLIB=no MKLINT=no MKPICINSTALL=no
960		MKPROFILE=no MKSTATICLIB=no".
961		Default: no
962
963LIBISPRIVATE	If not "no", act as "MKDEBUGLIB=no MKLINT=no MKPIC=no
964		MKPROFILE=no", and don't install the (.a) library.
965		This is useful for "build only" helper libraries.
966		Default: no
967
968LIBISCXX	If not "no", Use ${CXX} instead of ${CC} to link
969		shared libraries.
970		This is useful for C++ libraries.
971		Default: no
972
973LINTLIBDIR	Target directory for lint libraries.
974
975LIBGRP		Library group.
976
977LIBOWN		Library owner.
978
979LIBMODE		Library mode.
980
981LDADD		Additional loader objects.
982
983MAN		The manual pages to be installed (use a .1 - .9 suffix).
984
985NOCHECKVER_<library>
986NOCHECKVER	If set, disables checking for installed shared object
987		libraries with versions greater than the source.  A
988		particular library name, without the "lib" prefix, may
989		be appended to the variable name to disable the check for
990		only that library.
991
992SRCS		List of source files to build the library.  Suffix types
993		.s, .c, and .f are supported.  Note, .s files are preferred
994		to .c files of the same name.  (This is not the default for
995		versions of make.)
996
997LIBDPLIBS	A list of the tuples:
998			libname  path-to-srcdir-of-libname
999
1000		For each tuple;
1001		     *	LIBDO.libname contains the .OBJDIR of the library
1002			`libname', and if it is not set it is determined
1003			from the srcdir and added to MAKEOVERRIDES (the
1004			latter is to allow for build time optimization).
1005		     *	LDADD gets  -L${LIBDO.libname} -llibname    added.
1006		     *	DPADD gets  ${LIBDO.libname}/liblibname.so  or
1007				    ${LIBDO.libname}/liblibname.a   added.
1008
1009		This variable may be used for individual libraries, as
1010		well as in parent directories to cache common libraries
1011		as a build-time optimization.
1012
1013The include file <bsd.lib.mk> includes the file named "../Makefile.inc"
1014if it exists, as well as the include file <bsd.man.mk>.
1015
1016It has rules for building profiled objects; profiled libraries are
1017built by default.
1018
1019Libraries are ranlib'd when made.
1020
1021
1022=-=-=-=-=   bsd.links.mk   =-=-=-=-=
1023
1024The include file <bsd.links.mk> handles the LINKS and SYMLINKS variables
1025and is included from from <bsd.lib.mk> and <bsd.prog.mk>.
1026
1027LINKS		The list of hard links, consisting of pairs of paths:
1028			source-file target-file
1029		${DESTDIR} is prepended to both paths before linking.
1030		For example, to link /bin/test and /bin/[, use:
1031			LINKS=/bin/test /bin/[
1032
1033CONFIGLINKS	Similar semantics to LINKS, except that the links
1034		are installed by the `configinstall' target,
1035		not the `install' target.
1036
1037SYMLINKS	The list of symbolic links, consisting of pairs of paths:
1038			source-file target-file
1039		${DESTDIR} is only prepended to target-file before linking.
1040		For example, to symlink /usr/bin/tar to /bin/tar resulting
1041		in ${DESTDIR}/usr/bin/tar -> /bin/tar:
1042			SYMLINKS=/bin/tar /usr/bin/tar
1043
1044CONFIGSYMLINKS	Similar semantics to SYMLINKS, except that the symbolic links
1045		are installed by the `configinstall' target,
1046		not the `install' target.
1047
1048
1049=-=-=-=-=   bsd.man.mk   =-=-=-=-=
1050
1051The include file <bsd.man.mk> handles installing manual pages and their
1052links.
1053
1054It has a three targets:
1055
1056	catinstall:
1057		Install the preformatted manual pages and their links.
1058	htmlinstall:
1059		Install the HTML manual pages and their links.
1060	maninstall:
1061		Install the manual page sources and their links.
1062
1063It sets/uses the following variables:
1064
1065MANDIR		Base path for manual installation.
1066
1067MANGRP		Manual group.
1068
1069MANOWN		Manual owner.
1070
1071MANMODE		Manual mode.
1072
1073MANSUBDIR	Subdirectory under the manual page section, i.e. "/vax"
1074		or "/tahoe" for machine specific manual pages.
1075
1076MAN		The manual pages to be installed (use a .1 - .9 suffix).
1077
1078MLINKS		List of manual page links (using a .1 - .9 suffix).  The
1079		linked-to file must come first, the linked file second,
1080		and there may be multiple pairs.  The files are soft-linked.
1081
1082The include file <bsd.man.mk> includes a file named "../Makefile.inc" if
1083it exists.
1084
1085
1086=-=-=-=-=   bsd.obj.mk   =-=-=-=-=
1087
1088The include file <bsd.obj.mk> defines targets related to the creation
1089and use of separated object and source directories.
1090
1091If an environment variable named MAKEOBJDIRPREFIX is set, make(1) uses
1092${MAKEOBJDIRPREFIX}${.CURDIR} as the name of the object directory if
1093it exists.  Otherwise make(1) looks for the existence of a
1094subdirectory (or a symlink to a directory) of the source directory
1095into which built targets should be placed.  If an environment variable
1096named MAKEOBJDIR is set, make(1) uses its value as the name of the
1097object directory; failing that, make first looks for a subdirectory
1098named "obj.${MACHINE}", and if that doesn't exist, it looks for "obj".
1099
1100Object directories are not created automatically by make(1) if they
1101don't exist; you need to run a separate "make obj".  (This will happen
1102during a top-level build if "MKOBJDIRS" is set to a value other than
1103"no").  When the source directory is a subdirectory of ${BSDSRCDIR} --
1104and this is determined by a simple string prefix comparison -- object
1105directories are created in a separate object directory tree, and a
1106symlink to the object directory in that tree is created in the source
1107directory; otherwise, "make obj" assumes that you're not in the main
1108source tree and that it's not safe to use a separate object tree.
1109
1110Several variables used by <bsd.obj.mk> control exactly what
1111directories and links get created during a "make obj":
1112
1113MAKEOBJDIR	If set, this is the component name of the object
1114		directory.
1115
1116OBJMACHINE	If this is set but MAKEOBJDIR is not set, creates
1117		object directories or links named "obj.${MACHINE}";
1118		otherwise, just creates ones named "obj".
1119
1120USR_OBJMACHINE  If set, and the current directory is a subdirectory of
1121		${BSDSRCDIR}, create object directory in the
1122		corresponding subdirectory of ${BSDOBJDIR}.${MACHINE};
1123		otherwise, create it in the corresponding subdirectory
1124		of ${BSDOBJDIR}
1125
1126BUILDID		If set, the contents of this variable are appended
1127		to the object directory name.  If OBJMACHINE is also
1128		set, ".${BUILDID}" is added after ".${MACHINE}".
1129
1130
1131=-=-=-=-=   bsd.prog.mk   =-=-=-=-=
1132
1133The include file <bsd.prog.mk> handles building programs from one or
1134more source files, along with their manual pages.  It has a limited number
1135of suffixes, consistent with the current needs of the BSD tree.
1136<bsd.prog.mk> includes <bsd.shlib.mk> to get shared library parameters.
1137
1138It has eight targets:
1139
1140	all:
1141		build the program and its manual page.  This also
1142		creates a GDB initialization file (.gdbinit) in
1143		the objdir.  The .gdbinit file sets the shared library
1144		prefix to ${DESTDIR} to facilitate cross-debugging.
1145	clean:
1146		remove the program, any object files and the files a.out,
1147		Errs, errs, mklog, and ${PROG}.core.
1148	cleandir:
1149		remove all of the files removed by the target clean, as
1150		well as .depend, tags, and any manual pages.
1151		`distclean' is a synonym for `cleandir'.
1152	depend:
1153		make the dependencies for the source files, and store
1154		them in the file .depend.
1155	includes:
1156		install any header files.
1157	install:
1158		install the program and its manual pages; if the Makefile
1159		does not itself define the target install, the targets
1160		beforeinstall and afterinstall may also be used to cause
1161		actions immediately before and after the install target
1162		is executed.
1163	lint:
1164		run lint on the source files
1165	tags:
1166		create a tags file for the source files.
1167
1168It sets/uses the following variables:
1169
1170BINGRP		Binary group.
1171
1172BINOWN		Binary owner.
1173
1174BINMODE		Binary mode.
1175
1176CLEANFILES	Additional files to remove for the clean and cleandir targets.
1177
1178COPTS		Additional flags to the compiler when creating C objects.
1179
1180COPTS.<fn>	Additional flags to the compiler when creating the
1181		C objects for <fn>.
1182		For <fn>.[ly], "<fn>.c" must be used.
1183
1184CPUFLAGS	Additional flags to the compiler/assembler to select
1185		CPU instruction set options, CPU tuning options, etc.
1186
1187CPUFLAGS.<fn>	Additional flags to the compiler/assembler for <fn>.
1188		For <fn>.[ly], "<fn>.c" must be used.
1189
1190CPPFLAGS	Additional flags to the C pre-processor.
1191
1192CPPFLAGS.<fn>	Additional flags to the C pre-processor for <fn>.
1193		For <fn>.[ly], "<fn>.c" must be used.
1194
1195GDBINIT		List of GDB initialization files to add to "source"
1196		directives in the .gdbinit file that is created in the
1197		objdir.
1198
1199LDADD		Additional loader objects.  Usually used for libraries.
1200		For example, to load with the compatibility and utility
1201		libraries, use:
1202
1203			LDADD+=-lutil -lcompat
1204
1205LDFLAGS		Additional linker flags (passed to ${CC} during link).
1206
1207LINKS		See <bsd.links.mk>
1208
1209OBJCOPTS	Additional flags to the compiler when creating ObjC objects.
1210
1211OBJCOPTS.<fn>	Additional flags to the compiler when creating the
1212		ObjC objects for <fn>.
1213		For <fn>.[ly], "<fn>.c" must be used.
1214
1215SYMLINKS	See <bsd.links.mk>
1216
1217MAN		Manual pages (should end in .1 - .9).  If no MAN variable is
1218		defined, "MAN=${PROG}.1" is assumed.
1219
1220PAXCTL_FLAGS	If defined, run paxctl(1) on the program binary after link
1221		time, with the value of this variable as args to paxctl(1).
1222
1223PAXCTL_FLAGS.${PROG} Custom override for PAXCTL_FLAGS.
1224
1225PROG		The name of the program to build.  If not supplied, nothing
1226		is built.
1227
1228PROG_CXX	If defined, the name of the program to build.  Also
1229		causes <bsd.prog.mk> to link the program with the C++
1230		compiler rather than the C compiler.  PROG_CXX overrides
1231		the value of PROG if PROG is also set.
1232
1233PROGNAME	The name that the above program will be installed as, if
1234		different from ${PROG}.
1235
1236SRCS		List of source files to build the program.  If SRCS is not
1237		defined, it's assumed to be ${PROG}.c.
1238
1239DPSRCS		List of source files which are needed for generating
1240		dependencies, but are not needed in ${SRCS}.
1241
1242DPADD		Additional dependencies for the program.  Usually used for
1243		libraries.  For example, to depend on the compatibility and
1244		utility libraries use:
1245
1246			DPADD+=${LIBCOMPAT} ${LIBUTIL}
1247
1248		The following libraries are predefined for DPADD:
1249
1250		LIBCRT0?=	${DESTDIR}/usr/lib/crt0.o
1251		LIBARCHIVE?=	${DESTDIR}/usr/lib/libarchive.a
1252		LIBASN1?=	${DESTDIR}/usr/lib/libasn1.a
1253		LIBBLUETOOTH?=	${DESTDIR}/usr/lib/libbluetooth.a
1254		LIBBSDMALLOC?=	${DESTDIR}/usr/lib/libbsdmalloc.a
1255		LIBBZ2?=	${DESTDIR}/usr/lib/libbz2.a
1256		LIBC?=		${DESTDIR}/usr/lib/libc.a
1257		LIBC_PIC?=	${DESTDIR}/usr/lib/libc_pic.a
1258		LIBCOM_ERR?=	${DESTDIR}/usr/lib/libcom_err.a
1259		LIBCOMPAT?=	${DESTDIR}/usr/lib/libcompat.a
1260		LIBCRYPT?=	${DESTDIR}/usr/lib/libcrypt.a
1261		LIBCRYPTO?=	${DESTDIR}/usr/lib/libcrypto.a
1262		LIBCRYPTO_IDEA?=${DESTDIR}/usr/lib/libcrypto_idea.a
1263		LIBCRYPTO_MDC2?=${DESTDIR}/usr/lib/libcrypto_mdc2.a
1264		LIBCRYPTO_RC5?=	${DESTDIR}/usr/lib/libcrypto_rc5.a
1265		LIBCURSES?=	${DESTDIR}/usr/lib/libcurses.a
1266		LIBDBM?=	${DESTDIR}/usr/lib/libdbm.a
1267		LIBDES?=	${DESTDIR}/usr/lib/libdes.a
1268		LIBEDIT?=	${DESTDIR}/usr/lib/libedit.a
1269		LIBEVENT?=	${DESTDIR}/usr/lib/libevent.a
1270		LIBFETCH?=	${DESTDIR}/usr/lib/libfetch.a
1271		LIBFORM?=	${DESTDIR}/usr/lib/libform.a
1272		LIBGCC?=	${DESTDIR}/usr/lib/libgcc.a
1273		LIBGNUMALLOC?=	${DESTDIR}/usr/lib/libgnumalloc.a
1274		LIBGSSAPI?=	${DESTDIR}/usr/lib/libgssapi.a
1275		LIBHDB?=	${DESTDIR}/usr/lib/libhdb.a
1276		LIBINTL?=	${DESTDIR}/usr/lib/libintl.a
1277		LIBIPSEC?=	${DESTDIR}/usr/lib/libipsec.a
1278		LIBKADM5CLNT?=	${DESTDIR}/usr/lib/libkadm5clnt.a
1279		LIBKADM5SRV?=	${DESTDIR}/usr/lib/libkadm5srv.a
1280		LIBKAFS?=	${DESTDIR}/usr/lib/libkafs.a
1281		LIBKRB5?=	${DESTDIR}/usr/lib/libkrb5.a
1282		LIBKVM?=	${DESTDIR}/usr/lib/libkvm.a
1283		LIBL?=		${DESTDIR}/usr/lib/libl.a
1284		LIBLBER?=	${DESTDIR}/usr/lib/liblber.a
1285		LIBLDAP?=	${DESTDIR}/usr/lib/libldap.a
1286		LIBLDAP_R?=	${DESTDIR}/usr/lib/libldap_r.a
1287		LIBM?=		${DESTDIR}/usr/lib/libm.a
1288		LIBMENU?=	${DESTDIR}/usr/lib/libmenu.a
1289		LIBOBJC?=	${DESTDIR}/usr/lib/libobjc.a
1290		LIBOSSAUDIO?=	${DESTDIR}/usr/lib/libossaudio.a
1291		LIBPAM?=	${DESTDIR}/usr/lib/libpam.a
1292		LIBPCAP?=	${DESTDIR}/usr/lib/libpcap.a
1293		LIBPCI?=	${DESTDIR}/usr/lib/libpci.a
1294		LIBPMC?=	${DESTDIR}/usr/lib/libpmc.a
1295		LIBPOSIX?=	${DESTDIR}/usr/lib/libposix.a
1296		LIBPTHREAD?=	${DESTDIR}/usr/lib/libpthread.a
1297		LIBPTHREAD_DBG?=${DESTDIR}/usr/lib/libpthread_dbg.a
1298		LIBRADIUS?=	${DESTDIR}/usr/lib/libradius.a
1299		LIBRESOLV?=	${DESTDIR}/usr/lib/libresolv.a
1300		LIBRMT?=	${DESTDIR}/usr/lib/librmt.a
1301		LIBROKEN?=	${DESTDIR}/usr/lib/libroken.a
1302		LIBRPCSVC?=	${DESTDIR}/usr/lib/librpcsvc.a
1303		LIBRT?=		${DESTDIR}/usr/lib/librt.a
1304		LIBSDP?=	${DESTDIR}/usr/lib/libsdp.a
1305		LIBSKEY?=	${DESTDIR}/usr/lib/libskey.a
1306		LIBSL?=		${DESTDIR}/usr/lib/libsl.a
1307		LIBSS?=		${DESTDIR}/usr/lib/libss.a
1308		LIBSSH?=	${DESTDIR}/usr/lib/libssh.a
1309		LIBSSL?=	${DESTDIR}/usr/lib/libssl.a
1310		LIBSSP?=	${DESTDIR}/usr/lib/libssp.a
1311		LIBSTDCXX?=	${DESTDIR}/usr/lib/libstdc++.a
1312		LIBSUPCXX?=	${DESTDIR}/usr/lib/libsupc++.a
1313		LIBTERMCAP?=	${DESTDIR}/usr/lib/libtermcap.a
1314		LIBUSBHID?=	${DESTDIR}/usr/lib/libusbhid.a
1315		LIBUTIL?=	${DESTDIR}/usr/lib/libutil.a
1316		LIBWRAP?=	${DESTDIR}/usr/lib/libwrap.a
1317		LIBY?=		${DESTDIR}/usr/lib/liby.a
1318		LIBZ?=		${DESTDIR}/usr/lib/libz.a
1319
1320SHAREDSTRINGS	If defined, a new .c.o rule is used that results in shared
1321		strings, using xstr(1). Note that this will not work with
1322		parallel makes.
1323
1324STRIPFLAG	The flag passed to the install program to cause the binary
1325		to be stripped.
1326
1327SUBDIR		A list of subdirectories that should be built as well.
1328		Each of the targets will execute the same target in the
1329		subdirectories.
1330
1331SCRIPTS		A list of interpreter scripts [file.{sh,csh,pl,awk,...}].
1332		These are installed exactly like programs.
1333
1334SCRIPTSDIR	The location to install the scripts.  Each script can be
1335		installed to a separate path by setting SCRIPTSDIR_<script>.
1336
1337SCRIPTSNAME	The name that the above program will be installed as, if
1338		different from ${SCRIPTS}. These can be further specialized
1339		by setting SCRIPTSNAME_<script>.
1340
1341FILES		See description of <bsd.files.mk>.
1342
1343SHLINKDIR	Target directory for shared linker.  See description of
1344		<bsd.own.mk> for additional information about this variable.
1345
1346The include file <bsd.prog.mk> includes the file named "../Makefile.inc"
1347if it exists, as well as the include file <bsd.man.mk>.
1348
1349Some simple examples:
1350
1351To build foo from foo.c with a manual page foo.1, use:
1352
1353	PROG=	foo
1354
1355	.include <bsd.prog.mk>
1356
1357To build foo from foo.c with a manual page foo.2, add the line:
1358
1359	MAN=	foo.2
1360
1361If foo does not have a manual page at all, add the line:
1362
1363	MKMAN=	no
1364
1365If foo has multiple source files, add the line:
1366
1367	SRCS=	a.c b.c c.c d.c
1368
1369
1370=-=-=-=-=   bsd.rpc.mk   =-=-=-=-=
1371
1372The include file <bsd.rpc.mk> contains a makefile fragment used to
1373construct source files built by rpcgen.
1374
1375The following macros may be defined in makefiles which include
1376<bsd.rpc.mk> in order to control which files get built and how they
1377are to be built:
1378
1379RPC_INCS:	construct .h file from .x file
1380RPC_XDRFILES:	construct _xdr.c from .x file
1381		(for marshalling/unmarshalling data types)
1382RPC_SVCFILES:	construct _svc.c from .x file
1383		(server-side stubs)
1384RPC_SVCFLAGS:	Additional flags passed to builds of RPC_SVCFILES.
1385
1386RPC_XDIR:	Directory containing .x/.h files
1387
1388
1389=-=-=-=-=   bsd.shlib.mk   =-=-=-=-=
1390
1391The include file <bsd.shlib.mk> computes parameters for shared library
1392installation and use.  It defines no targets.  <bsd.own.mk> MUST be
1393included before <bsd.shlib.mk>.
1394
1395<bsd.own.mk> sets the following variables, if they are not already defined
1396(defaults are in brackets):
1397
1398SHLIBINSTALLDIR	If ${USE_SHLIBDIR} is not "no", use ${SHLIBINSTALLDIR}
1399		instead of ${LIBDIR} as the base path for shared library
1400		installation.  [/lib]
1401
1402SHLIBDIR	The path to USE_SHLIBDIR shared libraries to use when building
1403		a program.  [/lib for programs in /bin and /sbin, /usr/lib
1404		for all others.]
1405
1406_LIBSODIR	Set to ${SHLIBINSTALLDIR} if ${USE_SHLIBDIR} is not "no",
1407		otherwise set to ${LIBDIR}
1408
1409SHLINKINSTALLDIR Base path for shared linker.  [/libexec]
1410
1411SHLINKDIR	Path to use for shared linker when building a program.
1412		[/libexec for programs in /bin and /sbin, /usr/libexec for
1413		all others.]
1414
1415
1416=-=-=-=-=   bsd.subdir.mk   =-=-=-=-=
1417
1418The include file <bsd.subdir.mk> contains the default targets for building
1419subdirectories.  It has the same eight targets as <bsd.prog.mk>: all,
1420clean, cleandir, depend, includes, install, lint, and tags.  It uses the
1421following variables:
1422
1423NOSUBDIR	If this variable is defined, then the SUBDIR variable
1424		will be ignored and subdirectories will not be processed.
1425
1426SUBDIR		For all of the directories listed in ${SUBDIR}, the
1427		specified directory will be visited and the target made.
1428		There is also a default target which allows the command
1429		"make subdir" where subdir is any directory listed in
1430		${SUBDIR}.
1431
1432		As a special case, the use of a token .WAIT as an
1433		entry in SUBDIR acts as a synchronization barrier
1434		when multiple make jobs are run; subdirs before the
1435		.WAIT must complete before any subdirs after .WAIT are
1436		started.  See make(1) for some caveats on use of .WAIT
1437		and other special sources.
1438
1439
1440=-=-=-=-=   bsd.sys.mk   =-=-=-=-=
1441
1442The include file <bsd.sys.mk> is used by <bsd.prog.mk> and
1443<bsd.lib.mk>.  It contains overrides that are used when building
1444the NetBSD source tree.
1445
1446The following variables control how various files are compiled/built.
1447(Note that these may be overridden in <bsd.own.mk> if USETOOLS == "yes"):
1448
1449AR		Create, modify, and extract from archives.  [ar]
1450
1451ARFLAGS		Options to ${AR}.  [rl]
1452
1453AS		Assembler.  [as]
1454
1455AFLAGS		Options to ${CC} when compiling or linking .s or .S
1456		assembly source files.  []
1457
1458BUILDSEED	GCC uses random numbers when compiling C++ code.
1459		If this option is present, seed the random number
1460		generator based on the value, source file names and
1461		the output file name to make builds more deterministic.
1462		Additional information is available in the GCC
1463		documentation of -frandom-seed.
1464
1465CC		C compiler.  [cc]
1466
1467CFLAGS		Options to ${CC}.  [Usually -O or -O2]
1468
1469CPP		C Pre-Processor.  [cpp]
1470
1471CPPFLAGS	Options to ${CPP}.  []
1472
1473CPUFLAGS	Optimization flags for ${CC}.  []
1474
1475CXX		C++ compiler.  [c++]
1476
1477CXXFLAGS	Options to ${CXX}.  [${CFLAGS}]
1478
1479ELF2ECOFF	Convert ELF-format executable to ECOFF.  [elf2ecoff]
1480
1481FC		Fortran compiler.  [f77]
1482
1483FFLAGS		Options to {$FC}.  [-O]
1484
1485HOST_SH		Shell.	This must be an absolute path, because it may be
1486		substituted into "#!" lines in scripts.	 [/bin/sh]
1487
1488INSTALL		install(1) command.  [install]
1489
1490LEX		Lexical analyzer.  [lex]
1491
1492LFLAGS		Options to ${LEX}.  []
1493
1494LPREFIX		Symbol prefix for ${LEX} (see -P option in lex(1)) [yy]
1495
1496LD		Linker.  [ld]
1497
1498LDFLAGS		Options to ${CC} during the link process.  []
1499
1500LINT		C program verifier.  [lint]
1501
1502LINTFLAGS	Options to ${LINT}.  [-chapbxzFS]
1503
1504LORDER		List dependencies for object files.  [lorder]
1505
1506MAKE		make(1).  [make]
1507
1508MKDEP		Construct Makefile dependency list.  [mkdep]
1509
1510NM		List symbols from object files.  [nm]
1511
1512PC		Pascal compiler.  [pc]  (Not present)
1513
1514PFLAGS		Options to ${PC}.  []
1515
1516OBJC		Objective C compiler.  [${CC}]
1517
1518OBJCFLAGS	Options to ${OBJC}.  [${CFLAGS}]
1519
1520OBJCOPY		Copy and translate object files.  [objcopy]
1521
1522OBJDUMP		Display information from object files.  [objdump]
1523
1524RANLIB		Generate index to archive.  [ranlib]
1525
1526SIZE		List section sizes and total size.  [size]
1527
1528STRIP		Discard symbols from object files.  [strip]
1529
1530TSORT		Topological sort of a directed graph.  [tsort -q]
1531
1532YACC		LALR(1) parser generator.  [yacc]
1533
1534YFLAGS		Options to ${YACC}.  []
1535
1536YHEADER		If defined, add "-d" to YFLAGS, and add dependencies
1537		from <file>.y to <file>.h and <file>.c, and add
1538		<foo>.h to CLEANFILES.
1539
1540YPREFIX		If defined, add "-p ${YPREFIX}" to YFLAGS.
1541
1542
1543Other variables of note (incomplete list):
1544
1545NOGCCERROR	If defined, prevents passing certain ${CFLAGS} to GCC
1546		that cause warnings to be fatal, such as:
1547			-Werror -Wa,--fatal-warnings
1548		(The latter being for as(1).)
1549
1550WARNS		Crank up GCC warning options; the distinct levels are:
1551			WARNS=1
1552			WARNS=2
1553			WARNS=3
1554			WARNS=4
1555
1556=-=-=-=-=   bsd.x11.mk   =-=-=-=-=
1557
1558The include file <bsd.x11.mk> contains parameters and targets for
1559cross-building X11 from ${X11SRCDIR.xc} / ${X11MITSRCDIR.*}.
1560It should be included after the general Makefile contents but before
1561the include files such as <bsd.prog.mk> and <bsd.lib.mk>.
1562
1563It provides the following targets:
1564	.man.1 .man.3 .man.4 .man.5 .man.7:
1565		If ${MAN} or ${PROG} is set and ${MKMAN} != "no",
1566		these rules convert from X11's manual page source
1567		into an mdoc.old source file.
1568	cleanx11man:
1569		Clean up the mdoc.old files generated by the above.
1570
1571It sets the following variables:
1572
1573BINDIR			Set to ${X11BINDIR}.
1574			To override, define after including <bsd.x11.mk>
1575
1576LIBDIR			Set to ${X11USRLIBDIR}.
1577			To override, define after including <bsd.x11.mk>
1578
1579MANDIR			Set to ${X11MANDIR}.
1580			To override, define after including <bsd.x11.mk>
1581
1582CPPFLAGS		Appended with definitions to include from
1583			${DESTDIR}${X11INCDIR}
1584
1585LDFLAGS			Appended with definitions to link from
1586			${DESTDIR}${X11USRLIBDIR}
1587
1588X11FLAGS.CONNECTION	Equivalent to X11's CONNECTION_FLAGS.
1589
1590X11FLAGS.EXTENSION	Equivalent to X11's EXT_DEFINES.
1591
1592X11FLAGS.LOADABLE	Equivalent to X11's LOADABLE.
1593
1594X11FLAGS.OS_DEFINES	Equivalent to X11's OS_DEFINES.
1595
1596X11FLAGS.SERVER		Equivalent to X11's ServerDefines.
1597
1598X11FLAGS.THREADLIB	Equivalent to X11's THREADS_DEFINES for libraries.
1599
1600X11FLAGS.THREADS	Equivalent to X11's THREADS_DEFINES.
1601
1602X11FLAGS.VERSION	cpp(1) definitions of OSMAJORVERSION and OSMINORVERSION.
1603
1604X11FLAGS.DIX		Equivalent to X11's DIX_DEFINES.
1605
1606X11TOOL_UNXCOMM		Commandline to convert `XCOMM' comments to `#'
1607
1608It uses the following variables:
1609
1610APPDEFS			List of app-default files to install.
1611
1612CPPSCRIPTS		List of files/scripts to run through cpp(1)
1613			and then ${X11TOOL_UNXCOMM}.  The source files
1614			have a `.cpp' suffix, the generated files do not.
1615
1616CPPSCRIPTFLAGS		Additional flags to cpp(1) when building CPPSCRIPTS.
1617
1618CPPSCRIPTFLAGS_<fn>	Additional flags to cpp(1) when building CPPSCRIPT <fn>.
1619
1620
1621=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
1622