bsd.README revision 1.445
11.445Slukem#	$NetBSD: bsd.README,v 1.445 2023/07/22 18:50:31 lukem Exp $
21.24Smikel#	@(#)bsd.README	8.2 (Berkeley) 4/2/94
31.1Scgd
41.213SlukemThis is the README file for the make "include" files for the NetBSD
51.213Slukemsource tree.  The files are installed in /usr/share/mk, and are,
61.213Slukemby convention, named with the suffix ".mk".
71.1Scgd
81.444SlukemOther sources of relevant documentation are BUILDING in the top
91.444Slukemlevel of the NetBSD source tree, and the mk.conf(5) man page.
101.444Slukem
111.444SlukemNote: this file is not intended to replace reading through the .mk
121.1Scgdfiles for anything tricky.
131.1Scgd
141.1Scgd=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
151.1Scgd
161.1ScgdRANDOM THINGS WORTH KNOWING:
171.1Scgd
181.1ScgdThe files are simply C-style #include files, and pretty much behave like
191.1Scgdyou'd expect.  The syntax is slightly different in that a single '.' is
201.1Scgdused instead of the hash mark, i.e. ".include <bsd.prog.mk>".
211.1Scgd
221.1ScgdOne difference that will save you lots of debugging time is that inclusion
231.1Scgdof the file is normally done at the *end* of the Makefile.  The reason for
241.1Scgdthis is because .mk files often modify variables and behavior based on the
251.1Scgdvalues of variables set in the Makefile.  To make this work, remember that
261.1Scgdthe FIRST target found is the target that is used, i.e. if the Makefile has:
271.1Scgd
281.1Scgd	a:
291.1Scgd		echo a
301.1Scgd	a:
311.1Scgd		echo a number two
321.1Scgd
331.1Scgdthe command "make a" will echo "a".  To make things confusing, the SECOND
341.1Scgdvariable assignment is the overriding one, i.e. if the Makefile has:
351.1Scgd
361.1Scgd	a=	foo
371.1Scgd	a=	bar
381.1Scgd
391.1Scgd	b:
401.1Scgd		echo ${a}
411.1Scgd
421.1Scgdthe command "make b" will echo "bar".  This is for compatibility with the
431.1Scgdway the V7 make behaved.
441.1Scgd
451.1ScgdIt's fairly difficult to make the BSD .mk files work when you're building
461.75Sagcmultiple programs in a single directory.  It's a lot easier to split up the
471.1Scgdprograms than to deal with the problem.  Most of the agony comes from making
481.36Srossthe "obj" directory stuff work right, not because we switched to a new version
491.1Scgdof make.  So, don't get mad at us, figure out a better way to handle multiple
501.1Scgdarchitectures so we can quit using the symbolic link stuff.  (Imake doesn't
511.1Scgdcount.)
521.1Scgd
531.1ScgdThe file .depend in the source directory is expected to contain dependencies
541.1Scgdfor the source files.  This file is read automatically by make after reading
551.1Scgdthe Makefile.
561.1Scgd
571.1ScgdThe variable DESTDIR works as before.  It's not set anywhere but will change
581.1Scgdthe tree where the file gets installed.
591.1Scgd
601.1ScgdThe profiled libraries are no longer built in a different directory than
611.1Scgdthe regular libraries.  A new suffix, ".po", is used to denote a profiled
621.265Snjolyobject, and ".pico" denotes a shared (position-independent) object.
631.97Sitojun
641.142SlukemThere are various make variables used during the build.
651.142Slukem
661.142SlukemMany variables support a (case sensitive) value of "no" or "yes",
671.142Slukemand are tested with  ${VAR} == "no"  and  ${VAR} != "no" .
681.142Slukem
691.142Slukem
701.172ShubertfThe basic rule for the variable naming scheme is as follows:
711.172Shubertf
721.444SlukemHOST_<cmd>	A command that runs on the host machine regardless of
731.231Sapb		whether or not the system is being cross compiled, or
741.445Slukem		options for such a command.
751.231Sapb
761.444SlukemMK<feature>	Can be set to "no" to disable feature <feature>,
771.444Slukem		or "yes" to enable feature <feature>.
781.172Shubertf		Usually defaults to "yes", although some variables
791.172Shubertf		default to "no".
801.172Shubertf		Due to make(1) implementation issues, if a temporary
811.224Slukem		command-line override of a mk.conf(5) or <bsd.own.mk>
821.214Swiz		setting is required whilst still honoring a particular
831.444Slukem		Makefile's setting of MK<feature>, use
841.444Slukem			env MK<feature>=value make
851.172Shubertf		instead of
861.444Slukem			make MK<feature>=value
871.172Shubertf
881.444SlukemNO<feature>	If defined, disables feature <feature>, overriding
891.444Slukem		a user's MK<feature>=yes configuration.
901.172Shubertf		Not intended for users.
911.172Shubertf		This is to allow Makefiles to disable functionality
921.172Shubertf		that they don't support (such as missing man pages).
931.444Slukem		NO<feature> variables must be defined before <bsd.own.mk>
941.444Slukem		is included, which generally means define before
951.444Slukem		any <*.mk> is included.
961.444Slukem		See "Variables for a Makefile".
971.172Shubertf
981.444SlukemTOOL_<tool>	A tool that is provided as part of the USETOOLS
991.231Sapb		framework.  When not using the USETOOLS framework,
1001.444Slukem		TOOL_<tool> variables should refer to tools that are
1011.231Sapb		already installed on the host system.
1021.231Sapb
1031.445SlukemVarious mk.conf(5) variables control the NetBSD system build.
1041.445SlukemThese should not be set by Makefiles; they're for the user to define
1051.445Slukemin MAKECONF (see mk.conf(5) or <bsd.own.mk> documented below) or on
1061.445Slukemthe make(1) command line.
1071.445Slukem
1081.445SlukemThe supported mk.conf(5) make variables are:
1091.445Slukem
1101.445Slukem	BSDOBJDIR, BSDSRCDIR, BUILD, BUILDID, BUILDINFO, BUILDSEED,
1111.445Slukem	CDEXTRA, CONFIGOPTS, COPTS, CPUFLAGS, DESTDIR, EXTERNAL_TOOLCHAIN,
1121.445Slukem	INSTALLBOOT_BOARDS, INSTALLWORLDDIR, KERNARCHDIR, KERNCONFDIR,
1131.445Slukem	KERNEL_DIR, KERNOBJDIR, KERNSRCDIR, LOCALTIME, MAKEVERBOSE,
1141.445Slukem	MKAMDGPUFIRMWARE, MKARGON2, MKARZERO, MKATF, MKBINUTILS, MKBSDGREP,
1151.445Slukem	MKBSDTAR, MKCATPAGES, MKCLEANSRC, MKCLEANVERIFY, MKCOMPAT,
1161.445Slukem	MKCOMPATMODULES, MKCOMPATTESTS, MKCOMPATX11, MKCOMPLEX, MKCROSSGDB,
1171.445Slukem	MKCTF, MKCVS, MKCXX, MKDEBUG, MKDEBUGKERNEL, MKDEBUGLIB,
1181.445Slukem	MKDEBUGTOOLS, MKDEPINCLUDES, MKDOC, MKDTB, MKDTC, MKDTRACE,
1191.445Slukem	MKDYNAMICROOT, MKFIRMWARE, MKGCC, MKGCCCMDS, MKGDB, MKGROFF,
1201.445Slukem	MKGROFFHTMLDOC, MKHESIOD, MKHOSTOBJ, MKHTML, MKIEEEFP, MKINET6,
1211.445Slukem	MKINFO, MKIPFILTER, MKISCSI, MKKERBEROS, MKKMOD, MKKYUA, MKLDAP,
1221.445Slukem	MKLIBCSANITIZER, MKLIBCXX, MKLIBSTDCXX, MKLINKLIB, MKLINT, MKLLVM,
1231.445Slukem	MKLLVMRT, MKLVM, MKMAKEMANDB, MKMAN, MKMANDOC, MKMANZ, MKMDNS,
1241.445Slukem	MKNLS, MKNOUVEAUFIRMWARE, MKNPF, MKNSD, MKOBJ, MKOBJDIRS, MKPAM,
1251.445Slukem	MKPCC, MKPF, MKPIC, MKPICINSTALL, MKPICLIB, MKPIE, MKPIGZGZIP,
1261.445Slukem	MKPOSTFIX, MKPROFILE, MKRADEONFIRMWARE, MKRELRO, MKREPRO,
1271.445Slukem	MKREPRO_TIMESTAMP, MKRUMP, MKSANITIZER, MKSHARE, MKSKEY, MKSLJIT,
1281.445Slukem	MKSOFTFLOAT, MKSTATICLIB, MKSTATICPIE, MKSTRIPIDENT, MKSTRIPSYM,
1291.445Slukem	MKTEGRAFIRMWARE, MKTPM, MKUNBOUND, MKUNPRIVED, MKUPDATE, MKX11,
1301.445Slukem	MKX11FONTS, MKX11MOTIF, MKXORG_SERVER, MKYP, MKZFS, NETBSDSRCDIR,
1311.445Slukem	NETBSD_OFFICIAL_RELEASE, NOCLEANDIR, NODISTRIBDIRS, NOINCLUDES,
1321.445Slukem	OBJMACHINE, RELEASEDIR, RUMPUSER_THREADS, RUMP_CURLWP, RUMP_DEBUG,
1331.445Slukem	RUMP_DIAGNOSTIC, RUMP_KTRACE, RUMP_LOCKDEBUG, RUMP_LOCKS_UP,
1341.445Slukem	RUMP_NBCOMPAT, RUMP_VIRTIF, RUMP_VNODE_LOCKDEBUG,
1351.445Slukem	TOOLCHAIN_MISSING, TOOLDIR, USETOOLS, USE_FORT, USE_HESIOD,
1361.445Slukem	USE_INET6, USE_JEMALLOC, USE_KERBEROS, USE_LDAP, USE_LIBCSANITIZER,
1371.445Slukem	USE_PAM, USE_PIGZGZIP, USE_SANITIZER, USE_SKEY, USE_SSP,
1381.445Slukem	USE_XZ_SETS, USE_YP, X11MOTIFPATH, X11SRCDIR.
1391.445Slukem
1401.445SlukemThe obsolete mk.conf(5) make variables are:
1411.445Slukem
1421.445Slukem	EXTSRCSRCDIR, MKBFD, MKCRYPTO, MKEXTSRC, MKKDEBUG, MKKERBEROS4,
1431.445Slukem	MKLLD, MKLLDB, MKMCLINKER, MKPERFUSE, MKTOOLSDEBUG, NBUILDJOBS,
1441.445Slukem	SHAREDSTRINGS, USE_COMBINE, USE_NEW_TOOLCHAIN.
1451.445Slukem
1461.445SlukemNotable variables documented in mk.conf(5) and duplicated here:
1471.445Slukem
1481.445SlukemDESTDIR		Directory to contain the built NetBSD system.  If set,
1491.445Slukem		special options are passed to the compilation tools to
1501.445Slukem		prevent their default use of the host system's
1511.445Slukem		/usr/include, /usr/lib, and so forth.  This pathname must
1521.445Slukem		be an absolute path, and should not end with a slash (/)
1531.445Slukem		character.  (For installation into the system's root
1541.445Slukem		directory, set DESTDIR to an empty string, not to "/").
1551.445Slukem		The directory must reside on a file system which supports
1561.445Slukem		long file names and hard links.
1571.445Slukem
1581.445Slukem		Note: build.sh will provide a default of
1591.445Slukem		"destdir.MACHINE" (in the top-level .OBJDIR) unless run
1601.445Slukem		in `expert' mode with the -E option.
1611.445Slukem
1621.445Slukem		Default: Empty string if USETOOLS=yes; otherwise unset.
1631.445Slukem
1641.445SlukemRELEASEDIR	If set, specifies the directory to which a release(7)
1651.445Slukem		layout will be written at the end of a "make release".
1661.445Slukem		If specified, must be an absolute path.
1671.445Slukem
1681.445Slukem		Note: build.sh will provide a default of "releasedir" (in
1691.445Slukem		the top-level .OBJDIR) unless run in `expert' mode with
1701.445Slukem		the -E option.
1711.444Slukem
1721.444Slukem		Default: Unset.
1731.444Slukem
1741.172ShubertfCOPTS.lib<lib>
1751.177SmrgOBJCOPTS.lib<lib>
1761.172ShubertfLDADD.lib<lib>
1771.172ShubertfCPPFLAGS.lib<lib>
1781.172ShubertfCXXFLAGS.lib<lib>
1791.172ShubertfCOPTS.<prog>
1801.428SchristosOBJCOPTS.<prog>
1811.172ShubertfLDADD.<prog>
1821.172ShubertfCPPFLAGS.<prog>
1831.444SlukemCXXFLAGS.<prog> These provide a way to specify additions to the associated
1841.172Shubertf		variables in a way that applies only to a particular library
1851.172Shubertf		or program.  <lib> corresponds to the LIB variable set in
1861.172Shubertf		the library's makefile.  <prog> corresponds to either PROG
1871.172Shubertf		or PROG_CXX (if set).  For example, if COPTS.libcrypto is
1881.172Shubertf		set to "-g", "-g" will be added to COPTS only when compiling
1891.172Shubertf		the crypto library.
1901.445Slukem		See bsd.prog.mk below for more details about these variables.
1911.118Slukem
1921.281SjoergThe active compiler is selected using the following variables:
1931.281SjoergAVAILABLE_COMPILER
1941.281Sjoerg		List of available compiler suites.  Processed in order
1951.281Sjoerg		for selecting the active compiler for each frontend.
1961.281SjoergHAVE_PCC	If defined, PCC is present and enabled.
1971.281SjoergHAVE_LLVM	If defined, LLVM/Clang is present and enabled.
1981.444SlukemUNSUPPORTED_COMPILER.<comp>
1991.444Slukem		If defined, the support for compiler <comp> is disabled.
2001.281Sjoerg
2011.281SjoergFor the frontends (CC, CPP, CXX, FC and OBJC) the following variables exist:
2021.281SjoergACTIVE_CC	Active compile suite for the CC frontend.
2031.281SjoergSUPPORTED_CC	Compile suite with support for the CC frontend.
2041.444SlukemTOOL_CC.<comp>	Path to the CC frontend for compiler <comp>.
2051.444Slukem
2061.444Slukem
2071.444Slukem=-=-=-=-=   Variables for a Makefile   =-=-=-=-=
2081.444Slukem
2091.444SlukemIf the following varialbes are defined in the Makefile before
2101.444Slukemany make(1) .include directives, they force the specific behavior.
2111.444Slukem
2121.444SlukemNOCOMPAT	Force MKCOMPAT=no.
2131.444SlukemNOCTF		Force MKCTF=no.
2141.444SlukemNODEBUG		Force MKDEBUG=no.
2151.444SlukemNODEBUGLIB	Force MKDEBUGLIB=no.
2161.444SlukemNODOC		Force MKDOC=no.
2171.444SlukemNOFORT		Force USE_FORT=no.
2181.444SlukemNOHTML		Force MKHTML=no.
2191.444SlukemNOINFO		Force MKINFO=no.
2201.444SlukemNOLIBCSANITIZER Force MKLIBCSANITIZER=no (and USE_LIBCSANITIZER=no)
2211.444SlukemNOLINKLIB	Force MKLINKLIB=no.
2221.444SlukemNOLINT		Force MKLINT=no.
2231.444SlukemNOMAN		Force MKMAN=no.
2241.444SlukemNOMANDOC	Force MKMANDOC=no.
2251.444SlukemNONLS		Force MKNLS=no.
2261.444SlukemNOOBJ		Force MKOBJ=no.
2271.444SlukemNOPIC		Force MKPIC=no.
2281.444SlukemNOPICINSTALL	Force MKPICINSTALL=no.
2291.444SlukemNOPIE		Force MKPIE=no.
2301.444SlukemNOPROFILE	Force MKPROFILE=no.
2311.444SlukemNORELRO		Force MKREPRO=no.
2321.444SlukemNOSANITIZER	Force MKSANITIZER=no (and USE_SANITIZER=no)
2331.444SlukemNOSHARE		Force MKSHARE=no.
2341.444SlukemNOSSP		Force USE_SSP=no.
2351.444SlukemNOSTATICLIB	Force MKSTATICLIB=no.
2361.444Slukem
2371.444SlukemSpecial variations:
2381.444Slukem
2391.444SlukemNOFULLRELRO!=no Force MKRELRO=no if MKRELRO=full
2401.444Slukem
2411.444SlukemTODO: NOFULLRELRO should just be a defined test for consistency.
2421.444Slukem
2431.281Sjoerg
2441.118Slukem=-=-=-=-=   sys.mk   =-=-=-=-=
2451.1Scgd
2461.1ScgdThe include file <sys.mk> has the default rules for all makes, in the BSD
2471.1Scgdenvironment or otherwise.  You probably don't want to touch this file.
2481.1Scgd
2491.118Slukem=-=-=-=-=   bsd.own.mk   =-=-=-=-=
2501.1Scgd
2511.17SthorpejThe include file <bsd.own.mk> contains source tree configuration parameters,
2521.17Sthorpejsuch as the owners, groups, etc. for both manual pages and binaries, and
2531.17Sthorpeja few global "feature configuration" parameters.
2541.1Scgd
2551.1ScgdIt has no targets.
2561.1Scgd
2571.134SlukemTo get system-specific configuration parameters, <bsd.own.mk> will try to
2581.445Slukeminclude the mk.conf(5) file specified by the MAKECONF variable, which may
2591.445Slukembe either set in the environment or provided on the make(1) command line.
2601.445SlukemMAKECONF defaults to /etc/mk.conf.  mk.conf(5) may define any of the
2611.445Slukemvariables described below.
2621.17Sthorpej
2631.134Slukem<bsd.own.mk> sets the following variables, if they are not already defined
2641.17Sthorpej(defaults are in brackets):
2651.15Scgd
2661.445SlukemNETBSDSRCDIR	The path to the top level of the NetBSD sources.
2671.98Slukem		If _SRC_TOP_ != "", that will be used as the default,
2681.98Slukem		otherwise BSDSRCDIR will be used as the default.
2691.98Slukem		Various makefiles within the NetBSD source tree will
2701.98Slukem		use this to reference the top level of the source tree.
2711.445Slukem		Default: Top level of the NetBSD source tree (as
2721.445Slukem		determined by the presence of build.sh and tools/) if
2731.445Slukem		make(1) is run from within that tree; otherwise BSDSRCDIR
2741.445Slukem		will be used.
2751.98Slukem
2761.95Slukem_SRC_TOP_	Top of the system source tree, as determined by <bsd.own.mk>
2771.98Slukem		based on the presence of tools/ and build.sh.  This variable
2781.98Slukem		is "internal" to <bsd.own.mk>, although its value is only
2791.98Slukem		determined once and then propagated to all sub-makes.
2801.95Slukem
2811.305Sapb_NETBSD_VERSION_DEPENDS
2821.305Sapb		A list of files which contain information about
2831.305Sapb		the version of the NetBSD being built.  This is
2841.305Sapb		defined only if the current directory appears
2851.305Sapb		to be inside a NetBSD source tree.  The list of
2861.305Sapb		files includes ${NETBSDSRCDIR}/sys/sys/param.h
2871.305Sapb		(which contains the kernel version number),
2881.305Sapb		${NETBSDSRCDIR}/sys/conf/newvers.sh and
2891.305Sapb		${NETBSDSRCDIR}/sys/conf/osrelease.sh (which
2901.305Sapb		interpret the information in sys/sys/param.h), and
2911.305Sapb		${_SRC_TOP_OBJ_}/params (which is an optional file,
2921.305Sapb		created by "make build" in ${_SRC_TOP_}/Makefile,
2931.305Sapb		containing all the variables that may influence the
2941.305Sapb		build).
2951.305Sapb
2961.305Sapb		Targets that depend on the NetBSD version, or on
2971.305Sapb		variables defined at build time, can declare a
2981.305Sapb		dependency on ${_NETBSD_VERSION_DEPENDS}, like this:
2991.305Sapb
3001.305Sapb			version.c: ${_NETBSD_VERSION_DEPENDS}
3011.305Sapb				commands to create version.c
3021.305Sapb
3031.445SlukemBSDSRCDIR	The real path to the NetBSD source tree, if NETBSDSRCDIR
3041.445Slukem		isn't defined.
3051.445Slukem		Default: "/usr/src".
3061.445Slukem
3071.445SlukemBSDOBJDIR	The real path to the object directory tree for the NetBSD
3081.445Slukem		source tree.
3091.445Slukem		Default: "/usr/obj".
3101.15Scgd
3111.116SlukemBINGRP		Binary group.  [wheel]
3121.15Scgd
3131.116SlukemBINOWN		Binary owner.  [root]
3141.15Scgd
3151.116SlukemBINMODE		Binary mode.  [555]
3161.15Scgd
3171.116SlukemNONBINMODE	Mode for non-executable files.  [444]
3181.15Scgd
3191.415SkamilMANDIR		Base path for manual installation.  [/usr/share/man/cat]
3201.15Scgd
3211.116SlukemMANGRP		Manual group.  [wheel]
3221.15Scgd
3231.116SlukemMANOWN		Manual owner.  [root]
3241.15Scgd
3251.116SlukemMANMODE		Manual mode.  [${NONBINMODE}]
3261.15Scgd
3271.222SlukemMANINSTALL	Manual installation type.  Space separated list:
3281.415Skamil			catinstall, htmlinstall, maninstall
3291.415Skamil		Default value derived from MKCATPAGES and MKHTML.
3301.76Sfair
3311.76SfairLDSTATIC	Control program linking; if set blank, link everything
3321.129Slukem		dynamically.  If set to "-static", link everything statically.
3331.76Sfair		If not set, programs link according to their makefile.
3341.21Schristos
3351.116SlukemLIBDIR		Base path for library installation.  [/usr/lib]
3361.15Scgd
3371.116SlukemLINTLIBDIR	Base path for lint(1) library installation.  [/usr/libdata/lint]
3381.15Scgd
3391.116SlukemLIBGRP		Library group.  [${BINGRP}]
3401.15Scgd
3411.116SlukemLIBOWN		Library owner.  [${BINOWN}]
3421.15Scgd
3431.116SlukemLIBMODE		Library mode.  [${NONBINMODE}]
3441.15Scgd
3451.15ScgdDOCDIR		Base path for system documentation (e.g. PSD, USD, etc.)
3461.444Slukem		installation.  [/usr/share/doc]
3471.62Ssimonb
3481.116SlukemDOCGRP		Documentation group.  [wheel]
3491.15Scgd
3501.116SlukemDOCOWN		Documentation owner.  [root]
3511.15Scgd
3521.116SlukemDOCMODE		Documentation mode.  [${NONBINMODE}]
3531.15Scgd
3541.445SlukemGZIP_N_FLAG	Options to pass to TOOL_GZIP to prevent it from inserting
3551.335Sapb		file names or timestamps in the compressed output.
3561.335Sapb		[-n, or -nT when TOOL_GZIP is really TOOL_PIGZ]
3571.335Sapb
3581.84SkleinkNLSDIR		Base path for Native Language Support files installation.
3591.15Scgd		[/usr/share/nls]
3601.1Scgd
3611.116SlukemNLSGRP		Native Language Support files group.  [wheel]
3621.1Scgd
3631.116SlukemNLSOWN		Native Language Support files owner.  [root]
3641.1Scgd
3651.116SlukemNLSMODE		Native Language Support files mode.  [${NONBINMODE}]
3661.1Scgd
3671.445SlukemX11SRCDIR	Directory containing the modular Xorg source.  If
3681.445Slukem		specified, must be an absolute path.  The main modular
3691.445Slukem		Xorg source is found in ${X11SRCDIR}/external/mit.
3701.445Slukem
3711.445Slukem		Default: ${NETBSDSRCDIR}/../xsrc, if that exists; otherwise
3721.445Slukem		"/usr/xsrc".
3731.144Slukem
3741.444SlukemX11SRCDIR.local The path to the local X11 src tree.  [${X11SRCDIR}/local]
3751.144Slukem
3761.221SmrgX11SRCDIR.lib<package>
3771.221SmrgX11SRCDIR.<package>
3781.425Smsaitoh		The path to the xorg src tree for the specified package>.
3791.221Smrg		[${X11SRCDIR}/external/mit/xorg/<package>/dist]
3801.221Smrg
3811.367SsnjX11ROOTDIR	Root directory of the X11 installation.  [/usr/X11R7]
3821.144Slukem
3831.144SlukemX11BINDIR	X11 bin directory.  [${X11ROOTDIR}/bin]
3841.144Slukem
3851.144SlukemX11FONTDIR	X11 font directory.  [${X11ROOTDIR}/lib/X11/fonts]
3861.144Slukem
3871.144SlukemX11INCDIR	X11 include directory.  [${X11ROOTDIR}/include]
3881.144Slukem
3891.144SlukemX11LIBDIR	X11 lib/x11 (config) directory.  [${X11ROOTDIR}/lib/X11]
3901.144Slukem
3911.144SlukemX11MANDIR	X11 manual directory.  [${X11ROOTDIR}/man]
3921.144Slukem
3931.144SlukemX11USRLIBDIR	X11 library directory.  [${X11ROOTDIR}/lib]
3941.144Slukem
3951.445SlukemSTRIPFLAG	The option passed to the install program to cause the binary
3961.1Scgd		to be stripped.  This is to be used when building your
3971.1Scgd		own install script so that the entire system can be made
3981.146Slukem		stripped/not-stripped using a single knob.  []
3991.1Scgd
4001.445SlukemCOPY		The option passed to the install program to cause the binary
4011.2Scgd		to be copied rather than moved.  This is to be used when
4021.2Scgd		building our own install script so that the entire system
4031.2Scgd		can either be installed with copies, or with moves using
4041.116Slukem		a single knob.  [-c]
4051.15Scgd
4061.310SapbMAKEDIRTARGETENV
4071.310Sapb		Environment variables passed to the child make process
4081.310Sapb		invoked by MAKEDIRTARGET.
4091.310Sapb
4101.150SlukemMAKEDIRTARGET dir target [params]
4111.150Slukem		Runs "cd $${dir} && ${MAKE} [params] $${target}",
4121.150Slukem		displaying a "pretty" message whilst doing so.
4131.150Slukem
4141.152SclRELEASEMACHINEDIR
4151.152Scl		Subdirectory used below RELEASEDIR when building
4161.395Smartin		a release.  [${MACHINE},
4171.395Smartin		or ${MACHINE}-${MACHINE_ARCH} for evb{arm,mips,sh3}*]
4181.152Scl
4191.152SclRELEASEMACHINE	Subdirectory or path component used for the following
4201.152Scl		paths:
4211.152Scl			distrib/${RELEASEMACHINE}
4221.152Scl			distrib/notes/${RELEASEMACHINE}
4231.152Scl			etc/etc.${RELEASEMACHINE}
4241.152Scl		Used when building a release.  [${MACHINE}]
4251.150Slukem
4261.134SlukemAdditionally, the following variables may be set by <bsd.own.mk> or in a
4271.214Swizmake configuration file to modify the behavior of the system build
4281.17Sthorpejprocess (default values are in brackets along with comments, if set by
4291.134Slukem<bsd.own.mk>):
4301.33Sjonathan
4311.445SlukemUSETOOLS	Can be set to "yes" or "no".  Indicates whether the tools
4321.445Slukem		specified by ${TOOLDIR} should be used as part of a build in
4331.445Slukem		progress. Must be set to "yes" if cross-compiling.
4341.172Shubertf		Supported values:
4351.172Shubertf
4361.172Shubertf		yes	Use the tools from TOOLDIR.
4371.172Shubertf
4381.172Shubertf		no	Do not use the tools from TOOLDIR, but refuse to
4391.172Shubertf			build native compilation tool components that are
4401.172Shubertf			version-specific for that tool.
4411.172Shubertf
4421.172Shubertf		never	Do not use the tools from TOOLDIR, even when
4431.172Shubertf			building native tool components.  This is similar to
4441.172Shubertf			the traditional NetBSD build method, but does not
4451.172Shubertf			verify that the compilation tools in use are
4461.172Shubertf			up-to-date enough in order to build the tree
4471.172Shubertf			successfully.  This may cause build or runtime
4481.172Shubertf			problems when building the whole NetBSD source tree.
4491.172Shubertf
4501.445Slukem		Default: "no" when using <bsd.*.mk> outside the NetBSD
4511.445Slukem		source tree (detected automatically) or if
4521.445Slukem		TOOLCHAIN_MISSING=yes; otherwise "yes".
4531.142Slukem
4541.116SlukemOBJECT_FMT	Object file format.  [set to "ELF" on architectures that
4551.199Ssimonb		use ELF -- currently all architectures].
4561.33Sjonathan
4571.103SthorpejTOOLCHAIN_MISSING
4581.445Slukem		Can be set to "yes" or "no".  If not "no", this
4591.445Slukem		indicates that the platform "MACHINE_ARCH" being built
4601.445Slukem		does not have a working in-tree toolchain.
4611.445Slukem		If the ${MACHINE_ARCH} in question falls into this category,
4621.301Sabs		TOOLCHAIN_MISSING is conditionally assigned the value "yes".
4631.103Sthorpej		Otherwise, the variable is unconditionally assigned the
4641.103Sthorpej		value "no".
4651.445Slukem
4661.445Slukem		If not "no", acts as MKBINUTILS=no MKGCC=no MKGDB=no.
4671.445Slukem
4681.445Slukem		Default: "no".
4691.103Sthorpej
4701.103SthorpejEXTERNAL_TOOLCHAIN
4711.103Sthorpej		This variable is not directly set by <bsd.own.mk>, but
4721.103Sthorpej		including <bsd.own.mk> is the canonical way to gain
4731.103Sthorpej		access to this variable.  The variable should be defined
4741.445Slukem		either in the user's environment or in the user's mk.conf(5)
4751.445Slukem		file.
4761.445Slukem
4771.445Slukem		If defined, this variable indicates the root directory of
4781.103Sthorpej		an external toolchain which will be used to build the
4791.142Slukem		tree.  For example, if a platform is a ${TOOLCHAIN_MISSING}
4801.103Sthorpej		platform, EXTERNAL_TOOLCHAIN can be used to re-enable the
4811.103Sthorpej		cross-compile framework.
4821.103Sthorpej
4831.445Slukem		If EXTERNAL_TOOLCHAIN is defined, act as MKGCC=no, since
4841.445Slukem		the external version of the compiler may not be able to build
4851.445Slukem		the library components of the in-tree compiler.
4861.445Slukem
4871.445Slukem		This variable should be used in conjunction with an
4881.445Slukem		appropriate HAVE_GCC or HAVE_LLVM setting to control the
4891.445Slukem		compiler options.
4901.371Sjoerg
4911.445Slukem		Note: This variable is not yet used in as many places as
4921.103Sthorpej		it should be.  Expect the exact semantics of this variable
4931.103Sthorpej		to change in the short term as parts of the cross-compile
4941.103Sthorpej		framework continue to be cleaned up.
4951.1Scgd
4961.236SapbThe following variables are defined to commands to perform the
4971.236Sapbappropriate operation, with the default in [brackets].  Note that
4981.236Sapbthe defaults change if USETOOLS == "yes":
4991.236Sapb
5001.236SapbTOOL_AMIGAAOUT2BB	aout to Amiga bootblock converter.  [amiga-aout2bb]
5011.236Sapb
5021.236SapbTOOL_AMIGAELF2BB	ELF to Amiga bootblock converter.  [amiga-elf2bb]
5031.236Sapb
5041.387SchristosTOOL_AMIGATXLT		Amiga assembly language format translator.  [amiga-txlt]
5051.387Schristos
5061.387SchristosTOOL_ARMELF2AOUT	ELF to a.out executable converter [arm-elf2aout}
5071.236Sapb
5081.236SapbTOOL_ASN1_COMPILE	ASN1 compiler.  [asn1_compile]
5091.236Sapb
5101.236SapbTOOL_AWK		Pattern-directed scanning/processing language.  [awk]
5111.236Sapb
5121.236SapbTOOL_CAP_MKDB		Create capability database.  [cap_mkdb]
5131.236Sapb
5141.236SapbTOOL_CAT		Concatenate and print files.  [cat]
5151.236Sapb
5161.236SapbTOOL_CKSUM		Display file checksums.  [cksum]
5171.236Sapb
5181.236SapbTOOL_COMPILE_ET		Error table compiler.  [compile_et]
5191.236Sapb
5201.236SapbTOOL_CONFIG		Build kernel compilation directories.  [config]
5211.236Sapb
5221.236SapbTOOL_CRUNCHGEN		Generate crunched binary build environment.  [crunchgen]
5231.236Sapb
5241.236SapbTOOL_CTAGS		Create a tags file.  [ctags]
5251.236Sapb
5261.236SapbTOOL_DB			Manipulate db(3) databases.  [db]
5271.236Sapb
5281.236SapbTOOL_DISKLABEL		Read and write disk pack label.  [disklabel]
5291.236Sapb
5301.236SapbTOOL_EQN		Format equations for groff.  [eqn]
5311.236Sapb
5321.236SapbTOOL_FDISK		MS-DOS partition maintenance program.  [fdisk]
5331.236Sapb
5341.236SapbTOOL_FGEN		IEEE 1275 Open Firmware FCode Tokenizer.  [fgen]
5351.236Sapb
5361.236SapbTOOL_GENASSYM		Generate constants for assembly files.  [genassym]
5371.236Sapb
5381.236SapbTOOL_GENCAT		Generate NLS message catalogs.  [gencat]
5391.236Sapb
5401.236SapbTOOL_GMAKE		GNU make utility.  [gmake]
5411.236Sapb
5421.247SsketchTOOL_GREP		Print lines matching a pattern.  [grep]
5431.247Ssketch
5441.236SapbTOOL_GROFF		Front end for groff document formatting system.  [groff]
5451.236Sapb
5461.327SapbTOOL_GZIP		Compression/decompression tool.  [gzip]
5471.327Sapb
5481.335SapbTOOL_GZIP_N		Same as TOOL_GZIP, plus a command line option to
5491.335Sapb			prevent it from inserting file names or timestamps
5501.335Sapb			into the compressed output.
5511.335Sapb			[${TOOL_GZIP} ${GZIP_N_FLAG}]
5521.335Sapb
5531.236SapbTOOL_HEXDUMP		Ascii, decimal, hexadecimal, octal dump.  [hexdump]
5541.236Sapb
5551.236SapbTOOL_HP300MKBOOT	Make bootable image for hp300.  [hp300-mkboot]
5561.236Sapb
5571.328SskrllTOOL_HPPAMKBOOT		Make bootable image for hppa.  [hppa-mkboot]
5581.236Sapb
5591.236SapbTOOL_INDXBIB		Make bibliographic database's inverted index.  [indxbib]
5601.236Sapb
5611.236SapbTOOL_INSTALLBOOT	Install disk bootstrap software.  [installboot]
5621.236Sapb
5631.236SapbTOOL_INSTALL_INFO	Update info/dir entries.  [install-info]
5641.236Sapb
5651.236SapbTOOL_JOIN		Relational database operator.  [join]
5661.236Sapb
5671.236SapbTOOL_M4			M4 macro language processor.  [m4]
5681.236Sapb
5691.387SchristosTOOL_M68KELF2AOUT	ELF to a.out executable converter [m68k-elf2aout}
5701.387Schristos
5711.236SapbTOOL_MACPPCFIXCOFF	Fix up xcoff headers for macppc.  [macppc-fixcoff]
5721.236Sapb
5731.236SapbTOOL_MAKEFS		Create file system image from directory tree.  [makefs]
5741.236Sapb
5751.236SapbTOOL_MAKEINFO		Translate Texinfo documents.  [makeinfo]
5761.236Sapb
5771.236SapbTOOL_MAKEWHATIS		Create a whatis.db database.  [makewhatis]
5781.236Sapb
5791.236SapbTOOL_MDSETIMAGE		Set kernel RAM disk image.  [mdsetimage]
5801.236Sapb
5811.236SapbTOOL_MENUC		Menu compiler.  [menuc]
5821.236Sapb
5831.236SapbTOOL_MIPSELF2ECOFF	Convert ELF-format executable to ECOFF for mips.
5841.236Sapb			[mips-elf2ecoff]
5851.236Sapb
5861.236SapbTOOL_MKCSMAPPER		Make charset mapping table.  [mkcsmapper]
5871.236Sapb
5881.236SapbTOOL_MKESDB		Make encoding scheme database.  [mkesdb]
5891.236Sapb
5901.236SapbTOOL_MKLOCALE		Make LC_CTYPE locale files.  [mklocale]
5911.236Sapb
5921.236SapbTOOL_MKMAGIC		Create database for file(1).  [file]
5931.236Sapb
5941.311SjmcneillTOOL_MKNOD		Make device special file.  [mknod]
5951.311Sjmcneill
5961.236SapbTOOL_MKTEMP		Make (unique) temporary file name.  [mktemp]
5971.236Sapb
5981.236SapbTOOL_MSGC		Simple message list compiler.  [msgc]
5991.236Sapb
6001.236SapbTOOL_MTREE		Map a directory hierarchy.  [mtree]
6011.236Sapb
6021.332SphxTOOL_NCDCS		Turn ELF kernel into a NCD firmware image. [ncdcs]
6031.332Sphx
6041.236SapbTOOL_PAX		Manipulate file archives and copy directories.  [pax]
6051.236Sapb
6061.236SapbTOOL_PIC		Compile pictures for groff.  [pic]
6071.236Sapb
6081.273SmrgTOOL_PIGZ		Parallel compressor.  [pigz]
6091.273Smrg
6101.444SlukemTOOL_POWERPCMKBOOTIMAGE Make bootable image for powerpc.  [powerpc-mkbootimage]
6111.236Sapb
6121.236SapbTOOL_PWD_MKDB		Generate the password databases.  [pwd_mkdb]
6131.236Sapb
6141.236SapbTOOL_REFER		Preprocess bibliographic references for groff.  [refer]
6151.236Sapb
6161.236SapbTOOL_ROFF_ASCII		Generate ASCII groff output.  [nroff]
6171.236Sapb
6181.236SapbTOOL_ROFF_DVI		Generate DVI groff output.  [${TOOL_GROFF} -Tdvi]
6191.236Sapb
6201.236SapbTOOL_ROFF_HTML		Generate HTML groff output.
6211.236Sapb			[${TOOL_GROFF} -Tlatin1 -mdoc2html]
6221.236Sapb
6231.236SapbTOOL_ROFF_PS		Generate PS groff output.  [${TOOL_GROFF} -Tps]
6241.236Sapb
6251.236SapbTOOL_ROFF_RAW		Generate "raw" groff output.  [${TOOL_GROFF} -Z]
6261.236Sapb
6271.236SapbTOOL_RPCGEN		Remote Procedure Call (RPC) protocol compiler.  [rpcgen]
6281.236Sapb
6291.236SapbTOOL_SED		Stream editor.  [sed]
6301.236Sapb
6311.236SapbTOOL_SOELIM		Eliminate .so's from groff input.  [soelim]
6321.236Sapb
6331.236SapbTOOL_SPARKCRC		Generate a crc suitable for use in a sparkive file.
6341.236Sapb			[sparkcrc]
6351.236Sapb
6361.236SapbTOOL_STAT		Display file status.  [stat]
6371.236Sapb
6381.236SapbTOOL_STRFILE		Create a random access file for storing strings.
6391.236Sapb			[strfile]
6401.236Sapb
6411.236SapbTOOL_SUNLABEL		Read or modify a SunOS disk label.  [sunlabel]
6421.236Sapb
6431.236SapbTOOL_TBL		Format tables for groff.  [tbl]
6441.236Sapb
6451.236SapbTOOL_UUDECODE		Uudecode a binary file.  [uudecode]
6461.236Sapb
6471.236SapbTOOL_VGRIND		Grind nice listings of programs.  [vgrind -f]
6481.236Sapb
6491.236SapbTOOL_ZIC		Time zone compiler.  [zic]
6501.236Sapb
6511.323SmattFor each possible value of MACHINE_CPU, MACHINES.${MACHINE_CPU} contain a
6521.323Smattlist of what ports can be built for it.  This keeps those definitions in
6531.323Smattcentralized place.
6541.323Smatt
6551.134Slukem<bsd.own.mk> is generally useful when building your own Makefiles so that
6561.1Scgdthey use the same default owners etc. as the rest of the tree.
6571.131Slukem
6581.131Slukem
6591.286Sapb=-=-=-=-=   bsd.clean.mk   =-=-=-=-=
6601.286Sapb
6611.286SapbThe include file <bsd.clean.mk> defines the clean and cleandir
6621.286Sapbtargets.  It uses the following variables:
6631.286Sapb
6641.286SapbCLEANFILES	Files to remove for both the clean and cleandir targets.
6651.286Sapb
6661.286SapbCLEANDIRFILES	Files to remove for the cleandir target, but not for
6671.286Sapb		the clean target.
6681.286Sapb
6691.287SapbMKCLEANSRC	Controls whether or not the clean and cleandir targets
6701.287Sapb		will delete files from both the object directory,
6711.287Sapb		${.OBJDIR}, and the source directory, ${.CURDIR}.
6721.287Sapb
6731.287Sapb		If MKCLEANSRC is set to "no", then the file names in
6741.287Sapb		CLEANFILES or CLEANDIRFILES are interpreted relative
6751.287Sapb		to the object directory, ${.OBJDIR}.  This is the
6761.287Sapb		traditional behaviour.
6771.287Sapb
6781.287Sapb		If MKCLEANSRC is set to "yes", then the file deletion
6791.287Sapb		is performed relative to both the object directory,
6801.287Sapb		${.OBJDIR}, and the source directory, ${.CURDIR}.  (This
6811.287Sapb		has no effect if ${.OBJDIR} is the same as ${.CURDIR}.)
6821.287Sapb		Deleting files from ${.CURDIR} is intended to remove
6831.287Sapb		stray output files that had been left in the source
6841.287Sapb		directory by an earlier build that did not use object
6851.287Sapb		directories.
6861.287Sapb
6871.287Sapb		The default is MKCLEANSRC=yes.  If you always build with
6881.287Sapb		separate object directories, and you are sure that there
6891.287Sapb		are no stray files in the source directories, then you
6901.287Sapb		may set MKCLEANSRC=no to save some time.
6911.287Sapb
6921.287SapbMKCLEANVERIFY	Controls whether or not the clean and cleandir targets
6931.287Sapb		will verify that files have been deleted.
6941.287Sapb
6951.287Sapb		If MKCLEANVERIFY is set to "no", then the files will
6961.287Sapb		be deleted using a "rm -f" command, and its success or
6971.287Sapb		failure will be ignored.
6981.287Sapb
6991.287Sapb		If MKCLEANVERIFY is set to "yes", then the success of
7001.287Sapb		the "rm -f" command will be verified using an "ls"
7011.287Sapb		command.
7021.287Sapb
7031.287Sapb		The default is MKCLEANVERIFY=yes.  If you are sure that
7041.287Sapb		there will be no problems caused by file permissions,
7051.287Sapb		read-only file systems, or the like, then you may set
7061.287Sapb		MKCLEANVERIFY=no to save some time.
7071.286Sapb
7081.286SapbTo use the clean and cleandir targets defined in <bsd.clean.mk>, other
7091.286SapbMakefiles or bsd.*.mk files should append file names to the CLEANFILES
7101.286Sapbor CLEANDIRFILES variables.  For example:
7111.286Sapb
7121.286Sapb	    CLEANFILES+= a.out
7131.286Sapb	    CLEANDIRFILES+= .depend
7141.286Sapb
7151.286Sapb	    .include <bsd.clean.mk>
7161.286Sapb
7171.308SapbThe files listed in CLEANFILES and CLEANDIRFILES must not be
7181.308Sapbdirectories, because the potential risk from running "rm -rf" commands
7191.308Sapbin bsd.clean.mk is considered too great.  If you want to recursively
7201.308Sapbdelete a directory as part of "make clean" or "make cleandir" then you
7211.308Sapbneed to provide your own target.
7221.286Sapb
7231.131Slukem=-=-=-=-=   bsd.dep.mk   =-=-=-=-=
7241.131Slukem
7251.131SlukemThe include file <bsd.dep.mk> contains the default targets for building
7261.133Slukem.depend files.  It creates .d files from entries in SRCS and DPSRCS
7271.133Slukemthat are C, C++, or Objective C source files, and builds .depend from the
7281.133Slukem.d files.  All other files in SRCS and all of DPSRCS will be used as
7291.133Slukemdependencies for the .d files.  In order for this to function correctly,
7301.132Slukemit should be .included after all other .mk files and directives that may
7311.132Slukemmodify SRCS or DPSRCS.  It uses the following variables:
7321.132Slukem
7331.132SlukemSRCS		List of source files to build the program.
7341.132Slukem
7351.132SlukemDPSRCS		List of source files which are needed for generating
7361.132Slukem		dependencies, but are not needed in ${SRCS}.
7371.1Scgd
7381.444SlukemNODPSRCS	TODO
7391.1Scgd
7401.118Slukem=-=-=-=-=   bsd.files.mk   =-=-=-=-=
7411.106Sthorpej
7421.118SlukemThe include file <bsd.files.mk> handles the FILES variables and is included
7431.134Slukemfrom <bsd.lib.mk> and <bsd.prog.mk>, and uses the following variables:
7441.124Slukem
7451.124SlukemFILES		The list of files to install.
7461.124Slukem
7471.153SlukemCONFIGFILES	Similar semantics to FILES, except that the files
7481.153Slukem		are installed by the `configinstall' target,
7491.153Slukem		not the `install' target.
7501.153Slukem		The FILES* variables documented below also apply.
7511.153Slukem
7521.124SlukemFILESOWN	File owner.  [${BINOWN}]
7531.124Slukem
7541.124SlukemFILESGRP	File group.  [${BINGRP}]
7551.124Slukem
7561.203SdhollandFILESMODE	File mode.  [${NONBINMODE}]
7571.124Slukem
7581.124SlukemFILESDIR	The location to install the files.
7591.124Slukem
7601.124SlukemFILESNAME	Optional name to install each file as.
7611.124Slukem
7621.153SlukemFILESOWN_<fn>	File owner of the specific file <fn>.
7631.153Slukem
7641.153SlukemFILESGRP_<fn>	File group of the specific file <fn>.
7651.153Slukem
7661.153SlukemFILESMODE_<fn>	File mode of the specific file <fn>.
7671.153Slukem
7681.202SuweFILESDIR_<fn>	The location to install the specific file <fn>.
7691.153Slukem
7701.153SlukemFILESNAME_<fn>	Optional name to install <fn> as.
7711.124Slukem
7721.285SapbFILESBUILD	If this variable is defined, then its value will be
7731.285Sapb		used as the default for all FILESBUILD_<fn> variables.
7741.285Sapb		Otherwise, the default will be "no".
7751.285Sapb
7761.444SlukemFILESBUILD_<fn> A value different from "no" will add the file to the list of
7771.243Scube		targets to be built by `realall'.  Users of that variable
7781.243Scube		should provide a target to build the file.
7791.243Scube
7801.135Slukem
7811.139SlukemBUILDSYMLINKS	List of two word items:
7821.135Slukem			lnsrc lntgt
7831.135Slukem		For each lnsrc item, create a symlink named lntgt.
7841.135Slukem		The lntgt symlinks are removed by the cleandir target.
7851.106Sthorpej
7861.148SjmcUUDECODE_FILES	List of files which are stored as <file>.uue in the source
7871.148Sjmc		tree. Each one will be decoded with ${TOOL_UUDECODE}.
7881.301Sabs		The source files have a `.uue' suffix, the generated files do
7891.148Sjmc		not.
7901.149Sjmc
7911.202SuweUUDECODE_FILES_RENAME_<fn>
7921.202Suwe		Rename the output from the decode to the provided name.
7931.382Schristos
7941.445Slukem		Note: These files are simply decoded, with no install or other
7951.445Slukem		rule applying implicitly except being added to the clean
7961.445Slukem		target.
7971.106Sthorpej
7981.118Slukem=-=-=-=-=   bsd.gcc.mk   =-=-=-=-=
7991.113Sthorpej
8001.113SthorpejThe include file <bsd.gcc.mk> computes various parameters related to GCC
8011.113Sthorpejsupport libraries.  It defines no targets.  <bsd.own.mk> MUST be included
8021.134Slukembefore <bsd.gcc.mk>.
8031.113Sthorpej
8041.134SlukemThe primary users of <bsd.gcc.mk> are <bsd.prog.mk> and <bsd.lib.mk>, each
8051.113Sthorpejof which need to know where to find certain GCC support libraries.
8061.113Sthorpej
8071.134SlukemThe behavior of <bsd.gcc.mk> is influenced by the EXTERNAL_TOOLCHAIN variable,
8081.113Sthorpejwhich is generally set by the user.  If EXTERNAL_TOOLCHAIN it set, then
8091.113Sthorpejthe compiler is asked where to find the support libraries, otherwise the
8101.113Sthorpejsupport libraries are found in ${DESTDIR}/usr/lib.
8111.113Sthorpej
8121.134Slukem<bsd.gcc.mk> sets the following variables:
8131.113Sthorpej
8141.118Slukem_GCC_CRTBEGIN	The full path name to crtbegin.o.
8151.118Slukem
8161.118Slukem_GCC_CRTBEGINS	The full path name to crtbeginS.o.
8171.118Slukem
8181.118Slukem_GCC_CRTEND	The full path name to crtend.o.
8191.118Slukem
8201.118Slukem_GCC_CRTENDS	The full path name to crtendS.o.
8211.118Slukem
8221.118Slukem_GCC_LIBGCCDIR	The directory where libgcc.a is located.
8231.118Slukem
8241.118Slukem
8251.118Slukem=-=-=-=-=   bsd.inc.mk   =-=-=-=-=
8261.118Slukem
8271.134SlukemThe include file <bsd.inc.mk> defines the includes target and uses the
8281.118Slukemvariables:
8291.118Slukem
8301.124SlukemINCS		The list of include files.
8311.118Slukem
8321.118SlukemINCSDIR		The location to install the include files.
8331.118Slukem
8341.118SlukemINCSNAME	Target name of the include file, if only one; same as
8351.118Slukem		FILESNAME, but for include files.
8361.118Slukem
8371.134SlukemINCSYMLINKS	Similar to SYMLINKS in <bsd.links.mk>, except that these
8381.134Slukem		are installed in the 'includes' target and not the
8391.134Slukem		(much later) 'install' target.
8401.134Slukem
8411.444SlukemINCSNAME_<file> The name file <file> should be installed as, if not <file>,
8421.118Slukem		same as FILESNAME_<file>, but for include files.
8431.118Slukem
8441.118Slukem
8451.118Slukem=-=-=-=-=   bsd.info.mk   =-=-=-=-=
8461.118Slukem
8471.118SlukemThe include file <bsd.info.mk> is used to generate and install GNU Info
8481.118Slukemdocumentation from respective Texinfo source files.  It defines three
8491.118Slukemimplicit targets (.txi.info, .texi.info, and .texinfo.info), and uses the
8501.118Slukemfollowing variables:
8511.118Slukem
8521.118SlukemTEXINFO		List of Texinfo source files.  Info documentation will
8531.118Slukem		consist of single files with the extension replaced by
8541.118Slukem		.info.
8551.118Slukem
8561.445SlukemINFOFLAGS	Options to pass to makeinfo.  []
8571.118Slukem
8581.118Slukem
8591.118Slukem=-=-=-=-=   bsd.kernobj.mk   =-=-=-=-=
8601.118Slukem
8611.118SlukemThe include file <bsd.kernobj.mk> defines variables related to the
8621.118Slukemlocation of kernel sources and object directories.
8631.118Slukem
8641.445SlukemKERNSRCDIR	Directory at the top of the kernel source..
8651.445Slukem		[${NETBSDSRCDIR}/sys]
8661.118Slukem
8671.445SlukemKERNARCHDIR	Directory under KERNSRCDIR containing the machine
8681.445Slukem		dependent kernel sources.
8691.124Slukem		[arch/${MACHINE}]
8701.120Slukem
8711.445SlukemKERNCONFDIR	Directory containing the kernel configuration files.
8721.124Slukem		[${KERNSRCDIR}/${KERNARCHDIR}/conf]
8731.118Slukem
8741.445SlukemKERNOBJDIR	Directory for kernel builds.  For example, the kernel
8751.445Slukem		GENERIC will be compiled in KERNOBJDIR/GENERIC.
8761.445Slukem		Default:
8771.118Slukem		${MAKEOBJDIRPREFIX}${KERNSRCDIR}/${KERNARCHDIR}/compile
8781.445Slukem		if it exists or the make(1) target 'obj' is being made;
8791.445Slukem		otherwise ${KERNSRCDIR}/${KERNARCHDIR}/compile.
8801.118Slukem
8811.118SlukemIt is important that Makefiles (such as those under src/distrib) that
8821.134Slukemwish to find compiled kernels use <bsd.kernobj.mk> and ${KERNOBJDIR}
8831.118Slukemrather than make assumptions about the location of the compiled kernel.
8841.118Slukem
8851.118Slukem
8861.118Slukem=-=-=-=-=   bsd.kinc.mk   =-=-=-=-=
8871.118Slukem
8881.118SlukemThe include file <bsd.kinc.mk> defines the many targets (includes,
8891.118Slukemsubdirectories, etc.), and is used by kernel makefiles to handle
8901.118Slukeminclude file installation.  It is intended to be included alone, by
8911.134Slukemkernel Makefiles.  It uses similar variables to <bsd.inc.mk>.
8921.134SlukemPlease see <bsd.kinc.mk> for more details, and keep the documentation
8931.134Slukemin that file up to date.
8941.118Slukem
8951.325Schristos=-=-=-=-=   bsd.syscall.mk =-=-=-=-=
8961.325Schristos
8971.325SchristosThe include file <bsd.syscall.mk> contains the logic to create syscall
8981.325Schristosfiles for various emulations. It includes <bsd.kinc.mk> to handle the
8991.325Schristosrest of the targets.
9001.118Slukem
9011.118Slukem=-=-=-=-=   bsd.lib.mk   =-=-=-=-=
9021.118Slukem
9031.118SlukemThe include file <bsd.lib.mk> has support for building libraries.  It has
9041.118Slukemthe same eight targets as <bsd.prog.mk>: all, clean, cleandir, depend,
9051.118Slukemincludes, install, lint, and tags.  Additionally, it has a checkver target
9061.118Slukemwhich checks for installed shared object libraries whose version is greater
9071.118Slukemthat the version of the source. It has a limited number of suffixes,
9081.134Slukemconsistent with the current needs of the BSD tree.  <bsd.lib.mk> includes
9091.118Slukem<bsd.shlib.mk> to get shared library parameters.
9101.118Slukem
9111.118SlukemIt sets/uses the following variables:
9121.118Slukem
9131.118SlukemLIB		The name of the library to build.
9141.118Slukem
9151.118SlukemLIBDIR		Target directory for libraries.
9161.118Slukem
9171.444SlukemSHLIBINSTALLDIR Target directory for shared libraries if ${USE_SHLIBDIR}
9181.300Sjoerg		is not "no".
9191.300Sjoerg
9201.263SabsSHLIB_MAJOR
9211.263SabsSHLIB_MINOR
9221.263SabsSHLIB_TEENY	Major, minor, and teeny version numbers of shared library
9231.263Sabs
9241.300SjoergUSE_SHLIBDIR	If not "no", use ${SHLIBINSTALLDIR} instead of ${LIBDIR}
9251.118Slukem		as the path to install shared libraries to.
9261.118Slukem		USE_SHLIBDIR must be defined before <bsd.own.mk> is included.
9271.130Slukem		Default: no
9281.118Slukem
9291.218SlukemLIBISMODULE	If not "no", install as ${LIB}.so (without the "lib" prefix),
9301.423Schristos		and act as "MKDEBUGLIB=no MKPICINSTALL=no MKPROFILE=no
9311.423Schristos		MKSTATICLIB=no". Also do not install the lint library.
9321.218Slukem		Default: no
9331.218Slukem
9341.423SchristosLIBISPRIVATE	If not "no", act as "MKDEBUGLIB=no MKPIC=no MKPROFILE=no",
9351.423Schristos		and don't install the (.a) library or the lint library.
9361.154Slukem		This is useful for "build only" helper libraries.
9371.406Schristos		If set to "pic", then a _pic.a library is also produced,
9381.406Schristos		so that it can be incorporated into other shared objects.
9391.154Slukem		Default: no
9401.154Slukem
9411.244SmrgLIBISCXX	If not "no", Use ${CXX} instead of ${CC} to link
9421.244Smrg		shared libraries.
9431.244Smrg		This is useful for C++ libraries.
9441.244Smrg		Default: no
9451.244Smrg
9461.118SlukemLINTLIBDIR	Target directory for lint libraries.
9471.118Slukem
9481.118SlukemLIBGRP		Library group.
9491.118Slukem
9501.118SlukemLIBOWN		Library owner.
9511.118Slukem
9521.118SlukemLIBMODE		Library mode.
9531.118Slukem
9541.118SlukemLDADD		Additional loader objects.
9551.118Slukem
9561.118SlukemMAN		The manual pages to be installed (use a .1 - .9 suffix).
9571.118Slukem
9581.118SlukemNOCHECKVER_<library>
9591.118SlukemNOCHECKVER	If set, disables checking for installed shared object
9601.118Slukem		libraries with versions greater than the source.  A
9611.118Slukem		particular library name, without the "lib" prefix, may
9621.118Slukem		be appended to the variable name to disable the check for
9631.118Slukem		only that library.
9641.118Slukem
9651.118SlukemSRCS		List of source files to build the library.  Suffix types
9661.118Slukem		.s, .c, and .f are supported.  Note, .s files are preferred
9671.118Slukem		to .c files of the same name.  (This is not the default for
9681.118Slukem		versions of make.)
9691.118Slukem
9701.383SchristosLIBDPLIBS/
9711.383SchristosPROGDPLIBS	A list of the tuples:
9721.444Slukem			libname	 path-to-srcdir-of-libname
9731.157Slukem
9741.384Schristos		Instead of depending on installed versions of the libraries,
9751.384Schristos		one can depend on their built version in the source directory.
9761.384Schristos		This is useful for finding private libraries (LIBISPRIVATE).
9771.384Schristos
9781.157Slukem		For each tuple;
9791.157Slukem		     *	LIBDO.libname contains the .OBJDIR of the library
9801.157Slukem			`libname', and if it is not set it is determined
9811.157Slukem			from the srcdir and added to MAKEOVERRIDES (the
9821.157Slukem			latter is to allow for build time optimization).
9831.157Slukem		     *	LDADD gets  -L${LIBDO.libname} -llibname    added.
9841.157Slukem		     *	DPADD gets  ${LIBDO.libname}/liblibname.so  or
9851.157Slukem				    ${LIBDO.libname}/liblibname.a   added.
9861.157Slukem
9871.307Spooka		The special value "_external" for LIBDO.lib makes the
9881.307Spooka		build system to assume the library comes from outside
9891.307Spooka		of the NetBSD source tree and only causes -llibname
9901.307Spooka		to be added to LDADD.
9911.307Spooka
9921.383Schristos		This variable may be used for individual libraries/programs,
9931.383Schristos		as well as in parent directories to cache common libraries
9941.157Slukem		as a build-time optimization.
9951.157Slukem
9961.118SlukemThe include file <bsd.lib.mk> includes the file named "../Makefile.inc"
9971.118Slukemif it exists, as well as the include file <bsd.man.mk>.
9981.118Slukem
9991.118SlukemIt has rules for building profiled objects; profiled libraries are
10001.118Slukembuilt by default.
10011.118Slukem
10021.118SlukemLibraries are ranlib'd when made.
10031.118Slukem
10041.118Slukem
10051.118Slukem=-=-=-=-=   bsd.links.mk   =-=-=-=-=
10061.118Slukem
10071.118SlukemThe include file <bsd.links.mk> handles the LINKS and SYMLINKS variables
10081.424Smsaitohand is included from <bsd.lib.mk> and <bsd.prog.mk>.
10091.134Slukem
10101.249SapbLINKSOWN, LINKSGRP, and LINKSMODE, are relevant only if a metadata log
10111.249Sapbis used. The defaults may be modified by other bsd.*.mk files which
10121.249Sapbinclude bsd.links.mk.  In the future, these variables may be replaced
10131.249Sapbby a method for explicitly recording hard links in a metadata log.
10141.249Sapb
10151.134SlukemLINKS		The list of hard links, consisting of pairs of paths:
10161.134Slukem			source-file target-file
10171.134Slukem		${DESTDIR} is prepended to both paths before linking.
10181.134Slukem		For example, to link /bin/test and /bin/[, use:
10191.134Slukem			LINKS=/bin/test /bin/[
10201.134Slukem
10211.153SlukemCONFIGLINKS	Similar semantics to LINKS, except that the links
10221.153Slukem		are installed by the `configinstall' target,
10231.153Slukem		not the `install' target.
10241.153Slukem
10251.134SlukemSYMLINKS	The list of symbolic links, consisting of pairs of paths:
10261.134Slukem			source-file target-file
10271.134Slukem		${DESTDIR} is only prepended to target-file before linking.
10281.134Slukem		For example, to symlink /usr/bin/tar to /bin/tar resulting
10291.134Slukem		in ${DESTDIR}/usr/bin/tar -> /bin/tar:
10301.134Slukem			SYMLINKS=/bin/tar /usr/bin/tar
10311.118Slukem
10321.153SlukemCONFIGSYMLINKS	Similar semantics to SYMLINKS, except that the symbolic links
10331.153Slukem		are installed by the `configinstall' target,
10341.153Slukem		not the `install' target.
10351.153Slukem
10361.249SapbLINKSOWN	Link owner.  [${BINOWN}]
10371.249Sapb
10381.249SapbLINKSGRP	Link group.  [${BINGRP}]
10391.249Sapb
10401.249SapbLINKSMODE	Link mode.  [${NONBINMODE}]
10411.249Sapb
10421.249SapbLINKSOWN_<fn>	Link owner of the specific file <fn>.
10431.249Sapb
10441.249SapbLINKSGRP_<fn>	Link group of the specific file <fn>.
10451.249Sapb
10461.249SapbLINKSMODE_<fn>	Link mode of the specific file <fn>.
10471.249Sapb
10481.118Slukem
10491.118Slukem=-=-=-=-=   bsd.man.mk   =-=-=-=-=
10501.118Slukem
10511.118SlukemThe include file <bsd.man.mk> handles installing manual pages and their
10521.118Slukemlinks.
10531.118Slukem
10541.222SlukemIt has a three targets:
10551.118Slukem
10561.415Skamil	catinstall:
10571.415Skamil		Install the preformatted manual pages and their links.
10581.222Slukem	htmlinstall:
10591.222Slukem		Install the HTML manual pages and their links.
10601.118Slukem	maninstall:
10611.118Slukem		Install the manual page sources and their links.
10621.118Slukem
10631.118SlukemIt sets/uses the following variables:
10641.118Slukem
10651.118SlukemMANDIR		Base path for manual installation.
10661.118Slukem
10671.118SlukemMANGRP		Manual group.
10681.118Slukem
10691.118SlukemMANOWN		Manual owner.
10701.118Slukem
10711.118SlukemMANMODE		Manual mode.
10721.118Slukem
10731.118SlukemMANSUBDIR	Subdirectory under the manual page section, i.e. "/vax"
10741.118Slukem		or "/tahoe" for machine specific manual pages.
10751.118Slukem
10761.118SlukemMAN		The manual pages to be installed (use a .1 - .9 suffix).
10771.118Slukem
10781.118SlukemMLINKS		List of manual page links (using a .1 - .9 suffix).  The
10791.118Slukem		linked-to file must come first, the linked file second,
10801.276Sreed		and there may be multiple pairs.
10811.118Slukem
10821.118SlukemThe include file <bsd.man.mk> includes a file named "../Makefile.inc" if
10831.118Slukemit exists.
10841.118Slukem
10851.118Slukem
10861.118Slukem=-=-=-=-=   bsd.obj.mk   =-=-=-=-=
10871.118Slukem
10881.118SlukemThe include file <bsd.obj.mk> defines targets related to the creation
10891.118Slukemand use of separated object and source directories.
10901.118Slukem
10911.118SlukemIf an environment variable named MAKEOBJDIRPREFIX is set, make(1) uses
10921.118Slukem${MAKEOBJDIRPREFIX}${.CURDIR} as the name of the object directory if
10931.118Slukemit exists.  Otherwise make(1) looks for the existence of a
10941.118Slukemsubdirectory (or a symlink to a directory) of the source directory
10951.118Slukeminto which built targets should be placed.  If an environment variable
10961.118Slukemnamed MAKEOBJDIR is set, make(1) uses its value as the name of the
10971.118Slukemobject directory; failing that, make first looks for a subdirectory
10981.118Slukemnamed "obj.${MACHINE}", and if that doesn't exist, it looks for "obj".
10991.118Slukem
11001.118SlukemObject directories are not created automatically by make(1) if they
11011.118Slukemdon't exist; you need to run a separate "make obj".  (This will happen
11021.118Slukemduring a top-level build if "MKOBJDIRS" is set to a value other than
11031.118Slukem"no").  When the source directory is a subdirectory of ${BSDSRCDIR} --
11041.118Slukemand this is determined by a simple string prefix comparison -- object
11051.118Slukemdirectories are created in a separate object directory tree, and a
11061.118Slukemsymlink to the object directory in that tree is created in the source
11071.118Slukemdirectory; otherwise, "make obj" assumes that you're not in the main
11081.118Slukemsource tree and that it's not safe to use a separate object tree.
11091.118Slukem
11101.118SlukemSeveral variables used by <bsd.obj.mk> control exactly what
11111.118Slukemdirectories and links get created during a "make obj":
11121.118Slukem
11131.118SlukemMAKEOBJDIR	If set, this is the component name of the object
11141.118Slukem		directory.
11151.118Slukem
11161.118SlukemOBJMACHINE	If this is set but MAKEOBJDIR is not set, creates
11171.118Slukem		object directories or links named "obj.${MACHINE}";
11181.118Slukem		otherwise, just creates ones named "obj".
11191.118Slukem
11201.444SlukemOBJMACHINE_ARCH If set with OBJMACHINE, creates object directories or
11211.409Sjmcneill		links named "obj.${MACHINE}-${MACHINE_ARCH}".
11221.409Sjmcneill
11231.444SlukemUSR_OBJMACHINE	If set, and the current directory is a subdirectory of
11241.118Slukem		${BSDSRCDIR}, create object directory in the
11251.118Slukem		corresponding subdirectory of ${BSDOBJDIR}.${MACHINE};
11261.118Slukem		otherwise, create it in the corresponding subdirectory
11271.118Slukem		of ${BSDOBJDIR}
11281.113Sthorpej
11291.445SlukemBUILDID		Identifier for the build.  If set, this should be a short
11301.445Slukem		string that is suitable for use as part of a file or
11311.445Slukem		directory name.  The identifier will be appended to
11321.445Slukem		object directory names; if OBJMACHINE is also set, then
11331.445Slukem		.BUILDID is appended after .MACHINE.  The identifier will
11341.445Slukem		also be used as part of the kernel version string, which
11351.445Slukem		can be shown by “uname -v”.
11361.445Slukem
11371.445Slukem		Default: Unset.
11381.113Sthorpej
11391.106Sthorpej
11401.118Slukem=-=-=-=-=   bsd.prog.mk   =-=-=-=-=
11411.106Sthorpej
11421.1ScgdThe include file <bsd.prog.mk> handles building programs from one or
11431.1Scgdmore source files, along with their manual pages.  It has a limited number
11441.301Sabsof suffixes, consistent with the current needs of the BSD tree.
11451.134Slukem<bsd.prog.mk> includes <bsd.shlib.mk> to get shared library parameters.
11461.1Scgd
11471.16SjtcIt has eight targets:
11481.1Scgd
11491.1Scgd	all:
11501.102Sthorpej		build the program and its manual page.  This also
11511.102Sthorpej		creates a GDB initialization file (.gdbinit) in
11521.102Sthorpej		the objdir.  The .gdbinit file sets the shared library
11531.102Sthorpej		prefix to ${DESTDIR} to facilitate cross-debugging.
11541.1Scgd	clean:
11551.1Scgd		remove the program, any object files and the files a.out,
11561.24Smikel		Errs, errs, mklog, and ${PROG}.core.
11571.1Scgd	cleandir:
11581.1Scgd		remove all of the files removed by the target clean, as
11591.1Scgd		well as .depend, tags, and any manual pages.
11601.42Slukem		`distclean' is a synonym for `cleandir'.
11611.1Scgd	depend:
11621.1Scgd		make the dependencies for the source files, and store
11631.1Scgd		them in the file .depend.
11641.16Sjtc	includes:
11651.16Sjtc		install any header files.
11661.1Scgd	install:
11671.1Scgd		install the program and its manual pages; if the Makefile
11681.1Scgd		does not itself define the target install, the targets
11691.1Scgd		beforeinstall and afterinstall may also be used to cause
11701.1Scgd		actions immediately before and after the install target
11711.1Scgd		is executed.
11721.1Scgd	lint:
11731.1Scgd		run lint on the source files
11741.1Scgd	tags:
11751.1Scgd		create a tags file for the source files.
11761.1Scgd
11771.1ScgdIt sets/uses the following variables:
11781.1Scgd
11791.1ScgdBINGRP		Binary group.
11801.1Scgd
11811.1ScgdBINOWN		Binary owner.
11821.1Scgd
11831.1ScgdBINMODE		Binary mode.
11841.1Scgd
11851.286SapbCLEANDIRFILES	Additional files to remove for the cleandir target.
11861.286Sapb
11871.1ScgdCLEANFILES	Additional files to remove for the clean and cleandir targets.
11881.1Scgd
11891.445SlukemCONFIGOPTS	Additional options to config(1) when building kernels.
11901.445Slukem
11911.445Slukem		Default: Unset.
11921.445Slukem
11931.445SlukemCOPTS		Extra options for the C compiler.  Should be appended to
11941.445Slukem		(e.g., COPTS+=-g), rather than explicitly set.
11951.337Suebayasi
11961.445Slukem		Note: CPUFLAGS, not COPTS, should be used for compiler
11971.445Slukem		options that select CPU-related options.
11981.112Sthorpej
11991.445SlukemCOPTS.<fn>	Extra options for the C compiler when creating the
12001.125Slukem		C objects for <fn>.
12011.125Slukem		For <fn>.[ly], "<fn>.c" must be used.
12021.125Slukem
12031.445SlukemCPUFLAGS	Additional options passed to the compiler/assembler to
12041.445Slukem		select CPU instruction set options, CPU tuning options,
12051.445Slukem		etc.
12061.445Slukem
12071.445Slukem		Note: Such options should not be specified in COPTS,
12081.445Slukem		because some parts of the build process need to override
12091.445Slukem		CPU-related compiler options.
12101.35Slukem
12111.445Slukem		Default: Unset.
12121.445Slukem
12131.445SlukemCPUFLAGS.<fn>	Additional options to the compiler/assembler for <fn>.
12141.125Slukem		For <fn>.[ly], "<fn>.c" must be used.
12151.125Slukem
12161.445SlukemCPPFLAGS	Additional options to the C pre-processor.
12171.125Slukem
12181.445SlukemCPPFLAGS.<fn>	Additional options to the C pre-processor for <fn>.
12191.125Slukem		For <fn>.[ly], "<fn>.c" must be used.
12201.102Sthorpej
12211.102SthorpejGDBINIT		List of GDB initialization files to add to "source"
12221.102Sthorpej		directives in the .gdbinit file that is created in the
12231.102Sthorpej		objdir.
12241.1Scgd
12251.1ScgdLDADD		Additional loader objects.  Usually used for libraries.
12261.1Scgd		For example, to load with the compatibility and utility
12271.1Scgd		libraries, use:
12281.1Scgd
12291.5Sjtc			LDADD+=-lutil -lcompat
12301.1Scgd
12311.445SlukemLDFLAGS		Additional linker options (passed to ${CC} during link).
12321.1Scgd
12331.134SlukemLINKS		See <bsd.links.mk>
12341.134Slukem
12351.445SlukemOBJCOPTS	Additional options to the compiler when creating ObjC objects.
12361.177Smrg
12371.445SlukemOBJCOPTS.<fn>	Additional options to the compiler when creating the
12381.177Smrg		ObjC objects for <fn>.
12391.177Smrg		For <fn>.[ly], "<fn>.c" must be used.
12401.177Smrg
12411.134SlukemSYMLINKS	See <bsd.links.mk>
12421.1Scgd
12431.15ScgdMAN		Manual pages (should end in .1 - .9).  If no MAN variable is
12441.8Scgd		defined, "MAN=${PROG}.1" is assumed.
12451.1Scgd
12461.214SwizPAXCTL_FLAGS	If defined, run paxctl(1) on the program binary after link
12471.445Slukem		time, with the value of this variable as options to paxctl(1).
12481.193Sperry
12491.193SperryPAXCTL_FLAGS.${PROG} Custom override for PAXCTL_FLAGS.
12501.193Sperry
12511.1ScgdPROG		The name of the program to build.  If not supplied, nothing
12521.1Scgd		is built.
12531.1Scgd
12541.88SthorpejPROG_CXX	If defined, the name of the program to build.  Also
12551.88Sthorpej		causes <bsd.prog.mk> to link the program with the C++
12561.88Sthorpej		compiler rather than the C compiler.  PROG_CXX overrides
12571.88Sthorpej		the value of PROG if PROG is also set.
12581.87Sthorpej
12591.21SchristosPROGNAME	The name that the above program will be installed as, if
12601.21Schristos		different from ${PROG}.
12611.21Schristos
12621.408SlukemPROGS		Multiple programs to build from a single directory.
12631.408Slukem		Defaults to PROG. For each program ${_P} in ${PROGS},
12641.408Slukem		uses SRCS.${_P}, defaulting to ${_P}.c.
12651.408Slukem
12661.408SlukemPROGS_CXX	Multiple C++ programs to build from a single directory.
12671.408Slukem		Defaults to PROG_CXX. For each program ${_P} in ${PROGS_CXX},
12681.408Slukem		uses SRCS.${_P}, defaulting to ${_P}.cc.
12691.408Slukem
12701.37StvSRCS		List of source files to build the program.  If SRCS is not
12711.408Slukem		defined, it's assumed to be ${PROG}.c or ${PROG_CXX}.cc.
12721.108Sjwise
12731.108SjwiseDPSRCS		List of source files which are needed for generating
12741.108Sjwise		dependencies, but are not needed in ${SRCS}.
12751.1Scgd
12761.1ScgdDPADD		Additional dependencies for the program.  Usually used for
12771.1Scgd		libraries.  For example, to depend on the compatibility and
12781.1Scgd		utility libraries use:
12791.1Scgd
12801.5Sjtc			DPADD+=${LIBCOMPAT} ${LIBUTIL}
12811.1Scgd
12821.288Schristos		The following system libraries are predefined for DPADD:
12831.1Scgd
12841.382Schristos		LIBARCHIVE?=		${DESTDIR}/usr/lib/libarchive.a
12851.382Schristos		LIBASN1?=		${DESTDIR}/usr/lib/libasn1.a
12861.382Schristos		LIBATF_C?=		${DESTDIR}/usr/lib/libatf-c.a
12871.382Schristos		LIBATF_CXX?=		${DESTDIR}/usr/lib/libatf-c++.a
12881.382Schristos		LIBBIND9?=		${DESTDIR}/usr/lib/libbind9.a
12891.407Schristos		LIBBLOCKLIST?=		${DESTDIR}/usr/lib/libblocklist.a
12901.382Schristos		LIBBLUETOOTH?=		${DESTDIR}/usr/lib/libbluetooth.a
12911.382Schristos		LIBBSDMALLOC?=		${DESTDIR}/usr/lib/libbsdmalloc.a
12921.382Schristos		LIBBZ2?=		${DESTDIR}/usr/lib/libbz2.a
12931.396Schristos		LIBC?=			${DESTDIR}/usr/lib/libc.a
12941.382Schristos		LIBC_PIC?=		${DESTDIR}/usr/lib/libc_pic.a
12951.398Schristos		LIBCBOR?=		${DESTDIR}/usr/lib/libcbor.a
12961.382Schristos		LIBCOMPAT?=		${DESTDIR}/usr/lib/libcompat.a
12971.382Schristos		LIBCOM_ERR?=		${DESTDIR}/usr/lib/libcom_err.a
12981.382Schristos		LIBCRYPT?=		${DESTDIR}/usr/lib/libcrypt.a
12991.382Schristos		LIBCRYPTO?=		${DESTDIR}/usr/lib/libcrypto.a
13001.382Schristos		LIBCURSES?=		${DESTDIR}/usr/lib/libcurses.a
13011.396Schristos		LIBCXX?=		${DESTDIR}/usr/lib/libc++.a
13021.382Schristos		LIBDES?=		${DESTDIR}/usr/lib/libdes.a
13031.382Schristos		LIBDNS?=		${DESTDIR}/usr/lib/libdns.a
13041.382Schristos		LIBEDIT?=		${DESTDIR}/usr/lib/libedit.a
13051.382Schristos		LIBEVENT?=		${DESTDIR}/usr/lib/libevent.a
13061.315Schristos		LIBEVENT_OPENSSL?=	${DESTDIR}/usr/lib/libevent_openssl.a
13071.315Schristos		LIBEVENT_PTHREADS?=	${DESTDIR}/usr/lib/libevent_pthreads.a
13081.382Schristos		LIBEXECINFO?=		${DESTDIR}/usr/lib/libexecinfo.a
13091.382Schristos		LIBEXPAT?=		${DESTDIR}/usr/lib/libexpat.a
13101.382Schristos		LIBFETCH?=		${DESTDIR}/usr/lib/libfetch.a
13111.398Schristos		LIBFIDO2?=		${DESTDIR}/usr/lib/libfido2.a
13121.382Schristos		LIBFL?=			${DESTDIR}/usr/lib/libfl.a
13131.382Schristos		LIBFORM?=		${DESTDIR}/usr/lib/libform.a
13141.382Schristos		LIBGCC?=		${DESTDIR}/usr/lib/libgcc.a
13151.400Schristos		LIBGNUCTF?=		${DESTDIR}/usr/lib/libgnuctf.a
13161.382Schristos		LIBGNUMALLOC?=		${DESTDIR}/usr/lib/libgnumalloc.a
13171.382Schristos		LIBGSSAPI?=		${DESTDIR}/usr/lib/libgssapi.a
13181.382Schristos		LIBHDB?=		${DESTDIR}/usr/lib/libhdb.a
13191.382Schristos		LIBHEIMBASE?=		${DESTDIR}/usr/lib/libheimbase.a
13201.382Schristos		LIBHEIMNTLM?=		${DESTDIR}/usr/lib/libheimntlm.a
13211.382Schristos		LIBHX500?=		${DESTDIR}/usr/lib/libhx500.a
13221.382Schristos		LIBINTL?=		${DESTDIR}/usr/lib/libintl.a
13231.382Schristos		LIBIPSEC?=		${DESTDIR}/usr/lib/libipsec.a
13241.382Schristos		LIBISC?=		${DESTDIR}/usr/lib/libisc.a
13251.382Schristos		LIBISCCC?=		${DESTDIR}/usr/lib/libisccc.a
13261.382Schristos		LIBISCFG?=		${DESTDIR}/usr/lib/libiscfg.a
13271.382Schristos		LIBKADM5CLNT?=		${DESTDIR}/usr/lib/libkadm5clnt.a
13281.382Schristos		LIBKADM5SRV?=		${DESTDIR}/usr/lib/libkadm5srv.a
13291.382Schristos		LIBKAFS?=		${DESTDIR}/usr/lib/libkafs.a
13301.382Schristos		LIBKRB5?=		${DESTDIR}/usr/lib/libkrb5.a
13311.382Schristos		LIBKVM?=		${DESTDIR}/usr/lib/libkvm.a
13321.382Schristos		LIBL?=			${DESTDIR}/usr/lib/libl.a
13331.382Schristos		LIBLBER?=		${DESTDIR}/usr/lib/liblber.a
13341.382Schristos		LIBLDAP?=		${DESTDIR}/usr/lib/libldap.a
13351.382Schristos		LIBLDAP_R?=		${DESTDIR}/usr/lib/libldap_r.a
13361.382Schristos		LIBLUA?=		${DESTDIR}/usr/lib/liblua.a
13371.382Schristos		LIBM?=			${DESTDIR}/usr/lib/libm.a
13381.382Schristos		LIBMAGIC?=		${DESTDIR}/usr/lib/libmagic.a
13391.382Schristos		LIBMENU?=		${DESTDIR}/usr/lib/libmenu.a
13401.382Schristos		LIBNETPGPVERIFY?=	${DESTDIR}/usr/lib/libnetpgpverify.a
13411.382Schristos		LIBNS?=			${DESTDIR}/usr/lib/libns.a
13421.382Schristos		LIBOBJC?=		${DESTDIR}/usr/lib/libobjc.a
13431.382Schristos		LIBOSSAUDIO?=		${DESTDIR}/usr/lib/libossaudio.a
13441.382Schristos		LIBPAM?=		${DESTDIR}/usr/lib/libpam.a
13451.382Schristos		LIBPANEL?=		${DESTDIR}/usr/lib/libpanel.a
13461.382Schristos		LIBPCAP?=		${DESTDIR}/usr/lib/libpcap.a
13471.382Schristos		LIBPCI?=		${DESTDIR}/usr/lib/libpci.a
13481.382Schristos		LIBPOSIX?=		${DESTDIR}/usr/lib/libposix.a
13491.382Schristos		LIBPTHREAD?=		${DESTDIR}/usr/lib/libpthread.a
13501.382Schristos		LIBPUFFS?=		${DESTDIR}/usr/lib/libpuffs.a
13511.382Schristos		LIBQUOTA?=		${DESTDIR}/usr/lib/libquota.a
13521.382Schristos		LIBRADIUS?=		${DESTDIR}/usr/lib/libradius.a
13531.382Schristos		LIBREFUSE?=		${DESTDIR}/usr/lib/librefuse.a
13541.382Schristos		LIBRESOLV?=		${DESTDIR}/usr/lib/libresolv.a
13551.382Schristos		LIBRMT?=		${DESTDIR}/usr/lib/librmt.a
13561.382Schristos		LIBROKEN?=		${DESTDIR}/usr/lib/libroken.a
13571.382Schristos		LIBRPCSVC?=		${DESTDIR}/usr/lib/librpcsvc.a
13581.382Schristos		LIBRT?=			${DESTDIR}/usr/lib/librt.a
13591.382Schristos		LIBRUMP?=		${DESTDIR}/usr/lib/librump.a
13601.396Schristos		LIBRUMPFS_CD9660?=	${DESTDIR}/usr/lib/librumpfs_cd9660.a
13611.382Schristos		LIBRUMPFS_EFS?=		${DESTDIR}/usr/lib/librumpfs_efs.a
13621.382Schristos		LIBRUMPFS_EXT2FS?=	${DESTDIR}/usr/lib/librumpfs_ext2fs.a
13631.382Schristos		LIBRUMPFS_FFS?=		${DESTDIR}/usr/lib/librumpfs_ffs.a
13641.382Schristos		LIBRUMPFS_HFS?=		${DESTDIR}/usr/lib/librumpfs_hfs.a
13651.382Schristos		LIBRUMPFS_LFS?=		${DESTDIR}/usr/lib/librumpfs_lfs.a
13661.396Schristos		LIBRUMPFS_MSDOS?=	${DESTDIR}/usr/lib/librumpfs_msdos.a
13671.382Schristos		LIBRUMPFS_NFS?=		${DESTDIR}/usr/lib/librumpfs_nfs.a
13681.382Schristos		LIBRUMPFS_NTFS?=	${DESTDIR}/usr/lib/librumpfs_ntfs.a
13691.382Schristos		LIBRUMPFS_SYSPUFFS?=	${DESTDIR}/usr/lib/librumpfs_syspuffs.a
13701.382Schristos		LIBRUMPFS_TMPFS?=	${DESTDIR}/usr/lib/librumpfs_tmpfs.a
13711.382Schristos		LIBRUMPFS_UDF?=		${DESTDIR}/usr/lib/librumpfs_udf.a
13721.382Schristos		LIBRUMPUSER?=		${DESTDIR}/usr/lib/librumpuser.a
13731.382Schristos		LIBSASLC?=		${DESTDIR}/usr/lib/libsaslc.a
13741.382Schristos		LIBSKEY?=		${DESTDIR}/usr/lib/libskey.a
13751.382Schristos		LIBSL?=			${DESTDIR}/usr/lib/libsl.a
13761.382Schristos		LIBSQLITE3?=		${DESTDIR}/usr/lib/libsqlite3.a
13771.382Schristos		LIBSSH?=		${DESTDIR}/usr/lib/libssh.a
13781.382Schristos		LIBSSL?=		${DESTDIR}/usr/lib/libssl.a
13791.382Schristos		LIBSTDCXX?=		${DESTDIR}/usr/lib/libstdc++.a
13801.382Schristos		LIBSUPCXX?=		${DESTDIR}/usr/lib/libsupc++.a
13811.382Schristos		LIBTERMINFO?=		${DESTDIR}/usr/lib/libterminfo.a
13821.382Schristos		LIBTRE?=		${DESTDIR}/usr/lib/libtre.a
13831.382Schristos		LIBUNBOUND?=		${DESTDIR}/usr/lib/libunbound.a
13841.382Schristos		LIBUSBHID?=		${DESTDIR}/usr/lib/libusbhid.a
13851.382Schristos		LIBUTIL?=		${DESTDIR}/usr/lib/libutil.a
13861.382Schristos		LIBWIND?=		${DESTDIR}/usr/lib/libwind.a
13871.382Schristos		LIBWRAP?=		${DESTDIR}/usr/lib/libwrap.a
13881.382Schristos		LIBY?=			${DESTDIR}/usr/lib/liby.a
13891.382Schristos		LIBZ?=			${DESTDIR}/usr/lib/libz.a
13901.382Schristos
13911.382Schristos		The following c startup files.
13921.382Schristos
13931.382Schristos		LIBCRT0?=		${DESTDIR}/usr/lib/crt0.o
13941.382Schristos		LIBCRTI?=		${DESTDIR}/usr/lib/crti.o
13951.382Schristos		LIBCRTBEGIN?=		${DESTDIR}/usr/lib/crti.o
13961.382Schristos		LIBCRTEND?=		${DESTDIR}/usr/lib/crtn.o
13971.1Scgd
13981.288Schristos		The following X-Windows libraries are predefined for DPADD:
13991.288Schristos
14001.394Schristos		LIBDPS?=		${DESTDIR}/usr/X11R7/lib/libdps.a
14011.394Schristos		LIBFNTSTUBS?=		${DESTDIR}/usr/X11R7/lib/libfntstubs.a
14021.394Schristos		LIBFONTCACHE?=		${DESTDIR}/usr/X11R7/lib/libfontcache.a
14031.394Schristos		LIBFONTCONFIG?=		${DESTDIR}/usr/X11R7/lib/libfontconfig.a
14041.394Schristos		LIBFONTENC?=		${DESTDIR}/usr/X11R7/lib/libfontenc.a
14051.394Schristos		LIBFREETYPE?=		${DESTDIR}/usr/X11R7/lib/libfreetype.a
14061.382Schristos		LIBFS?=			${DESTDIR}/usr/X11R7/lib/libFS.a
14071.382Schristos		LIBGL?=			${DESTDIR}/usr/X11R7/lib/libGL.a
14081.382Schristos		LIBGLU?=		${DESTDIR}/usr/X11R7/lib/libGLU.a
14091.382Schristos		LIBICE?=		${DESTDIR}/usr/X11R7/lib/libICE.a
14101.394Schristos		LIBLBXUTIL?=		${DESTDIR}/usr/X11R7/lib/liblbxutil.a
14111.382Schristos		LIBSM?=			${DESTDIR}/usr/X11R7/lib/libSM.a
14121.382Schristos		LIBX11?=		${DESTDIR}/usr/X11R7/lib/libX11.a
14131.382Schristos		LIBX11_XCB?=		${DESTDIR}/usr/X11R7/lib/libX11-xcb.a
14141.382Schristos		LIBXAU?=		${DESTDIR}/usr/X11R7/lib/libXau.a
14151.382Schristos		LIBXAW?=		${DESTDIR}/usr/X11R7/lib/libXaw.a
14161.382Schristos		LIBXCB?=		${DESTDIR}/usr/X11R7/lib/libxcb.a
14171.412Snia		LIBXCOMPOSITE?=		${DESTDIR}/usr/X11R7/lib/libXcomposite.a
14181.440Smrg		LIBXCVT?=		${DESTDIR}/usr/X11R7/lib/libxcvt.a
14191.412Snia		LIBXDAMAGE?=		${DESTDIR}/usr/X11R7/lib/libXdamage.a
14201.382Schristos		LIBXDMCP?=		${DESTDIR}/usr/X11R7/lib/libXdmcp.a
14211.382Schristos		LIBXEXT?=		${DESTDIR}/usr/X11R7/lib/libXext.a
14221.412Snia		LIBXFIXES?=		${DESTDIR}/usr/X11R7/lib/libXfixes.a
14231.394Schristos		LIBXFONT2?=		${DESTDIR}/usr/X11R7/lib/libXfont2.a
14241.382Schristos		LIBXFONT?=		${DESTDIR}/usr/X11R7/lib/libXfont.a
14251.382Schristos		LIBXFT?=		${DESTDIR}/usr/X11R7/lib/libXft.a
14261.382Schristos		LIBXI?=			${DESTDIR}/usr/X11R7/lib/libXi.a
14271.382Schristos		LIBXINERAMA?=		${DESTDIR}/usr/X11R7/lib/libXinerama.a
14281.394Schristos		LIBXKBFILE?=		${DESTDIR}/usr/X11R7/lib/libxkbfile.a
14291.382Schristos		LIBXMU?=		${DESTDIR}/usr/X11R7/lib/libXmu.a
14301.382Schristos		LIBXMUU?=		${DESTDIR}/usr/X11R7/lib/libXmuu.a
14311.382Schristos		LIBXPM?=		${DESTDIR}/usr/X11R7/lib/libXpm.a
14321.382Schristos		LIBXRANDR?=		${DESTDIR}/usr/X11R7/lib/libXrandr.a
14331.382Schristos		LIBXRENDER?=		${DESTDIR}/usr/X11R7/lib/libXrender.a
14341.382Schristos		LIBXSS?=		${DESTDIR}/usr/X11R7/lib/libXss.a
14351.382Schristos		LIBXT?=			${DESTDIR}/usr/X11R7/lib/libXt.a
14361.394Schristos		LIBXTRAP?=		${DESTDIR}/usr/X11R7/lib/libXTrap.a
14371.382Schristos		LIBXTST?=		${DESTDIR}/usr/X11R7/lib/libXtst.a
14381.382Schristos		LIBXV?=			${DESTDIR}/usr/X11R7/lib/libXv.a
14391.382Schristos		LIBXXF86DGA?=		${DESTDIR}/usr/X11R7/lib/libXxf86dga.a
14401.382Schristos		LIBXXF86MISC?=		${DESTDIR}/usr/X11R7/lib/libXxf86misc.a
14411.382Schristos		LIBXXF86VM?=		${DESTDIR}/usr/X11R7/lib/libXxf86vm.a
14421.288Schristos
14431.445SlukemSTRIPFLAG	The option passed to the install program to cause the binary
14441.1Scgd		to be stripped.
14451.1Scgd
14461.1ScgdSUBDIR		A list of subdirectories that should be built as well.
14471.1Scgd		Each of the targets will execute the same target in the
14481.1Scgd		subdirectories.
14491.1Scgd
14501.21SchristosSCRIPTS		A list of interpreter scripts [file.{sh,csh,pl,awk,...}].
14511.21Schristos		These are installed exactly like programs.
14521.21Schristos
14531.166SrtrSCRIPTSDIR	The location to install the scripts.  Each script can be
14541.166Srtr		installed to a separate path by setting SCRIPTSDIR_<script>.
14551.166Srtr
14561.21SchristosSCRIPTSNAME	The name that the above program will be installed as, if
14571.21Schristos		different from ${SCRIPTS}. These can be further specialized
14581.21Schristos		by setting SCRIPTSNAME_<script>.
14591.21Schristos
14601.124SlukemFILES		See description of <bsd.files.mk>.
14611.21Schristos
14621.106SthorpejSHLINKDIR	Target directory for shared linker.  See description of
14631.106Sthorpej		<bsd.own.mk> for additional information about this variable.
14641.130Slukem
14651.1ScgdThe include file <bsd.prog.mk> includes the file named "../Makefile.inc"
14661.1Scgdif it exists, as well as the include file <bsd.man.mk>.
14671.1Scgd
14681.1ScgdSome simple examples:
14691.1Scgd
14701.1ScgdTo build foo from foo.c with a manual page foo.1, use:
14711.1Scgd
14721.1Scgd	PROG=	foo
14731.1Scgd
14741.1Scgd	.include <bsd.prog.mk>
14751.1Scgd
14761.1ScgdTo build foo from foo.c with a manual page foo.2, add the line:
14771.1Scgd
14781.9Scgd	MAN=	foo.2
14791.1Scgd
14801.445SlukemIf foo does not have a manual page at all, add the line
14811.445Slukembefore any make(1) .include directives:
14821.1Scgd
14831.445Slukem	NOMAN=
14841.1Scgd
14851.1ScgdIf foo has multiple source files, add the line:
14861.1Scgd
14871.1Scgd	SRCS=	a.c b.c c.c d.c
14881.1Scgd
14891.1Scgd
14901.118Slukem=-=-=-=-=   bsd.rpc.mk   =-=-=-=-=
14911.118Slukem
14921.118SlukemThe include file <bsd.rpc.mk> contains a makefile fragment used to
14931.118Slukemconstruct source files built by rpcgen.
14941.72Ssommerfe
14951.118SlukemThe following macros may be defined in makefiles which include
14961.118Slukem<bsd.rpc.mk> in order to control which files get built and how they
14971.118Slukemare to be built:
14981.21Schristos
14991.444SlukemRPC_INCS	construct .h file from .x file
15001.444SlukemRPC_XDRFILES	construct _xdr.c from .x file
15011.118Slukem		(for marshalling/unmarshalling data types)
15021.444SlukemRPC_SVCFILES	construct _svc.c from .x file
15031.118Slukem		(server-side stubs)
15041.445SlukemRPC_SVCFLAGS	Additional options passed to builds of RPC_SVCFILES.
15051.21Schristos
15061.444SlukemRPC_XDIR	Directory containing .x/.h files
15071.23Schristos
15081.23Schristos
15091.118Slukem=-=-=-=-=   bsd.shlib.mk   =-=-=-=-=
15101.21Schristos
15111.118SlukemThe include file <bsd.shlib.mk> computes parameters for shared library
15121.118Slukeminstallation and use.  It defines no targets.  <bsd.own.mk> MUST be
15131.134Slukemincluded before <bsd.shlib.mk>.
15141.21Schristos
15151.134Slukem<bsd.own.mk> sets the following variables, if they are not already defined
15161.118Slukem(defaults are in brackets):
15171.21Schristos
15181.444SlukemSHLIBINSTALLDIR If ${USE_SHLIBDIR} is not "no", use ${SHLIBINSTALLDIR}
15191.300Sjoerg		instead of ${LIBDIR} as the base path for shared library
15201.300Sjoerg		installation.  [/lib]
15211.300Sjoerg
15221.118SlukemSHLIBDIR	The path to USE_SHLIBDIR shared libraries to use when building
15231.118Slukem		a program.  [/lib for programs in /bin and /sbin, /usr/lib
15241.118Slukem		for all others.]
15251.81Swiz
15261.300Sjoerg_LIBSODIR	Set to ${SHLIBINSTALLDIR} if ${USE_SHLIBDIR} is not "no",
15271.118Slukem		otherwise set to ${LIBDIR}
15281.81Swiz
15291.300SjoergSHLINKINSTALLDIR Base path for shared linker.  [/libexec]
15301.300Sjoerg
15311.118SlukemSHLINKDIR	Path to use for shared linker when building a program.
15321.118Slukem		[/libexec for programs in /bin and /sbin, /usr/libexec for
15331.118Slukem		all others.]
15341.39Scgd
15351.13Schristos
15361.118Slukem=-=-=-=-=   bsd.subdir.mk   =-=-=-=-=
15371.13Schristos
15381.118SlukemThe include file <bsd.subdir.mk> contains the default targets for building
15391.120Slukemsubdirectories.  It has the same eight targets as <bsd.prog.mk>: all,
15401.233Sapbclean, cleandir, depend, includes, install, lint, and tags.  It uses the
15411.233Sapbfollowing variables:
15421.233Sapb
15431.233SapbNOSUBDIR	If this variable is defined, then the SUBDIR variable
15441.233Sapb		will be ignored and subdirectories will not be processed.
15451.233Sapb
15461.233SapbSUBDIR		For all of the directories listed in ${SUBDIR}, the
15471.233Sapb		specified directory will be visited and the target made.
15481.233Sapb
15491.233Sapb		As a special case, the use of a token .WAIT as an
15501.233Sapb		entry in SUBDIR acts as a synchronization barrier
15511.233Sapb		when multiple make jobs are run; subdirs before the
15521.233Sapb		.WAIT must complete before any subdirs after .WAIT are
15531.233Sapb		started.  See make(1) for some caveats on use of .WAIT
15541.233Sapb		and other special sources.
15551.47Stv
15561.47Stv
15571.326Schristos=-=-=-=-=   bsd.x11.mk   =-=-=-=-=
15581.326Schristos
15591.326SchristosThe include file <bsd.x11.mk> contains parameters and targets for
15601.346Smrgcross-building X11 from ${X11SRCDIR.<package>}.  It should be included
15611.346Smrgafter the general Makefile contents but before the include files such as
15621.346Smrg<bsd.prog.mk> and <bsd.lib.mk>.
15631.326Schristos
15641.326SchristosIt provides the following targets:
15651.326Schristos	.man.1 .man.3 .man.4 .man.5 .man.7:
15661.326Schristos		If ${MAN} or ${PROG} is set and ${MKMAN} != "no",
15671.326Schristos		these rules convert from X11's manual page source
15681.326Schristos		into an mdoc.old source file.
15691.326Schristos
15701.326SchristosIt sets the following variables:
15711.326Schristos
15721.326SchristosBINDIR			Set to ${X11BINDIR}.
15731.326Schristos			To override, define after including <bsd.x11.mk>
15741.326Schristos
15751.326SchristosLIBDIR			Set to ${X11USRLIBDIR}.
15761.326Schristos			To override, define after including <bsd.x11.mk>
15771.326Schristos
15781.326SchristosMANDIR			Set to ${X11MANDIR}.
15791.326Schristos			To override, define after including <bsd.x11.mk>
15801.326Schristos
15811.326SchristosCPPFLAGS		Appended with definitions to include from
15821.326Schristos			${DESTDIR}${X11INCDIR}
15831.326Schristos
15841.326SchristosLDFLAGS			Appended with definitions to link from
15851.326Schristos			${DESTDIR}${X11USRLIBDIR}
15861.326Schristos
15871.326SchristosX11FLAGS.CONNECTION	Equivalent to X11's CONNECTION_FLAGS.
15881.326Schristos
15891.326SchristosX11FLAGS.EXTENSION	Equivalent to X11's EXT_DEFINES.
15901.326Schristos
15911.326SchristosX11FLAGS.LOADABLE	Equivalent to X11's LOADABLE.
15921.326Schristos
15931.326SchristosX11FLAGS.OS_DEFINES	Equivalent to X11's OS_DEFINES.
15941.326Schristos
15951.326SchristosX11FLAGS.SERVER		Equivalent to X11's ServerDefines.
15961.326Schristos
15971.326SchristosX11FLAGS.THREADLIB	Equivalent to X11's THREADS_DEFINES for libraries.
15981.326Schristos
15991.326SchristosX11FLAGS.THREADS	Equivalent to X11's THREADS_DEFINES.
16001.326Schristos
16011.326SchristosX11FLAGS.VERSION	cpp(1) definitions of OSMAJORVERSION and OSMINORVERSION.
16021.326Schristos
16031.326SchristosX11FLAGS.DIX		Equivalent to X11's DIX_DEFINES.
16041.326Schristos
16051.326SchristosX11TOOL_UNXCOMM		Commandline to convert `XCOMM' comments to `#'
16061.326Schristos
16071.326SchristosIt uses the following variables:
16081.326Schristos
16091.326SchristosAPPDEFS			List of app-default files to install.
16101.326Schristos
16111.326SchristosCPPSCRIPTS		List of files/scripts to run through cpp(1)
16121.326Schristos			and then ${X11TOOL_UNXCOMM}.  The source files
16131.326Schristos			have a `.cpp' suffix, the generated files do not.
16141.326Schristos
16151.445SlukemCPPSCRIPTFLAGS		Additional options to cpp(1) when building CPPSCRIPTS.
16161.326Schristos
16171.445SlukemCPPSCRIPTFLAGS_<fn>	Additional options to cpp(1) when building CPPSCRIPT <fn>.
16181.326Schristos
16191.326Schristos
16201.326Schristos=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
16211.326Schristos
16221.326SchristosThe following files are described here for completion, but they are not
16231.326Schristossupposed to be included directly from other Makefiles; they are used
16241.326Schristosinternally by other system files.
16251.326Schristos
16261.118Slukem=-=-=-=-=   bsd.sys.mk   =-=-=-=-=
16271.47Stv
16281.326SchristosThe include file <bsd.sys.mk> is used by other system mk files and
16291.326Schristosit is not intended to be included standalone. It contains rules and
16301.326Schristossystem build variables. It requires bsd.own.mk to be included first.
16311.326SchristosIt contains overrides that are used when building the NetBSD source tree.
16321.133Slukem
16331.133SlukemThe following variables control how various files are compiled/built.
16341.142Slukem(Note that these may be overridden in <bsd.own.mk> if USETOOLS == "yes"):
16351.133Slukem
16361.133SlukemAR		Create, modify, and extract from archives.  [ar]
16371.133Slukem
16381.133SlukemARFLAGS		Options to ${AR}.  [rl]
16391.133Slukem
16401.387SchristosARM_ELF2AOUT	Convert ELF-format executable to a.out.  [elf2aout]
16411.387Schristos
16421.151SlukemAS		Assembler.  [as]
16431.151Slukem
16441.211SlukemAFLAGS		Options to ${CC} when compiling or linking .s or .S
16451.211Slukem		assembly source files.  []
16461.151Slukem
16471.445SlukemBUILDSEED	g++(1) uses random numbers when compiling C++ code.  This
16481.445Slukem		variable seeds the g++(1) random number generator using
16491.445Slukem		-frandom-seed with this value.  By default, it is set to
16501.445Slukem		"NetBSD-(majorversion)".  Using a fixed value causes C++
16511.445Slukem		binaries to be the same when built from the same sources,
16521.445Slukem		resulting in identical (reproducible) builds.  Additional
16531.445Slukem		information is available in the g++(1) documentation of
16541.445Slukem		-frandom-seed.
16551.445Slukem
16561.445Slukem		Default: Unset.
16571.217Sjoerg
16581.133SlukemCC		C compiler.  [cc]
16591.133Slukem
16601.133SlukemCFLAGS		Options to ${CC}.  [Usually -O or -O2]
16611.445Slukem		Note: CFLAGS should never be set in mk.conf(5).
16621.133Slukem
16631.133SlukemCPP		C Pre-Processor.  [cpp]
16641.133Slukem
16651.133SlukemCPPFLAGS	Options to ${CPP}.  []
16661.133Slukem
16671.445SlukemCPUFLAGS	Optimization options for ${CC}.  []
16681.133Slukem
16691.133SlukemCXX		C++ compiler.  [c++]
16701.133Slukem
16711.133SlukemCXXFLAGS	Options to ${CXX}.  [${CFLAGS}]
16721.133Slukem
16731.387SchristosM68K_ELF2AOUT	Convert ELF-format executable to a.out.  [elf2aout]
16741.387Schristos
16751.387SchristosMIPS_ELF2ECOFF	Convert ELF-format executable to ECOFF.  [elf2ecoff]
16761.133Slukem
16771.133SlukemFC		Fortran compiler.  [f77]
16781.133Slukem
16791.133SlukemFFLAGS		Options to {$FC}.  [-O]
16801.133Slukem
16811.444SlukemHOST_SH		Shell.  This must be an absolute path, because it may be
16821.444Slukem		substituted into "#!" lines in scripts.  [/bin/sh]
16831.235Sapb
16841.133SlukemINSTALL		install(1) command.  [install]
16851.133Slukem
16861.133SlukemLEX		Lexical analyzer.  [lex]
16871.133Slukem
16881.133SlukemLFLAGS		Options to ${LEX}.  []
16891.133Slukem
16901.145SjwiseLPREFIX		Symbol prefix for ${LEX} (see -P option in lex(1)) [yy]
16911.145Sjwise
16921.133SlukemLD		Linker.  [ld]
16931.133Slukem
16941.178SlukemLDFLAGS		Options to ${CC} during the link process.  []
16951.133Slukem
16961.133SlukemLINT		C program verifier.  [lint]
16971.133Slukem
16981.390SchristosLINTFLAGS	Options to ${LINT}.  [-chapbrxzgFS]
16991.133Slukem
17001.133SlukemLORDER		List dependencies for object files.  [lorder]
17011.133Slukem
17021.133SlukemMAKE		make(1).  [make]
17031.133Slukem
17041.133SlukemMKDEP		Construct Makefile dependency list.  [mkdep]
17051.133Slukem
17061.321SmrgMKDEPCXX	Construct Makefile dependency list for C++ files.  [mkdep]
17071.321Smrg
17081.133SlukemNM		List symbols from object files.  [nm]
17091.133Slukem
17101.444SlukemPC		Pascal compiler.  [pc]	(Not present)
17111.133Slukem
17121.133SlukemPFLAGS		Options to ${PC}.  []
17131.133Slukem
17141.133SlukemOBJC		Objective C compiler.  [${CC}]
17151.133Slukem
17161.133SlukemOBJCFLAGS	Options to ${OBJC}.  [${CFLAGS}]
17171.133Slukem
17181.133SlukemOBJCOPY		Copy and translate object files.  [objcopy]
17191.133Slukem
17201.445SlukemOBJCOPYLIBFLAGS Options to pass to objcopy when library objects are
17211.291Schristos		being built. [${.TARGET} =~ "*.po" ? -X : -x]
17221.291Schristos
17231.168SrizOBJDUMP		Display information from object files.  [objdump]
17241.168Sriz
17251.133SlukemRANLIB		Generate index to archive.  [ranlib]
17261.133Slukem
17271.343SpookaREADELF		Display information from ELF object files.  [readelf]
17281.343Spooka
17291.133SlukemSIZE		List section sizes and total size.  [size]
17301.133Slukem
17311.343SpookaSTRINGS		Display printable character sequences in files.  [strings]
17321.343Spooka
17331.133SlukemSTRIP		Discard symbols from object files.  [strip]
17341.133Slukem
17351.133SlukemTSORT		Topological sort of a directed graph.  [tsort -q]
17361.133Slukem
17371.133SlukemYACC		LALR(1) parser generator.  [yacc]
17381.133Slukem
17391.133SlukemYFLAGS		Options to ${YACC}.  []
17401.133Slukem
17411.133SlukemYHEADER		If defined, add "-d" to YFLAGS, and add dependencies
17421.133Slukem		from <file>.y to <file>.h and <file>.c, and add
17431.133Slukem		<foo>.h to CLEANFILES.
17441.133Slukem
17451.133SlukemYPREFIX		If defined, add "-p ${YPREFIX}" to YFLAGS.
17461.133Slukem
17471.116Slukem
17481.69SsommerfeOther variables of note (incomplete list):
17491.69Ssommerfe
17501.444SlukemNOCLANGERROR	If defined and clang is used as C compiler, -Werror is not
17511.444Slukem		passed to it.
17521.444Slukem
17531.213SlukemNOGCCERROR	If defined, prevents passing certain ${CFLAGS} to GCC
17541.213Slukem		that cause warnings to be fatal, such as:
17551.213Slukem			-Werror -Wa,--fatal-warnings
17561.213Slukem		(The latter being for as(1).)
17571.212Slukem
17581.296SplunkyWARNS		Crank up compiler warning options; the distinct levels are:
17591.82Slukem			WARNS=1
17601.82Slukem			WARNS=2
17611.82Slukem			WARNS=3
17621.164Smatt			WARNS=4
17631.296Splunky			WARNS=5
17641.336Schristos			WARNS=6
17651.69Ssommerfe
17661.444Slukem=-=-=-=-=   bsd.host.mk   =-=-=-=-=
17671.144Slukem
17681.326SchristosThis file is automatically included from bsd.own.mk. It contains settings
17691.326Schristosfor all the HOST_* variables that are used in host programs and libraries.
17701.144Slukem
17711.326SchristosHOST_AR			The host archive processing command
17721.144Slukem
17731.326SchristosHOST_CC			The host c compiler
17741.144Slukem
17751.445SlukemHOST_CFLAGS		The host c compiler options
17761.144Slukem
17771.445SlukemHOST_COMPILE.c		The host c compiler line with options
17781.144Slukem
17791.445SlukemHOST_COMPILE.cc		The host c++ compiler line with options
17801.144Slukem
17811.326SchristosHOST_CPP		The host c pre-processor
17821.144Slukem
17831.445SlukemHOST_CPPFLAGS		The host c pre-processor options
17841.144Slukem
17851.326SchristosHOST_CXX		The host c++ compiler
17861.144Slukem
17871.445SlukemHOST_CXXFLAGS		The host c++ compiler options
17881.144Slukem
17891.326SchristosHOST_INSTALL_DIR	The host command to install a directory
17901.144Slukem
17911.326SchristosHOST_INSTALL_FILE	The host command to install a file
17921.144Slukem
17931.326SchristosHOST_INSTALL_SYMLINK	The host command to install a symlink
17941.144Slukem
17951.326SchristosHOST_LD			The host linker command
17961.144Slukem
17971.445SlukemHOST_LDFLAGS		The host linker options
17981.144Slukem
17991.445SlukemHOST_LINK.c		The host c linker line with options
18001.221Smrg
18011.445SlukemHOST_LINK.cc		The host c++ linker line with options
18021.144Slukem
18031.326SchristosHOST_LN			The host command to link two files
18041.144Slukem
18051.326SchristosHOST_MKDEP		The host command to create dependencies for c programs
18061.144Slukem
18071.326SchristosHOST_MKDEPCXX		The host command to create dependencies for c++ programs
18081.144Slukem
18091.326SchristosHOST_OSTYPE		The host OSNAME-RELEASE-ARCH tupple
18101.144Slukem
18111.326SchristosHOST_RANLIB		The host command to create random access archives
18121.144Slukem
18131.326SchristosHOST_SH			The host Bourne shell interpreter name (absolute path)
18141.144Slukem
18151.30Sagc=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
1816