bsd.README revision 1.87
1#	$NetBSD: bsd.README,v 1.87 2002/01/01 00:34:26 thorpej Exp $
2#	@(#)bsd.README	8.2 (Berkeley) 4/2/94
3
4This is the README file for the new make "include" files for the BSD
5source tree.  The files are installed in /usr/share/mk, and are, by
6convention, 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
61The following variables that control how things are made/installed that
62are not set by default. These should not be set by Makefiles; they're for
63the user to define in MAKECONF (see bsd.own.mk, below) or on the make(1)
64command line:
65
66BUILD 		If defined, 'make install' checks that the targets in the
67		source directories are up-to-date and remakes them if they
68                are out of date, instead of blindly trying to install
69                out of date or non-existent targets.
70
71UPDATE 		If defined, 'make install' only installs targets that are
72		more recently modified in the source directories that their
73		installed counterparts.
74
75UNPRIVED	If defined, don't set the owner/group/mode when installing
76		files or directories, and keep a metadata log of what
77		the owner/group/mode should be.  This allows a
78		non-root "make install".
79
80MKBFD		If "no", don't build libbfd, libiberty, or any of
81		the things that depend on them (binutils/gas/ld,
82		gdb, dbsym, mdsetimage).  Only meaningful if
83		USE_NEW_TOOLCHAIN is set.
84
85MKCATPAGES	If "no", don't build or install the catman pages.
86
87MKDOC		If "no", don't build or install the documentation.
88
89MKGDB		If "no", don't build gdb.  Only meaningful if
90		USE_NEW_TOOLCHAIN is set.
91
92MKGCC		If "no", don't build gcc or any of the gcc-related
93		libraries (libg2c, libgcc, libobjc, libstdc++).
94		Only meaningful if USE_NEW_TOOLCHAIN is set.
95
96MKINFO		If "no", don't build or install Info documentation from
97		Texinfo source files.
98
99MKLINT		If "no", don't build or install the lint libraries.
100
101MKMAN		If "no", don't build or install the man or catman pages.
102		Also acts as "MKCATPAGES=no"
103
104MKNLS		If "no", don't build or install the NLS files and locale
105		definition files.
106
107MKOBJ		If "no", don't enable the rule which creates objdirs.
108		"yes" by default.
109
110MKOBJDIRS	If "no", don't create objdirs during a "make build".
111		"no" by default.
112
113MKPIC		If "no", don't build or install shared libraries.
114
115MKPICINSTALL	If "no", don't install the *_pic.a libraries.
116
117MKPROFILE	If "no", don't build or install the profiling libraries.
118
119MKSHARE		If "no", act as "MKCATPAGES=no MKDOC=no MKINFO=no MKMAN=no
120		MKNLS=no".  I.e, don't build catman pages, documentation,
121		Info documentation, man pages, NLS files, ...
122
123=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
124
125The include file <sys.mk> has the default rules for all makes, in the BSD
126environment or otherwise.  You probably don't want to touch this file.
127If you intend to run a cross build, you will need to supply the following
128host tools, and configure the following variables properly:
129
130OBJCOPY		objcopy - copy and translate object files
131
132STRIP		strip - Discard symbols from object files
133
134CONFIG		config - build kernel compilation directories
135
136RPCGEN		rpcgen - Remote Procedure Call (RPC) protocol compiler
137
138MKLOCALE	mklocale - make LC_CTYPE locale files
139
140MTREE		mtree - build directory tree from a spec file
141
142=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
143
144The include file <bsd.man.mk> handles installing manual pages and their
145links.
146
147It has a two targets:
148
149	maninstall:
150		Install the manual page sources and their links.
151	catinstall:
152		Install the preformatted manual pages and their links.
153
154It sets/uses the following variables:
155
156MANDIR		Base path for manual installation.
157
158MANGRP		Manual group.
159
160MANOWN		Manual owner.
161
162MANMODE		Manual mode.
163
164MANSUBDIR	Subdirectory under the manual page section, i.e. "/vax"
165		or "/tahoe" for machine specific manual pages.
166
167MAN		The manual pages to be installed (use a .1 - .9 suffix).
168
169MLINKS		List of manual page links (using a .1 - .9 suffix).  The
170		linked-to file must come first, the linked file second,
171		and there may be multiple pairs.  The files are soft-linked.
172
173The include file <bsd.man.mk> includes a file named "../Makefile.inc" if
174it exists.
175
176=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
177
178The include file <bsd.own.mk> contains source tree configuration parameters,
179such as the owners, groups, etc. for both manual pages and binaries, and
180a few global "feature configuration" parameters.
181
182It has no targets.
183
184To get system-specific configuration parameters, bsd.own.mk will try to
185include the file specified by the "MAKECONF" variable.  If MAKECONF is not
186set, or no such file exists, the system make configuration file, /etc/mk.conf
187is included.  These files may define any of the variables described below.
188
189bsd.own.mk sets the following variables, if they are not already defined
190(defaults are in brackets):
191
192BSDSRCDIR	The real path to the system sources, so that 'make obj'
193		will work correctly. [/usr/src]
194
195BSDOBJDIR	The real path to the system 'obj' tree, so that 'make obj'
196		will work correctly. [/usr/obj]
197
198BINGRP		Binary group. [wheel]
199
200BINOWN		Binary owner. [root]
201
202BINMODE		Binary mode. [555]
203
204NONBINMODE	Mode for non-executable files. [444]
205
206MANDIR		Base path for manual installation. [/usr/share/man/cat]
207
208MANGRP		Manual group. [wheel]
209
210MANOWN		Manual owner. [root]
211
212MANMODE		Manual mode. [${NONBINMODE}]
213
214MANINSTALL	Manual installation type: maninstall, catinstall, or both
215
216LDSTATIC	Control program linking; if set blank, link everything
217		dynamically. If set to "-static", link everything statically.
218		If not set, programs link according to their makefile.
219
220LIBDIR		Base path for library installation. [/usr/lib]
221
222SHLIBDIR	If ${USE_SHLIBDIR} is "yes", use ${SHLIBDIR} instead of
223		${LIBDIR} as the base path for shared library installation.
224		[/usr/lib]
225
226_LIBSODIR	Set to ${SHLIBDIR} if ${USE_SHLIBDIR} is "yes",
227		otherwise set to ${LIBDIR}
228
229SHLINKDIR	Base path for shared linker. [/usr/libexec]
230
231LINTLIBDIR	Base path for lint(1) library installation. [/usr/libdata/lint]
232
233LIBGRP		Library group. [${BINGRP}]
234
235LIBOWN		Library owner. [${BINOWN}]
236
237LIBMODE		Library mode. [${NONBINMODE}]
238
239DOCDIR		Base path for system documentation (e.g. PSD, USD, etc.)
240	        installation. [/usr/share/doc]
241
242HTMLDOCDIR	Base path for html system documentation installation.
243		[/usr/share/doc/html]
244
245DOCGRP		Documentation group. [wheel]
246
247DOCOWN		Documentation owner. [root]
248
249DOCMODE		Documentation mode. [${NONBINMODE}]
250
251NLSDIR		Base path for Native Language Support files installation.
252		[/usr/share/nls]
253
254NLSGRP		Native Language Support files group. [wheel]
255
256NLSOWN		Native Language Support files owner. [root]
257
258NLSMODE		Native Language Support files mode. [${NONBINMODE}]
259
260STRIPFLAG	The flag passed to the install program to cause the binary
261		to be stripped.  This is to be used when building your
262		own install script so that the entire system can be made
263		stripped/not-stripped using a single knob. [-s]
264
265COPY		The flag passed to the install program to cause the binary
266		to be copied rather than moved.  This is to be used when
267		building our own install script so that the entire system
268		can either be installed with copies, or with moves using
269		a single knob. [-c]
270
271Additionally, the following variables may be set by bsd.own.mk or in a
272make configuration file to modify the behaviour of the system build
273process (default values are in brackets along with comments, if set by
274bsd.own.mk):
275
276MKCRYPTO	If set to "no", no cryptography support will be built
277		into the system.  Defaults to "yes".
278
279NOCRYPTO	If set, it is equivalent to setting MKCRYPTO to "no".
280
281MKCRYPTO_IDEA	If set to "yes", IDEA support will be built into
282		libcrypto_idea.a.  Defaults to "no".
283
284MKCRYPTO_RC5	If set to "yes", RC5 support will be built into
285		libcrypto_rc5.a.  Defaults to "no".
286
287MKKERBEROS	If set to "no", disables building Kerberos (v4 or v5)
288		support into various system utilities that support it.
289		Defaults to "yes".  NOTE: This does not affect the
290		building of the Kerberos libraries or infrastructure
291		programs themselves.  To completely disable Kerberos,
292		set MKCRYPTO to "no".
293
294NOKERBEROS	If set, it is equivalent to setting MKKERBEROS to "no".
295
296SKEY		Compile in support for S/key authentication. [yes, set
297		unconditionally]
298
299MANZ		Compress manual pages at installation time.
300
301SYS_INCLUDE	Copy or symlink kernel include files into /usr/include.
302		Possible values are "symlinks" or "copies" (which is
303		the same as the variable being unset).
304
305NOPROFILE	Do not build profiled versions of system libraries
306
307NOPIC		Do not build PIC versions of system libraries, and
308		do not build shared libraries.  [set if ${MACHINE_ARCH}
309		is "sh3" and ${OBJECT_FMT} is "COFF", unset otherwise.]
310
311NOLINT		Do not build lint libraries.
312
313OBJECT_FMT	Object file format. [set to "ELF" on architectures that
314		use ELF -- currently if ${MACHINE_ARCH} is "alpha",
315		"mipsel", "mipseb", "powerpc", "sparc", "sparc64",
316		"i386" and some m68k machines, or set to "a.out" on
317		other architectures].
318
319MKSOFTFLOAT	If "yes", build with options to enable the compiler to
320		generate output containing library calls for floating
321		point and possibly soft-float library support.  Defaults
322		to "no".
323
324bsd.own.mk is generally useful when building your own Makefiles so that
325they use the same default owners etc. as the rest of the tree.
326
327=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
328
329The include file <bsd.prog.mk> handles building programs from one or
330more source files, along with their manual pages.  It has a limited number
331of suffixes, consistent with the current needs of the BSD tree.
332
333It has eight targets:
334
335	all:
336		build the program and its manual page
337	clean:
338		remove the program, any object files and the files a.out,
339		Errs, errs, mklog, and ${PROG}.core.
340	cleandir:
341		remove all of the files removed by the target clean, as
342		well as .depend, tags, and any manual pages.
343		`distclean' is a synonym for `cleandir'.
344	depend:
345		make the dependencies for the source files, and store
346		them in the file .depend.
347	includes:
348		install any header files.
349	install:
350		install the program and its manual pages; if the Makefile
351		does not itself define the target install, the targets
352		beforeinstall and afterinstall may also be used to cause
353		actions immediately before and after the install target
354		is executed.
355	lint:
356		run lint on the source files
357	tags:
358		create a tags file for the source files.
359
360It sets/uses the following variables:
361
362BINGRP		Binary group.
363
364BINOWN		Binary owner.
365
366BINMODE		Binary mode.
367
368CLEANFILES	Additional files to remove for the clean and cleandir targets.
369
370COPTS		Additional flags to the compiler when creating C objects.
371
372CPPFLAGS	Additional flags to the C pre-processor
373
374LDADD		Additional loader objects.  Usually used for libraries.
375		For example, to load with the compatibility and utility
376		libraries, use:
377
378			LDADD+=-lutil -lcompat
379
380LDFLAGS		Additional loader flags.
381
382LINKS		The list of binary links; should be full pathnames, the
383		linked-to file coming first, followed by the linked
384		file.  The files are hard-linked.  For example, to link
385		/bin/test and /bin/[, use:
386
387			LINKS=	${DESTDIR}/bin/test ${DESTDIR}/bin/[
388
389SYMLINKS	The list of symbolic links; should be full pathnames.
390                Syntax is identical to LINKS. Note that DESTDIR is not
391		automatically included in the link.
392
393MAN		Manual pages (should end in .1 - .9).  If no MAN variable is
394		defined, "MAN=${PROG}.1" is assumed.
395
396PROG		The name of the program to build.  If not supplied, nothing
397		is built.
398
399PROG_CXX	If defined, causes <bsd.prog.mk> to link the program with
400		the C++ compiler rather than the C compiler.
401
402PROGNAME	The name that the above program will be installed as, if
403		different from ${PROG}.
404
405SRCS		List of source files to build the program.  If SRCS is not
406		defined, it's assumed to be ${PROG}.c.
407
408DPADD		Additional dependencies for the program.  Usually used for
409		libraries.  For example, to depend on the compatibility and
410		utility libraries use:
411
412			DPADD+=${LIBCOMPAT} ${LIBUTIL}
413
414		The following libraries are predefined for DPADD:
415
416		LIBCRT0?=	${DESTDIR}/usr/lib/crt0.o
417		LIBC?=		${DESTDIR}/usr/lib/libc.a
418		LIBC_PIC?=	${DESTDIR}/usr/lib/libc_pic.a
419		LIBCOMPAT?=	${DESTDIR}/usr/lib/libcompat.a
420		LIBCRYPT?=	${DESTDIR}/usr/lib/libcrypt.a
421		LIBCURSES?=	${DESTDIR}/usr/lib/libcurses.a
422		LIBDBM?=	${DESTDIR}/usr/lib/libdbm.a
423		LIBDES?=	${DESTDIR}/usr/lib/libdes.a
424		LIBEDIT?=	${DESTDIR}/usr/lib/libedit.a
425		LIBFORM?=	${DESTDIR}/usr/lib/libform.a
426		LIBGCC?=	${DESTDIR}/usr/lib/libgcc.a
427		LIBGNUMALLOC?=	${DESTDIR}/usr/lib/libgnumalloc.a
428		LIBINTL?=	${DESTDIR}/usr/lib/libintl.a
429		LIBIPSEC?=	${DESTDIR}/usr/lib/libipsec.a
430		LIBKDB?=	${DESTDIR}/usr/lib/libkdb.a
431		LIBKRB?=	${DESTDIR}/usr/lib/libkrb.a
432		LIBKVM?=	${DESTDIR}/usr/lib/libkvm.a
433		LIBL?=		${DESTDIR}/usr/lib/libl.a
434		LIBM?=		${DESTDIR}/usr/lib/libm.a
435		LIBMENU?=	${DESTDIR}/usr/lib/libmenu.a
436		LIBMP?=		${DESTDIR}/usr/lib/libmp.a
437		LIBNTP?=	${DESTDIR}/usr/lib/libntp.a
438		LIBPC?=		${DESTDIR}/usr/lib/libpc.a
439		LIBPCAP?=	${DESTDIR}/usr/lib/libpcap.a
440		LIBPLOT?=	${DESTDIR}/usr/lib/libplot.a
441		LIBPOSIX?=	${DESTDIR}/usr/lib/libposix.a
442		LIBRESOLV?=	${DESTDIR}/usr/lib/libresolv.a
443		LIBRPCSVC?=	${DESTDIR}/usr/lib/librpcsvc.a
444		LIBSKEY?=	${DESTDIR}/usr/lib/libskey.a
445		LIBTERMCAP?=	${DESTDIR}/usr/lib/libtermcap.a
446		LIBTELNET?=	${DESTDIR}/usr/lib/libtelnet.a
447		LIBUTIL?=	${DESTDIR}/usr/lib/libutil.a
448		LIBWRAP?=	${DESTDIR}/usr/lib/libwrap.a
449		LIBY?=		${DESTDIR}/usr/lib/liby.a
450		LIBZ?=		${DESTDIR}/usr/lib/libz.a
451
452HAVE_GCC3	If defined and PROG_CXX is defined by the program's
453		Makefile, causes <bsd.prog.mk> to pull in additional
454		C++ support libraries required for programs compiled
455		with GNU C++ 3.x.  This is intended as a temporary
456		measure to ease the transition to GCC 3.x.
457
458SHAREDSTRINGS	If defined, a new .c.o rule is used that results in shared
459		strings, using xstr(1). Note that this will not work with
460		parallel makes.
461
462STRIPFLAG	The flag passed to the install program to cause the binary
463		to be stripped.
464
465SUBDIR		A list of subdirectories that should be built as well.
466		Each of the targets will execute the same target in the
467		subdirectories.
468
469SCRIPTS		A list of interpreter scripts [file.{sh,csh,pl,awk,...}].
470		These are installed exactly like programs.
471
472SCRIPTSNAME	The name that the above program will be installed as, if
473		different from ${SCRIPTS}. These can be further specialized
474		by setting SCRIPTSNAME_<script>.
475
476FILES		A list of files to install. The installation is controlled
477		by the FILESNAME, FILESOWN, FILESGRP, FILESMODE, FILESDIR
478		variables that can be further specialized by FILES<VAR>_<file>
479
480SHLINKDIR	Target directory for shared linker.
481
482The include file <bsd.prog.mk> includes the file named "../Makefile.inc"
483if it exists, as well as the include file <bsd.man.mk>.
484
485Some simple examples:
486
487To build foo from foo.c with a manual page foo.1, use:
488
489	PROG=	foo
490
491	.include <bsd.prog.mk>
492
493To build foo from foo.c with a manual page foo.2, add the line:
494
495	MAN=	foo.2
496
497If foo does not have a manual page at all, add the line:
498
499	MKMAN=	no
500
501If foo has multiple source files, add the line:
502
503	SRCS=	a.c b.c c.c d.c
504
505=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
506
507The include file <bsd.subdir.mk> contains the default targets for building
508subdirectories.  It has the same eight targets as <bsd.prog.mk>: all, 
509clean, cleandir, depend, includes, install, lint, and tags.  For all of
510the directories listed in the variable SUBDIR, the specified directory 
511will be visited and the target made.  There is also a default target which
512allows the command "make subdir" where subdir is any directory listed in
513the variable SUBDIR.
514
515As a special case, the use of a token .WAIT as an entry in SUBDIR acts
516as a synchronization barrier when multiple make jobs are run; subdirs
517before the .WAIT must complete before any subdirs after .WAIT are
518started.  See make(1) for some caveats on use of .WAIT and other
519special sources.
520
521=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
522
523The include file <bsd.links.mk> handles the LINKS and SYMLINKS variables
524and is included from from bsd.lib.mk and bsd.prog.mk.
525
526=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
527
528The include file <bsd.files.mk> handles the FILES variables and is included
529from bsd.lib.mk and bsd.prog.mk.
530
531=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
532
533The include file <bsd.inc.mk> defines the includes target and uses two
534variables:
535
536INCS		The list of include files
537
538INCSDIR		The location to install the include files.
539
540INCSNAME	Target name of the include file, if only one; same as
541		FILESNAME, but for include files.
542
543INCSNAME_<file>	The name file <file> should be installed as, if not <file>,
544		same as FILESNAME_<file>, but for include files.
545
546=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
547
548The include file <bsd.kinc.mk> defines the many targets (includes,
549subdirectories, etc.), and is used by kernel makefiles to handle
550include file installation.  It is intended to be included alone, by
551kernel Makefiles.  Please see bsd.kinc.mk for more details, and keep
552the documentation in that file up to date.
553
554=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
555
556The include file <bsd.info.mk> is used to generate and install GNU Info
557documentation from respective Texinfo source files.  It defines three
558implicit targets (.txi.info, .texi.info, and .texinfo.info), and uses the
559following variables:
560
561TEXINFO		List of Texinfo source files.  Info documentation will
562		consist of single files with the extension replaced by
563		.info.
564
565INFOFLAGS	Flags to pass to makeinfo.  []
566
567INSTALL_INFO	Name of install-info program.  [install-info]
568
569MAKEINFO	Name of makeinfo program.  [makeinfo]
570
571=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
572
573The include file <bsd.sys.mk> is used by <bsd.prog.mk> and
574<bsd.lib.mk>.  It contains overrides that are used when building
575the NetBSD source tree.  For instance, if "PARALLEL" is defined by
576the program/library Makefile, it includes a set of rules for lex and
577yacc that allow multiple lex and yacc targets to be built in parallel.
578
579Other variables of note (incomplete list):
580
581WARNS		Crank up gcc warning options; the distinct levels are:
582			WARNS=1
583			WARNS=2
584			WARNS=3
585
586FORMAT_AUDIT	If FORMAT_AUDIT is set, and WFORMAT is set and > 1, turn on
587WFORMAT 	-Wnetbsd-format-audit for extra-stringent format checking.
588		WFORMAT belongs in individual makefiles and/or
589		Makefile.inc files.  (set WFORMAT=1 in individual
590		makefiles if a program is not security critical and is
591		doing bizarre things with format strings which would
592		be even uglier if rewritten) FORMAT_AUDIT should go in
593		mk.conf if you're doing format-string auditing. 
594		FORMAT_AUDIT may go away in time.
595
596=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
597
598The include file <bsd.lib.mk> has support for building libraries.  It has
599the same eight targets as <bsd.prog.mk>: all, clean, cleandir, depend,
600includes, install, lint, and tags.  Additionally, it has a checkver target
601which checks for installed shared object libraries whose version is greater
602that the version of the source. It has a limited number of suffixes,
603consistent with the current needs of the BSD tree.
604
605It sets/uses the following variables:
606
607LIB		The name of the library to build.
608
609LIBDIR		Target directory for libraries.
610
611SHLIBDIR	Target directory for shared libraries if ${USE_SHLIBDIR}
612		is "yes".
613
614USE_SHLIBDIR	If "yes", use ${SHLIBDIR} instead of ${LIBDIR}
615		as the path to install shared libraries to.
616
617LINTLIBDIR	Target directory for lint libraries.
618
619LIBGRP		Library group.
620
621LIBOWN		Library owner.
622
623LIBMODE		Library mode.
624
625LDADD		Additional loader objects.
626
627MAN		The manual pages to be installed (use a .1 - .9 suffix).
628
629MKLINKLIB	If "no", act as "MKPICINSTALL=no MKPROFILE=no".
630		Also:
631			- don't install the .a libraries
632			- don't install _pic.a libraries on PIC systems
633			- don't build .a libraries on PIC systems
634			- don't install the .so symlink on ELF systems
635		I.e, only install the shared library (and the .so.major
636		symlink on ELF).
637
638MKPICLIB	If "no", don't build _pic.a libraries, and build the
639		shared object libraries from the .a libraries.  A
640		symlink is installed in ${DESTDIR}/usr/lib for the
641		_pic.a library pointing to the .a library.
642
643NOCHECKVER_<library>
644NOCHECKVER	If set, disables checking for installed shared object
645		libraries with versions greater than the source.  A
646		particular library name, without the "lib" prefix, may
647		be appended to the variable name to disable the check for
648		only that library.
649
650SRCS		List of source files to build the library.  Suffix types
651		.s, .c, and .f are supported.  Note, .s files are preferred
652		to .c files of the same name.  (This is not the default for
653		versions of make.)
654
655The include file <bsd.lib.mk> includes the file named "../Makefile.inc"
656if it exists, as well as the include file <bsd.man.mk>.
657
658It has rules for building profiled objects; profiled libraries are
659built by default.
660
661Libraries are ranlib'd when made.
662
663=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
664
665The include file <bsd.obj.mk> defines targets related to the creation
666and use of separated object and source directories.
667
668If an environment variable named MAKEOBJDIRPREFIX is set, make(1) uses
669${MAKEOBJDIRPREFIX}${.CURDIR} as the name of the object directory if
670it exists.  Otherwise make(1) looks for the existence of a
671subdirectory (or a symlink to a directory) of the source directory
672into which built targets should be placed.  If an environment variable
673named MAKEOBJDIR is set, make(1) uses its value as the name of the
674object directory; failing that, make first looks for a subdirectory
675named "obj.${MACHINE}", and if that doesn't exist, it looks for "obj".
676
677Object directories are not created automatically by make(1) if they
678don't exist; you need to run a separate "make obj".  (This will happen
679during a top-level build if "MKOBJDIRS" is set to a value other than
680"no").  When the source directory is a subdirectory of ${BSDSRCDIR} --
681and this is determined by a simple string prefix comparison -- object
682directories are created in a separate object directory tree, and a
683symlink to the object directory in that tree is created in the source
684directory; otherwise, "make obj" assumes that you're not in the main
685source tree and that it's not safe to use a separate object tree.
686
687Several variables used by <bsd.obj.mk> control exactly what
688directories and links get created during a "make obj":
689
690MAKEOBJDIR	If set, this is the component name of the object
691		directory.
692
693OBJMACHINE	If this is set but MAKEOBJDIR is not set, creates
694		object directories or links named "obj.${MACHINE}";
695		otherwise, just creates ones named "obj".
696
697USR_OBJMACHINE  If set, and the current directory is a subdirectory of
698		${BSDSRCDIR}, create object directory in the
699		corresponding subdirectory of ${BSDOBJDIR}.${MACHINE};
700		otherwise, create it in the corresponding subdirectory
701		of ${BSDOBJDIR}
702
703=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
704
705The include file <bsd.kernobj.mk> defines variables related to the
706location of kernel sources and object directories.
707
708KERNSRCDIR	Is the location of the top of the kernel src.
709		It defaults to ${BSDSRCDIR}/sys, but the top-level
710		Makefile.inc sets it to ${ABSTOP}/sys (ABSTOP is the
711		absolute path to the directory where the top-level
712		Makefile.inc was found.
713
714KERNARCHDIR	Is the location of the machine dependent kernel
715		sources.  It defaults to arch/${MACHINE}
716		
717KERNCONFDIR	Is where the configuration files for kernels are
718		found; default is ${KERNSRCDIR}/${KERNARCHDIR}/conf.
719
720KERNOBJDIR	Is the kernel build directory.  The kernel GENERIC for
721		instance will be compiled in ${KERNOBJDIR}/GENERIC.
722		The default value is
723		${MAKEOBJDIRPREFIX}${KERNSRCDIR}/${KERNARCHDIR}/compile
724		if it exists or the target 'obj' is being made.
725		Otherwise the default is
726		${KERNSRCDIR}/${KERNARCHDIR}/compile.
727
728It is important that Makefiles (such as those under src/distrib) that
729wish to find compiled kernels use bsd.kernobj.mk and ${KERNOBJDIR}
730rather than make assumptions about the location of the compiled kernel.
731
732=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
733