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