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