bsd.README revision 1.112
11.112Sthorpej#	$NetBSD: bsd.README,v 1.112 2003/05/30 18:43:24 thorpej 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.97SitojunThere are various make variables used during the build.  Basic rule for
621.97Sitojunthe variable naming scheme is as follows:
631.97Sitojun
641.97SitojunMKxxx		Can be set to `no' by a user to disable functionality.
651.97Sitojun		Defaults to `yes' (or usually does)
661.97Sitojun
671.97SitojunNOxxx		If defined, disables a feature.  Not intended for users,
681.97Sitojun		it's to allow Makefiles to disable functionality that
691.97Sitojun		they don't support (such as missing man pages).
701.101Slukem		NOxxx variables must be defined before <bsd.own.mk>
711.101Slukem		is included.
721.21Schristos
731.45SlukemThe following variables that control how things are made/installed that
741.47Stvare not set by default. These should not be set by Makefiles; they're for
751.47Stvthe user to define in MAKECONF (see bsd.own.mk, below) or on the make(1)
761.47Stvcommand line:
771.21Schristos
781.45SlukemBUILD 		If defined, 'make install' checks that the targets in the
791.45Slukem		source directories are up-to-date and remakes them if they
801.21Schristos                are out of date, instead of blindly trying to install
811.79Swiz                out of date or non-existent targets.
821.21Schristos
831.45SlukemUPDATE 		If defined, 'make install' only installs targets that are
841.45Slukem		more recently modified in the source directories that their
851.45Slukem		installed counterparts.
861.52Ssimonb
871.83SperryUNPRIVED	If defined, don't set the owner/group/mode when installing
881.83Sperry		files or directories, and keep a metadata log of what
891.83Sperry		the owner/group/mode should be.  This allows a
901.83Sperry		non-root "make install".
911.45Slukem
921.86SthorpejMKBFD		If "no", don't build libbfd, libiberty, or any of
931.86Sthorpej		the things that depend on them (binutils/gas/ld,
941.103Sthorpej		gdb, dbsym, mdsetimage).
951.86Sthorpej
961.45SlukemMKCATPAGES	If "no", don't build or install the catman pages.
971.45Slukem
981.45SlukemMKDOC		If "no", don't build or install the documentation.
991.86Sthorpej
1001.104SlukemMKDYNAMICROOT	If "no", build programs in /bin and /sbin statically,
1011.104Slukem		don't install certain libraries in /lib, and don't
1021.104Slukem		install the shared linker into /libexec.
1031.104Slukem
1041.103SthorpejMKGDB		If "no", don't build gdb.
1051.86Sthorpej
1061.86SthorpejMKGCC		If "no", don't build gcc or any of the gcc-related
1071.86Sthorpej		libraries (libg2c, libgcc, libobjc, libstdc++).
1081.92Sross
1091.92SrossMKIEEEFP	If "no", don't add code for IEEE754/IEC60559 conformance.
1101.92Sross		Has no effect on most platforms.
1111.45Slukem
1121.47StvMKINFO		If "no", don't build or install Info documentation from
1131.47Stv		Texinfo source files.
1141.45Slukem
1151.45SlukemMKLINT		If "no", don't build or install the lint libraries.
1161.45Slukem
1171.45SlukemMKMAN		If "no", don't build or install the man or catman pages.
1181.46Slukem		Also acts as "MKCATPAGES=no"
1191.45Slukem
1201.74SitojunMKNLS		If "no", don't build or install the NLS files and locale
1211.74Sitojun		definition files.
1221.45Slukem
1231.55SsommerfeMKOBJ		If "no", don't enable the rule which creates objdirs.
1241.55Ssommerfe		"yes" by default.
1251.55Ssommerfe
1261.55SsommerfeMKOBJDIRS	If "no", don't create objdirs during a "make build".
1271.55Ssommerfe		"no" by default.
1281.45Slukem
1291.45SlukemMKPIC		If "no", don't build or install shared libraries.
1301.45Slukem
1311.45SlukemMKPICINSTALL	If "no", don't install the *_pic.a libraries.
1321.45Slukem
1331.45SlukemMKPROFILE	If "no", don't build or install the profiling libraries.
1341.45Slukem
1351.48SlukemMKSHARE		If "no", act as "MKCATPAGES=no MKDOC=no MKINFO=no MKMAN=no
1361.48Slukem		MKNLS=no".  I.e, don't build catman pages, documentation,
1371.48Slukem		Info documentation, man pages, NLS files, ...
1381.1Scgd
1391.1Scgd=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
1401.1Scgd
1411.1ScgdThe include file <sys.mk> has the default rules for all makes, in the BSD
1421.1Scgdenvironment or otherwise.  You probably don't want to touch this file.
1431.71SitojunIf you intend to run a cross build, you will need to supply the following
1441.71Sitojunhost tools, and configure the following variables properly:
1451.71Sitojun
1461.71SitojunOBJCOPY		objcopy - copy and translate object files
1471.71Sitojun
1481.71SitojunSTRIP		strip - Discard symbols from object files
1491.71Sitojun
1501.71SitojunCONFIG		config - build kernel compilation directories
1511.71Sitojun
1521.71SitojunRPCGEN		rpcgen - Remote Procedure Call (RPC) protocol compiler
1531.71Sitojun
1541.71SitojunMKLOCALE	mklocale - make LC_CTYPE locale files
1551.80Sjmc
1561.80SjmcMTREE		mtree - build directory tree from a spec file
1571.1Scgd
1581.1Scgd=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
1591.1Scgd
1601.1ScgdThe include file <bsd.man.mk> handles installing manual pages and their
1611.1Scgdlinks.
1621.1Scgd
1631.21SchristosIt has a two targets:
1641.1Scgd
1651.1Scgd	maninstall:
1661.21Schristos		Install the manual page sources and their links.
1671.21Schristos	catinstall:
1681.21Schristos		Install the preformatted manual pages and their links.
1691.1Scgd
1701.1ScgdIt sets/uses the following variables:
1711.1Scgd
1721.1ScgdMANDIR		Base path for manual installation.
1731.1Scgd
1741.1ScgdMANGRP		Manual group.
1751.1Scgd
1761.1ScgdMANOWN		Manual owner.
1771.1Scgd
1781.1ScgdMANMODE		Manual mode.
1791.1Scgd
1801.1ScgdMANSUBDIR	Subdirectory under the manual page section, i.e. "/vax"
1811.1Scgd		or "/tahoe" for machine specific manual pages.
1821.1Scgd
1831.15ScgdMAN		The manual pages to be installed (use a .1 - .9 suffix).
1841.1Scgd
1851.15ScgdMLINKS		List of manual page links (using a .1 - .9 suffix).  The
1861.1Scgd		linked-to file must come first, the linked file second,
1871.1Scgd		and there may be multiple pairs.  The files are soft-linked.
1881.1Scgd
1891.1ScgdThe include file <bsd.man.mk> includes a file named "../Makefile.inc" if
1901.1Scgdit exists.
1911.1Scgd
1921.1Scgd=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
1931.1Scgd
1941.17SthorpejThe include file <bsd.own.mk> contains source tree configuration parameters,
1951.17Sthorpejsuch as the owners, groups, etc. for both manual pages and binaries, and
1961.17Sthorpeja few global "feature configuration" parameters.
1971.1Scgd
1981.1ScgdIt has no targets.
1991.1Scgd
2001.29ScjsTo get system-specific configuration parameters, bsd.own.mk will try to
2011.29Scjsinclude the file specified by the "MAKECONF" variable.  If MAKECONF is not
2021.29Scjsset, or no such file exists, the system make configuration file, /etc/mk.conf
2031.29Scjsis included.  These files may define any of the variables described below.
2041.17Sthorpej
2051.17Sthorpejbsd.own.mk sets the following variables, if they are not already defined
2061.17Sthorpej(defaults are in brackets):
2071.15Scgd
2081.98SlukemNETBSDSRCDIR	Top of the NetBSD source tree.
2091.98Slukem		If _SRC_TOP_ != "", that will be used as the default,
2101.98Slukem		otherwise BSDSRCDIR will be used as the default.
2111.98Slukem		Various makefiles within the NetBSD source tree will
2121.98Slukem		use this to reference the top level of the source tree.
2131.98Slukem
2141.95Slukem_SRC_TOP_	Top of the system source tree, as determined by <bsd.own.mk>
2151.98Slukem		based on the presence of tools/ and build.sh.  This variable
2161.98Slukem		is "internal" to <bsd.own.mk>, although its value is only
2171.98Slukem		determined once and then propagated to all sub-makes.
2181.95Slukem
2191.15ScgdBSDSRCDIR	The real path to the system sources, so that 'make obj'
2201.15Scgd		will work correctly. [/usr/src]
2211.15Scgd
2221.15ScgdBSDOBJDIR	The real path to the system 'obj' tree, so that 'make obj'
2231.15Scgd		will work correctly. [/usr/obj]
2241.15Scgd
2251.34SlukemBINGRP		Binary group. [wheel]
2261.15Scgd
2271.34SlukemBINOWN		Binary owner. [root]
2281.15Scgd
2291.15ScgdBINMODE		Binary mode. [555]
2301.15Scgd
2311.15ScgdNONBINMODE	Mode for non-executable files. [444]
2321.15Scgd
2331.15ScgdMANDIR		Base path for manual installation. [/usr/share/man/cat]
2341.15Scgd
2351.34SlukemMANGRP		Manual group. [wheel]
2361.15Scgd
2371.34SlukemMANOWN		Manual owner. [root]
2381.15Scgd
2391.15ScgdMANMODE		Manual mode. [${NONBINMODE}]
2401.15Scgd
2411.21SchristosMANINSTALL	Manual installation type: maninstall, catinstall, or both
2421.76Sfair
2431.76SfairLDSTATIC	Control program linking; if set blank, link everything
2441.76Sfair		dynamically. If set to "-static", link everything statically.
2451.76Sfair		If not set, programs link according to their makefile.
2461.21Schristos
2471.15ScgdLIBDIR		Base path for library installation. [/usr/lib]
2481.15Scgd
2491.15ScgdLINTLIBDIR	Base path for lint(1) library installation. [/usr/libdata/lint]
2501.15Scgd
2511.15ScgdLIBGRP		Library group. [${BINGRP}]
2521.15Scgd
2531.15ScgdLIBOWN		Library owner. [${BINOWN}]
2541.15Scgd
2551.15ScgdLIBMODE		Library mode. [${NONBINMODE}]
2561.15Scgd
2571.15ScgdDOCDIR		Base path for system documentation (e.g. PSD, USD, etc.)
2581.15Scgd	        installation. [/usr/share/doc]
2591.62Ssimonb
2601.62SsimonbHTMLDOCDIR	Base path for html system documentation installation.
2611.62Ssimonb		[/usr/share/doc/html]
2621.15Scgd
2631.34SlukemDOCGRP		Documentation group. [wheel]
2641.15Scgd
2651.34SlukemDOCOWN		Documentation owner. [root]
2661.15Scgd
2671.15ScgdDOCMODE		Documentation mode. [${NONBINMODE}]
2681.15Scgd
2691.84SkleinkNLSDIR		Base path for Native Language Support files installation.
2701.15Scgd		[/usr/share/nls]
2711.1Scgd
2721.84SkleinkNLSGRP		Native Language Support files group. [wheel]
2731.1Scgd
2741.84SkleinkNLSOWN		Native Language Support files owner. [root]
2751.1Scgd
2761.84SkleinkNLSMODE		Native Language Support files mode. [${NONBINMODE}]
2771.1Scgd
2781.32SmikelSTRIPFLAG	The flag passed to the install program to cause the binary
2791.1Scgd		to be stripped.  This is to be used when building your
2801.1Scgd		own install script so that the entire system can be made
2811.15Scgd		stripped/not-stripped using a single knob. [-s]
2821.1Scgd
2831.2ScgdCOPY		The flag passed to the install program to cause the binary
2841.2Scgd		to be copied rather than moved.  This is to be used when
2851.2Scgd		building our own install script so that the entire system
2861.2Scgd		can either be installed with copies, or with moves using
2871.15Scgd		a single knob. [-c]
2881.15Scgd
2891.17SthorpejAdditionally, the following variables may be set by bsd.own.mk or in a
2901.17Sthorpejmake configuration file to modify the behaviour of the system build
2911.17Sthorpejprocess (default values are in brackets along with comments, if set by
2921.17Sthorpejbsd.own.mk):
2931.111Sthorpej
2941.111SthorpejMKPICLIB	bsd.own.mk provides a default for this variable, which is
2951.111Sthorpej		used by bsd.lib.mk.  The default value is provided by
2961.111Sthorpej		bsd.own.mk since non-library Makefiles may need to check
2971.111Sthorpej		its value in order to generate proper dependencies against
2981.111Sthorpej		libraries used only during the build process (which would
2991.111Sthorpej		not be installed into the destination directory).
3001.15Scgd
3011.64SthorpejMKCRYPTO	If set to "no", no cryptography support will be built
3021.64Sthorpej		into the system.  Defaults to "yes".
3031.64Sthorpej
3041.66SitojunMKCRYPTO_IDEA	If set to "yes", IDEA support will be built into
3051.66Sitojun		libcrypto_idea.a.  Defaults to "no".
3061.64Sthorpej
3071.105SitojunMKCRYPTO_MDC2	If set to "yes", MDC2 support will be built into
3081.105Sitojun		libcrypto_mdc2.a.  Defaults to "no".
3091.105Sitojun
3101.66SitojunMKCRYPTO_RC5	If set to "yes", RC5 support will be built into
3111.66Sitojun		libcrypto_rc5.a.  Defaults to "no".
3121.64Sthorpej
3131.94SthorpejMKHESIOD	If set to "no", disables building of Hesiod infrastructure
3141.94Sthorpej		(libraries and support programs).
3151.64Sthorpej
3161.94SthorpejMKKERBEROS	If set to "no", disables building of Kerberos (v4 or v5)
3171.94Sthorpej		infrastructure (libraries and support programs).
3181.2Scgd
3191.94SthorpejMKSKEY		If set to "no", disables building of S/key authentication
3201.94Sthorpej		infrastructure (libraries and support programs).
3211.94Sthorpej
3221.94SthorpejMKYP		If set to "no", disables building of YP (NIS)
3231.94Sthorpej		infrastructure (libraries and support programs).
3241.94Sthorpej
3251.94SthorpejUSE_HESIOD	If set to "no", disables building Hesiod support into
3261.94Sthorpej		various system utilities/libraries that support it.
3271.94Sthorpej		If MKHESIOD is set to "no", USE_HESIOD will also be
3281.94Sthorpej		forced to "no".
3291.94Sthorpej
3301.94SthorpejUSE_KERBEROS	If set to "no", disables building Kerberos (v4 or v5)
3311.94Sthorpej		support into various system utilities/libraries that
3321.94Sthorpej		support it.  If MKKERBEROS is set to "no", USE_KERBEROS
3331.94Sthorpej		will also be forced to "no".
3341.94Sthorpej
3351.94SthorpejUSE_SKEY	If set to "no", disables building S/key authentication
3361.94Sthorpej		support into various system utilities/libraries that
3371.94Sthorpej		support it.  If MKSKEY is set to "no", USE_SKEY will
3381.94Sthorpej		also be forced to "no".
3391.94Sthorpej
3401.94SthorpejUSE_YP		If set to "no", disables building YP (NIS) support into
3411.94Sthorpej		various system utilities/libraries that support it.  If
3421.94Sthorpej		MKYP is set to "no", USE_YP will also be forced to "no".
3431.15Scgd
3441.15ScgdMANZ		Compress manual pages at installation time.
3451.1Scgd
3461.15ScgdNOPROFILE	Do not build profiled versions of system libraries
3471.1Scgd
3481.15ScgdNOPIC		Do not build PIC versions of system libraries, and
3491.15Scgd		do not build shared libraries.  [set if ${MACHINE_ARCH}
3501.65Sjlam		is "sh3" and ${OBJECT_FMT} is "COFF", unset otherwise.]
3511.1Scgd
3521.40SperryNOLINT		Do not build lint libraries.
3531.33Sjonathan
3541.50SthorpejOBJECT_FMT	Object file format. [set to "ELF" on architectures that
3551.50Sthorpej		use ELF -- currently if ${MACHINE_ARCH} is "alpha",
3561.50Sthorpej		"mipsel", "mipseb", "powerpc", "sparc", "sparc64",
3571.77Ssimonb		"i386" and some m68k machines, or set to "a.out" on
3581.77Ssimonb		other architectures].
3591.33Sjonathan
3601.78SsimonbMKSOFTFLOAT	If "yes", build with options to enable the compiler to
3611.78Ssimonb		generate output containing library calls for floating
3621.78Ssimonb		point and possibly soft-float library support.  Defaults
3631.78Ssimonb		to "no".
3641.103Sthorpej
3651.103SthorpejTOOLCHAIN_MISSING
3661.103Sthorpej		If "yes", this indicates that the platform being built
3671.103Sthorpej		does not have a working in-tree toolchain.  If the
3681.103Sthorpej		MACHINE_ARCH in question falls into this category, the
3691.103Sthorpej		variable is conditionally assigned the value "yes".
3701.103Sthorpej		Otherwise, the variable is unconditionally assigned the
3711.103Sthorpej		value "no".
3721.103Sthorpej
3731.103Sthorpej		If TOOLCHAIN_MISSING is "yes", the variables MKBFD, MKGCC,
3741.103Sthorpej		and MKGDB are unconditionally assigned the value "no".
3751.103Sthorpej
3761.103SthorpejEXTERNAL_TOOLCHAIN
3771.103Sthorpej		This variable is not directly set by <bsd.own.mk>, but
3781.103Sthorpej		including <bsd.own.mk> is the canonical way to gain
3791.103Sthorpej		access to this variable.  The variable should be defined
3801.103Sthorpej		either in the user's environment or in the user's mk.conf
3811.103Sthorpej		file.  If defined, this variable indicates the root of
3821.103Sthorpej		an external toolchain which will be used to build the
3831.103Sthorpej		tree.  For example, if a platform is a TOOLCHAIN_MISSING
3841.103Sthorpej		platform, EXTERNAL_TOOLCHAIN can be used to re-enable the
3851.103Sthorpej		cross-compile framework.
3861.103Sthorpej
3871.103Sthorpej		If EXTERNAL_TOOLCHAIN is defined, the variable MKGCC is
3881.103Sthorpej		unconditionally assigned the value "no", since the external
3891.103Sthorpej		version of the compiler may not be able to build the library
3901.103Sthorpej		components of the in-tree compiler.
3911.103Sthorpej
3921.103Sthorpej		NOTE: This variable is not yet used in as many places as
3931.103Sthorpej		it should be.  Expect the exact semantics of this variable
3941.103Sthorpej		to change in the short term as parts of the cross-compile
3951.103Sthorpej		framework continue to be cleaned up.
3961.1Scgd
3971.17Sthorpejbsd.own.mk is generally useful when building your own Makefiles so that
3981.1Scgdthey use the same default owners etc. as the rest of the tree.
3991.1Scgd
4001.1Scgd=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
4011.1Scgd
4021.106SthorpejThe include file <bsd.shlib.mk> computes parameters for shared library
4031.106Sthorpejinstallation and use.  It defines no targets.  <bsd.own.mk> MUST be
4041.106Sthorpejincluded before bsd.shlib.mk.
4051.106Sthorpej
4061.106Sthorpejbsd.own.mk sets the following variables, if they are not already defined
4071.106Sthorpej(defaults are in brackets):
4081.106Sthorpej
4091.106SthorpejSHLIBINSTALLDIR	If ${USE_SHLIBDIR} is "yes", use ${SHLIBINSTALLDIR} instead of
4101.106Sthorpej		${LIBDIR} as the base path for shared library installation.
4111.106Sthorpej		[/lib]
4121.106Sthorpej
4131.106SthorpejSHLIBDIR	The path to USE_SHLIBDIR shared libraries to use when building
4141.106Sthorpej		a program.  [/lib for programs in /bin and /sbin, /usr/lib
4151.106Sthorpej		for all others.]
4161.106Sthorpej
4171.106Sthorpej_LIBSODIR	Set to ${SHLIBINSTALLDIR} if ${USE_SHLIBDIR} is "yes",
4181.106Sthorpej		otherwise set to ${LIBDIR}
4191.106Sthorpej
4201.106SthorpejSHLINKINSTALLDIR Base path for shared linker. [/libexec]
4211.106Sthorpej
4221.106SthorpejSHLINKDIR	Path to use for shared linker when building a program.
4231.106Sthorpej		[/libexec for programs in /bin and /sbin, /usr/libexec for
4241.106Sthorpej		all others.]
4251.106Sthorpej
4261.106Sthorpej=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
4271.106Sthorpej
4281.1ScgdThe include file <bsd.prog.mk> handles building programs from one or
4291.1Scgdmore source files, along with their manual pages.  It has a limited number
4301.106Sthorpejof suffixes, consistent with the current needs of the BSD tree.  bsd.prog.mk
4311.106Sthorpejincludes <bsd.shlib.mk> to get shared library parameters.
4321.1Scgd
4331.16SjtcIt has eight targets:
4341.1Scgd
4351.1Scgd	all:
4361.102Sthorpej		build the program and its manual page.  This also
4371.102Sthorpej		creates a GDB initialization file (.gdbinit) in
4381.102Sthorpej		the objdir.  The .gdbinit file sets the shared library
4391.102Sthorpej		prefix to ${DESTDIR} to facilitate cross-debugging.
4401.1Scgd	clean:
4411.1Scgd		remove the program, any object files and the files a.out,
4421.24Smikel		Errs, errs, mklog, and ${PROG}.core.
4431.1Scgd	cleandir:
4441.1Scgd		remove all of the files removed by the target clean, as
4451.1Scgd		well as .depend, tags, and any manual pages.
4461.42Slukem		`distclean' is a synonym for `cleandir'.
4471.1Scgd	depend:
4481.1Scgd		make the dependencies for the source files, and store
4491.1Scgd		them in the file .depend.
4501.16Sjtc	includes:
4511.16Sjtc		install any header files.
4521.1Scgd	install:
4531.1Scgd		install the program and its manual pages; if the Makefile
4541.1Scgd		does not itself define the target install, the targets
4551.1Scgd		beforeinstall and afterinstall may also be used to cause
4561.1Scgd		actions immediately before and after the install target
4571.1Scgd		is executed.
4581.1Scgd	lint:
4591.1Scgd		run lint on the source files
4601.1Scgd	tags:
4611.1Scgd		create a tags file for the source files.
4621.1Scgd
4631.1ScgdIt sets/uses the following variables:
4641.1Scgd
4651.1ScgdBINGRP		Binary group.
4661.1Scgd
4671.1ScgdBINOWN		Binary owner.
4681.1Scgd
4691.1ScgdBINMODE		Binary mode.
4701.1Scgd
4711.1ScgdCLEANFILES	Additional files to remove for the clean and cleandir targets.
4721.1Scgd
4731.1ScgdCOPTS		Additional flags to the compiler when creating C objects.
4741.112Sthorpej
4751.112SthorpejCPUFLAGS	Additional flags to the compiler/assembler to select
4761.112Sthorpej		CPU instruction set options, CPU tuning options, etc.
4771.35Slukem
4781.35SlukemCPPFLAGS	Additional flags to the C pre-processor
4791.102Sthorpej
4801.102SthorpejGDBINIT		List of GDB initialization files to add to "source"
4811.102Sthorpej		directives in the .gdbinit file that is created in the
4821.102Sthorpej		objdir.
4831.1Scgd
4841.1ScgdLDADD		Additional loader objects.  Usually used for libraries.
4851.1Scgd		For example, to load with the compatibility and utility
4861.1Scgd		libraries, use:
4871.1Scgd
4881.5Sjtc			LDADD+=-lutil -lcompat
4891.1Scgd
4901.1ScgdLDFLAGS		Additional loader flags.
4911.1Scgd
4921.1ScgdLINKS		The list of binary links; should be full pathnames, the
4931.1Scgd		linked-to file coming first, followed by the linked
4941.1Scgd		file.  The files are hard-linked.  For example, to link
4951.1Scgd		/bin/test and /bin/[, use:
4961.1Scgd
4971.1Scgd			LINKS=	${DESTDIR}/bin/test ${DESTDIR}/bin/[
4981.19Sperry
4991.19SperrySYMLINKS	The list of symbolic links; should be full pathnames.
5001.20Sperry                Syntax is identical to LINKS. Note that DESTDIR is not
5011.20Sperry		automatically included in the link.
5021.1Scgd
5031.15ScgdMAN		Manual pages (should end in .1 - .9).  If no MAN variable is
5041.8Scgd		defined, "MAN=${PROG}.1" is assumed.
5051.1Scgd
5061.1ScgdPROG		The name of the program to build.  If not supplied, nothing
5071.1Scgd		is built.
5081.1Scgd
5091.88SthorpejPROG_CXX	If defined, the name of the program to build.  Also
5101.88Sthorpej		causes <bsd.prog.mk> to link the program with the C++
5111.88Sthorpej		compiler rather than the C compiler.  PROG_CXX overrides
5121.88Sthorpej		the value of PROG if PROG is also set.
5131.87Sthorpej
5141.21SchristosPROGNAME	The name that the above program will be installed as, if
5151.21Schristos		different from ${PROG}.
5161.21Schristos
5171.37StvSRCS		List of source files to build the program.  If SRCS is not
5181.1Scgd		defined, it's assumed to be ${PROG}.c.
5191.108Sjwise
5201.108SjwiseDPSRCS		List of source files which are needed for generating
5211.108Sjwise		dependencies, but are not needed in ${SRCS}.
5221.1Scgd
5231.1ScgdDPADD		Additional dependencies for the program.  Usually used for
5241.1Scgd		libraries.  For example, to depend on the compatibility and
5251.1Scgd		utility libraries use:
5261.1Scgd
5271.5Sjtc			DPADD+=${LIBCOMPAT} ${LIBUTIL}
5281.1Scgd
5291.1Scgd		The following libraries are predefined for DPADD:
5301.1Scgd
5311.21Schristos		LIBCRT0?=	${DESTDIR}/usr/lib/crt0.o
5321.99Sitojun		LIBBZ2?=	${DESTDIR}/usr/lib/libbz2.a
5331.21Schristos		LIBC?=		${DESTDIR}/usr/lib/libc.a
5341.21Schristos		LIBC_PIC?=	${DESTDIR}/usr/lib/libc_pic.a
5351.99Sitojun		LIBCDK?=	${DESTDIR}/usr/lib/libcdk.a
5361.99Sitojun		LIBCOM_ERR?=	${DESTDIR}/usr/lib/libcom_err.a
5371.21Schristos		LIBCOMPAT?=	${DESTDIR}/usr/lib/libcompat.a
5381.21Schristos		LIBCRYPT?=	${DESTDIR}/usr/lib/libcrypt.a
5391.99Sitojun		LIBCRYPTO?=	${DESTDIR}/usr/lib/libcrypto.a
5401.99Sitojun		LIBCRYPTO_IDEA?=${DESTDIR}/usr/lib/libcrypto_idea.a
5411.105Sitojun		LIBCRYPTO_MDC2?=${DESTDIR}/usr/lib/libcrypto_mdc2.a
5421.99Sitojun		LIBCRYPTO_RC5?=	${DESTDIR}/usr/lib/libcrypto_rc5.a
5431.21Schristos		LIBCURSES?=	${DESTDIR}/usr/lib/libcurses.a
5441.21Schristos		LIBDBM?=	${DESTDIR}/usr/lib/libdbm.a
5451.21Schristos		LIBDES?=	${DESTDIR}/usr/lib/libdes.a
5461.21Schristos		LIBEDIT?=	${DESTDIR}/usr/lib/libedit.a
5471.73Sblymn		LIBFORM?=	${DESTDIR}/usr/lib/libform.a
5481.21Schristos		LIBGCC?=	${DESTDIR}/usr/lib/libgcc.a
5491.21Schristos		LIBGNUMALLOC?=	${DESTDIR}/usr/lib/libgnumalloc.a
5501.99Sitojun		LIBGSSAPI?=	${DESTDIR}/usr/lib/libgssapi.a
5511.99Sitojun		LIBHDB?=	${DESTDIR}/usr/lib/libhdb.a
5521.70Sitojun		LIBINTL?=	${DESTDIR}/usr/lib/libintl.a
5531.49Sitojun		LIBIPSEC?=	${DESTDIR}/usr/lib/libipsec.a
5541.99Sitojun		LIBKADM?=	${DESTDIR}/usr/lib/libkadm.a
5551.99Sitojun		LIBKADM5CLNT?=	${DESTDIR}/usr/lib/libkadm5clnt.a
5561.99Sitojun		LIBKADM5SRV?=	${DESTDIR}/usr/lib/libkadm5srv.a
5571.99Sitojun		LIBKAFS?=	${DESTDIR}/usr/lib/libkafs.a
5581.21Schristos		LIBKDB?=	${DESTDIR}/usr/lib/libkdb.a
5591.21Schristos		LIBKRB?=	${DESTDIR}/usr/lib/libkrb.a
5601.99Sitojun		LIBKRB5?=	${DESTDIR}/usr/lib/libkrb5.a
5611.99Sitojun		LIBKSTREAM?=	${DESTDIR}/usr/lib/libkstream.a
5621.21Schristos		LIBKVM?=	${DESTDIR}/usr/lib/libkvm.a
5631.21Schristos		LIBL?=		${DESTDIR}/usr/lib/libl.a
5641.21Schristos		LIBM?=		${DESTDIR}/usr/lib/libm.a
5651.53Sblymn		LIBMENU?=	${DESTDIR}/usr/lib/libmenu.a
5661.21Schristos		LIBMP?=		${DESTDIR}/usr/lib/libmp.a
5671.25Schristos		LIBNTP?=	${DESTDIR}/usr/lib/libntp.a
5681.99Sitojun		LIBOBJC?=	${DESTDIR}/usr/lib/libobjc.a
5691.99Sitojun		LIBOSSAUDIO?=	${DESTDIR}/usr/lib/libossaudio.a
5701.21Schristos		LIBPC?=		${DESTDIR}/usr/lib/libpc.a
5711.21Schristos		LIBPCAP?=	${DESTDIR}/usr/lib/libpcap.a
5721.99Sitojun		LIBPCI?=	${DESTDIR}/usr/lib/libpci.a
5731.21Schristos		LIBPLOT?=	${DESTDIR}/usr/lib/libplot.a
5741.100Sthorpej		LIBPMC?=	${DESTDIR}/usr/lib/libpmc.a
5751.26Skleink		LIBPOSIX?=	${DESTDIR}/usr/lib/libposix.a
5761.110Sthorpej		LIBPTHREAD?=	${DESTDIR}/usr/lib/libpthread.a
5771.110Sthorpej		LIBPTHREAD_DBG?=${DESTDIR}/usr/lib/libpthread_dbg.a
5781.21Schristos		LIBRESOLV?=	${DESTDIR}/usr/lib/libresolv.a
5791.99Sitojun		LIBRMT?=	${DESTDIR}/usr/lib/librmt.a
5801.99Sitojun		LIBROKEN?=	${DESTDIR}/usr/lib/libroken.a
5811.21Schristos		LIBRPCSVC?=	${DESTDIR}/usr/lib/librpcsvc.a
5821.110Sthorpej		LIBRT?=		${DESTDIR}/usr/lib/librt.a
5831.21Schristos		LIBSKEY?=	${DESTDIR}/usr/lib/libskey.a
5841.99Sitojun		LIBSS?=		${DESTDIR}/usr/lib/libss.a
5851.99Sitojun		LIBSSL?=	${DESTDIR}/usr/lib/libssl.a
5861.99Sitojun		LIBSKEY?=	${DESTDIR}/usr/lib/libskey.a
5871.99Sitojun		LIBSL?=		${DESTDIR}/usr/lib/libsl.a
5881.21Schristos		LIBTERMCAP?=	${DESTDIR}/usr/lib/libtermcap.a
5891.21Schristos		LIBTELNET?=	${DESTDIR}/usr/lib/libtelnet.a
5901.99Sitojun		LIBUSBHID?=	${DESTDIR}/usr/lib/libusbhid.a
5911.21Schristos		LIBUTIL?=	${DESTDIR}/usr/lib/libutil.a
5921.21Schristos		LIBWRAP?=	${DESTDIR}/usr/lib/libwrap.a
5931.21Schristos		LIBY?=		${DESTDIR}/usr/lib/liby.a
5941.21Schristos		LIBZ?=		${DESTDIR}/usr/lib/libz.a
5951.1Scgd
5961.1ScgdSHAREDSTRINGS	If defined, a new .c.o rule is used that results in shared
5971.12Schristos		strings, using xstr(1). Note that this will not work with
5981.12Schristos		parallel makes.
5991.1Scgd
6001.59SjlamSTRIPFLAG	The flag passed to the install program to cause the binary
6011.1Scgd		to be stripped.
6021.1Scgd
6031.1ScgdSUBDIR		A list of subdirectories that should be built as well.
6041.1Scgd		Each of the targets will execute the same target in the
6051.1Scgd		subdirectories.
6061.1Scgd
6071.21SchristosSCRIPTS		A list of interpreter scripts [file.{sh,csh,pl,awk,...}].
6081.21Schristos		These are installed exactly like programs.
6091.21Schristos
6101.21SchristosSCRIPTSNAME	The name that the above program will be installed as, if
6111.21Schristos		different from ${SCRIPTS}. These can be further specialized
6121.21Schristos		by setting SCRIPTSNAME_<script>.
6131.21Schristos
6141.21SchristosFILES		A list of files to install. The installation is controlled
6151.21Schristos		by the FILESNAME, FILESOWN, FILESGRP, FILESMODE, FILESDIR
6161.21Schristos		variables that can be further specialized by FILES<VAR>_<file>
6171.21Schristos
6181.106SthorpejSHLINKDIR	Target directory for shared linker.  See description of
6191.106Sthorpej		<bsd.own.mk> for additional information about this variable.
6201.85Slukem
6211.1ScgdThe include file <bsd.prog.mk> includes the file named "../Makefile.inc"
6221.1Scgdif it exists, as well as the include file <bsd.man.mk>.
6231.1Scgd
6241.1ScgdSome simple examples:
6251.1Scgd
6261.1ScgdTo build foo from foo.c with a manual page foo.1, use:
6271.1Scgd
6281.1Scgd	PROG=	foo
6291.1Scgd
6301.1Scgd	.include <bsd.prog.mk>
6311.1Scgd
6321.1ScgdTo build foo from foo.c with a manual page foo.2, add the line:
6331.1Scgd
6341.9Scgd	MAN=	foo.2
6351.1Scgd
6361.1ScgdIf foo does not have a manual page at all, add the line:
6371.1Scgd
6381.75Sagc	MKMAN=	no
6391.1Scgd
6401.1ScgdIf foo has multiple source files, add the line:
6411.1Scgd
6421.1Scgd	SRCS=	a.c b.c c.c d.c
6431.1Scgd
6441.1Scgd=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
6451.1Scgd
6461.1ScgdThe include file <bsd.subdir.mk> contains the default targets for building
6471.16Sjtcsubdirectories.  It has the same eight targets as <bsd.prog.mk>: all, 
6481.16Sjtcclean, cleandir, depend, includes, install, lint, and tags.  For all of
6491.72Ssommerfethe directories listed in the variable SUBDIR, the specified directory 
6501.16Sjtcwill be visited and the target made.  There is also a default target which
6511.16Sjtcallows the command "make subdir" where subdir is any directory listed in
6521.72Ssommerfethe variable SUBDIR.
6531.72Ssommerfe
6541.72SsommerfeAs a special case, the use of a token .WAIT as an entry in SUBDIR acts
6551.72Ssommerfeas a synchronization barrier when multiple make jobs are run; subdirs
6561.72Ssommerfebefore the .WAIT must complete before any subdirs after .WAIT are
6571.75Sagcstarted.  See make(1) for some caveats on use of .WAIT and other
6581.75Sagcspecial sources.
6591.21Schristos
6601.21Schristos=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
6611.21Schristos
6621.23SchristosThe include file <bsd.links.mk> handles the LINKS and SYMLINKS variables
6631.23Schristosand is included from from bsd.lib.mk and bsd.prog.mk.
6641.23Schristos
6651.23Schristos=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
6661.23Schristos
6671.23SchristosThe include file <bsd.files.mk> handles the FILES variables and is included
6681.23Schristosfrom bsd.lib.mk and bsd.prog.mk.
6691.21Schristos
6701.21Schristos=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
6711.21Schristos
6721.29ScjsThe include file <bsd.inc.mk> defines the includes target and uses two
6731.29Scjsvariables:
6741.21Schristos
6751.81SwizINCS		The list of include files
6761.21Schristos
6771.81SwizINCSDIR		The location to install the include files.
6781.81Swiz
6791.81SwizINCSNAME	Target name of the include file, if only one; same as
6801.81Swiz		FILESNAME, but for include files.
6811.81Swiz
6821.81SwizINCSNAME_<file>	The name file <file> should be installed as, if not <file>,
6831.81Swiz		same as FILESNAME_<file>, but for include files.
6841.39Scgd
6851.39Scgd=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
6861.39Scgd
6871.39ScgdThe include file <bsd.kinc.mk> defines the many targets (includes,
6881.39Scgdsubdirectories, etc.), and is used by kernel makefiles to handle
6891.39Scgdinclude file installation.  It is intended to be included alone, by
6901.39Scgdkernel Makefiles.  Please see bsd.kinc.mk for more details, and keep
6911.39Scgdthe documentation in that file up to date.
6921.13Schristos
6931.13Schristos=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
6941.13Schristos
6951.47StvThe include file <bsd.info.mk> is used to generate and install GNU Info
6961.47Stvdocumentation from respective Texinfo source files.  It defines three
6971.47Stvimplicit targets (.txi.info, .texi.info, and .texinfo.info), and uses the
6981.47Stvfollowing variables:
6991.47Stv
7001.47StvTEXINFO		List of Texinfo source files.  Info documentation will
7011.47Stv		consist of single files with the extension replaced by
7021.47Stv		.info.
7031.47Stv
7041.47StvINFOFLAGS	Flags to pass to makeinfo.  []
7051.47Stv
7061.47StvINSTALL_INFO	Name of install-info program.  [install-info]
7071.47Stv
7081.47StvMAKEINFO	Name of makeinfo program.  [makeinfo]
7091.47Stv
7101.47Stv=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
7111.47Stv
7121.13SchristosThe include file <bsd.sys.mk> is used by <bsd.prog.mk> and
7131.14Scgd<bsd.lib.mk>.  It contains overrides that are used when building
7141.14Scgdthe NetBSD source tree.  For instance, if "PARALLEL" is defined by
7151.14Scgdthe program/library Makefile, it includes a set of rules for lex and
7161.14Scgdyacc that allow multiple lex and yacc targets to be built in parallel.
7171.69Ssommerfe
7181.69SsommerfeOther variables of note (incomplete list):
7191.69Ssommerfe
7201.82SlukemWARNS		Crank up gcc warning options; the distinct levels are:
7211.82Slukem			WARNS=1
7221.82Slukem			WARNS=2
7231.82Slukem			WARNS=3
7241.69Ssommerfe
7251.69SsommerfeFORMAT_AUDIT	If FORMAT_AUDIT is set, and WFORMAT is set and > 1, turn on
7261.69SsommerfeWFORMAT 	-Wnetbsd-format-audit for extra-stringent format checking.
7271.75Sagc		WFORMAT belongs in individual makefiles and/or
7281.75Sagc		Makefile.inc files.  (set WFORMAT=1 in individual
7291.75Sagc		makefiles if a program is not security critical and is
7301.75Sagc		doing bizarre things with format strings which would
7311.75Sagc		be even uglier if rewritten) FORMAT_AUDIT should go in
7321.75Sagc		mk.conf if you're doing format-string auditing. 
7331.69Ssommerfe		FORMAT_AUDIT may go away in time.
7341.1Scgd
7351.1Scgd=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
7361.1Scgd
7371.1ScgdThe include file <bsd.lib.mk> has support for building libraries.  It has
7381.16Sjtcthe same eight targets as <bsd.prog.mk>: all, clean, cleandir, depend,
7391.44Serhincludes, install, lint, and tags.  Additionally, it has a checkver target
7401.44Serhwhich checks for installed shared object libraries whose version is greater
7411.44Serhthat the version of the source. It has a limited number of suffixes,
7421.106Sthorpejconsistent with the current needs of the BSD tree.  bsd.lib.mk includes
7431.106Sthorpej<bsd.shlib.mk> to get shared library parameters.
7441.1Scgd
7451.1ScgdIt sets/uses the following variables:
7461.10Scgd
7471.10ScgdLIB		The name of the library to build.
7481.1Scgd
7491.1ScgdLIBDIR		Target directory for libraries.
7501.85Slukem
7511.106SthorpejSHLIBINSTALLDIR	Target directory for shared libraries if ${USE_SHLIBDIR}
7521.85Slukem		is "yes".
7531.85Slukem
7541.106SthorpejUSE_SHLIBDIR	If "yes", use ${SHLIBINSTALLDIR} instead of ${LIBDIR}
7551.85Slukem		as the path to install shared libraries to.
7561.101Slukem		USE_SHLIBDIR must be defined before <bsd.own.mk> is included.
7571.1Scgd
7581.1ScgdLINTLIBDIR	Target directory for lint libraries.
7591.1Scgd
7601.1ScgdLIBGRP		Library group.
7611.1Scgd
7621.1ScgdLIBOWN		Library owner.
7631.1Scgd
7641.1ScgdLIBMODE		Library mode.
7651.1Scgd
7661.1ScgdLDADD		Additional loader objects.
7671.1Scgd
7681.15ScgdMAN		The manual pages to be installed (use a .1 - .9 suffix).
7691.47Stv
7701.47StvMKLINKLIB	If "no", act as "MKPICINSTALL=no MKPROFILE=no".
7711.47Stv		Also:
7721.47Stv			- don't install the .a libraries
7731.47Stv			- don't install _pic.a libraries on PIC systems
7741.47Stv			- don't build .a libraries on PIC systems
7751.47Stv			- don't install the .so symlink on ELF systems
7761.47Stv		I.e, only install the shared library (and the .so.major
7771.47Stv		symlink on ELF).
7781.54Ssimonb
7791.54SsimonbMKPICLIB	If "no", don't build _pic.a libraries, and build the
7801.54Ssimonb		shared object libraries from the .a libraries.  A
7811.54Ssimonb		symlink is installed in ${DESTDIR}/usr/lib for the
7821.54Ssimonb		_pic.a library pointing to the .a library.
7831.44Serh
7841.44SerhNOCHECKVER_<library>
7851.44SerhNOCHECKVER	If set, disables checking for installed shared object
7861.44Serh		libraries with versions greater than the source.  A
7871.44Serh		particular library name, without the "lib" prefix, may
7881.44Serh		be appended to the variable name to disable the check for
7891.44Serh		only that library.
7901.1Scgd
7911.1ScgdSRCS		List of source files to build the library.  Suffix types
7921.1Scgd		.s, .c, and .f are supported.  Note, .s files are preferred
7931.1Scgd		to .c files of the same name.  (This is not the default for
7941.1Scgd		versions of make.)
7951.1Scgd
7961.1ScgdThe include file <bsd.lib.mk> includes the file named "../Makefile.inc"
7971.1Scgdif it exists, as well as the include file <bsd.man.mk>.
7981.1Scgd
7991.1ScgdIt has rules for building profiled objects; profiled libraries are
8001.1Scgdbuilt by default.
8011.1Scgd
8021.4ScgdLibraries are ranlib'd when made.
8031.56Ssommerfe
8041.56Ssommerfe=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
8051.56Ssommerfe
8061.56SsommerfeThe include file <bsd.obj.mk> defines targets related to the creation
8071.56Ssommerfeand use of separated object and source directories.
8081.56Ssommerfe
8091.63SsjgIf an environment variable named MAKEOBJDIRPREFIX is set, make(1) uses
8101.63Ssjg${MAKEOBJDIRPREFIX}${.CURDIR} as the name of the object directory if
8111.75Sagcit exists.  Otherwise make(1) looks for the existence of a
8121.63Ssjgsubdirectory (or a symlink to a directory) of the source directory
8131.63Ssjginto which built targets should be placed.  If an environment variable
8141.63Ssjgnamed MAKEOBJDIR is set, make(1) uses its value as the name of the
8151.63Ssjgobject directory; failing that, make first looks for a subdirectory
8161.63Ssjgnamed "obj.${MACHINE}", and if that doesn't exist, it looks for "obj".
8171.56Ssommerfe
8181.56SsommerfeObject directories are not created automatically by make(1) if they
8191.56Ssommerfedon't exist; you need to run a separate "make obj".  (This will happen
8201.56Ssommerfeduring a top-level build if "MKOBJDIRS" is set to a value other than
8211.58Ssommerfe"no").  When the source directory is a subdirectory of ${BSDSRCDIR} --
8221.58Ssommerfeand this is determined by a simple string prefix comparison -- object
8231.58Ssommerfedirectories are created in a separate object directory tree, and a
8241.58Ssommerfesymlink to the object directory in that tree is created in the source
8251.58Ssommerfedirectory; otherwise, "make obj" assumes that you're not in the main
8261.58Ssommerfesource tree and that it's not safe to use a separate object tree.
8271.56Ssommerfe
8281.56SsommerfeSeveral variables used by <bsd.obj.mk> control exactly what
8291.56Ssommerfedirectories and links get created during a "make obj":
8301.56Ssommerfe
8311.56SsommerfeMAKEOBJDIR	If set, this is the component name of the object
8321.56Ssommerfe		directory.
8331.56Ssommerfe
8341.56SsommerfeOBJMACHINE	If this is set but MAKEOBJDIR is not set, creates
8351.56Ssommerfe		object directories or links named "obj.${MACHINE}";
8361.56Ssommerfe		otherwise, just creates ones named "obj".
8371.56Ssommerfe
8381.56SsommerfeUSR_OBJMACHINE  If set, and the current directory is a subdirectory of
8391.56Ssommerfe		${BSDSRCDIR}, create object directory in the
8401.56Ssommerfe		corresponding subdirectory of ${BSDOBJDIR}.${MACHINE};
8411.56Ssommerfe		otherwise, create it in the corresponding subdirectory
8421.56Ssommerfe		of ${BSDOBJDIR}
8431.93Sthorpej
8441.93SthorpejBUILDID		If set, the contents of this variable are appended
8451.93Sthorpej		to the object directory name.  If OBJMACHINE is also
8461.93Sthorpej		set, ".${BUILDID}" is added after ".${MACHINE}".
8471.63Ssjg
8481.63Ssjg=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
8491.63Ssjg
8501.63SsjgThe include file <bsd.kernobj.mk> defines variables related to the
8511.63Ssjglocation of kernel sources and object directories.
8521.63Ssjg
8531.63SsjgKERNSRCDIR	Is the location of the top of the kernel src.
8541.95Slukem		It defaults to ${_SRC_TOP_}/sys
8551.63Ssjg
8561.63SsjgKERNARCHDIR	Is the location of the machine dependent kernel
8571.63Ssjg		sources.  It defaults to arch/${MACHINE}
8581.63Ssjg		
8591.63SsjgKERNCONFDIR	Is where the configuration files for kernels are
8601.63Ssjg		found; default is ${KERNSRCDIR}/${KERNARCHDIR}/conf.
8611.63Ssjg
8621.63SsjgKERNOBJDIR	Is the kernel build directory.  The kernel GENERIC for
8631.63Ssjg		instance will be compiled in ${KERNOBJDIR}/GENERIC.
8641.63Ssjg		The default value is
8651.63Ssjg		${MAKEOBJDIRPREFIX}${KERNSRCDIR}/${KERNARCHDIR}/compile
8661.63Ssjg		if it exists or the target 'obj' is being made.
8671.63Ssjg		Otherwise the default is
8681.63Ssjg		${KERNSRCDIR}/${KERNARCHDIR}/compile.
8691.63Ssjg
8701.63SsjgIt is important that Makefiles (such as those under src/distrib) that
8711.63Ssjgwish to find compiled kernels use bsd.kernobj.mk and ${KERNOBJDIR}
8721.63Ssjgrather than make assumptions about the location of the compiled kernel.
8731.109Ssommerfe
8741.109Ssommerfe=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
8751.109Ssommerfe
8761.109SsommerfeThe include file <bsd.rpc.mk> contains a makefile fragment used to
8771.109Ssommerfeconstruct source files built by rpcgen.
8781.109Ssommerfe
8791.109SsommerfeThe following macros may be defined in makefiles which include
8801.109Ssommerfe<bsd.rpc.mk> in order to control which files get built and how they
8811.109Ssommerfeare to be built:
8821.109Ssommerfe
8831.109SsommerfeRPC_INCS:	construct .h file from .x file
8841.109SsommerfeRPC_XDRFILES:	construct _xdr.c from .x file 
8851.109Ssommerfe		(for marshalling/unmarshalling data types)
8861.109SsommerfeRPC_SVCFILES:	construct _svc.c from .x file
8871.109Ssommerfe		(server-side stubs)
8881.109SsommerfeRPC_SVCFLAGS:	Additional flags passed to builds of RPC_SVCFILES.
8891.109Ssommerfe
8901.109SsommerfeRPC_XDIR:	Directory containing .x/.h files
8911.109Ssommerfe
8921.109Ssommerfe
8931.30Sagc
8941.30Sagc=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
895