bsd.README revision 1.171
11.171Shubertf#	$NetBSD: bsd.README,v 1.171 2005/12/21 04:25:54 hubertf 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.75Sagcmultiple programs in a single directory.  It's a lot easier to 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.97Sitojun
611.142SlukemThere are various make variables used during the build.
621.142Slukem
631.142SlukemMany variables support a (case sensitive) value of "no" or "yes",
641.142Slukemand are tested with  ${VAR} == "no"  and  ${VAR} != "no" .
651.142Slukem
661.171ShubertfPlease see mk.conf(5) for documentation of all the possible
671.171Shubertfvariables that can be set!
681.142Slukem
691.118Slukem
701.118Slukem=-=-=-=-=   sys.mk   =-=-=-=-=
711.1Scgd
721.1ScgdThe include file <sys.mk> has the default rules for all makes, in the BSD
731.1Scgdenvironment or otherwise.  You probably don't want to touch this file.
741.1Scgd
751.118Slukem=-=-=-=-=   bsd.own.mk   =-=-=-=-=
761.1Scgd
771.17SthorpejThe include file <bsd.own.mk> contains source tree configuration parameters,
781.17Sthorpejsuch as the owners, groups, etc. for both manual pages and binaries, and
791.17Sthorpeja few global "feature configuration" parameters.
801.1Scgd
811.1ScgdIt has no targets.
821.1Scgd
831.134SlukemTo get system-specific configuration parameters, <bsd.own.mk> will try to
841.29Scjsinclude the file specified by the "MAKECONF" variable.  If MAKECONF is not
851.29Scjsset, or no such file exists, the system make configuration file, /etc/mk.conf
861.29Scjsis included.  These files may define any of the variables described below.
871.17Sthorpej
881.134Slukem<bsd.own.mk> sets the following variables, if they are not already defined
891.17Sthorpej(defaults are in brackets):
901.15Scgd
911.98SlukemNETBSDSRCDIR	Top of the NetBSD source tree.
921.98Slukem		If _SRC_TOP_ != "", that will be used as the default,
931.98Slukem		otherwise BSDSRCDIR will be used as the default.
941.98Slukem		Various makefiles within the NetBSD source tree will
951.98Slukem		use this to reference the top level of the source tree.
961.98Slukem
971.95Slukem_SRC_TOP_	Top of the system source tree, as determined by <bsd.own.mk>
981.98Slukem		based on the presence of tools/ and build.sh.  This variable
991.98Slukem		is "internal" to <bsd.own.mk>, although its value is only
1001.98Slukem		determined once and then propagated to all sub-makes.
1011.95Slukem
1021.15ScgdBSDSRCDIR	The real path to the system sources, so that 'make obj'
1031.116Slukem		will work correctly.  [/usr/src]
1041.15Scgd
1051.15ScgdBSDOBJDIR	The real path to the system 'obj' tree, so that 'make obj'
1061.116Slukem		will work correctly.  [/usr/obj]
1071.15Scgd
1081.116SlukemBINGRP		Binary group.  [wheel]
1091.15Scgd
1101.116SlukemBINOWN		Binary owner.  [root]
1111.15Scgd
1121.116SlukemBINMODE		Binary mode.  [555]
1131.15Scgd
1141.116SlukemNONBINMODE	Mode for non-executable files.  [444]
1151.15Scgd
1161.116SlukemMANDIR		Base path for manual installation.  [/usr/share/man/cat]
1171.15Scgd
1181.116SlukemMANGRP		Manual group.  [wheel]
1191.15Scgd
1201.116SlukemMANOWN		Manual owner.  [root]
1211.15Scgd
1221.116SlukemMANMODE		Manual mode.  [${NONBINMODE}]
1231.15Scgd
1241.21SchristosMANINSTALL	Manual installation type: maninstall, catinstall, or both
1251.155Sjmc		[maninstall catinstall]
1261.76Sfair
1271.76SfairLDSTATIC	Control program linking; if set blank, link everything
1281.129Slukem		dynamically.  If set to "-static", link everything statically.
1291.76Sfair		If not set, programs link according to their makefile.
1301.21Schristos
1311.116SlukemLIBDIR		Base path for library installation.  [/usr/lib]
1321.15Scgd
1331.116SlukemLINTLIBDIR	Base path for lint(1) library installation.  [/usr/libdata/lint]
1341.15Scgd
1351.116SlukemLIBGRP		Library group.  [${BINGRP}]
1361.15Scgd
1371.116SlukemLIBOWN		Library owner.  [${BINOWN}]
1381.15Scgd
1391.116SlukemLIBMODE		Library mode.  [${NONBINMODE}]
1401.15Scgd
1411.15ScgdDOCDIR		Base path for system documentation (e.g. PSD, USD, etc.)
1421.116Slukem	        installation.  [/usr/share/doc]
1431.62Ssimonb
1441.62SsimonbHTMLDOCDIR	Base path for html system documentation installation.
1451.62Ssimonb		[/usr/share/doc/html]
1461.15Scgd
1471.116SlukemDOCGRP		Documentation group.  [wheel]
1481.15Scgd
1491.116SlukemDOCOWN		Documentation owner.  [root]
1501.15Scgd
1511.116SlukemDOCMODE		Documentation mode.  [${NONBINMODE}]
1521.15Scgd
1531.84SkleinkNLSDIR		Base path for Native Language Support files installation.
1541.15Scgd		[/usr/share/nls]
1551.1Scgd
1561.116SlukemNLSGRP		Native Language Support files group.  [wheel]
1571.1Scgd
1581.116SlukemNLSOWN		Native Language Support files owner.  [root]
1591.1Scgd
1601.116SlukemNLSMODE		Native Language Support files mode.  [${NONBINMODE}]
1611.1Scgd
1621.144SlukemX11SRCDIR	The path to the xsrc tree.  [/usr/xsrc]
1631.144Slukem
1641.144SlukemX11SRCDIR.xc	The path to the X11R6 xc src tree.  [${X11SRCDIR}/xfree/xc]
1651.144Slukem
1661.144SlukemX11SRCDIR.local	The path to the local X11R6 src tree.  [${X11SRCDIR}/local]
1671.144Slukem
1681.144SlukemX11ROOTDIR	Root directory of the X11 installation.  [/usr/X11R6]
1691.144Slukem
1701.144SlukemX11BINDIR	X11 bin directory.  [${X11ROOTDIR}/bin]
1711.144Slukem
1721.144SlukemX11FONTDIR	X11 font directory.  [${X11ROOTDIR}/lib/X11/fonts]
1731.144Slukem
1741.144SlukemX11INCDIR	X11 include directory.  [${X11ROOTDIR}/include]
1751.144Slukem
1761.144SlukemX11LIBDIR	X11 lib/x11 (config) directory.  [${X11ROOTDIR}/lib/X11]
1771.144Slukem
1781.144SlukemX11MANDIR	X11 manual directory.  [${X11ROOTDIR}/man]
1791.144Slukem
1801.144SlukemX11USRLIBDIR	X11 library directory.  [${X11ROOTDIR}/lib]
1811.144Slukem
1821.32SmikelSTRIPFLAG	The flag passed to the install program to cause the binary
1831.1Scgd		to be stripped.  This is to be used when building your
1841.1Scgd		own install script so that the entire system can be made
1851.146Slukem		stripped/not-stripped using a single knob.  []
1861.1Scgd
1871.2ScgdCOPY		The flag passed to the install program to cause the binary
1881.2Scgd		to be copied rather than moved.  This is to be used when
1891.2Scgd		building our own install script so that the entire system
1901.2Scgd		can either be installed with copies, or with moves using
1911.116Slukem		a single knob.  [-c]
1921.15Scgd
1931.150SlukemMAKEDIRTARGET dir target [params]
1941.150Slukem		Runs "cd $${dir} && ${MAKE} [params] $${target}",
1951.150Slukem		displaying a "pretty" message whilst doing so.
1961.150Slukem
1971.152SclRELEASEMACHINEDIR
1981.152Scl		Subdirectory used below RELEASEDIR when building
1991.152Scl		a release.  [${MACHINE}]
2001.152Scl
2011.152SclRELEASEMACHINE	Subdirectory or path component used for the following
2021.152Scl		paths:
2031.152Scl			distrib/${RELEASEMACHINE}
2041.152Scl			distrib/notes/${RELEASEMACHINE}
2051.152Scl			etc/etc.${RELEASEMACHINE}
2061.152Scl		Used when building a release.  [${MACHINE}]
2071.150Slukem
2081.134SlukemAdditionally, the following variables may be set by <bsd.own.mk> or in a
2091.17Sthorpejmake configuration file to modify the behaviour of the system build
2101.17Sthorpejprocess (default values are in brackets along with comments, if set by
2111.134Slukem<bsd.own.mk>):
2121.33Sjonathan
2131.171ShubertfUSETOOLS	Documented in mk.conf(5)
2141.142Slukem
2151.116SlukemOBJECT_FMT	Object file format.  [set to "ELF" on architectures that
2161.156Stron		use ELF -- currently all architectures but ns32k, set to
2171.156Stron		"a.out" on ns32k].
2181.33Sjonathan
2191.103SthorpejTOOLCHAIN_MISSING
2201.142Slukem		If not "no", this indicates that the platform being built
2211.103Sthorpej		does not have a working in-tree toolchain.  If the
2221.142Slukem		${MACHINE_ARCH} in question falls into this category,
2231.142Slukem		TOOLCHAIN_MISSING is conditionally assigned the value "yes". 
2241.103Sthorpej		Otherwise, the variable is unconditionally assigned the
2251.103Sthorpej		value "no".
2261.142Slukem		If not "no", ${MKBFD}, ${MKGCC}, and ${MKGDB} are
2271.142Slukem		unconditionally assigned the value "no".
2281.103Sthorpej
2291.103SthorpejEXTERNAL_TOOLCHAIN
2301.103Sthorpej		This variable is not directly set by <bsd.own.mk>, but
2311.103Sthorpej		including <bsd.own.mk> is the canonical way to gain
2321.103Sthorpej		access to this variable.  The variable should be defined
2331.103Sthorpej		either in the user's environment or in the user's mk.conf
2341.103Sthorpej		file.  If defined, this variable indicates the root of
2351.103Sthorpej		an external toolchain which will be used to build the
2361.142Slukem		tree.  For example, if a platform is a ${TOOLCHAIN_MISSING}
2371.103Sthorpej		platform, EXTERNAL_TOOLCHAIN can be used to re-enable the
2381.103Sthorpej		cross-compile framework.
2391.103Sthorpej
2401.142Slukem		If EXTERNAL_TOOLCHAIN is defined, ${MKGCC} is unconditionally
2411.142Slukem		assigned the value "no", since the external version of the
2421.142Slukem		compiler may not be able to build the library components of
2431.142Slukem		the in-tree compiler.
2441.103Sthorpej
2451.103Sthorpej		NOTE: This variable is not yet used in as many places as
2461.103Sthorpej		it should be.  Expect the exact semantics of this variable
2471.103Sthorpej		to change in the short term as parts of the cross-compile
2481.103Sthorpej		framework continue to be cleaned up.
2491.1Scgd
2501.134Slukem<bsd.own.mk> is generally useful when building your own Makefiles so that
2511.1Scgdthey use the same default owners etc. as the rest of the tree.
2521.131Slukem
2531.131Slukem
2541.131Slukem=-=-=-=-=   bsd.dep.mk   =-=-=-=-=
2551.131Slukem
2561.131SlukemThe include file <bsd.dep.mk> contains the default targets for building
2571.133Slukem.depend files.  It creates .d files from entries in SRCS and DPSRCS
2581.133Slukemthat are C, C++, or Objective C source files, and builds .depend from the
2591.133Slukem.d files.  All other files in SRCS and all of DPSRCS will be used as
2601.133Slukemdependencies for the .d files.  In order for this to function correctly,
2611.132Slukemit should be .included after all other .mk files and directives that may
2621.132Slukemmodify SRCS or DPSRCS.  It uses the following variables:
2631.132Slukem
2641.132SlukemSRCS		List of source files to build the program.
2651.132Slukem
2661.132SlukemDPSRCS		List of source files which are needed for generating
2671.132Slukem		dependencies, but are not needed in ${SRCS}.
2681.1Scgd
2691.1Scgd
2701.118Slukem=-=-=-=-=   bsd.files.mk   =-=-=-=-=
2711.106Sthorpej
2721.118SlukemThe include file <bsd.files.mk> handles the FILES variables and is included
2731.134Slukemfrom <bsd.lib.mk> and <bsd.prog.mk>, and uses the following variables:
2741.124Slukem
2751.124SlukemFILES		The list of files to install.
2761.124Slukem
2771.153SlukemCONFIGFILES	Similar semantics to FILES, except that the files
2781.153Slukem		are installed by the `configinstall' target,
2791.153Slukem		not the `install' target.
2801.153Slukem		The FILES* variables documented below also apply.
2811.153Slukem
2821.124SlukemFILESOWN	File owner.  [${BINOWN}]
2831.124Slukem
2841.124SlukemFILESGRP	File group.  [${BINGRP}]
2851.124Slukem
2861.124SlukemFILESMODE	File mode.  [${BINMODE}]
2871.124Slukem
2881.124SlukemFILESDIR	The location to install the files.
2891.124Slukem
2901.124SlukemFILESNAME	Optional name to install each file as.
2911.124Slukem
2921.153SlukemFILESOWN_<fn>	File owner of the specific file <fn>.
2931.153Slukem
2941.153SlukemFILESGRP_<fn>	File group of the specific file <fn>.
2951.153Slukem
2961.153SlukemFILESMODE_<fn>	File mode of the specific file <fn>.
2971.153Slukem
2981.153SlukemFILESDIR_<fn>	The location to install the specific file <fn>>
2991.153Slukem
3001.153SlukemFILESNAME_<fn>	Optional name to install <fn> as.
3011.124Slukem
3021.135Slukem
3031.139SlukemBUILDSYMLINKS	List of two word items:
3041.135Slukem			lnsrc lntgt
3051.135Slukem		For each lnsrc item, create a symlink named lntgt.
3061.135Slukem		The lntgt symlinks are removed by the cleandir target.
3071.106Sthorpej
3081.148SjmcUUDECODE_FILES	List of files which are stored as <file>.uue in the source
3091.148Sjmc		tree. Each one will be decoded with ${TOOL_UUDECODE}.
3101.148Sjmc		The source files have a `.uue' suffix, the generated files do 
3111.148Sjmc		not.
3121.149Sjmc
3131.149SjmcUUDECODE_FILES_RENAME_fn Rename the output from the decode to the provided name.
3141.148Sjmc		
3151.148Sjmc		*NOTE: These files are simply decoded, with no install or other
3161.148Sjmc		       rule applying implicitly except being added to the clean
3171.148Sjmc		       target.
3181.106Sthorpej
3191.118Slukem=-=-=-=-=   bsd.gcc.mk   =-=-=-=-=
3201.113Sthorpej
3211.113SthorpejThe include file <bsd.gcc.mk> computes various parameters related to GCC
3221.113Sthorpejsupport libraries.  It defines no targets.  <bsd.own.mk> MUST be included
3231.134Slukembefore <bsd.gcc.mk>.
3241.113Sthorpej
3251.134SlukemThe primary users of <bsd.gcc.mk> are <bsd.prog.mk> and <bsd.lib.mk>, each
3261.113Sthorpejof which need to know where to find certain GCC support libraries.
3271.113Sthorpej
3281.134SlukemThe behavior of <bsd.gcc.mk> is influenced by the EXTERNAL_TOOLCHAIN variable,
3291.113Sthorpejwhich is generally set by the user.  If EXTERNAL_TOOLCHAIN it set, then
3301.113Sthorpejthe compiler is asked where to find the support libraries, otherwise the
3311.113Sthorpejsupport libraries are found in ${DESTDIR}/usr/lib.
3321.113Sthorpej
3331.134Slukem<bsd.gcc.mk> sets the following variables:
3341.113Sthorpej
3351.118Slukem_GCC_CRTBEGIN	The full path name to crtbegin.o.
3361.118Slukem
3371.118Slukem_GCC_CRTBEGINS	The full path name to crtbeginS.o.
3381.118Slukem
3391.118Slukem_GCC_CRTEND	The full path name to crtend.o.
3401.118Slukem
3411.118Slukem_GCC_CRTENDS	The full path name to crtendS.o.
3421.118Slukem
3431.118Slukem_GCC_LIBGCCDIR	The directory where libgcc.a is located.
3441.118Slukem
3451.118Slukem
3461.118Slukem=-=-=-=-=   bsd.inc.mk   =-=-=-=-=
3471.118Slukem
3481.134SlukemThe include file <bsd.inc.mk> defines the includes target and uses the
3491.118Slukemvariables:
3501.118Slukem
3511.124SlukemINCS		The list of include files.
3521.118Slukem
3531.118SlukemINCSDIR		The location to install the include files.
3541.118Slukem
3551.118SlukemINCSNAME	Target name of the include file, if only one; same as
3561.118Slukem		FILESNAME, but for include files.
3571.118Slukem
3581.134SlukemINCSYMLINKS	Similar to SYMLINKS in <bsd.links.mk>, except that these
3591.134Slukem		are installed in the 'includes' target and not the
3601.134Slukem		(much later) 'install' target.
3611.134Slukem
3621.118SlukemINCSNAME_<file>	The name file <file> should be installed as, if not <file>,
3631.118Slukem		same as FILESNAME_<file>, but for include files.
3641.118Slukem
3651.118Slukem
3661.118Slukem=-=-=-=-=   bsd.info.mk   =-=-=-=-=
3671.118Slukem
3681.118SlukemThe include file <bsd.info.mk> is used to generate and install GNU Info
3691.118Slukemdocumentation from respective Texinfo source files.  It defines three
3701.118Slukemimplicit targets (.txi.info, .texi.info, and .texinfo.info), and uses the
3711.118Slukemfollowing variables:
3721.118Slukem
3731.118SlukemTEXINFO		List of Texinfo source files.  Info documentation will
3741.118Slukem		consist of single files with the extension replaced by
3751.118Slukem		.info.
3761.118Slukem
3771.118SlukemINFOFLAGS	Flags to pass to makeinfo.  []
3781.118Slukem
3791.118Slukem
3801.118Slukem=-=-=-=-=   bsd.kernobj.mk   =-=-=-=-=
3811.118Slukem
3821.118SlukemThe include file <bsd.kernobj.mk> defines variables related to the
3831.118Slukemlocation of kernel sources and object directories.
3841.118Slukem
3851.118SlukemKERNSRCDIR	Is the location of the top of the kernel src.
3861.124Slukem		[${_SRC_TOP_}/sys]
3871.118Slukem
3881.124SlukemKERNARCHDIR	Is the location of the machine dependent kernel sources.
3891.124Slukem		[arch/${MACHINE}]
3901.120Slukem
3911.124SlukemKERNCONFDIR	Is where the configuration files for kernels are found.
3921.124Slukem		[${KERNSRCDIR}/${KERNARCHDIR}/conf]
3931.118Slukem
3941.118SlukemKERNOBJDIR	Is the kernel build directory.  The kernel GENERIC for
3951.118Slukem		instance will be compiled in ${KERNOBJDIR}/GENERIC.
3961.118Slukem		The default value is
3971.118Slukem		${MAKEOBJDIRPREFIX}${KERNSRCDIR}/${KERNARCHDIR}/compile
3981.118Slukem		if it exists or the target 'obj' is being made.
3991.118Slukem		Otherwise the default is
4001.118Slukem		${KERNSRCDIR}/${KERNARCHDIR}/compile.
4011.118Slukem
4021.118SlukemIt is important that Makefiles (such as those under src/distrib) that
4031.134Slukemwish to find compiled kernels use <bsd.kernobj.mk> and ${KERNOBJDIR}
4041.118Slukemrather than make assumptions about the location of the compiled kernel.
4051.118Slukem
4061.118Slukem
4071.118Slukem=-=-=-=-=   bsd.kinc.mk   =-=-=-=-=
4081.118Slukem
4091.118SlukemThe include file <bsd.kinc.mk> defines the many targets (includes,
4101.118Slukemsubdirectories, etc.), and is used by kernel makefiles to handle
4111.118Slukeminclude file installation.  It is intended to be included alone, by
4121.134Slukemkernel Makefiles.  It uses similar variables to <bsd.inc.mk>.
4131.134SlukemPlease see <bsd.kinc.mk> for more details, and keep the documentation
4141.134Slukemin that file up to date.
4151.118Slukem
4161.118Slukem
4171.118Slukem=-=-=-=-=   bsd.lib.mk   =-=-=-=-=
4181.118Slukem
4191.118SlukemThe include file <bsd.lib.mk> has support for building libraries.  It has
4201.118Slukemthe same eight targets as <bsd.prog.mk>: all, clean, cleandir, depend,
4211.118Slukemincludes, install, lint, and tags.  Additionally, it has a checkver target
4221.118Slukemwhich checks for installed shared object libraries whose version is greater
4231.118Slukemthat the version of the source. It has a limited number of suffixes,
4241.134Slukemconsistent with the current needs of the BSD tree.  <bsd.lib.mk> includes
4251.118Slukem<bsd.shlib.mk> to get shared library parameters.
4261.118Slukem
4271.118SlukemIt sets/uses the following variables:
4281.118Slukem
4291.118SlukemLIB		The name of the library to build.
4301.118Slukem
4311.118SlukemLIBDIR		Target directory for libraries.
4321.118Slukem
4331.118SlukemSHLIBINSTALLDIR	Target directory for shared libraries if ${USE_SHLIBDIR}
4341.142Slukem		is not "no".
4351.118Slukem
4361.142SlukemUSE_SHLIBDIR	If not "no", use ${SHLIBINSTALLDIR} instead of ${LIBDIR}
4371.118Slukem		as the path to install shared libraries to.
4381.118Slukem		USE_SHLIBDIR must be defined before <bsd.own.mk> is included.
4391.130Slukem		Default: no
4401.118Slukem
4411.154SlukemMKPRIVATELIB	If not "no", act as "MKPROFILE=no MKPIC=no MKLINT=no",
4421.154Slukem		and don't install the (.a) library.
4431.154Slukem		This is useful for "build only" helper libraries.
4441.154Slukem		Default: no
4451.154Slukem
4461.118SlukemLINTLIBDIR	Target directory for lint libraries.
4471.118Slukem
4481.118SlukemLIBGRP		Library group.
4491.118Slukem
4501.118SlukemLIBOWN		Library owner.
4511.118Slukem
4521.118SlukemLIBMODE		Library mode.
4531.118Slukem
4541.118SlukemLDADD		Additional loader objects.
4551.118Slukem
4561.118SlukemMAN		The manual pages to be installed (use a .1 - .9 suffix).
4571.118Slukem
4581.118SlukemNOCHECKVER_<library>
4591.118SlukemNOCHECKVER	If set, disables checking for installed shared object
4601.118Slukem		libraries with versions greater than the source.  A
4611.118Slukem		particular library name, without the "lib" prefix, may
4621.118Slukem		be appended to the variable name to disable the check for
4631.118Slukem		only that library.
4641.118Slukem
4651.118SlukemSRCS		List of source files to build the library.  Suffix types
4661.118Slukem		.s, .c, and .f are supported.  Note, .s files are preferred
4671.118Slukem		to .c files of the same name.  (This is not the default for
4681.118Slukem		versions of make.)
4691.118Slukem
4701.157SlukemLIBDPLIBS	A list of the tuples:
4711.157Slukem			libname  path-to-srcdir-of-libname
4721.157Slukem
4731.157Slukem		For each tuple;
4741.157Slukem		     *	LIBDO.libname contains the .OBJDIR of the library
4751.157Slukem			`libname', and if it is not set it is determined
4761.157Slukem			from the srcdir and added to MAKEOVERRIDES (the
4771.157Slukem			latter is to allow for build time optimization).
4781.157Slukem		     *	LDADD gets  -L${LIBDO.libname} -llibname    added.
4791.157Slukem		     *	DPADD gets  ${LIBDO.libname}/liblibname.so  or
4801.157Slukem				    ${LIBDO.libname}/liblibname.a   added.
4811.157Slukem
4821.157Slukem		This variable may be used for individual libraries, as
4831.157Slukem		well as in parent directories to cache common libraries 
4841.157Slukem		as a build-time optimization.
4851.157Slukem
4861.118SlukemThe include file <bsd.lib.mk> includes the file named "../Makefile.inc"
4871.118Slukemif it exists, as well as the include file <bsd.man.mk>.
4881.118Slukem
4891.118SlukemIt has rules for building profiled objects; profiled libraries are
4901.118Slukembuilt by default.
4911.118Slukem
4921.118SlukemLibraries are ranlib'd when made.
4931.118Slukem
4941.118Slukem
4951.118Slukem=-=-=-=-=   bsd.links.mk   =-=-=-=-=
4961.118Slukem
4971.118SlukemThe include file <bsd.links.mk> handles the LINKS and SYMLINKS variables
4981.134Slukemand is included from from <bsd.lib.mk> and <bsd.prog.mk>.
4991.134Slukem
5001.134SlukemLINKS		The list of hard links, consisting of pairs of paths:
5011.134Slukem			source-file target-file
5021.134Slukem		${DESTDIR} is prepended to both paths before linking.
5031.134Slukem		For example, to link /bin/test and /bin/[, use:
5041.134Slukem			LINKS=/bin/test /bin/[
5051.134Slukem
5061.153SlukemCONFIGLINKS	Similar semantics to LINKS, except that the links
5071.153Slukem		are installed by the `configinstall' target,
5081.153Slukem		not the `install' target.
5091.153Slukem
5101.134SlukemSYMLINKS	The list of symbolic links, consisting of pairs of paths:
5111.134Slukem			source-file target-file
5121.134Slukem		${DESTDIR} is only prepended to target-file before linking.
5131.134Slukem		For example, to symlink /usr/bin/tar to /bin/tar resulting
5141.134Slukem		in ${DESTDIR}/usr/bin/tar -> /bin/tar:
5151.134Slukem			SYMLINKS=/bin/tar /usr/bin/tar
5161.118Slukem
5171.153SlukemCONFIGSYMLINKS	Similar semantics to SYMLINKS, except that the symbolic links
5181.153Slukem		are installed by the `configinstall' target,
5191.153Slukem		not the `install' target.
5201.153Slukem
5211.118Slukem
5221.118Slukem=-=-=-=-=   bsd.man.mk   =-=-=-=-=
5231.118Slukem
5241.118SlukemThe include file <bsd.man.mk> handles installing manual pages and their
5251.118Slukemlinks.
5261.118Slukem
5271.118SlukemIt has a two targets:
5281.118Slukem
5291.118Slukem	maninstall:
5301.118Slukem		Install the manual page sources and their links.
5311.118Slukem	catinstall:
5321.118Slukem		Install the preformatted manual pages and their links.
5331.118Slukem
5341.118SlukemIt sets/uses the following variables:
5351.118Slukem
5361.118SlukemMANDIR		Base path for manual installation.
5371.118Slukem
5381.118SlukemMANGRP		Manual group.
5391.118Slukem
5401.118SlukemMANOWN		Manual owner.
5411.118Slukem
5421.118SlukemMANMODE		Manual mode.
5431.118Slukem
5441.118SlukemMANSUBDIR	Subdirectory under the manual page section, i.e. "/vax"
5451.118Slukem		or "/tahoe" for machine specific manual pages.
5461.118Slukem
5471.118SlukemMAN		The manual pages to be installed (use a .1 - .9 suffix).
5481.118Slukem
5491.118SlukemMLINKS		List of manual page links (using a .1 - .9 suffix).  The
5501.118Slukem		linked-to file must come first, the linked file second,
5511.118Slukem		and there may be multiple pairs.  The files are soft-linked.
5521.118Slukem
5531.118SlukemThe include file <bsd.man.mk> includes a file named "../Makefile.inc" if
5541.118Slukemit exists.
5551.118Slukem
5561.118Slukem
5571.118Slukem=-=-=-=-=   bsd.obj.mk   =-=-=-=-=
5581.118Slukem
5591.118SlukemThe include file <bsd.obj.mk> defines targets related to the creation
5601.118Slukemand use of separated object and source directories.
5611.118Slukem
5621.118SlukemIf an environment variable named MAKEOBJDIRPREFIX is set, make(1) uses
5631.118Slukem${MAKEOBJDIRPREFIX}${.CURDIR} as the name of the object directory if
5641.118Slukemit exists.  Otherwise make(1) looks for the existence of a
5651.118Slukemsubdirectory (or a symlink to a directory) of the source directory
5661.118Slukeminto which built targets should be placed.  If an environment variable
5671.118Slukemnamed MAKEOBJDIR is set, make(1) uses its value as the name of the
5681.118Slukemobject directory; failing that, make first looks for a subdirectory
5691.118Slukemnamed "obj.${MACHINE}", and if that doesn't exist, it looks for "obj".
5701.118Slukem
5711.118SlukemObject directories are not created automatically by make(1) if they
5721.118Slukemdon't exist; you need to run a separate "make obj".  (This will happen
5731.118Slukemduring a top-level build if "MKOBJDIRS" is set to a value other than
5741.118Slukem"no").  When the source directory is a subdirectory of ${BSDSRCDIR} --
5751.118Slukemand this is determined by a simple string prefix comparison -- object
5761.118Slukemdirectories are created in a separate object directory tree, and a
5771.118Slukemsymlink to the object directory in that tree is created in the source
5781.118Slukemdirectory; otherwise, "make obj" assumes that you're not in the main
5791.118Slukemsource tree and that it's not safe to use a separate object tree.
5801.118Slukem
5811.118SlukemSeveral variables used by <bsd.obj.mk> control exactly what
5821.118Slukemdirectories and links get created during a "make obj":
5831.118Slukem
5841.118SlukemMAKEOBJDIR	If set, this is the component name of the object
5851.118Slukem		directory.
5861.118Slukem
5871.118SlukemOBJMACHINE	If this is set but MAKEOBJDIR is not set, creates
5881.118Slukem		object directories or links named "obj.${MACHINE}";
5891.118Slukem		otherwise, just creates ones named "obj".
5901.118Slukem
5911.118SlukemUSR_OBJMACHINE  If set, and the current directory is a subdirectory of
5921.118Slukem		${BSDSRCDIR}, create object directory in the
5931.118Slukem		corresponding subdirectory of ${BSDOBJDIR}.${MACHINE};
5941.118Slukem		otherwise, create it in the corresponding subdirectory
5951.118Slukem		of ${BSDOBJDIR}
5961.113Sthorpej
5971.118SlukemBUILDID		If set, the contents of this variable are appended
5981.118Slukem		to the object directory name.  If OBJMACHINE is also
5991.118Slukem		set, ".${BUILDID}" is added after ".${MACHINE}".
6001.113Sthorpej
6011.106Sthorpej
6021.118Slukem=-=-=-=-=   bsd.prog.mk   =-=-=-=-=
6031.106Sthorpej
6041.1ScgdThe include file <bsd.prog.mk> handles building programs from one or
6051.1Scgdmore source files, along with their manual pages.  It has a limited number
6061.134Slukemof suffixes, consistent with the current needs of the BSD tree. 
6071.134Slukem<bsd.prog.mk> includes <bsd.shlib.mk> to get shared library parameters.
6081.1Scgd
6091.16SjtcIt has eight targets:
6101.1Scgd
6111.1Scgd	all:
6121.102Sthorpej		build the program and its manual page.  This also
6131.102Sthorpej		creates a GDB initialization file (.gdbinit) in
6141.102Sthorpej		the objdir.  The .gdbinit file sets the shared library
6151.102Sthorpej		prefix to ${DESTDIR} to facilitate cross-debugging.
6161.1Scgd	clean:
6171.1Scgd		remove the program, any object files and the files a.out,
6181.24Smikel		Errs, errs, mklog, and ${PROG}.core.
6191.1Scgd	cleandir:
6201.1Scgd		remove all of the files removed by the target clean, as
6211.1Scgd		well as .depend, tags, and any manual pages.
6221.42Slukem		`distclean' is a synonym for `cleandir'.
6231.1Scgd	depend:
6241.1Scgd		make the dependencies for the source files, and store
6251.1Scgd		them in the file .depend.
6261.16Sjtc	includes:
6271.16Sjtc		install any header files.
6281.1Scgd	install:
6291.1Scgd		install the program and its manual pages; if the Makefile
6301.1Scgd		does not itself define the target install, the targets
6311.1Scgd		beforeinstall and afterinstall may also be used to cause
6321.1Scgd		actions immediately before and after the install target
6331.1Scgd		is executed.
6341.1Scgd	lint:
6351.1Scgd		run lint on the source files
6361.1Scgd	tags:
6371.1Scgd		create a tags file for the source files.
6381.1Scgd
6391.1ScgdIt sets/uses the following variables:
6401.1Scgd
6411.1ScgdBINGRP		Binary group.
6421.1Scgd
6431.1ScgdBINOWN		Binary owner.
6441.1Scgd
6451.1ScgdBINMODE		Binary mode.
6461.1Scgd
6471.1ScgdCLEANFILES	Additional files to remove for the clean and cleandir targets.
6481.1Scgd
6491.1ScgdCOPTS		Additional flags to the compiler when creating C objects.
6501.112Sthorpej
6511.125SlukemCOPTS.<fn>	Additional flags to the compiler when creating the
6521.125Slukem		C objects for <fn>.
6531.125Slukem		For <fn>.[ly], "<fn>.c" must be used.
6541.125Slukem
6551.112SthorpejCPUFLAGS	Additional flags to the compiler/assembler to select
6561.112Sthorpej		CPU instruction set options, CPU tuning options, etc.
6571.35Slukem
6581.125SlukemCPUFLAGS.<fn>	Additional flags to the compiler/assembler for <fn>.
6591.125Slukem		For <fn>.[ly], "<fn>.c" must be used.
6601.125Slukem
6611.124SlukemCPPFLAGS	Additional flags to the C pre-processor.
6621.125Slukem
6631.125SlukemCPPFLAGS.<fn>	Additional flags to the C pre-processor for <fn>.
6641.125Slukem		For <fn>.[ly], "<fn>.c" must be used.
6651.102Sthorpej
6661.102SthorpejGDBINIT		List of GDB initialization files to add to "source"
6671.102Sthorpej		directives in the .gdbinit file that is created in the
6681.102Sthorpej		objdir.
6691.1Scgd
6701.1ScgdLDADD		Additional loader objects.  Usually used for libraries.
6711.1Scgd		For example, to load with the compatibility and utility
6721.1Scgd		libraries, use:
6731.1Scgd
6741.5Sjtc			LDADD+=-lutil -lcompat
6751.1Scgd
6761.1ScgdLDFLAGS		Additional loader flags.
6771.1Scgd
6781.134SlukemLINKS		See <bsd.links.mk>
6791.134Slukem
6801.134SlukemSYMLINKS	See <bsd.links.mk>
6811.1Scgd
6821.15ScgdMAN		Manual pages (should end in .1 - .9).  If no MAN variable is
6831.8Scgd		defined, "MAN=${PROG}.1" is assumed.
6841.1Scgd
6851.1ScgdPROG		The name of the program to build.  If not supplied, nothing
6861.1Scgd		is built.
6871.1Scgd
6881.88SthorpejPROG_CXX	If defined, the name of the program to build.  Also
6891.88Sthorpej		causes <bsd.prog.mk> to link the program with the C++
6901.88Sthorpej		compiler rather than the C compiler.  PROG_CXX overrides
6911.88Sthorpej		the value of PROG if PROG is also set.
6921.87Sthorpej
6931.21SchristosPROGNAME	The name that the above program will be installed as, if
6941.21Schristos		different from ${PROG}.
6951.21Schristos
6961.37StvSRCS		List of source files to build the program.  If SRCS is not
6971.1Scgd		defined, it's assumed to be ${PROG}.c.
6981.108Sjwise
6991.108SjwiseDPSRCS		List of source files which are needed for generating
7001.108Sjwise		dependencies, but are not needed in ${SRCS}.
7011.1Scgd
7021.1ScgdDPADD		Additional dependencies for the program.  Usually used for
7031.1Scgd		libraries.  For example, to depend on the compatibility and
7041.1Scgd		utility libraries use:
7051.1Scgd
7061.5Sjtc			DPADD+=${LIBCOMPAT} ${LIBUTIL}
7071.1Scgd
7081.1Scgd		The following libraries are predefined for DPADD:
7091.1Scgd
7101.21Schristos		LIBCRT0?=	${DESTDIR}/usr/lib/crt0.o
7111.159Slukem		LIBASN1?=	${DESTDIR}/usr/lib/libasn1.a
7121.159Slukem		LIBBSDMALLOC?=	${DESTDIR}/usr/lib/libbsdmalloc.a
7131.99Sitojun		LIBBZ2?=	${DESTDIR}/usr/lib/libbz2.a
7141.21Schristos		LIBC?=		${DESTDIR}/usr/lib/libc.a
7151.21Schristos		LIBC_PIC?=	${DESTDIR}/usr/lib/libc_pic.a
7161.99Sitojun		LIBCDK?=	${DESTDIR}/usr/lib/libcdk.a
7171.99Sitojun		LIBCOM_ERR?=	${DESTDIR}/usr/lib/libcom_err.a
7181.21Schristos		LIBCOMPAT?=	${DESTDIR}/usr/lib/libcompat.a
7191.21Schristos		LIBCRYPT?=	${DESTDIR}/usr/lib/libcrypt.a
7201.99Sitojun		LIBCRYPTO?=	${DESTDIR}/usr/lib/libcrypto.a
7211.99Sitojun		LIBCRYPTO_IDEA?=${DESTDIR}/usr/lib/libcrypto_idea.a
7221.105Sitojun		LIBCRYPTO_MDC2?=${DESTDIR}/usr/lib/libcrypto_mdc2.a
7231.99Sitojun		LIBCRYPTO_RC5?=	${DESTDIR}/usr/lib/libcrypto_rc5.a
7241.21Schristos		LIBCURSES?=	${DESTDIR}/usr/lib/libcurses.a
7251.21Schristos		LIBDBM?=	${DESTDIR}/usr/lib/libdbm.a
7261.21Schristos		LIBDES?=	${DESTDIR}/usr/lib/libdes.a
7271.21Schristos		LIBEDIT?=	${DESTDIR}/usr/lib/libedit.a
7281.114Sprovos		LIBEVENT?=	${DESTDIR}/usr/lib/libevent.a
7291.73Sblymn		LIBFORM?=	${DESTDIR}/usr/lib/libform.a
7301.159Slukem		LIBG2C?=	${DESTDIR}/usr/lib/libg2c.a
7311.21Schristos		LIBGCC?=	${DESTDIR}/usr/lib/libgcc.a
7321.21Schristos		LIBGNUMALLOC?=	${DESTDIR}/usr/lib/libgnumalloc.a
7331.99Sitojun		LIBGSSAPI?=	${DESTDIR}/usr/lib/libgssapi.a
7341.99Sitojun		LIBHDB?=	${DESTDIR}/usr/lib/libhdb.a
7351.70Sitojun		LIBINTL?=	${DESTDIR}/usr/lib/libintl.a
7361.49Sitojun		LIBIPSEC?=	${DESTDIR}/usr/lib/libipsec.a
7371.99Sitojun		LIBKADM?=	${DESTDIR}/usr/lib/libkadm.a
7381.99Sitojun		LIBKADM5CLNT?=	${DESTDIR}/usr/lib/libkadm5clnt.a
7391.99Sitojun		LIBKADM5SRV?=	${DESTDIR}/usr/lib/libkadm5srv.a
7401.99Sitojun		LIBKAFS?=	${DESTDIR}/usr/lib/libkafs.a
7411.21Schristos		LIBKDB?=	${DESTDIR}/usr/lib/libkdb.a
7421.21Schristos		LIBKRB?=	${DESTDIR}/usr/lib/libkrb.a
7431.99Sitojun		LIBKRB5?=	${DESTDIR}/usr/lib/libkrb5.a
7441.99Sitojun		LIBKSTREAM?=	${DESTDIR}/usr/lib/libkstream.a
7451.21Schristos		LIBKVM?=	${DESTDIR}/usr/lib/libkvm.a
7461.21Schristos		LIBL?=		${DESTDIR}/usr/lib/libl.a
7471.21Schristos		LIBM?=		${DESTDIR}/usr/lib/libm.a
7481.53Sblymn		LIBMENU?=	${DESTDIR}/usr/lib/libmenu.a
7491.99Sitojun		LIBOBJC?=	${DESTDIR}/usr/lib/libobjc.a
7501.99Sitojun		LIBOSSAUDIO?=	${DESTDIR}/usr/lib/libossaudio.a
7511.159Slukem		LIBPAM?=	${DESTDIR}/usr/lib/libpam.a
7521.21Schristos		LIBPCAP?=	${DESTDIR}/usr/lib/libpcap.a
7531.99Sitojun		LIBPCI?=	${DESTDIR}/usr/lib/libpci.a
7541.100Sthorpej		LIBPMC?=	${DESTDIR}/usr/lib/libpmc.a
7551.26Skleink		LIBPOSIX?=	${DESTDIR}/usr/lib/libposix.a
7561.110Sthorpej		LIBPTHREAD?=	${DESTDIR}/usr/lib/libpthread.a
7571.110Sthorpej		LIBPTHREAD_DBG?=${DESTDIR}/usr/lib/libpthread_dbg.a
7581.163Schristos		LIBRADIUS?=	${DESTDIR}/usr/lib/libradius.a
7591.21Schristos		LIBRESOLV?=	${DESTDIR}/usr/lib/libresolv.a
7601.99Sitojun		LIBRMT?=	${DESTDIR}/usr/lib/librmt.a
7611.99Sitojun		LIBROKEN?=	${DESTDIR}/usr/lib/libroken.a
7621.21Schristos		LIBRPCSVC?=	${DESTDIR}/usr/lib/librpcsvc.a
7631.110Sthorpej		LIBRT?=		${DESTDIR}/usr/lib/librt.a
7641.21Schristos		LIBSKEY?=	${DESTDIR}/usr/lib/libskey.a
7651.140Slukem		LIBSL?=		${DESTDIR}/usr/lib/libsl.a
7661.99Sitojun		LIBSS?=		${DESTDIR}/usr/lib/libss.a
7671.159Slukem		LIBSSH?=	${DESTDIR}/usr/lib/libssh.a
7681.99Sitojun		LIBSSL?=	${DESTDIR}/usr/lib/libssl.a
7691.140Slukem		LIBSTDCXX?=	${DESTDIR}/usr/lib/libstdc++.a
7701.21Schristos		LIBTERMCAP?=	${DESTDIR}/usr/lib/libtermcap.a
7711.99Sitojun		LIBUSBHID?=	${DESTDIR}/usr/lib/libusbhid.a
7721.21Schristos		LIBUTIL?=	${DESTDIR}/usr/lib/libutil.a
7731.21Schristos		LIBWRAP?=	${DESTDIR}/usr/lib/libwrap.a
7741.21Schristos		LIBY?=		${DESTDIR}/usr/lib/liby.a
7751.21Schristos		LIBZ?=		${DESTDIR}/usr/lib/libz.a
7761.1Scgd
7771.1ScgdSHAREDSTRINGS	If defined, a new .c.o rule is used that results in shared
7781.12Schristos		strings, using xstr(1). Note that this will not work with
7791.12Schristos		parallel makes.
7801.1Scgd
7811.59SjlamSTRIPFLAG	The flag passed to the install program to cause the binary
7821.1Scgd		to be stripped.
7831.1Scgd
7841.1ScgdSUBDIR		A list of subdirectories that should be built as well.
7851.1Scgd		Each of the targets will execute the same target in the
7861.1Scgd		subdirectories.
7871.1Scgd
7881.21SchristosSCRIPTS		A list of interpreter scripts [file.{sh,csh,pl,awk,...}].
7891.21Schristos		These are installed exactly like programs.
7901.21Schristos
7911.166SrtrSCRIPTSDIR	The location to install the scripts.  Each script can be
7921.166Srtr		installed to a separate path by setting SCRIPTSDIR_<script>.
7931.166Srtr
7941.21SchristosSCRIPTSNAME	The name that the above program will be installed as, if
7951.21Schristos		different from ${SCRIPTS}. These can be further specialized
7961.21Schristos		by setting SCRIPTSNAME_<script>.
7971.21Schristos
7981.124SlukemFILES		See description of <bsd.files.mk>.
7991.21Schristos
8001.106SthorpejSHLINKDIR	Target directory for shared linker.  See description of
8011.106Sthorpej		<bsd.own.mk> for additional information about this variable.
8021.130Slukem
8031.130SlukemUSE_LIBSTDCXX	If "no", the support libraries needed for C++ programs
8041.130Slukem		are set to `-lsupc++ -lm', rather than `-lstdc++ -lm'.
8051.130Slukem		Default: yes
8061.85Slukem
8071.1ScgdThe include file <bsd.prog.mk> includes the file named "../Makefile.inc"
8081.1Scgdif it exists, as well as the include file <bsd.man.mk>.
8091.1Scgd
8101.1ScgdSome simple examples:
8111.1Scgd
8121.1ScgdTo build foo from foo.c with a manual page foo.1, use:
8131.1Scgd
8141.1Scgd	PROG=	foo
8151.1Scgd
8161.1Scgd	.include <bsd.prog.mk>
8171.1Scgd
8181.1ScgdTo build foo from foo.c with a manual page foo.2, add the line:
8191.1Scgd
8201.9Scgd	MAN=	foo.2
8211.1Scgd
8221.1ScgdIf foo does not have a manual page at all, add the line:
8231.1Scgd
8241.75Sagc	MKMAN=	no
8251.1Scgd
8261.1ScgdIf foo has multiple source files, add the line:
8271.1Scgd
8281.1Scgd	SRCS=	a.c b.c c.c d.c
8291.1Scgd
8301.1Scgd
8311.118Slukem=-=-=-=-=   bsd.rpc.mk   =-=-=-=-=
8321.118Slukem
8331.118SlukemThe include file <bsd.rpc.mk> contains a makefile fragment used to
8341.118Slukemconstruct source files built by rpcgen.
8351.72Ssommerfe
8361.118SlukemThe following macros may be defined in makefiles which include
8371.118Slukem<bsd.rpc.mk> in order to control which files get built and how they
8381.118Slukemare to be built:
8391.21Schristos
8401.118SlukemRPC_INCS:	construct .h file from .x file
8411.120SlukemRPC_XDRFILES:	construct _xdr.c from .x file
8421.118Slukem		(for marshalling/unmarshalling data types)
8431.118SlukemRPC_SVCFILES:	construct _svc.c from .x file
8441.118Slukem		(server-side stubs)
8451.118SlukemRPC_SVCFLAGS:	Additional flags passed to builds of RPC_SVCFILES.
8461.21Schristos
8471.118SlukemRPC_XDIR:	Directory containing .x/.h files
8481.23Schristos
8491.23Schristos
8501.118Slukem=-=-=-=-=   bsd.shlib.mk   =-=-=-=-=
8511.21Schristos
8521.118SlukemThe include file <bsd.shlib.mk> computes parameters for shared library
8531.118Slukeminstallation and use.  It defines no targets.  <bsd.own.mk> MUST be
8541.134Slukemincluded before <bsd.shlib.mk>.
8551.21Schristos
8561.134Slukem<bsd.own.mk> sets the following variables, if they are not already defined
8571.118Slukem(defaults are in brackets):
8581.21Schristos
8591.142SlukemSHLIBINSTALLDIR	If ${USE_SHLIBDIR} is not "no", use ${SHLIBINSTALLDIR}
8601.142Slukem		instead of ${LIBDIR} as the base path for shared library
8611.142Slukem		installation.  [/lib]
8621.21Schristos
8631.118SlukemSHLIBDIR	The path to USE_SHLIBDIR shared libraries to use when building
8641.118Slukem		a program.  [/lib for programs in /bin and /sbin, /usr/lib
8651.118Slukem		for all others.]
8661.81Swiz
8671.142Slukem_LIBSODIR	Set to ${SHLIBINSTALLDIR} if ${USE_SHLIBDIR} is not "no",
8681.118Slukem		otherwise set to ${LIBDIR}
8691.81Swiz
8701.118SlukemSHLINKINSTALLDIR Base path for shared linker.  [/libexec]
8711.39Scgd
8721.118SlukemSHLINKDIR	Path to use for shared linker when building a program.
8731.118Slukem		[/libexec for programs in /bin and /sbin, /usr/libexec for
8741.118Slukem		all others.]
8751.39Scgd
8761.13Schristos
8771.118Slukem=-=-=-=-=   bsd.subdir.mk   =-=-=-=-=
8781.13Schristos
8791.118SlukemThe include file <bsd.subdir.mk> contains the default targets for building
8801.120Slukemsubdirectories.  It has the same eight targets as <bsd.prog.mk>: all,
8811.118Slukemclean, cleandir, depend, includes, install, lint, and tags.  For all of
8821.142Slukemthe directories listed in ${SUBDIR}, the specified directory will be
8831.142Slukemvisited and the target made.  There is also a default target which allows
8841.142Slukemthe command "make subdir" where subdir is any directory listed in ${SUBDIR}.
8851.47Stv
8861.118SlukemAs a special case, the use of a token .WAIT as an entry in SUBDIR acts
8871.118Slukemas a synchronization barrier when multiple make jobs are run; subdirs
8881.118Slukembefore the .WAIT must complete before any subdirs after .WAIT are
8891.118Slukemstarted.  See make(1) for some caveats on use of .WAIT and other
8901.118Slukemspecial sources.
8911.47Stv
8921.47Stv
8931.118Slukem=-=-=-=-=   bsd.sys.mk   =-=-=-=-=
8941.47Stv
8951.13SchristosThe include file <bsd.sys.mk> is used by <bsd.prog.mk> and
8961.14Scgd<bsd.lib.mk>.  It contains overrides that are used when building
8971.133Slukemthe NetBSD source tree.
8981.133Slukem
8991.133SlukemThe following variables control how various files are compiled/built.
9001.142Slukem(Note that these may be overridden in <bsd.own.mk> if USETOOLS == "yes"):
9011.133Slukem
9021.133SlukemAR		Create, modify, and extract from archives.  [ar]
9031.133Slukem
9041.133SlukemARFLAGS		Options to ${AR}.  [rl]
9051.133Slukem
9061.151SlukemAS		Assembler.  [as]
9071.151Slukem
9081.151SlukemAFLAGS		Options to ${AS}.  []
9091.151Slukem
9101.133SlukemCC		C compiler.  [cc]
9111.133Slukem
9121.133SlukemCFLAGS		Options to ${CC}.  [Usually -O or -O2]
9131.133Slukem
9141.133SlukemCPP		C Pre-Processor.  [cpp]
9151.133Slukem
9161.133SlukemCPPFLAGS	Options to ${CPP}.  []
9171.133Slukem
9181.151SlukemCPUFLAGS	Optimization flags for ${CC}.  []
9191.133Slukem
9201.133SlukemCXX		C++ compiler.  [c++]
9211.133Slukem
9221.133SlukemCXXFLAGS	Options to ${CXX}.  [${CFLAGS}]
9231.133Slukem
9241.133SlukemELF2ECOFF	Convert ELF-format executable to ECOFF.  [elf2ecoff]
9251.133Slukem
9261.133SlukemFC		Fortran compiler.  [f77]
9271.133Slukem
9281.133SlukemFFLAGS		Options to {$FC}.  [-O]
9291.133Slukem
9301.133SlukemINSTALL		install(1) command.  [install]
9311.133Slukem
9321.133SlukemLEX		Lexical analyzer.  [lex]
9331.133Slukem
9341.133SlukemLFLAGS		Options to ${LEX}.  []
9351.133Slukem
9361.145SjwiseLPREFIX		Symbol prefix for ${LEX} (see -P option in lex(1)) [yy]
9371.145Sjwise
9381.133SlukemLD		Linker.  [ld]
9391.133Slukem
9401.133SlukemLDFLAGS		Options to ${LD}.  []
9411.133Slukem
9421.133SlukemLINT		C program verifier.  [lint]
9431.133Slukem
9441.133SlukemLINTFLAGS	Options to ${LINT}.  [-chapbxzF]
9451.133Slukem
9461.133SlukemLORDER		List dependencies for object files.  [lorder]
9471.133Slukem
9481.133SlukemMAKE		make(1).  [make]
9491.133Slukem
9501.133SlukemMKDEP		Construct Makefile dependency list.  [mkdep]
9511.133Slukem
9521.133SlukemNM		List symbols from object files.  [nm]
9531.133Slukem
9541.133SlukemPC		Pascal compiler.  [pc]  (Not present)
9551.133Slukem
9561.133SlukemPFLAGS		Options to ${PC}.  []
9571.133Slukem
9581.133SlukemOBJC		Objective C compiler.  [${CC}]
9591.133Slukem
9601.133SlukemOBJCFLAGS	Options to ${OBJC}.  [${CFLAGS}]
9611.133Slukem
9621.133SlukemOBJCOPY		Copy and translate object files.  [objcopy]
9631.133Slukem
9641.168SrizOBJDUMP		Display information from object files.  [objdump]
9651.168Sriz
9661.133SlukemRANLIB		Generate index to archive.  [ranlib]
9671.133Slukem
9681.133SlukemSHELL		Shell.  [sh]
9691.133Slukem
9701.133SlukemSIZE		List section sizes and total size.  [size]
9711.133Slukem
9721.133SlukemSTRIP		Discard symbols from object files.  [strip]
9731.133Slukem
9741.133SlukemTSORT		Topological sort of a directed graph.  [tsort -q]
9751.133Slukem
9761.133SlukemYACC		LALR(1) parser generator.  [yacc]
9771.133Slukem
9781.133SlukemYFLAGS		Options to ${YACC}.  []
9791.133Slukem
9801.133SlukemYHEADER		If defined, add "-d" to YFLAGS, and add dependencies
9811.133Slukem		from <file>.y to <file>.h and <file>.c, and add
9821.133Slukem		<foo>.h to CLEANFILES.
9831.133Slukem
9841.133SlukemYPREFIX		If defined, add "-p ${YPREFIX}" to YFLAGS.
9851.133Slukem
9861.116Slukem
9871.116SlukemThe following variables are defined to commands to perform the
9881.116Slukemappropriate operation, with the default in [brackets].
9891.142Slukem(Note that these are overridden in <bsd.own.mk> if USETOOLS == "yes"):
9901.116Slukem
9911.116SlukemTOOL_ASN1_COMPILE	ASN1 compiler.  [asn1_compile]
9921.116Slukem
9931.116SlukemTOOL_CAP_MKDB		Create capability database.  [cap_mkdb]
9941.116Slukem
9951.116SlukemTOOL_CAT		Concatenate and print files.  [cat]
9961.116Slukem
9971.116SlukemTOOL_CKSUM		Display file checksums.  [cksum]
9981.116Slukem
9991.116SlukemTOOL_COMPILE_ET		Error table compiler.  [compile_et]
10001.116Slukem
10011.116SlukemTOOL_CONFIG		Build kernel compilation directories.  [config]
10021.116Slukem
10031.116SlukemTOOL_CRUNCHGEN		Generate crunched binary build environment.  [crunchgen]
10041.116Slukem
10051.116SlukemTOOL_CTAGS		Create a tags file.  [ctags]
10061.116Slukem
10071.116SlukemTOOL_DB			Manipulate db(3) databases.  [db]
10081.116Slukem
10091.116SlukemTOOL_EQN		Format equations for groff.  [eqn]
10101.116Slukem
10111.116SlukemTOOL_FGEN		IEEE 1275 Open Firmware FCode Tokenizer.  [fgen]
10121.116Slukem
10131.169SthorpejTOOL_GENASSYM		Generate constants for assembly files.  [genassym]
10141.169Sthorpej
10151.116SlukemTOOL_GENCAT		Generate NLS message catalogs.  [gencat]
10161.116Slukem
10171.116SlukemTOOL_GROFF		Front end for groff document formatting system.  [groff]
10181.116Slukem
10191.116SlukemTOOL_HEXDUMP		Ascii, decimal, hexadecimal, octal dump.  [hexdump]
10201.116Slukem
10211.116SlukemTOOL_INDXBIB		Make bibliographic database's inverted index.  [indxbib]
10221.116Slukem
10231.116SlukemTOOL_INSTALLBOOT	Install disk bootstrap software.  [installboot]
10241.116Slukem
10251.116SlukemTOOL_INSTALL_INFO	Update info/dir entries.  [install-info]
10261.116Slukem
10271.116SlukemTOOL_M4			M4 macro language processor.  [m4]
10281.116Slukem
10291.116SlukemTOOL_MAKEFS		Create file system image from directory tree.  [makefs]
10301.116Slukem
10311.116SlukemTOOL_MAKEINFO		Translate Texinfo documents.  [makeinfo]
10321.116Slukem
10331.116SlukemTOOL_MAKEWHATIS		Create a whatis.db database.  [makewhatis]
10341.116Slukem
10351.116SlukemTOOL_MDSETIMAGE		Set kernel RAM disk image.  [mdsetimage]
10361.116Slukem
10371.116SlukemTOOL_MENUC		Menu compiler.  [menuc]
10381.116Slukem
10391.116SlukemTOOL_MKCSMAPPER		Make charset mapping table.  [mkcsmapper]
10401.116Slukem
10411.116SlukemTOOL_MKESDB		Make encoding scheme database.  [mkesdb]
10421.116Slukem
10431.116SlukemTOOL_MKLOCALE		Make LC_CTYPE locale files.  [mklocale]
10441.116Slukem
10451.116SlukemTOOL_MKMAGIC		Create database for file(1).  [file]
10461.116Slukem
10471.116SlukemTOOL_MKTEMP		Make (unique) temporary file name.  [mktemp]
10481.116Slukem
10491.116SlukemTOOL_MSGC		Simple message list compiler.  [msgc]
10501.116Slukem
10511.116SlukemTOOL_MTREE		Map a directory hierarchy.  [mtree]
10521.116Slukem
10531.116SlukemTOOL_PAX		Manipulate file archives and copy directories.  [pax]
10541.116Slukem
10551.116SlukemTOOL_PIC		Compile pictures for groff.  [pic]
10561.116Slukem
10571.116SlukemTOOL_PREPMKBOOTIMAGE	prep-mkbootimage (XXXBUILDSH).  [prep-mkbootimage]
10581.116Slukem
10591.116SlukemTOOL_PWD_MKDB		Generate the password databases.  [pwd_mkdb]
10601.116Slukem
10611.116SlukemTOOL_REFER		Preprocess bibliographic references for groff.  [refer]
10621.116Slukem
10631.116SlukemTOOL_ROFF_ASCII		Generate ASCII groff output.  [nroff]
10641.116Slukem
10651.116SlukemTOOL_ROFF_DVI		Generate DVI groff output.  [${TOOL_GROFF} -Tdvi]
10661.116Slukem
10671.116SlukemTOOL_ROFF_HTML		Generate HTML groff output.
10681.119Slukem			[${TOOL_GROFF} -Tlatin1 -mdoc2html]
10691.116Slukem
10701.116SlukemTOOL_ROFF_PS		Generate PS groff output.  [${TOOL_GROFF} -Tps]
10711.116Slukem
10721.116SlukemTOOL_ROFF_RAW		Generate "raw" groff output.  [${TOOL_GROFF} -Z]
10731.116Slukem
10741.116SlukemTOOL_RPCGEN		Remote Procedure Call (RPC) protocol compiler.  [rpcgen]
10751.116Slukem
10761.116SlukemTOOL_SOELIM		Eliminate .so's from groff input.  [soelim]
10771.123Slukem
10781.123SlukemTOOL_STAT		Display file status.  [stat]
10791.116Slukem
10801.116SlukemTOOL_SUNLABEL		Read or modify a SunOS disk label.  [sunlabel]
10811.116Slukem
10821.116SlukemTOOL_TBL		Format tables for groff.  [tbl]
10831.116Slukem
10841.116SlukemTOOL_UUDECODE		Uudecode a binary file.  [uudecode]
10851.116Slukem
10861.116SlukemTOOL_VGRIND		Grind nice listings of programs.  [vgrind -f]
10871.116Slukem
10881.116SlukemTOOL_ZIC		Time zone compiler.  [zic]
10891.116Slukem
10901.69Ssommerfe
10911.69SsommerfeOther variables of note (incomplete list):
10921.69Ssommerfe
10931.82SlukemWARNS		Crank up gcc warning options; the distinct levels are:
10941.82Slukem			WARNS=1
10951.82Slukem			WARNS=2
10961.82Slukem			WARNS=3
10971.164Smatt			WARNS=4
10981.69Ssommerfe
10991.69SsommerfeFORMAT_AUDIT	If FORMAT_AUDIT is set, and WFORMAT is set and > 1, turn on
11001.69SsommerfeWFORMAT 	-Wnetbsd-format-audit for extra-stringent format checking.
11011.75Sagc		WFORMAT belongs in individual makefiles and/or
11021.75Sagc		Makefile.inc files.  (set WFORMAT=1 in individual
11031.75Sagc		makefiles if a program is not security critical and is
11041.75Sagc		doing bizarre things with format strings which would
11051.75Sagc		be even uglier if rewritten) FORMAT_AUDIT should go in
11061.120Slukem		mk.conf if you're doing format-string auditing.
11071.69Ssommerfe		FORMAT_AUDIT may go away in time.
11081.30Sagc
11091.144Slukem
11101.144Slukem=-=-=-=-=   bsd.x11.mk   =-=-=-=-=
11111.144Slukem
11121.144SlukemThe include file <bsd.x11.mk> contains parameters and targets for
11131.144Slukemcross-building X11R6 from ${X11SRCDIR.xc}.
11141.144SlukemIt should be included after the general Makefile contents but before
11151.144Slukemthe include files such as <bsd.prog.mk> and <bsd.lib.mk>.
11161.144Slukem
11171.144SlukemIt provides the following targets:
11181.144Slukem	.man.1 .man.3 .man.4 .man.5 .man.7:
11191.144Slukem		If ${MAN} or ${PROG} is set and ${MKMAN} != "no",
11201.144Slukem		these rules convert from X11R6's manual page source
11211.144Slukem		into an mdoc.old source file.
11221.144Slukem	cleanx11man:
11231.144Slukem		Clean up the mdoc.old files generated by the above.
11241.144Slukem
11251.144SlukemIt sets the following variables:
11261.144Slukem
11271.144SlukemBINDIR			Set to ${X11BINDIR}.
11281.144Slukem			To override, define after including <bsd.x11.mk>
11291.144Slukem
11301.144SlukemLIBDIR			Set to ${X11USRLIBDIR}.
11311.144Slukem			To override, define after including <bsd.x11.mk>
11321.144Slukem
11331.144SlukemMANDIR			Set to ${X11MANDIR}.
11341.144Slukem			To override, define after including <bsd.x11.mk>
11351.144Slukem
11361.144SlukemCPPFLAGS		Appended with definitions to include from
11371.144Slukem			${DESTDIR}${X11INCDIR}
11381.144Slukem
11391.144SlukemLDFLAGS			Appended with definitions to link from
11401.144Slukem			${DESTDIR}${X11USRLIBDIR}
11411.144Slukem
11421.144SlukemX11FLAGS.CONNECTION	Equivalent to X11R6's CONNECTION_FLAGS.
11431.144Slukem
11441.144SlukemX11FLAGS.EXTENSION	Equivalent to X11R6's EXT_DEFINES.
11451.144Slukem
11461.144SlukemX11FLAGS.LOADABLE	Equivalent to X11R6's LOADABLE.
11471.144Slukem
11481.144SlukemX11FLAGS.OS_DEFINES	Equivalent to X11R6's OS_DEFINES.
11491.144Slukem
11501.144SlukemX11FLAGS.SERVER		Equivalent to X11R6's ServerDefines.
11511.144Slukem
11521.144SlukemX11FLAGS.THREADLIB	Equivalent to X11R6's THREADS_DEFINES for libraries.
11531.144Slukem
11541.144SlukemX11FLAGS.THREADS	Equivalent to X11R6's THREADS_DEFINES.
11551.144Slukem
11561.144SlukemX11FLAGS.VERSION	cpp(1) definitions of OSMAJORVERSION and OSMINORVERSION.
11571.144Slukem
11581.144SlukemX11TOOL_UNXCOMM		Commandline to convert `XCOMM' comments to `#'
11591.144Slukem
11601.144SlukemIt uses the following variables:
11611.144Slukem
11621.144SlukemAPPDEFS			List of app-default files to install.
11631.144Slukem
11641.144SlukemCPPSCRIPTS		List of files/scripts to run through cpp(1)
11651.144Slukem			and then ${X11TOOL_UNXCOMM}.  The source files
11661.144Slukem			have a `.cpp' suffix, the generated files do not.
11671.144Slukem
11681.144SlukemCPPSCRIPTFLAGS		Additional flags to cpp(1) when building CPPSCRIPTS.
11691.144Slukem
11701.144SlukemCPPSCRIPTFLAGS_<fn>	Additional flags to cpp(1) when building CPPSCRIPT <fn>.
11711.144Slukem
11721.144Slukem
11731.30Sagc=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
1174