bsd.README revision 1.54
11.54Ssimonb#	$NetBSD: bsd.README,v 1.54 1999/11/28 04:50:41 simonb Exp $
21.24Smikel#	@(#)bsd.README	8.2 (Berkeley) 4/2/94
31.1Scgd
41.1ScgdThis is the README file for the new make "include" files for the BSD
51.1Scgdsource tree.  The files are installed in /usr/share/mk, and are, by
61.11Sjtcconvention, named with the suffix ".mk".
71.1Scgd
81.1ScgdNote, this file is not intended to replace reading through the .mk
91.1Scgdfiles for anything tricky.
101.1Scgd
111.1Scgd=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
121.1Scgd
131.1ScgdRANDOM THINGS WORTH KNOWING:
141.1Scgd
151.1ScgdThe files are simply C-style #include files, and pretty much behave like
161.1Scgdyou'd expect.  The syntax is slightly different in that a single '.' is
171.1Scgdused instead of the hash mark, i.e. ".include <bsd.prog.mk>".
181.1Scgd
191.1ScgdOne difference that will save you lots of debugging time is that inclusion
201.1Scgdof the file is normally done at the *end* of the Makefile.  The reason for
211.1Scgdthis is because .mk files often modify variables and behavior based on the
221.1Scgdvalues of variables set in the Makefile.  To make this work, remember that
231.1Scgdthe FIRST target found is the target that is used, i.e. if the Makefile has:
241.1Scgd
251.1Scgd	a:
261.1Scgd		echo a
271.1Scgd	a:
281.1Scgd		echo a number two
291.1Scgd
301.1Scgdthe command "make a" will echo "a".  To make things confusing, the SECOND
311.1Scgdvariable assignment is the overriding one, i.e. if the Makefile has:
321.1Scgd
331.1Scgd	a=	foo
341.1Scgd	a=	bar
351.1Scgd
361.1Scgd	b:
371.1Scgd		echo ${a}
381.1Scgd
391.1Scgdthe command "make b" will echo "bar".  This is for compatibility with the
401.1Scgdway the V7 make behaved.
411.1Scgd
421.1ScgdIt's fairly difficult to make the BSD .mk files work when you're building
431.1Scgdmultiple programs in a single directory.  It's a lot easier split up the
441.1Scgdprograms than to deal with the problem.  Most of the agony comes from making
451.36Srossthe "obj" directory stuff work right, not because we switched to a new version
461.1Scgdof make.  So, don't get mad at us, figure out a better way to handle multiple
471.1Scgdarchitectures so we can quit using the symbolic link stuff.  (Imake doesn't
481.1Scgdcount.)
491.1Scgd
501.1ScgdThe file .depend in the source directory is expected to contain dependencies
511.1Scgdfor the source files.  This file is read automatically by make after reading
521.1Scgdthe Makefile.
531.1Scgd
541.1ScgdThe variable DESTDIR works as before.  It's not set anywhere but will change
551.1Scgdthe tree where the file gets installed.
561.1Scgd
571.1ScgdThe profiled libraries are no longer built in a different directory than
581.1Scgdthe regular libraries.  A new suffix, ".po", is used to denote a profiled
591.21Schristosobject, and ".so" denotes a shared (position-independent) object.
601.21Schristos
611.45SlukemThe following variables that control how things are made/installed that
621.47Stvare not set by default. These should not be set by Makefiles; they're for
631.47Stvthe user to define in MAKECONF (see bsd.own.mk, below) or on the make(1)
641.47Stvcommand line:
651.21Schristos
661.45SlukemBUILD 		If defined, 'make install' checks that the targets in the
671.45Slukem		source directories are up-to-date and remakes them if they
681.21Schristos                are out of date, instead of blindly trying to install
691.21Schristos                out of date or non-existant targets.
701.21Schristos
711.45SlukemUPDATE 		If defined, 'make install' only installs targets that are
721.45Slukem		more recently modified in the source directories that their
731.45Slukem		installed counterparts.
741.52Ssimonb
751.52SsimonbUNPRIVILEGED	If defined, don't set the owner/group/mode when installing
761.52Ssimonb		files or directories.  This allows a non-root "make install".
771.45Slukem
781.45SlukemMKCATPAGES	If "no", don't build or install the catman pages.
791.45Slukem
801.45SlukemMKDOC		If "no", don't build or install the documentation.
811.45Slukem
821.47StvMKINFO		If "no", don't build or install Info documentation from
831.47Stv		Texinfo source files.
841.45Slukem
851.45SlukemMKLINT		If "no", don't build or install the lint libraries.
861.45Slukem
871.45SlukemMKMAN		If "no", don't build or install the man or catman pages.
881.46Slukem		Also acts as "MKCATPAGES=no"
891.45Slukem
901.45SlukemMKNLS		If "no", don't build or install the NLS files.
911.45Slukem
921.45SlukemMKOBJ		If "no", don't create objdirs.
931.45Slukem
941.45SlukemMKPIC		If "no", don't build or install shared libraries.
951.45Slukem
961.45SlukemMKPICINSTALL	If "no", don't install the *_pic.a libraries.
971.45Slukem
981.45SlukemMKPROFILE	If "no", don't build or install the profiling libraries.
991.45Slukem
1001.48SlukemMKSHARE		If "no", act as "MKCATPAGES=no MKDOC=no MKINFO=no MKMAN=no
1011.48Slukem		MKNLS=no".  I.e, don't build catman pages, documentation,
1021.48Slukem		Info documentation, man pages, NLS files, ...
1031.1Scgd
1041.1Scgd=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
1051.1Scgd
1061.1ScgdThe include file <sys.mk> has the default rules for all makes, in the BSD
1071.1Scgdenvironment or otherwise.  You probably don't want to touch this file.
1081.1Scgd
1091.1Scgd=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
1101.1Scgd
1111.1ScgdThe include file <bsd.man.mk> handles installing manual pages and their
1121.1Scgdlinks.
1131.1Scgd
1141.21SchristosIt has a two targets:
1151.1Scgd
1161.1Scgd	maninstall:
1171.21Schristos		Install the manual page sources and their links.
1181.21Schristos	catinstall:
1191.21Schristos		Install the preformatted manual pages and their links.
1201.1Scgd
1211.1ScgdIt sets/uses the following variables:
1221.1Scgd
1231.1ScgdMANDIR		Base path for manual installation.
1241.1Scgd
1251.1ScgdMANGRP		Manual group.
1261.1Scgd
1271.1ScgdMANOWN		Manual owner.
1281.1Scgd
1291.1ScgdMANMODE		Manual mode.
1301.1Scgd
1311.1ScgdMANSUBDIR	Subdirectory under the manual page section, i.e. "/vax"
1321.1Scgd		or "/tahoe" for machine specific manual pages.
1331.1Scgd
1341.15ScgdMAN		The manual pages to be installed (use a .1 - .9 suffix).
1351.1Scgd
1361.15ScgdMLINKS		List of manual page links (using a .1 - .9 suffix).  The
1371.1Scgd		linked-to file must come first, the linked file second,
1381.1Scgd		and there may be multiple pairs.  The files are soft-linked.
1391.1Scgd
1401.1ScgdThe include file <bsd.man.mk> includes a file named "../Makefile.inc" if
1411.1Scgdit exists.
1421.1Scgd
1431.1Scgd=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
1441.1Scgd
1451.17SthorpejThe include file <bsd.own.mk> contains source tree configuration parameters,
1461.17Sthorpejsuch as the owners, groups, etc. for both manual pages and binaries, and
1471.17Sthorpeja few global "feature configuration" parameters.
1481.1Scgd
1491.1ScgdIt has no targets.
1501.1Scgd
1511.29ScjsTo get system-specific configuration parameters, bsd.own.mk will try to
1521.29Scjsinclude the file specified by the "MAKECONF" variable.  If MAKECONF is not
1531.29Scjsset, or no such file exists, the system make configuration file, /etc/mk.conf
1541.29Scjsis included.  These files may define any of the variables described below.
1551.17Sthorpej
1561.17Sthorpejbsd.own.mk sets the following variables, if they are not already defined
1571.17Sthorpej(defaults are in brackets):
1581.15Scgd
1591.15ScgdBSDSRCDIR	The real path to the system sources, so that 'make obj'
1601.15Scgd		will work correctly. [/usr/src]
1611.15Scgd
1621.15ScgdBSDOBJDIR	The real path to the system 'obj' tree, so that 'make obj'
1631.15Scgd		will work correctly. [/usr/obj]
1641.15Scgd
1651.34SlukemBINGRP		Binary group. [wheel]
1661.15Scgd
1671.34SlukemBINOWN		Binary owner. [root]
1681.15Scgd
1691.15ScgdBINMODE		Binary mode. [555]
1701.15Scgd
1711.15ScgdNONBINMODE	Mode for non-executable files. [444]
1721.15Scgd
1731.15ScgdMANDIR		Base path for manual installation. [/usr/share/man/cat]
1741.15Scgd
1751.34SlukemMANGRP		Manual group. [wheel]
1761.15Scgd
1771.34SlukemMANOWN		Manual owner. [root]
1781.15Scgd
1791.15ScgdMANMODE		Manual mode. [${NONBINMODE}]
1801.15Scgd
1811.21SchristosMANINSTALL	Manual installation type: maninstall, catinstall, or both
1821.21Schristos
1831.15ScgdLIBDIR		Base path for library installation. [/usr/lib]
1841.15Scgd
1851.15ScgdLINTLIBDIR	Base path for lint(1) library installation. [/usr/libdata/lint]
1861.15Scgd
1871.15ScgdLIBGRP		Library group. [${BINGRP}]
1881.15Scgd
1891.15ScgdLIBOWN		Library owner. [${BINOWN}]
1901.15Scgd
1911.15ScgdLIBMODE		Library mode. [${NONBINMODE}]
1921.15Scgd
1931.15ScgdDOCDIR		Base path for system documentation (e.g. PSD, USD, etc.)
1941.15Scgd	        installation. [/usr/share/doc]
1951.15Scgd
1961.34SlukemDOCGRP		Documentation group. [wheel]
1971.15Scgd
1981.34SlukemDOCOWN		Documentation owner. [root]
1991.15Scgd
2001.15ScgdDOCMODE		Documentation mode. [${NONBINMODE}]
2011.15Scgd
2021.15ScgdNLSDIR		Base path for National Language Support files installation.
2031.15Scgd		[/usr/share/nls]
2041.1Scgd
2051.34SlukemNLSGRP		National Language Support files group. [wheel]
2061.1Scgd
2071.34SlukemNLSOWN		National Language Support files owner. [root]
2081.1Scgd
2091.15ScgdNLSMODE		National Language Support files mode. [${NONBINMODE}]
2101.1Scgd
2111.32SmikelSTRIPFLAG	The flag passed to the install program to cause the binary
2121.1Scgd		to be stripped.  This is to be used when building your
2131.1Scgd		own install script so that the entire system can be made
2141.15Scgd		stripped/not-stripped using a single knob. [-s]
2151.1Scgd
2161.2ScgdCOPY		The flag passed to the install program to cause the binary
2171.2Scgd		to be copied rather than moved.  This is to be used when
2181.2Scgd		building our own install script so that the entire system
2191.2Scgd		can either be installed with copies, or with moves using
2201.15Scgd		a single knob. [-c]
2211.15Scgd
2221.17SthorpejAdditionally, the following variables may be set by bsd.own.mk or in a
2231.17Sthorpejmake configuration file to modify the behaviour of the system build
2241.17Sthorpejprocess (default values are in brackets along with comments, if set by
2251.17Sthorpejbsd.own.mk):
2261.15Scgd
2271.50SthorpejCRYPTOBASE	Select which cryptography code base to use when building
2281.50Sthorpej		cryptography support into the system.  See the
2291.50Sthorpej		bsd.crypto.mk section for more information.
2301.50Sthorpej
2311.15ScgdEXPORTABLE_SYSTEM
2321.50Sthorpej		Forces CRYPTOBASE to the value "none" for compatibility
2331.50Sthorpej		with older NetBSD build environments.  See the bsd.crypto.mk
2341.50Sthorpej		section for more information.
2351.2Scgd
2361.15ScgdSKEY		Compile in support for S/key authentication. [yes, set
2371.15Scgd		unconditionally]
2381.15Scgd
2391.15ScgdKERBEROS	Compile in support for Kerberos 4 authentication.
2401.15Scgd
2411.15ScgdKERBEROS5	Compile in support for Kerberos 5 authentication.
2421.15Scgd
2431.15ScgdMANZ		Compress manual pages at installation time.
2441.15Scgd
2451.15ScgdSYS_INCLUDE	Copy or symlink kernel include files into /usr/include.
2461.15Scgd		Possible values are "symlinks" or "copies" (which is
2471.15Scgd		the same as the variable being unset).
2481.1Scgd
2491.15ScgdNOPROFILE	Do not build profiled versions of system libraries
2501.1Scgd
2511.15ScgdNOPIC		Do not build PIC versions of system libraries, and
2521.15Scgd		do not build shared libraries.  [set if ${MACHINE_ARCH}
2531.45Slukem		is "sparc64", unset otherwise.]
2541.1Scgd
2551.40SperryNOLINT		Do not build lint libraries.
2561.33Sjonathan
2571.50SthorpejOBJECT_FMT	Object file format. [set to "ELF" on architectures that
2581.50Sthorpej		use ELF -- currently if ${MACHINE_ARCH} is "alpha",
2591.50Sthorpej		"mipsel", "mipseb", "powerpc", "sparc", "sparc64",
2601.50Sthorpej		and "i386", or set to "a.out" on other architectures].
2611.33Sjonathan
2621.1Scgd
2631.17Sthorpejbsd.own.mk is generally useful when building your own Makefiles so that
2641.1Scgdthey use the same default owners etc. as the rest of the tree.
2651.1Scgd
2661.1Scgd=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
2671.1Scgd
2681.1ScgdThe include file <bsd.prog.mk> handles building programs from one or
2691.1Scgdmore source files, along with their manual pages.  It has a limited number
2701.1Scgdof suffixes, consistent with the current needs of the BSD tree.
2711.1Scgd
2721.16SjtcIt has eight targets:
2731.1Scgd
2741.1Scgd	all:
2751.1Scgd		build the program and its manual page
2761.1Scgd	clean:
2771.1Scgd		remove the program, any object files and the files a.out,
2781.24Smikel		Errs, errs, mklog, and ${PROG}.core.
2791.1Scgd	cleandir:
2801.1Scgd		remove all of the files removed by the target clean, as
2811.1Scgd		well as .depend, tags, and any manual pages.
2821.42Slukem		`distclean' is a synonym for `cleandir'.
2831.1Scgd	depend:
2841.1Scgd		make the dependencies for the source files, and store
2851.1Scgd		them in the file .depend.
2861.16Sjtc	includes:
2871.16Sjtc		install any header files.
2881.1Scgd	install:
2891.1Scgd		install the program and its manual pages; if the Makefile
2901.1Scgd		does not itself define the target install, the targets
2911.1Scgd		beforeinstall and afterinstall may also be used to cause
2921.1Scgd		actions immediately before and after the install target
2931.1Scgd		is executed.
2941.1Scgd	lint:
2951.1Scgd		run lint on the source files
2961.1Scgd	tags:
2971.1Scgd		create a tags file for the source files.
2981.1Scgd
2991.1ScgdIt sets/uses the following variables:
3001.1Scgd
3011.1ScgdBINGRP		Binary group.
3021.1Scgd
3031.1ScgdBINOWN		Binary owner.
3041.1Scgd
3051.1ScgdBINMODE		Binary mode.
3061.1Scgd
3071.1ScgdCLEANFILES	Additional files to remove for the clean and cleandir targets.
3081.1Scgd
3091.1ScgdCOPTS		Additional flags to the compiler when creating C objects.
3101.35Slukem
3111.35SlukemCPPFLAGS	Additional flags to the C pre-processor
3121.1Scgd
3131.1ScgdLDADD		Additional loader objects.  Usually used for libraries.
3141.1Scgd		For example, to load with the compatibility and utility
3151.1Scgd		libraries, use:
3161.1Scgd
3171.5Sjtc			LDADD+=-lutil -lcompat
3181.1Scgd
3191.1ScgdLDFLAGS		Additional loader flags.
3201.1Scgd
3211.1ScgdLINKS		The list of binary links; should be full pathnames, the
3221.1Scgd		linked-to file coming first, followed by the linked
3231.1Scgd		file.  The files are hard-linked.  For example, to link
3241.1Scgd		/bin/test and /bin/[, use:
3251.1Scgd
3261.1Scgd			LINKS=	${DESTDIR}/bin/test ${DESTDIR}/bin/[
3271.19Sperry
3281.19SperrySYMLINKS	The list of symbolic links; should be full pathnames.
3291.20Sperry                Syntax is identical to LINKS. Note that DESTDIR is not
3301.20Sperry		automatically included in the link.
3311.1Scgd
3321.15ScgdMAN		Manual pages (should end in .1 - .9).  If no MAN variable is
3331.8Scgd		defined, "MAN=${PROG}.1" is assumed.
3341.1Scgd
3351.1ScgdPROG		The name of the program to build.  If not supplied, nothing
3361.1Scgd		is built.
3371.1Scgd
3381.21SchristosPROGNAME	The name that the above program will be installed as, if
3391.21Schristos		different from ${PROG}.
3401.21Schristos
3411.37StvSRCS		List of source files to build the program.  If SRCS is not
3421.1Scgd		defined, it's assumed to be ${PROG}.c.
3431.1Scgd
3441.1ScgdDPADD		Additional dependencies for the program.  Usually used for
3451.1Scgd		libraries.  For example, to depend on the compatibility and
3461.1Scgd		utility libraries use:
3471.1Scgd
3481.5Sjtc			DPADD+=${LIBCOMPAT} ${LIBUTIL}
3491.1Scgd
3501.1Scgd		The following libraries are predefined for DPADD:
3511.1Scgd
3521.21Schristos		LIBCRT0?=	${DESTDIR}/usr/lib/crt0.o
3531.21Schristos		LIBC?=		${DESTDIR}/usr/lib/libc.a
3541.21Schristos		LIBC_PIC?=	${DESTDIR}/usr/lib/libc_pic.a
3551.21Schristos		LIBCOMPAT?=	${DESTDIR}/usr/lib/libcompat.a
3561.21Schristos		LIBCRYPT?=	${DESTDIR}/usr/lib/libcrypt.a
3571.21Schristos		LIBCURSES?=	${DESTDIR}/usr/lib/libcurses.a
3581.21Schristos		LIBDBM?=	${DESTDIR}/usr/lib/libdbm.a
3591.21Schristos		LIBDES?=	${DESTDIR}/usr/lib/libdes.a
3601.21Schristos		LIBEDIT?=	${DESTDIR}/usr/lib/libedit.a
3611.21Schristos		LIBGCC?=	${DESTDIR}/usr/lib/libgcc.a
3621.21Schristos		LIBGNUMALLOC?=	${DESTDIR}/usr/lib/libgnumalloc.a
3631.49Sitojun		LIBIPSEC?=	${DESTDIR}/usr/lib/libipsec.a
3641.21Schristos		LIBKDB?=	${DESTDIR}/usr/lib/libkdb.a
3651.21Schristos		LIBKRB?=	${DESTDIR}/usr/lib/libkrb.a
3661.21Schristos		LIBKVM?=	${DESTDIR}/usr/lib/libkvm.a
3671.21Schristos		LIBL?=		${DESTDIR}/usr/lib/libl.a
3681.21Schristos		LIBM?=		${DESTDIR}/usr/lib/libm.a
3691.53Sblymn		LIBMENU?=	${DESTDIR}/usr/lib/libmenu.a
3701.21Schristos		LIBMP?=		${DESTDIR}/usr/lib/libmp.a
3711.25Schristos		LIBNTP?=	${DESTDIR}/usr/lib/libntp.a
3721.21Schristos		LIBPC?=		${DESTDIR}/usr/lib/libpc.a
3731.21Schristos		LIBPCAP?=	${DESTDIR}/usr/lib/libpcap.a
3741.21Schristos		LIBPLOT?=	${DESTDIR}/usr/lib/libplot.a
3751.26Skleink		LIBPOSIX?=	${DESTDIR}/usr/lib/libposix.a
3761.21Schristos		LIBRESOLV?=	${DESTDIR}/usr/lib/libresolv.a
3771.21Schristos		LIBRPCSVC?=	${DESTDIR}/usr/lib/librpcsvc.a
3781.21Schristos		LIBSKEY?=	${DESTDIR}/usr/lib/libskey.a
3791.21Schristos		LIBTERMCAP?=	${DESTDIR}/usr/lib/libtermcap.a
3801.21Schristos		LIBTELNET?=	${DESTDIR}/usr/lib/libtelnet.a
3811.21Schristos		LIBUTIL?=	${DESTDIR}/usr/lib/libutil.a
3821.21Schristos		LIBWRAP?=	${DESTDIR}/usr/lib/libwrap.a
3831.21Schristos		LIBY?=		${DESTDIR}/usr/lib/liby.a
3841.21Schristos		LIBZ?=		${DESTDIR}/usr/lib/libz.a
3851.21Schristos
3861.1Scgd
3871.1ScgdSHAREDSTRINGS	If defined, a new .c.o rule is used that results in shared
3881.12Schristos		strings, using xstr(1). Note that this will not work with
3891.12Schristos		parallel makes.
3901.1Scgd
3911.1ScgdSTRIP		The flag passed to the install program to cause the binary
3921.1Scgd		to be stripped.
3931.1Scgd
3941.1ScgdSUBDIR		A list of subdirectories that should be built as well.
3951.1Scgd		Each of the targets will execute the same target in the
3961.1Scgd		subdirectories.
3971.1Scgd
3981.21SchristosSCRIPTS		A list of interpreter scripts [file.{sh,csh,pl,awk,...}].
3991.21Schristos		These are installed exactly like programs.
4001.21Schristos
4011.21SchristosSCRIPTSNAME	The name that the above program will be installed as, if
4021.21Schristos		different from ${SCRIPTS}. These can be further specialized
4031.21Schristos		by setting SCRIPTSNAME_<script>.
4041.21Schristos
4051.21SchristosFILES		A list of files to install. The installation is controlled
4061.21Schristos		by the FILESNAME, FILESOWN, FILESGRP, FILESMODE, FILESDIR
4071.21Schristos		variables that can be further specialized by FILES<VAR>_<file>
4081.21Schristos
4091.1ScgdThe include file <bsd.prog.mk> includes the file named "../Makefile.inc"
4101.1Scgdif it exists, as well as the include file <bsd.man.mk>.
4111.1Scgd
4121.1ScgdSome simple examples:
4131.1Scgd
4141.1ScgdTo build foo from foo.c with a manual page foo.1, use:
4151.1Scgd
4161.1Scgd	PROG=	foo
4171.1Scgd
4181.1Scgd	.include <bsd.prog.mk>
4191.1Scgd
4201.1ScgdTo build foo from foo.c with a manual page foo.2, add the line:
4211.1Scgd
4221.9Scgd	MAN=	foo.2
4231.1Scgd
4241.1ScgdIf foo does not have a manual page at all, add the line:
4251.1Scgd
4261.1Scgd	NOMAN=	noman
4271.1Scgd
4281.1ScgdIf foo has multiple source files, add the line:
4291.1Scgd
4301.1Scgd	SRCS=	a.c b.c c.c d.c
4311.1Scgd
4321.1Scgd=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
4331.1Scgd
4341.1ScgdThe include file <bsd.subdir.mk> contains the default targets for building
4351.16Sjtcsubdirectories.  It has the same eight targets as <bsd.prog.mk>: all, 
4361.16Sjtcclean, cleandir, depend, includes, install, lint, and tags.  For all of
4371.16Sjtcthe directories listed in the variable SUBDIRS, the specified directory 
4381.16Sjtcwill be visited and the target made.  There is also a default target which
4391.16Sjtcallows the command "make subdir" where subdir is any directory listed in
4401.16Sjtcthe variable SUBDIRS.
4411.21Schristos
4421.21Schristos=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
4431.21Schristos
4441.23SchristosThe include file <bsd.links.mk> handles the LINKS and SYMLINKS variables
4451.23Schristosand is included from from bsd.lib.mk and bsd.prog.mk.
4461.23Schristos
4471.23Schristos=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
4481.23Schristos
4491.23SchristosThe include file <bsd.files.mk> handles the FILES variables and is included
4501.23Schristosfrom bsd.lib.mk and bsd.prog.mk.
4511.21Schristos
4521.21Schristos=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
4531.21Schristos
4541.29ScjsThe include file <bsd.inc.mk> defines the includes target and uses two
4551.29Scjsvariables:
4561.21Schristos
4571.29ScjsINCS	The list of include files
4581.21Schristos
4591.29ScjsINCSDIR	The location to install the include files.
4601.39Scgd
4611.39Scgd=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
4621.39Scgd
4631.39ScgdThe include file <bsd.kinc.mk> defines the many targets (includes,
4641.39Scgdsubdirectories, etc.), and is used by kernel makefiles to handle
4651.39Scgdinclude file installation.  It is intended to be included alone, by
4661.39Scgdkernel Makefiles.  Please see bsd.kinc.mk for more details, and keep
4671.39Scgdthe documentation in that file up to date.
4681.13Schristos
4691.13Schristos=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
4701.13Schristos
4711.47StvThe include file <bsd.info.mk> is used to generate and install GNU Info
4721.47Stvdocumentation from respective Texinfo source files.  It defines three
4731.47Stvimplicit targets (.txi.info, .texi.info, and .texinfo.info), and uses the
4741.47Stvfollowing variables:
4751.47Stv
4761.47StvTEXINFO		List of Texinfo source files.  Info documentation will
4771.47Stv		consist of single files with the extension replaced by
4781.47Stv		.info.
4791.47Stv
4801.47StvINFOFLAGS	Flags to pass to makeinfo.  []
4811.47Stv
4821.47StvINSTALL_INFO	Name of install-info program.  [install-info]
4831.47Stv
4841.47StvMAKEINFO	Name of makeinfo program.  [makeinfo]
4851.47Stv
4861.47Stv=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
4871.47Stv
4881.13SchristosThe include file <bsd.sys.mk> is used by <bsd.prog.mk> and
4891.14Scgd<bsd.lib.mk>.  It contains overrides that are used when building
4901.14Scgdthe NetBSD source tree.  For instance, if "PARALLEL" is defined by
4911.14Scgdthe program/library Makefile, it includes a set of rules for lex and
4921.14Scgdyacc that allow multiple lex and yacc targets to be built in parallel.
4931.1Scgd
4941.1Scgd=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
4951.1Scgd
4961.1ScgdThe include file <bsd.lib.mk> has support for building libraries.  It has
4971.16Sjtcthe same eight targets as <bsd.prog.mk>: all, clean, cleandir, depend,
4981.44Serhincludes, install, lint, and tags.  Additionally, it has a checkver target
4991.44Serhwhich checks for installed shared object libraries whose version is greater
5001.44Serhthat the version of the source. It has a limited number of suffixes,
5011.16Sjtcconsistent with the current needs of the BSD tree.
5021.1Scgd
5031.1ScgdIt sets/uses the following variables:
5041.10Scgd
5051.10ScgdLIB		The name of the library to build.
5061.1Scgd
5071.1ScgdLIBDIR		Target directory for libraries.
5081.1Scgd
5091.1ScgdLINTLIBDIR	Target directory for lint libraries.
5101.1Scgd
5111.1ScgdLIBGRP		Library group.
5121.1Scgd
5131.1ScgdLIBOWN		Library owner.
5141.1Scgd
5151.1ScgdLIBMODE		Library mode.
5161.1Scgd
5171.1ScgdLDADD		Additional loader objects.
5181.1Scgd
5191.15ScgdMAN		The manual pages to be installed (use a .1 - .9 suffix).
5201.47Stv
5211.47StvMKLINKLIB	If "no", act as "MKPICINSTALL=no MKPROFILE=no".
5221.47Stv		Also:
5231.47Stv			- don't install the .a libraries
5241.47Stv			- don't install _pic.a libraries on PIC systems
5251.47Stv			- don't build .a libraries on PIC systems
5261.47Stv			- don't install the .so symlink on ELF systems
5271.47Stv		I.e, only install the shared library (and the .so.major
5281.47Stv		symlink on ELF).
5291.54Ssimonb
5301.54SsimonbMKPICLIB	If "no", don't build _pic.a libraries, and build the
5311.54Ssimonb		shared object libraries from the .a libraries.  A
5321.54Ssimonb		symlink is installed in ${DESTDIR}/usr/lib for the
5331.54Ssimonb		_pic.a library pointing to the .a library.
5341.44Serh
5351.44SerhNOCHECKVER_<library>
5361.44SerhNOCHECKVER	If set, disables checking for installed shared object
5371.44Serh		libraries with versions greater than the source.  A
5381.44Serh		particular library name, without the "lib" prefix, may
5391.44Serh		be appended to the variable name to disable the check for
5401.44Serh		only that library.
5411.1Scgd
5421.1ScgdSRCS		List of source files to build the library.  Suffix types
5431.1Scgd		.s, .c, and .f are supported.  Note, .s files are preferred
5441.1Scgd		to .c files of the same name.  (This is not the default for
5451.1Scgd		versions of make.)
5461.1Scgd
5471.1ScgdThe include file <bsd.lib.mk> includes the file named "../Makefile.inc"
5481.1Scgdif it exists, as well as the include file <bsd.man.mk>.
5491.1Scgd
5501.1ScgdIt has rules for building profiled objects; profiled libraries are
5511.1Scgdbuilt by default.
5521.1Scgd
5531.4ScgdLibraries are ranlib'd when made.
5541.50Sthorpej
5551.50Sthorpej=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
5561.50Sthorpej
5571.50SthorpejThe include file <bsd.crypto.mk> contains variables related to building
5581.50Sthorpejcryptography support into the system.
5591.50Sthorpej
5601.50SthorpejIt has no targets.
5611.50Sthorpej
5621.50SthorpejIn order to get system-specific crypto configuration parameters,
5631.50Sthorpejbsd.crypto.mk will include <bsd.own.mk>, which in turn will include
5641.50Sthorpejthe configuration file specified by the "MAKECONF" variable.  See
5651.50Sthorpejthe <bsd.own.mk> section for more information.
5661.50Sthorpej
5671.50Sthorpejbsd.crypto.mk requires the "SRCTOP" variable to be defined before
5681.50Sthorpejinclusion.  This variable contains the relative path to the top of
5691.50Sthorpejthe source tree, with no trailing '/'.
5701.50Sthorpej
5711.50SthorpejThe variable "CRYPTOBASE" may be set by the user to select which
5721.50Sthorpejcryptography code base will be used when building the system.  If
5731.50SthorpejCRYPTOBASE is set to "none", no cryptography support will be built
5741.50Sthorpejinto the system.  CRYPTOBASE should be set to the name of the crypto
5751.50Sthorpejsub-tree in the SRCTOP directory.  If CRYPTOBASE is not set,
5761.50Sthorpejbsd.crypto.mk will use the following algorithm to set the variable:
5771.50Sthorpej
5781.50Sthorpej	.if exists(${SRCTOP}/crypto-us)
5791.50Sthorpej		CRYPTOBASE=crypto-us
5801.50Sthorpej	.elif exists(${SRCTOP}/crypto-intl)
5811.50Sthorpej		CRYPTOBASE=crypto-intl
5821.50Sthorpej	.else
5831.50Sthorpej		undef CRYPTOBASE
5841.50Sthorpej	.endif
5851.50Sthorpej
5861.50SthorpejNote that it is legal for the user to set CRYPTOBASE to a relative
5871.50Sthorpejpath outside of the source directory.  For example:
5881.50Sthorpej
5891.50Sthorpej	CRYPTOPATH= ../cryptosrc-intl/crypto-intl
5901.50Sthorpej
5911.50SthorpejIf CRYPTOBASE is set and not set to "none", bsd.crypto.mk will use
5921.50SthorpejCRYPTOBASE to set the "CRYPTOPATH" variable.  CRYPTOPATH is set to
5931.50Sthorpejthe value "${SRCTOP}/${CRYPTOBASE}".
5941.50Sthorpej
5951.50SthorpejOnce CRYPTOPATH is set by bsd.crypto.mk, it checks to see if the
5961.50Sthorpejpath actually exists.  If it does not exist, the variable is undefined.
5971.50SthorpejProgram and library Makefiles may key off the definition of CRYPTOPATH
5981.50Sthorpejto determine if cryptography support is to be included in that program.
5991.50SthorpejFor example, a typical program Makefile should do the following:
6001.50Sthorpej
6011.50Sthorpej	SRCTOP= ../..
6021.50Sthorpej	.include <bsd.crypto.mk>
6031.50Sthorpej
6041.50Sthorpej	PROG= login
6051.50Sthorpej	SRCS= login.c
6061.50Sthorpej	.
6071.50Sthorpej	.
6081.50Sthorpej	.
6091.50Sthorpej	.if defined(CRYPTOPATH)
6101.51Smrg	.sinclude "${CRYPTOPATH}/usr.bin/login/Makefile.frag"
6111.50Sthorpej	.endif
6121.50Sthorpej
6131.51SmrgThe Makefile.frag included (if it exists) will now influence the build
6141.51Smrgof the login(1) program, specifying additional source files, libraries,
6151.51Smrgand CPP flags.
6161.50Sthorpej
6171.50SthorpejThe "EXPORTABLE_SYSTEM" variable, if set, causes CRYPTOBASE to be set
6181.50Sthorpejto "none".  This is for compatibilty with older NetBSD build environments.
6191.30Sagc
6201.30Sagc=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
621