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