bsd.README revision 1.451
11.451Skalvisd#	$NetBSD: bsd.README,v 1.451 2024/10/23 00:45:58 kalvisd 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.447SchristosMAKELINKLIB	Defaults to ${MKLINKLIB} but can be overriden by Makefiles
3321.447Schristos
3331.447SchristosMAKESTATICLIB	Defaults to ${MKSTATICLIB} but can be overriden by Makefiles
3341.447Schristos
3351.76SfairLDSTATIC	Control program linking; if set blank, link everything
3361.129Slukem		dynamically.  If set to "-static", link everything statically.
3371.76Sfair		If not set, programs link according to their makefile.
3381.21Schristos
3391.116SlukemLIBDIR		Base path for library installation.  [/usr/lib]
3401.15Scgd
3411.116SlukemLINTLIBDIR	Base path for lint(1) library installation.  [/usr/libdata/lint]
3421.15Scgd
3431.116SlukemLIBGRP		Library group.  [${BINGRP}]
3441.15Scgd
3451.116SlukemLIBOWN		Library owner.  [${BINOWN}]
3461.15Scgd
3471.116SlukemLIBMODE		Library mode.  [${NONBINMODE}]
3481.15Scgd
3491.447SchristosLINKINSTALL	Install libraries used by users to link against (.a/.so)
3501.447Schristos		defaults to ${MAKELINKLIB}
3511.447Schristos
3521.15ScgdDOCDIR		Base path for system documentation (e.g. PSD, USD, etc.)
3531.444Slukem		installation.  [/usr/share/doc]
3541.62Ssimonb
3551.116SlukemDOCGRP		Documentation group.  [wheel]
3561.15Scgd
3571.116SlukemDOCOWN		Documentation owner.  [root]
3581.15Scgd
3591.116SlukemDOCMODE		Documentation mode.  [${NONBINMODE}]
3601.15Scgd
3611.445SlukemGZIP_N_FLAG	Options to pass to TOOL_GZIP to prevent it from inserting
3621.335Sapb		file names or timestamps in the compressed output.
3631.335Sapb		[-n, or -nT when TOOL_GZIP is really TOOL_PIGZ]
3641.335Sapb
3651.84SkleinkNLSDIR		Base path for Native Language Support files installation.
3661.15Scgd		[/usr/share/nls]
3671.1Scgd
3681.116SlukemNLSGRP		Native Language Support files group.  [wheel]
3691.1Scgd
3701.116SlukemNLSOWN		Native Language Support files owner.  [root]
3711.1Scgd
3721.116SlukemNLSMODE		Native Language Support files mode.  [${NONBINMODE}]
3731.1Scgd
3741.445SlukemX11SRCDIR	Directory containing the modular Xorg source.  If
3751.445Slukem		specified, must be an absolute path.  The main modular
3761.445Slukem		Xorg source is found in ${X11SRCDIR}/external/mit.
3771.445Slukem
3781.445Slukem		Default: ${NETBSDSRCDIR}/../xsrc, if that exists; otherwise
3791.445Slukem		"/usr/xsrc".
3801.144Slukem
3811.444SlukemX11SRCDIR.local The path to the local X11 src tree.  [${X11SRCDIR}/local]
3821.144Slukem
3831.221SmrgX11SRCDIR.lib<package>
3841.221SmrgX11SRCDIR.<package>
3851.425Smsaitoh		The path to the xorg src tree for the specified package>.
3861.221Smrg		[${X11SRCDIR}/external/mit/xorg/<package>/dist]
3871.221Smrg
3881.367SsnjX11ROOTDIR	Root directory of the X11 installation.  [/usr/X11R7]
3891.144Slukem
3901.144SlukemX11BINDIR	X11 bin directory.  [${X11ROOTDIR}/bin]
3911.144Slukem
3921.144SlukemX11FONTDIR	X11 font directory.  [${X11ROOTDIR}/lib/X11/fonts]
3931.144Slukem
3941.144SlukemX11INCDIR	X11 include directory.  [${X11ROOTDIR}/include]
3951.144Slukem
3961.144SlukemX11LIBDIR	X11 lib/x11 (config) directory.  [${X11ROOTDIR}/lib/X11]
3971.144Slukem
3981.144SlukemX11MANDIR	X11 manual directory.  [${X11ROOTDIR}/man]
3991.144Slukem
4001.144SlukemX11USRLIBDIR	X11 library directory.  [${X11ROOTDIR}/lib]
4011.144Slukem
4021.445SlukemSTRIPFLAG	The option passed to the install program to cause the binary
4031.1Scgd		to be stripped.  This is to be used when building your
4041.1Scgd		own install script so that the entire system can be made
4051.146Slukem		stripped/not-stripped using a single knob.  []
4061.1Scgd
4071.445SlukemCOPY		The option passed to the install program to cause the binary
4081.2Scgd		to be copied rather than moved.  This is to be used when
4091.2Scgd		building our own install script so that the entire system
4101.2Scgd		can either be installed with copies, or with moves using
4111.116Slukem		a single knob.  [-c]
4121.15Scgd
4131.310SapbMAKEDIRTARGETENV
4141.310Sapb		Environment variables passed to the child make process
4151.310Sapb		invoked by MAKEDIRTARGET.
4161.310Sapb
4171.150SlukemMAKEDIRTARGET dir target [params]
4181.150Slukem		Runs "cd $${dir} && ${MAKE} [params] $${target}",
4191.150Slukem		displaying a "pretty" message whilst doing so.
4201.150Slukem
4211.152SclRELEASEMACHINEDIR
4221.152Scl		Subdirectory used below RELEASEDIR when building
4231.395Smartin		a release.  [${MACHINE},
4241.395Smartin		or ${MACHINE}-${MACHINE_ARCH} for evb{arm,mips,sh3}*]
4251.152Scl
4261.152SclRELEASEMACHINE	Subdirectory or path component used for the following
4271.152Scl		paths:
4281.152Scl			distrib/${RELEASEMACHINE}
4291.152Scl			distrib/notes/${RELEASEMACHINE}
4301.152Scl			etc/etc.${RELEASEMACHINE}
4311.152Scl		Used when building a release.  [${MACHINE}]
4321.150Slukem
4331.134SlukemAdditionally, the following variables may be set by <bsd.own.mk> or in a
4341.214Swizmake configuration file to modify the behavior of the system build
4351.17Sthorpejprocess (default values are in brackets along with comments, if set by
4361.134Slukem<bsd.own.mk>):
4371.33Sjonathan
4381.445SlukemUSETOOLS	Can be set to "yes" or "no".  Indicates whether the tools
4391.445Slukem		specified by ${TOOLDIR} should be used as part of a build in
4401.445Slukem		progress. Must be set to "yes" if cross-compiling.
4411.172Shubertf		Supported values:
4421.172Shubertf
4431.172Shubertf		yes	Use the tools from TOOLDIR.
4441.172Shubertf
4451.172Shubertf		no	Do not use the tools from TOOLDIR, but refuse to
4461.172Shubertf			build native compilation tool components that are
4471.172Shubertf			version-specific for that tool.
4481.172Shubertf
4491.172Shubertf		never	Do not use the tools from TOOLDIR, even when
4501.172Shubertf			building native tool components.  This is similar to
4511.172Shubertf			the traditional NetBSD build method, but does not
4521.172Shubertf			verify that the compilation tools in use are
4531.172Shubertf			up-to-date enough in order to build the tree
4541.172Shubertf			successfully.  This may cause build or runtime
4551.172Shubertf			problems when building the whole NetBSD source tree.
4561.172Shubertf
4571.445Slukem		Default: "no" when using <bsd.*.mk> outside the NetBSD
4581.445Slukem		source tree (detected automatically) or if
4591.445Slukem		TOOLCHAIN_MISSING=yes; otherwise "yes".
4601.142Slukem
4611.116SlukemOBJECT_FMT	Object file format.  [set to "ELF" on architectures that
4621.199Ssimonb		use ELF -- currently all architectures].
4631.33Sjonathan
4641.103SthorpejTOOLCHAIN_MISSING
4651.445Slukem		Can be set to "yes" or "no".  If not "no", this
4661.445Slukem		indicates that the platform "MACHINE_ARCH" being built
4671.445Slukem		does not have a working in-tree toolchain.
4681.445Slukem		If the ${MACHINE_ARCH} in question falls into this category,
4691.301Sabs		TOOLCHAIN_MISSING is conditionally assigned the value "yes".
4701.103Sthorpej		Otherwise, the variable is unconditionally assigned the
4711.103Sthorpej		value "no".
4721.445Slukem
4731.445Slukem		If not "no", acts as MKBINUTILS=no MKGCC=no MKGDB=no.
4741.445Slukem
4751.445Slukem		Default: "no".
4761.103Sthorpej
4771.103SthorpejEXTERNAL_TOOLCHAIN
4781.103Sthorpej		This variable is not directly set by <bsd.own.mk>, but
4791.103Sthorpej		including <bsd.own.mk> is the canonical way to gain
4801.103Sthorpej		access to this variable.  The variable should be defined
4811.445Slukem		either in the user's environment or in the user's mk.conf(5)
4821.445Slukem		file.
4831.445Slukem
4841.445Slukem		If defined, this variable indicates the root directory of
4851.103Sthorpej		an external toolchain which will be used to build the
4861.142Slukem		tree.  For example, if a platform is a ${TOOLCHAIN_MISSING}
4871.103Sthorpej		platform, EXTERNAL_TOOLCHAIN can be used to re-enable the
4881.103Sthorpej		cross-compile framework.
4891.103Sthorpej
4901.445Slukem		If EXTERNAL_TOOLCHAIN is defined, act as MKGCC=no, since
4911.445Slukem		the external version of the compiler may not be able to build
4921.445Slukem		the library components of the in-tree compiler.
4931.445Slukem
4941.445Slukem		This variable should be used in conjunction with an
4951.445Slukem		appropriate HAVE_GCC or HAVE_LLVM setting to control the
4961.445Slukem		compiler options.
4971.371Sjoerg
4981.445Slukem		Note: This variable is not yet used in as many places as
4991.103Sthorpej		it should be.  Expect the exact semantics of this variable
5001.103Sthorpej		to change in the short term as parts of the cross-compile
5011.103Sthorpej		framework continue to be cleaned up.
5021.1Scgd
5031.236SapbThe following variables are defined to commands to perform the
5041.236Sapbappropriate operation, with the default in [brackets].  Note that
5051.236Sapbthe defaults change if USETOOLS == "yes":
5061.236Sapb
5071.236SapbTOOL_AMIGAAOUT2BB	aout to Amiga bootblock converter.  [amiga-aout2bb]
5081.236Sapb
5091.236SapbTOOL_AMIGAELF2BB	ELF to Amiga bootblock converter.  [amiga-elf2bb]
5101.236Sapb
5111.387SchristosTOOL_AMIGATXLT		Amiga assembly language format translator.  [amiga-txlt]
5121.387Schristos
5131.387SchristosTOOL_ARMELF2AOUT	ELF to a.out executable converter [arm-elf2aout}
5141.236Sapb
5151.236SapbTOOL_ASN1_COMPILE	ASN1 compiler.  [asn1_compile]
5161.236Sapb
5171.236SapbTOOL_AWK		Pattern-directed scanning/processing language.  [awk]
5181.236Sapb
5191.236SapbTOOL_CAP_MKDB		Create capability database.  [cap_mkdb]
5201.236Sapb
5211.236SapbTOOL_CAT		Concatenate and print files.  [cat]
5221.236Sapb
5231.236SapbTOOL_CKSUM		Display file checksums.  [cksum]
5241.236Sapb
5251.236SapbTOOL_COMPILE_ET		Error table compiler.  [compile_et]
5261.236Sapb
5271.236SapbTOOL_CONFIG		Build kernel compilation directories.  [config]
5281.236Sapb
5291.236SapbTOOL_CRUNCHGEN		Generate crunched binary build environment.  [crunchgen]
5301.236Sapb
5311.236SapbTOOL_CTAGS		Create a tags file.  [ctags]
5321.236Sapb
5331.236SapbTOOL_DB			Manipulate db(3) databases.  [db]
5341.236Sapb
5351.236SapbTOOL_DISKLABEL		Read and write disk pack label.  [disklabel]
5361.236Sapb
5371.236SapbTOOL_EQN		Format equations for groff.  [eqn]
5381.236Sapb
5391.236SapbTOOL_FDISK		MS-DOS partition maintenance program.  [fdisk]
5401.236Sapb
5411.236SapbTOOL_FGEN		IEEE 1275 Open Firmware FCode Tokenizer.  [fgen]
5421.236Sapb
5431.236SapbTOOL_GENASSYM		Generate constants for assembly files.  [genassym]
5441.236Sapb
5451.236SapbTOOL_GENCAT		Generate NLS message catalogs.  [gencat]
5461.236Sapb
5471.236SapbTOOL_GMAKE		GNU make utility.  [gmake]
5481.236Sapb
5491.247SsketchTOOL_GREP		Print lines matching a pattern.  [grep]
5501.247Ssketch
5511.236SapbTOOL_GROFF		Front end for groff document formatting system.  [groff]
5521.236Sapb
5531.327SapbTOOL_GZIP		Compression/decompression tool.  [gzip]
5541.327Sapb
5551.335SapbTOOL_GZIP_N		Same as TOOL_GZIP, plus a command line option to
5561.335Sapb			prevent it from inserting file names or timestamps
5571.335Sapb			into the compressed output.
5581.335Sapb			[${TOOL_GZIP} ${GZIP_N_FLAG}]
5591.335Sapb
5601.236SapbTOOL_HEXDUMP		Ascii, decimal, hexadecimal, octal dump.  [hexdump]
5611.236Sapb
5621.236SapbTOOL_HP300MKBOOT	Make bootable image for hp300.  [hp300-mkboot]
5631.236Sapb
5641.328SskrllTOOL_HPPAMKBOOT		Make bootable image for hppa.  [hppa-mkboot]
5651.236Sapb
5661.236SapbTOOL_INDXBIB		Make bibliographic database's inverted index.  [indxbib]
5671.236Sapb
5681.236SapbTOOL_INSTALLBOOT	Install disk bootstrap software.  [installboot]
5691.236Sapb
5701.236SapbTOOL_INSTALL_INFO	Update info/dir entries.  [install-info]
5711.236Sapb
5721.236SapbTOOL_JOIN		Relational database operator.  [join]
5731.236Sapb
5741.236SapbTOOL_M4			M4 macro language processor.  [m4]
5751.236Sapb
5761.387SchristosTOOL_M68KELF2AOUT	ELF to a.out executable converter [m68k-elf2aout}
5771.387Schristos
5781.236SapbTOOL_MACPPCFIXCOFF	Fix up xcoff headers for macppc.  [macppc-fixcoff]
5791.236Sapb
5801.236SapbTOOL_MAKEFS		Create file system image from directory tree.  [makefs]
5811.236Sapb
5821.236SapbTOOL_MAKEINFO		Translate Texinfo documents.  [makeinfo]
5831.236Sapb
5841.236SapbTOOL_MAKEWHATIS		Create a whatis.db database.  [makewhatis]
5851.236Sapb
5861.236SapbTOOL_MDSETIMAGE		Set kernel RAM disk image.  [mdsetimage]
5871.236Sapb
5881.236SapbTOOL_MENUC		Menu compiler.  [menuc]
5891.236Sapb
5901.236SapbTOOL_MIPSELF2ECOFF	Convert ELF-format executable to ECOFF for mips.
5911.236Sapb			[mips-elf2ecoff]
5921.236Sapb
5931.236SapbTOOL_MKCSMAPPER		Make charset mapping table.  [mkcsmapper]
5941.236Sapb
5951.236SapbTOOL_MKESDB		Make encoding scheme database.  [mkesdb]
5961.236Sapb
5971.236SapbTOOL_MKLOCALE		Make LC_CTYPE locale files.  [mklocale]
5981.236Sapb
5991.236SapbTOOL_MKMAGIC		Create database for file(1).  [file]
6001.236Sapb
6011.311SjmcneillTOOL_MKNOD		Make device special file.  [mknod]
6021.311Sjmcneill
6031.236SapbTOOL_MKTEMP		Make (unique) temporary file name.  [mktemp]
6041.236Sapb
6051.236SapbTOOL_MSGC		Simple message list compiler.  [msgc]
6061.236Sapb
6071.236SapbTOOL_MTREE		Map a directory hierarchy.  [mtree]
6081.236Sapb
6091.332SphxTOOL_NCDCS		Turn ELF kernel into a NCD firmware image. [ncdcs]
6101.332Sphx
6111.236SapbTOOL_PAX		Manipulate file archives and copy directories.  [pax]
6121.236Sapb
6131.236SapbTOOL_PIC		Compile pictures for groff.  [pic]
6141.236Sapb
6151.273SmrgTOOL_PIGZ		Parallel compressor.  [pigz]
6161.273Smrg
6171.444SlukemTOOL_POWERPCMKBOOTIMAGE Make bootable image for powerpc.  [powerpc-mkbootimage]
6181.236Sapb
6191.236SapbTOOL_PWD_MKDB		Generate the password databases.  [pwd_mkdb]
6201.236Sapb
6211.236SapbTOOL_REFER		Preprocess bibliographic references for groff.  [refer]
6221.236Sapb
6231.236SapbTOOL_ROFF_ASCII		Generate ASCII groff output.  [nroff]
6241.236Sapb
6251.236SapbTOOL_ROFF_DVI		Generate DVI groff output.  [${TOOL_GROFF} -Tdvi]
6261.236Sapb
6271.236SapbTOOL_ROFF_HTML		Generate HTML groff output.
6281.236Sapb			[${TOOL_GROFF} -Tlatin1 -mdoc2html]
6291.236Sapb
6301.236SapbTOOL_ROFF_PS		Generate PS groff output.  [${TOOL_GROFF} -Tps]
6311.236Sapb
6321.236SapbTOOL_ROFF_RAW		Generate "raw" groff output.  [${TOOL_GROFF} -Z]
6331.236Sapb
6341.236SapbTOOL_RPCGEN		Remote Procedure Call (RPC) protocol compiler.  [rpcgen]
6351.236Sapb
6361.236SapbTOOL_SED		Stream editor.  [sed]
6371.236Sapb
6381.236SapbTOOL_SOELIM		Eliminate .so's from groff input.  [soelim]
6391.236Sapb
6401.236SapbTOOL_SPARKCRC		Generate a crc suitable for use in a sparkive file.
6411.236Sapb			[sparkcrc]
6421.236Sapb
6431.236SapbTOOL_STAT		Display file status.  [stat]
6441.236Sapb
6451.236SapbTOOL_STRFILE		Create a random access file for storing strings.
6461.236Sapb			[strfile]
6471.236Sapb
6481.236SapbTOOL_SUNLABEL		Read or modify a SunOS disk label.  [sunlabel]
6491.236Sapb
6501.236SapbTOOL_TBL		Format tables for groff.  [tbl]
6511.236Sapb
6521.236SapbTOOL_UUDECODE		Uudecode a binary file.  [uudecode]
6531.236Sapb
6541.451SkalvisdTOOL_VAXMOPCOPY		Creates a MOP image from another executable format.
6551.451Skalvisd			[vax-mopcopy]
6561.451Skalvisd
6571.236SapbTOOL_VGRIND		Grind nice listings of programs.  [vgrind -f]
6581.236Sapb
6591.236SapbTOOL_ZIC		Time zone compiler.  [zic]
6601.236Sapb
6611.323SmattFor each possible value of MACHINE_CPU, MACHINES.${MACHINE_CPU} contain a
6621.323Smattlist of what ports can be built for it.  This keeps those definitions in
6631.323Smattcentralized place.
6641.323Smatt
6651.134Slukem<bsd.own.mk> is generally useful when building your own Makefiles so that
6661.1Scgdthey use the same default owners etc. as the rest of the tree.
6671.131Slukem
6681.131Slukem
6691.286Sapb=-=-=-=-=   bsd.clean.mk   =-=-=-=-=
6701.286Sapb
6711.286SapbThe include file <bsd.clean.mk> defines the clean and cleandir
6721.286Sapbtargets.  It uses the following variables:
6731.286Sapb
6741.286SapbCLEANFILES	Files to remove for both the clean and cleandir targets.
6751.286Sapb
6761.286SapbCLEANDIRFILES	Files to remove for the cleandir target, but not for
6771.286Sapb		the clean target.
6781.286Sapb
6791.287SapbMKCLEANSRC	Controls whether or not the clean and cleandir targets
6801.287Sapb		will delete files from both the object directory,
6811.287Sapb		${.OBJDIR}, and the source directory, ${.CURDIR}.
6821.287Sapb
6831.287Sapb		If MKCLEANSRC is set to "no", then the file names in
6841.287Sapb		CLEANFILES or CLEANDIRFILES are interpreted relative
6851.287Sapb		to the object directory, ${.OBJDIR}.  This is the
6861.287Sapb		traditional behaviour.
6871.287Sapb
6881.287Sapb		If MKCLEANSRC is set to "yes", then the file deletion
6891.287Sapb		is performed relative to both the object directory,
6901.287Sapb		${.OBJDIR}, and the source directory, ${.CURDIR}.  (This
6911.287Sapb		has no effect if ${.OBJDIR} is the same as ${.CURDIR}.)
6921.287Sapb		Deleting files from ${.CURDIR} is intended to remove
6931.287Sapb		stray output files that had been left in the source
6941.287Sapb		directory by an earlier build that did not use object
6951.287Sapb		directories.
6961.287Sapb
6971.287Sapb		The default is MKCLEANSRC=yes.  If you always build with
6981.287Sapb		separate object directories, and you are sure that there
6991.287Sapb		are no stray files in the source directories, then you
7001.287Sapb		may set MKCLEANSRC=no to save some time.
7011.287Sapb
7021.287SapbMKCLEANVERIFY	Controls whether or not the clean and cleandir targets
7031.287Sapb		will verify that files have been deleted.
7041.287Sapb
7051.287Sapb		If MKCLEANVERIFY is set to "no", then the files will
7061.287Sapb		be deleted using a "rm -f" command, and its success or
7071.287Sapb		failure will be ignored.
7081.287Sapb
7091.287Sapb		If MKCLEANVERIFY is set to "yes", then the success of
7101.287Sapb		the "rm -f" command will be verified using an "ls"
7111.287Sapb		command.
7121.287Sapb
7131.287Sapb		The default is MKCLEANVERIFY=yes.  If you are sure that
7141.287Sapb		there will be no problems caused by file permissions,
7151.287Sapb		read-only file systems, or the like, then you may set
7161.287Sapb		MKCLEANVERIFY=no to save some time.
7171.286Sapb
7181.286SapbTo use the clean and cleandir targets defined in <bsd.clean.mk>, other
7191.286SapbMakefiles or bsd.*.mk files should append file names to the CLEANFILES
7201.286Sapbor CLEANDIRFILES variables.  For example:
7211.286Sapb
7221.286Sapb	    CLEANFILES+= a.out
7231.286Sapb	    CLEANDIRFILES+= .depend
7241.286Sapb
7251.286Sapb	    .include <bsd.clean.mk>
7261.286Sapb
7271.308SapbThe files listed in CLEANFILES and CLEANDIRFILES must not be
7281.308Sapbdirectories, because the potential risk from running "rm -rf" commands
7291.308Sapbin bsd.clean.mk is considered too great.  If you want to recursively
7301.308Sapbdelete a directory as part of "make clean" or "make cleandir" then you
7311.308Sapbneed to provide your own target.
7321.286Sapb
7331.131Slukem=-=-=-=-=   bsd.dep.mk   =-=-=-=-=
7341.131Slukem
7351.131SlukemThe include file <bsd.dep.mk> contains the default targets for building
7361.133Slukem.depend files.  It creates .d files from entries in SRCS and DPSRCS
7371.133Slukemthat are C, C++, or Objective C source files, and builds .depend from the
7381.133Slukem.d files.  All other files in SRCS and all of DPSRCS will be used as
7391.133Slukemdependencies for the .d files.  In order for this to function correctly,
7401.132Slukemit should be .included after all other .mk files and directives that may
7411.132Slukemmodify SRCS or DPSRCS.  It uses the following variables:
7421.132Slukem
7431.132SlukemSRCS		List of source files to build the program.
7441.132Slukem
7451.132SlukemDPSRCS		List of source files which are needed for generating
7461.132Slukem		dependencies, but are not needed in ${SRCS}.
7471.1Scgd
7481.444SlukemNODPSRCS	TODO
7491.1Scgd
7501.118Slukem=-=-=-=-=   bsd.files.mk   =-=-=-=-=
7511.106Sthorpej
7521.118SlukemThe include file <bsd.files.mk> handles the FILES variables and is included
7531.134Slukemfrom <bsd.lib.mk> and <bsd.prog.mk>, and uses the following variables:
7541.124Slukem
7551.124SlukemFILES		The list of files to install.
7561.124Slukem
7571.153SlukemCONFIGFILES	Similar semantics to FILES, except that the files
7581.153Slukem		are installed by the `configinstall' target,
7591.153Slukem		not the `install' target.
7601.153Slukem		The FILES* variables documented below also apply.
7611.153Slukem
7621.124SlukemFILESOWN	File owner.  [${BINOWN}]
7631.124Slukem
7641.124SlukemFILESGRP	File group.  [${BINGRP}]
7651.124Slukem
7661.203SdhollandFILESMODE	File mode.  [${NONBINMODE}]
7671.124Slukem
7681.124SlukemFILESDIR	The location to install the files.
7691.124Slukem
7701.124SlukemFILESNAME	Optional name to install each file as.
7711.124Slukem
7721.153SlukemFILESOWN_<fn>	File owner of the specific file <fn>.
7731.153Slukem
7741.153SlukemFILESGRP_<fn>	File group of the specific file <fn>.
7751.153Slukem
7761.153SlukemFILESMODE_<fn>	File mode of the specific file <fn>.
7771.153Slukem
7781.202SuweFILESDIR_<fn>	The location to install the specific file <fn>.
7791.153Slukem
7801.153SlukemFILESNAME_<fn>	Optional name to install <fn> as.
7811.124Slukem
7821.285SapbFILESBUILD	If this variable is defined, then its value will be
7831.285Sapb		used as the default for all FILESBUILD_<fn> variables.
7841.285Sapb		Otherwise, the default will be "no".
7851.285Sapb
7861.444SlukemFILESBUILD_<fn> A value different from "no" will add the file to the list of
7871.243Scube		targets to be built by `realall'.  Users of that variable
7881.243Scube		should provide a target to build the file.
7891.243Scube
7901.135Slukem
7911.139SlukemBUILDSYMLINKS	List of two word items:
7921.135Slukem			lnsrc lntgt
7931.135Slukem		For each lnsrc item, create a symlink named lntgt.
7941.135Slukem		The lntgt symlinks are removed by the cleandir target.
7951.106Sthorpej
7961.148SjmcUUDECODE_FILES	List of files which are stored as <file>.uue in the source
7971.148Sjmc		tree. Each one will be decoded with ${TOOL_UUDECODE}.
7981.301Sabs		The source files have a `.uue' suffix, the generated files do
7991.148Sjmc		not.
8001.149Sjmc
8011.202SuweUUDECODE_FILES_RENAME_<fn>
8021.202Suwe		Rename the output from the decode to the provided name.
8031.382Schristos
8041.445Slukem		Note: These files are simply decoded, with no install or other
8051.445Slukem		rule applying implicitly except being added to the clean
8061.445Slukem		target.
8071.106Sthorpej
8081.118Slukem=-=-=-=-=   bsd.gcc.mk   =-=-=-=-=
8091.113Sthorpej
8101.113SthorpejThe include file <bsd.gcc.mk> computes various parameters related to GCC
8111.113Sthorpejsupport libraries.  It defines no targets.  <bsd.own.mk> MUST be included
8121.134Slukembefore <bsd.gcc.mk>.
8131.113Sthorpej
8141.134SlukemThe primary users of <bsd.gcc.mk> are <bsd.prog.mk> and <bsd.lib.mk>, each
8151.113Sthorpejof which need to know where to find certain GCC support libraries.
8161.113Sthorpej
8171.134SlukemThe behavior of <bsd.gcc.mk> is influenced by the EXTERNAL_TOOLCHAIN variable,
8181.113Sthorpejwhich is generally set by the user.  If EXTERNAL_TOOLCHAIN it set, then
8191.113Sthorpejthe compiler is asked where to find the support libraries, otherwise the
8201.113Sthorpejsupport libraries are found in ${DESTDIR}/usr/lib.
8211.113Sthorpej
8221.134Slukem<bsd.gcc.mk> sets the following variables:
8231.113Sthorpej
8241.118Slukem_GCC_CRTBEGIN	The full path name to crtbegin.o.
8251.118Slukem
8261.118Slukem_GCC_CRTBEGINS	The full path name to crtbeginS.o.
8271.118Slukem
8281.118Slukem_GCC_CRTEND	The full path name to crtend.o.
8291.118Slukem
8301.118Slukem_GCC_CRTENDS	The full path name to crtendS.o.
8311.118Slukem
8321.118Slukem_GCC_LIBGCCDIR	The directory where libgcc.a is located.
8331.118Slukem
8341.118Slukem
8351.118Slukem=-=-=-=-=   bsd.inc.mk   =-=-=-=-=
8361.118Slukem
8371.134SlukemThe include file <bsd.inc.mk> defines the includes target and uses the
8381.118Slukemvariables:
8391.118Slukem
8401.124SlukemINCS		The list of include files.
8411.118Slukem
8421.118SlukemINCSDIR		The location to install the include files.
8431.118Slukem
8441.118SlukemINCSNAME	Target name of the include file, if only one; same as
8451.118Slukem		FILESNAME, but for include files.
8461.118Slukem
8471.134SlukemINCSYMLINKS	Similar to SYMLINKS in <bsd.links.mk>, except that these
8481.134Slukem		are installed in the 'includes' target and not the
8491.134Slukem		(much later) 'install' target.
8501.134Slukem
8511.444SlukemINCSNAME_<file> The name file <file> should be installed as, if not <file>,
8521.118Slukem		same as FILESNAME_<file>, but for include files.
8531.118Slukem
8541.118Slukem
8551.118Slukem=-=-=-=-=   bsd.info.mk   =-=-=-=-=
8561.118Slukem
8571.118SlukemThe include file <bsd.info.mk> is used to generate and install GNU Info
8581.118Slukemdocumentation from respective Texinfo source files.  It defines three
8591.118Slukemimplicit targets (.txi.info, .texi.info, and .texinfo.info), and uses the
8601.118Slukemfollowing variables:
8611.118Slukem
8621.118SlukemTEXINFO		List of Texinfo source files.  Info documentation will
8631.118Slukem		consist of single files with the extension replaced by
8641.118Slukem		.info.
8651.118Slukem
8661.445SlukemINFOFLAGS	Options to pass to makeinfo.  []
8671.118Slukem
8681.118Slukem
8691.118Slukem=-=-=-=-=   bsd.kernobj.mk   =-=-=-=-=
8701.118Slukem
8711.118SlukemThe include file <bsd.kernobj.mk> defines variables related to the
8721.118Slukemlocation of kernel sources and object directories.
8731.118Slukem
8741.445SlukemKERNSRCDIR	Directory at the top of the kernel source..
8751.445Slukem		[${NETBSDSRCDIR}/sys]
8761.118Slukem
8771.445SlukemKERNARCHDIR	Directory under KERNSRCDIR containing the machine
8781.445Slukem		dependent kernel sources.
8791.124Slukem		[arch/${MACHINE}]
8801.120Slukem
8811.445SlukemKERNCONFDIR	Directory containing the kernel configuration files.
8821.124Slukem		[${KERNSRCDIR}/${KERNARCHDIR}/conf]
8831.118Slukem
8841.445SlukemKERNOBJDIR	Directory for kernel builds.  For example, the kernel
8851.445Slukem		GENERIC will be compiled in KERNOBJDIR/GENERIC.
8861.445Slukem		Default:
8871.118Slukem		${MAKEOBJDIRPREFIX}${KERNSRCDIR}/${KERNARCHDIR}/compile
8881.445Slukem		if it exists or the make(1) target 'obj' is being made;
8891.445Slukem		otherwise ${KERNSRCDIR}/${KERNARCHDIR}/compile.
8901.118Slukem
8911.118SlukemIt is important that Makefiles (such as those under src/distrib) that
8921.134Slukemwish to find compiled kernels use <bsd.kernobj.mk> and ${KERNOBJDIR}
8931.118Slukemrather than make assumptions about the location of the compiled kernel.
8941.118Slukem
8951.118Slukem
8961.118Slukem=-=-=-=-=   bsd.kinc.mk   =-=-=-=-=
8971.118Slukem
8981.118SlukemThe include file <bsd.kinc.mk> defines the many targets (includes,
8991.118Slukemsubdirectories, etc.), and is used by kernel makefiles to handle
9001.118Slukeminclude file installation.  It is intended to be included alone, by
9011.134Slukemkernel Makefiles.  It uses similar variables to <bsd.inc.mk>.
9021.134SlukemPlease see <bsd.kinc.mk> for more details, and keep the documentation
9031.134Slukemin that file up to date.
9041.118Slukem
9051.325Schristos=-=-=-=-=   bsd.syscall.mk =-=-=-=-=
9061.325Schristos
9071.325SchristosThe include file <bsd.syscall.mk> contains the logic to create syscall
9081.325Schristosfiles for various emulations. It includes <bsd.kinc.mk> to handle the
9091.325Schristosrest of the targets.
9101.118Slukem
9111.118Slukem=-=-=-=-=   bsd.lib.mk   =-=-=-=-=
9121.118Slukem
9131.118SlukemThe include file <bsd.lib.mk> has support for building libraries.  It has
9141.118Slukemthe same eight targets as <bsd.prog.mk>: all, clean, cleandir, depend,
9151.118Slukemincludes, install, lint, and tags.  Additionally, it has a checkver target
9161.118Slukemwhich checks for installed shared object libraries whose version is greater
9171.118Slukemthat the version of the source. It has a limited number of suffixes,
9181.134Slukemconsistent with the current needs of the BSD tree.  <bsd.lib.mk> includes
9191.118Slukem<bsd.shlib.mk> to get shared library parameters.
9201.118Slukem
9211.118SlukemIt sets/uses the following variables:
9221.118Slukem
9231.118SlukemLIB		The name of the library to build.
9241.118Slukem
9251.118SlukemLIBDIR		Target directory for libraries.
9261.118Slukem
9271.444SlukemSHLIBINSTALLDIR Target directory for shared libraries if ${USE_SHLIBDIR}
9281.300Sjoerg		is not "no".
9291.300Sjoerg
9301.263SabsSHLIB_MAJOR
9311.263SabsSHLIB_MINOR
9321.263SabsSHLIB_TEENY	Major, minor, and teeny version numbers of shared library
9331.263Sabs
9341.300SjoergUSE_SHLIBDIR	If not "no", use ${SHLIBINSTALLDIR} instead of ${LIBDIR}
9351.118Slukem		as the path to install shared libraries to.
9361.118Slukem		USE_SHLIBDIR must be defined before <bsd.own.mk> is included.
9371.130Slukem		Default: no
9381.118Slukem
9391.218SlukemLIBISMODULE	If not "no", install as ${LIB}.so (without the "lib" prefix),
9401.423Schristos		and act as "MKDEBUGLIB=no MKPICINSTALL=no MKPROFILE=no
9411.423Schristos		MKSTATICLIB=no". Also do not install the lint library.
9421.218Slukem		Default: no
9431.218Slukem
9441.423SchristosLIBISPRIVATE	If not "no", act as "MKDEBUGLIB=no MKPIC=no MKPROFILE=no",
9451.423Schristos		and don't install the (.a) library or the lint library.
9461.154Slukem		This is useful for "build only" helper libraries.
9471.406Schristos		If set to "pic", then a _pic.a library is also produced,
9481.406Schristos		so that it can be incorporated into other shared objects.
9491.154Slukem		Default: no
9501.154Slukem
9511.244SmrgLIBISCXX	If not "no", Use ${CXX} instead of ${CC} to link
9521.244Smrg		shared libraries.
9531.244Smrg		This is useful for C++ libraries.
9541.244Smrg		Default: no
9551.244Smrg
9561.118SlukemLINTLIBDIR	Target directory for lint libraries.
9571.118Slukem
9581.118SlukemLIBGRP		Library group.
9591.118Slukem
9601.118SlukemLIBOWN		Library owner.
9611.118Slukem
9621.118SlukemLIBMODE		Library mode.
9631.118Slukem
9641.118SlukemLDADD		Additional loader objects.
9651.118Slukem
9661.118SlukemMAN		The manual pages to be installed (use a .1 - .9 suffix).
9671.118Slukem
9681.118SlukemNOCHECKVER_<library>
9691.118SlukemNOCHECKVER	If set, disables checking for installed shared object
9701.118Slukem		libraries with versions greater than the source.  A
9711.118Slukem		particular library name, without the "lib" prefix, may
9721.118Slukem		be appended to the variable name to disable the check for
9731.118Slukem		only that library.
9741.118Slukem
9751.118SlukemSRCS		List of source files to build the library.  Suffix types
9761.118Slukem		.s, .c, and .f are supported.  Note, .s files are preferred
9771.118Slukem		to .c files of the same name.  (This is not the default for
9781.118Slukem		versions of make.)
9791.118Slukem
9801.383SchristosLIBDPLIBS/
9811.383SchristosPROGDPLIBS	A list of the tuples:
9821.444Slukem			libname	 path-to-srcdir-of-libname
9831.157Slukem
9841.384Schristos		Instead of depending on installed versions of the libraries,
9851.384Schristos		one can depend on their built version in the source directory.
9861.384Schristos		This is useful for finding private libraries (LIBISPRIVATE).
9871.384Schristos
9881.157Slukem		For each tuple;
9891.157Slukem		     *	LIBDO.libname contains the .OBJDIR of the library
9901.157Slukem			`libname', and if it is not set it is determined
9911.157Slukem			from the srcdir and added to MAKEOVERRIDES (the
9921.157Slukem			latter is to allow for build time optimization).
9931.157Slukem		     *	LDADD gets  -L${LIBDO.libname} -llibname    added.
9941.157Slukem		     *	DPADD gets  ${LIBDO.libname}/liblibname.so  or
9951.157Slukem				    ${LIBDO.libname}/liblibname.a   added.
9961.157Slukem
9971.307Spooka		The special value "_external" for LIBDO.lib makes the
9981.307Spooka		build system to assume the library comes from outside
9991.307Spooka		of the NetBSD source tree and only causes -llibname
10001.307Spooka		to be added to LDADD.
10011.307Spooka
10021.383Schristos		This variable may be used for individual libraries/programs,
10031.383Schristos		as well as in parent directories to cache common libraries
10041.157Slukem		as a build-time optimization.
10051.157Slukem
10061.446SriastradLIB_EXPSYM	File listing all symbols expected to be defined by the
10071.446Sriastrad		library.  Each line has a single symbol.  If the symbol
10081.446Sriastrad		is versioned, it is followed by `@@', if it is the
10091.446Sriastrad		default version, or `@', if not, and the symbol
10101.446Sriastrad		version.  The lines must be sorted in LANG=C.
10111.446Sriastrad
10121.446Sriastrad		bsd.lib.mk checks to make sure exactly the set of
10131.446Sriastrad		symbols in this file is defined when the library is
10141.446Sriastrad		built; if not, the build will fail and print a diff
10151.446Sriastrad		from the expected symbols to the actual symbols.
10161.446Sriastrad		During development, you can update the expected symbols
10171.446Sriastrad		from the actual ones with `make update-symbols'.
10181.446Sriastrad
10191.448SriastradVERSION_MAP	Path to an ld version script to use when linking the
10201.449Sriastrad		library.  Resolved from .PATH like a target
10211.449Sriastrad		prerequisite.
10221.448Sriastrad
10231.446Sriastrad
10241.118SlukemThe include file <bsd.lib.mk> includes the file named "../Makefile.inc"
10251.118Slukemif it exists, as well as the include file <bsd.man.mk>.
10261.118Slukem
10271.118SlukemIt has rules for building profiled objects; profiled libraries are
10281.118Slukembuilt by default.
10291.118Slukem
10301.118SlukemLibraries are ranlib'd when made.
10311.118Slukem
10321.118Slukem
10331.118Slukem=-=-=-=-=   bsd.links.mk   =-=-=-=-=
10341.118Slukem
10351.118SlukemThe include file <bsd.links.mk> handles the LINKS and SYMLINKS variables
10361.424Smsaitohand is included from <bsd.lib.mk> and <bsd.prog.mk>.
10371.134Slukem
10381.249SapbLINKSOWN, LINKSGRP, and LINKSMODE, are relevant only if a metadata log
10391.249Sapbis used. The defaults may be modified by other bsd.*.mk files which
10401.249Sapbinclude bsd.links.mk.  In the future, these variables may be replaced
10411.249Sapbby a method for explicitly recording hard links in a metadata log.
10421.249Sapb
10431.134SlukemLINKS		The list of hard links, consisting of pairs of paths:
10441.134Slukem			source-file target-file
10451.134Slukem		${DESTDIR} is prepended to both paths before linking.
10461.134Slukem		For example, to link /bin/test and /bin/[, use:
10471.134Slukem			LINKS=/bin/test /bin/[
10481.134Slukem
10491.153SlukemCONFIGLINKS	Similar semantics to LINKS, except that the links
10501.153Slukem		are installed by the `configinstall' target,
10511.153Slukem		not the `install' target.
10521.153Slukem
10531.134SlukemSYMLINKS	The list of symbolic links, consisting of pairs of paths:
10541.134Slukem			source-file target-file
10551.134Slukem		${DESTDIR} is only prepended to target-file before linking.
10561.134Slukem		For example, to symlink /usr/bin/tar to /bin/tar resulting
10571.134Slukem		in ${DESTDIR}/usr/bin/tar -> /bin/tar:
10581.134Slukem			SYMLINKS=/bin/tar /usr/bin/tar
10591.118Slukem
10601.153SlukemCONFIGSYMLINKS	Similar semantics to SYMLINKS, except that the symbolic links
10611.153Slukem		are installed by the `configinstall' target,
10621.153Slukem		not the `install' target.
10631.153Slukem
10641.249SapbLINKSOWN	Link owner.  [${BINOWN}]
10651.249Sapb
10661.249SapbLINKSGRP	Link group.  [${BINGRP}]
10671.249Sapb
10681.249SapbLINKSMODE	Link mode.  [${NONBINMODE}]
10691.249Sapb
10701.249SapbLINKSOWN_<fn>	Link owner of the specific file <fn>.
10711.249Sapb
10721.249SapbLINKSGRP_<fn>	Link group of the specific file <fn>.
10731.249Sapb
10741.249SapbLINKSMODE_<fn>	Link mode of the specific file <fn>.
10751.249Sapb
10761.118Slukem
10771.118Slukem=-=-=-=-=   bsd.man.mk   =-=-=-=-=
10781.118Slukem
10791.118SlukemThe include file <bsd.man.mk> handles installing manual pages and their
10801.118Slukemlinks.
10811.118Slukem
10821.222SlukemIt has a three targets:
10831.118Slukem
10841.415Skamil	catinstall:
10851.415Skamil		Install the preformatted manual pages and their links.
10861.222Slukem	htmlinstall:
10871.222Slukem		Install the HTML manual pages and their links.
10881.118Slukem	maninstall:
10891.118Slukem		Install the manual page sources and their links.
10901.118Slukem
10911.118SlukemIt sets/uses the following variables:
10921.118Slukem
10931.118SlukemMANDIR		Base path for manual installation.
10941.118Slukem
10951.118SlukemMANGRP		Manual group.
10961.118Slukem
10971.118SlukemMANOWN		Manual owner.
10981.118Slukem
10991.118SlukemMANMODE		Manual mode.
11001.118Slukem
11011.118SlukemMANSUBDIR	Subdirectory under the manual page section, i.e. "/vax"
11021.118Slukem		or "/tahoe" for machine specific manual pages.
11031.118Slukem
11041.118SlukemMAN		The manual pages to be installed (use a .1 - .9 suffix).
11051.118Slukem
11061.118SlukemMLINKS		List of manual page links (using a .1 - .9 suffix).  The
11071.118Slukem		linked-to file must come first, the linked file second,
11081.276Sreed		and there may be multiple pairs.
11091.118Slukem
11101.118SlukemThe include file <bsd.man.mk> includes a file named "../Makefile.inc" if
11111.118Slukemit exists.
11121.118Slukem
11131.118Slukem
11141.118Slukem=-=-=-=-=   bsd.obj.mk   =-=-=-=-=
11151.118Slukem
11161.118SlukemThe include file <bsd.obj.mk> defines targets related to the creation
11171.118Slukemand use of separated object and source directories.
11181.118Slukem
11191.118SlukemIf an environment variable named MAKEOBJDIRPREFIX is set, make(1) uses
11201.118Slukem${MAKEOBJDIRPREFIX}${.CURDIR} as the name of the object directory if
11211.118Slukemit exists.  Otherwise make(1) looks for the existence of a
11221.118Slukemsubdirectory (or a symlink to a directory) of the source directory
11231.118Slukeminto which built targets should be placed.  If an environment variable
11241.118Slukemnamed MAKEOBJDIR is set, make(1) uses its value as the name of the
11251.118Slukemobject directory; failing that, make first looks for a subdirectory
11261.118Slukemnamed "obj.${MACHINE}", and if that doesn't exist, it looks for "obj".
11271.118Slukem
11281.118SlukemObject directories are not created automatically by make(1) if they
11291.118Slukemdon't exist; you need to run a separate "make obj".  (This will happen
11301.118Slukemduring a top-level build if "MKOBJDIRS" is set to a value other than
11311.118Slukem"no").  When the source directory is a subdirectory of ${BSDSRCDIR} --
11321.118Slukemand this is determined by a simple string prefix comparison -- object
11331.118Slukemdirectories are created in a separate object directory tree, and a
11341.118Slukemsymlink to the object directory in that tree is created in the source
11351.118Slukemdirectory; otherwise, "make obj" assumes that you're not in the main
11361.118Slukemsource tree and that it's not safe to use a separate object tree.
11371.118Slukem
11381.118SlukemSeveral variables used by <bsd.obj.mk> control exactly what
11391.118Slukemdirectories and links get created during a "make obj":
11401.118Slukem
11411.118SlukemMAKEOBJDIR	If set, this is the component name of the object
11421.118Slukem		directory.
11431.118Slukem
11441.118SlukemOBJMACHINE	If this is set but MAKEOBJDIR is not set, creates
11451.118Slukem		object directories or links named "obj.${MACHINE}";
11461.118Slukem		otherwise, just creates ones named "obj".
11471.118Slukem
11481.444SlukemOBJMACHINE_ARCH If set with OBJMACHINE, creates object directories or
11491.409Sjmcneill		links named "obj.${MACHINE}-${MACHINE_ARCH}".
11501.409Sjmcneill
11511.444SlukemUSR_OBJMACHINE	If set, and the current directory is a subdirectory of
11521.118Slukem		${BSDSRCDIR}, create object directory in the
11531.118Slukem		corresponding subdirectory of ${BSDOBJDIR}.${MACHINE};
11541.118Slukem		otherwise, create it in the corresponding subdirectory
11551.118Slukem		of ${BSDOBJDIR}
11561.113Sthorpej
11571.445SlukemBUILDID		Identifier for the build.  If set, this should be a short
11581.445Slukem		string that is suitable for use as part of a file or
11591.445Slukem		directory name.  The identifier will be appended to
11601.445Slukem		object directory names; if OBJMACHINE is also set, then
11611.445Slukem		.BUILDID is appended after .MACHINE.  The identifier will
11621.445Slukem		also be used as part of the kernel version string, which
11631.445Slukem		can be shown by “uname -v”.
11641.445Slukem
11651.445Slukem		Default: Unset.
11661.113Sthorpej
11671.106Sthorpej
11681.118Slukem=-=-=-=-=   bsd.prog.mk   =-=-=-=-=
11691.106Sthorpej
11701.1ScgdThe include file <bsd.prog.mk> handles building programs from one or
11711.1Scgdmore source files, along with their manual pages.  It has a limited number
11721.301Sabsof suffixes, consistent with the current needs of the BSD tree.
11731.134Slukem<bsd.prog.mk> includes <bsd.shlib.mk> to get shared library parameters.
11741.1Scgd
11751.16SjtcIt has eight targets:
11761.1Scgd
11771.1Scgd	all:
11781.102Sthorpej		build the program and its manual page.  This also
11791.102Sthorpej		creates a GDB initialization file (.gdbinit) in
11801.102Sthorpej		the objdir.  The .gdbinit file sets the shared library
11811.102Sthorpej		prefix to ${DESTDIR} to facilitate cross-debugging.
11821.1Scgd	clean:
11831.1Scgd		remove the program, any object files and the files a.out,
11841.24Smikel		Errs, errs, mklog, and ${PROG}.core.
11851.1Scgd	cleandir:
11861.1Scgd		remove all of the files removed by the target clean, as
11871.1Scgd		well as .depend, tags, and any manual pages.
11881.42Slukem		`distclean' is a synonym for `cleandir'.
11891.1Scgd	depend:
11901.1Scgd		make the dependencies for the source files, and store
11911.1Scgd		them in the file .depend.
11921.16Sjtc	includes:
11931.16Sjtc		install any header files.
11941.1Scgd	install:
11951.1Scgd		install the program and its manual pages; if the Makefile
11961.1Scgd		does not itself define the target install, the targets
11971.1Scgd		beforeinstall and afterinstall may also be used to cause
11981.1Scgd		actions immediately before and after the install target
11991.1Scgd		is executed.
12001.1Scgd	lint:
12011.1Scgd		run lint on the source files
12021.1Scgd	tags:
12031.1Scgd		create a tags file for the source files.
12041.1Scgd
12051.1ScgdIt sets/uses the following variables:
12061.1Scgd
12071.1ScgdBINGRP		Binary group.
12081.1Scgd
12091.1ScgdBINOWN		Binary owner.
12101.1Scgd
12111.1ScgdBINMODE		Binary mode.
12121.1Scgd
12131.286SapbCLEANDIRFILES	Additional files to remove for the cleandir target.
12141.286Sapb
12151.1ScgdCLEANFILES	Additional files to remove for the clean and cleandir targets.
12161.1Scgd
12171.445SlukemCONFIGOPTS	Additional options to config(1) when building kernels.
12181.445Slukem
12191.445Slukem		Default: Unset.
12201.445Slukem
12211.445SlukemCOPTS		Extra options for the C compiler.  Should be appended to
12221.445Slukem		(e.g., COPTS+=-g), rather than explicitly set.
12231.337Suebayasi
12241.445Slukem		Note: CPUFLAGS, not COPTS, should be used for compiler
12251.445Slukem		options that select CPU-related options.
12261.112Sthorpej
12271.445SlukemCOPTS.<fn>	Extra options for the C compiler when creating the
12281.125Slukem		C objects for <fn>.
12291.125Slukem		For <fn>.[ly], "<fn>.c" must be used.
12301.125Slukem
12311.445SlukemCPUFLAGS	Additional options passed to the compiler/assembler to
12321.445Slukem		select CPU instruction set options, CPU tuning options,
12331.445Slukem		etc.
12341.445Slukem
12351.445Slukem		Note: Such options should not be specified in COPTS,
12361.445Slukem		because some parts of the build process need to override
12371.445Slukem		CPU-related compiler options.
12381.35Slukem
12391.445Slukem		Default: Unset.
12401.445Slukem
12411.445SlukemCPUFLAGS.<fn>	Additional options to the compiler/assembler for <fn>.
12421.125Slukem		For <fn>.[ly], "<fn>.c" must be used.
12431.125Slukem
12441.445SlukemCPPFLAGS	Additional options to the C pre-processor.
12451.125Slukem
12461.445SlukemCPPFLAGS.<fn>	Additional options to the C pre-processor for <fn>.
12471.125Slukem		For <fn>.[ly], "<fn>.c" must be used.
12481.102Sthorpej
12491.102SthorpejGDBINIT		List of GDB initialization files to add to "source"
12501.102Sthorpej		directives in the .gdbinit file that is created in the
12511.102Sthorpej		objdir.
12521.1Scgd
12531.1ScgdLDADD		Additional loader objects.  Usually used for libraries.
12541.1Scgd		For example, to load with the compatibility and utility
12551.1Scgd		libraries, use:
12561.1Scgd
12571.5Sjtc			LDADD+=-lutil -lcompat
12581.1Scgd
12591.445SlukemLDFLAGS		Additional linker options (passed to ${CC} during link).
12601.1Scgd
12611.134SlukemLINKS		See <bsd.links.mk>
12621.134Slukem
12631.445SlukemOBJCOPTS	Additional options to the compiler when creating ObjC objects.
12641.177Smrg
12651.445SlukemOBJCOPTS.<fn>	Additional options to the compiler when creating the
12661.177Smrg		ObjC objects for <fn>.
12671.177Smrg		For <fn>.[ly], "<fn>.c" must be used.
12681.177Smrg
12691.134SlukemSYMLINKS	See <bsd.links.mk>
12701.1Scgd
12711.15ScgdMAN		Manual pages (should end in .1 - .9).  If no MAN variable is
12721.8Scgd		defined, "MAN=${PROG}.1" is assumed.
12731.1Scgd
12741.214SwizPAXCTL_FLAGS	If defined, run paxctl(1) on the program binary after link
12751.445Slukem		time, with the value of this variable as options to paxctl(1).
12761.193Sperry
12771.193SperryPAXCTL_FLAGS.${PROG} Custom override for PAXCTL_FLAGS.
12781.193Sperry
12791.1ScgdPROG		The name of the program to build.  If not supplied, nothing
12801.1Scgd		is built.
12811.1Scgd
12821.88SthorpejPROG_CXX	If defined, the name of the program to build.  Also
12831.88Sthorpej		causes <bsd.prog.mk> to link the program with the C++
12841.88Sthorpej		compiler rather than the C compiler.  PROG_CXX overrides
12851.88Sthorpej		the value of PROG if PROG is also set.
12861.87Sthorpej
12871.21SchristosPROGNAME	The name that the above program will be installed as, if
12881.21Schristos		different from ${PROG}.
12891.21Schristos
12901.408SlukemPROGS		Multiple programs to build from a single directory.
12911.408Slukem		Defaults to PROG. For each program ${_P} in ${PROGS},
12921.408Slukem		uses SRCS.${_P}, defaulting to ${_P}.c.
12931.408Slukem
12941.408SlukemPROGS_CXX	Multiple C++ programs to build from a single directory.
12951.408Slukem		Defaults to PROG_CXX. For each program ${_P} in ${PROGS_CXX},
12961.408Slukem		uses SRCS.${_P}, defaulting to ${_P}.cc.
12971.408Slukem
12981.37StvSRCS		List of source files to build the program.  If SRCS is not
12991.408Slukem		defined, it's assumed to be ${PROG}.c or ${PROG_CXX}.cc.
13001.108Sjwise
13011.108SjwiseDPSRCS		List of source files which are needed for generating
13021.108Sjwise		dependencies, but are not needed in ${SRCS}.
13031.1Scgd
13041.1ScgdDPADD		Additional dependencies for the program.  Usually used for
13051.1Scgd		libraries.  For example, to depend on the compatibility and
13061.1Scgd		utility libraries use:
13071.1Scgd
13081.5Sjtc			DPADD+=${LIBCOMPAT} ${LIBUTIL}
13091.1Scgd
13101.288Schristos		The following system libraries are predefined for DPADD:
13111.1Scgd
13121.382Schristos		LIBARCHIVE?=		${DESTDIR}/usr/lib/libarchive.a
13131.382Schristos		LIBASN1?=		${DESTDIR}/usr/lib/libasn1.a
13141.382Schristos		LIBATF_C?=		${DESTDIR}/usr/lib/libatf-c.a
13151.382Schristos		LIBATF_CXX?=		${DESTDIR}/usr/lib/libatf-c++.a
13161.382Schristos		LIBBIND9?=		${DESTDIR}/usr/lib/libbind9.a
13171.407Schristos		LIBBLOCKLIST?=		${DESTDIR}/usr/lib/libblocklist.a
13181.382Schristos		LIBBLUETOOTH?=		${DESTDIR}/usr/lib/libbluetooth.a
13191.382Schristos		LIBBSDMALLOC?=		${DESTDIR}/usr/lib/libbsdmalloc.a
13201.382Schristos		LIBBZ2?=		${DESTDIR}/usr/lib/libbz2.a
13211.396Schristos		LIBC?=			${DESTDIR}/usr/lib/libc.a
13221.382Schristos		LIBC_PIC?=		${DESTDIR}/usr/lib/libc_pic.a
13231.398Schristos		LIBCBOR?=		${DESTDIR}/usr/lib/libcbor.a
13241.382Schristos		LIBCOMPAT?=		${DESTDIR}/usr/lib/libcompat.a
13251.382Schristos		LIBCOM_ERR?=		${DESTDIR}/usr/lib/libcom_err.a
13261.382Schristos		LIBCRYPT?=		${DESTDIR}/usr/lib/libcrypt.a
13271.382Schristos		LIBCRYPTO?=		${DESTDIR}/usr/lib/libcrypto.a
13281.382Schristos		LIBCURSES?=		${DESTDIR}/usr/lib/libcurses.a
13291.396Schristos		LIBCXX?=		${DESTDIR}/usr/lib/libc++.a
13301.382Schristos		LIBDES?=		${DESTDIR}/usr/lib/libdes.a
13311.382Schristos		LIBDNS?=		${DESTDIR}/usr/lib/libdns.a
13321.382Schristos		LIBEDIT?=		${DESTDIR}/usr/lib/libedit.a
13331.382Schristos		LIBEVENT?=		${DESTDIR}/usr/lib/libevent.a
13341.315Schristos		LIBEVENT_OPENSSL?=	${DESTDIR}/usr/lib/libevent_openssl.a
13351.315Schristos		LIBEVENT_PTHREADS?=	${DESTDIR}/usr/lib/libevent_pthreads.a
13361.382Schristos		LIBEXECINFO?=		${DESTDIR}/usr/lib/libexecinfo.a
13371.382Schristos		LIBEXPAT?=		${DESTDIR}/usr/lib/libexpat.a
13381.382Schristos		LIBFETCH?=		${DESTDIR}/usr/lib/libfetch.a
13391.398Schristos		LIBFIDO2?=		${DESTDIR}/usr/lib/libfido2.a
13401.382Schristos		LIBFL?=			${DESTDIR}/usr/lib/libfl.a
13411.382Schristos		LIBFORM?=		${DESTDIR}/usr/lib/libform.a
13421.382Schristos		LIBGCC?=		${DESTDIR}/usr/lib/libgcc.a
13431.400Schristos		LIBGNUCTF?=		${DESTDIR}/usr/lib/libgnuctf.a
13441.382Schristos		LIBGNUMALLOC?=		${DESTDIR}/usr/lib/libgnumalloc.a
13451.382Schristos		LIBGSSAPI?=		${DESTDIR}/usr/lib/libgssapi.a
13461.382Schristos		LIBHDB?=		${DESTDIR}/usr/lib/libhdb.a
13471.382Schristos		LIBHEIMBASE?=		${DESTDIR}/usr/lib/libheimbase.a
13481.382Schristos		LIBHEIMNTLM?=		${DESTDIR}/usr/lib/libheimntlm.a
13491.382Schristos		LIBHX500?=		${DESTDIR}/usr/lib/libhx500.a
13501.382Schristos		LIBINTL?=		${DESTDIR}/usr/lib/libintl.a
13511.382Schristos		LIBIPSEC?=		${DESTDIR}/usr/lib/libipsec.a
13521.382Schristos		LIBISC?=		${DESTDIR}/usr/lib/libisc.a
13531.382Schristos		LIBISCCC?=		${DESTDIR}/usr/lib/libisccc.a
13541.382Schristos		LIBISCFG?=		${DESTDIR}/usr/lib/libiscfg.a
13551.382Schristos		LIBKADM5CLNT?=		${DESTDIR}/usr/lib/libkadm5clnt.a
13561.382Schristos		LIBKADM5SRV?=		${DESTDIR}/usr/lib/libkadm5srv.a
13571.382Schristos		LIBKAFS?=		${DESTDIR}/usr/lib/libkafs.a
13581.382Schristos		LIBKRB5?=		${DESTDIR}/usr/lib/libkrb5.a
13591.382Schristos		LIBKVM?=		${DESTDIR}/usr/lib/libkvm.a
13601.382Schristos		LIBL?=			${DESTDIR}/usr/lib/libl.a
13611.382Schristos		LIBLBER?=		${DESTDIR}/usr/lib/liblber.a
13621.382Schristos		LIBLDAP?=		${DESTDIR}/usr/lib/libldap.a
13631.382Schristos		LIBLDAP_R?=		${DESTDIR}/usr/lib/libldap_r.a
13641.382Schristos		LIBLUA?=		${DESTDIR}/usr/lib/liblua.a
13651.382Schristos		LIBM?=			${DESTDIR}/usr/lib/libm.a
13661.382Schristos		LIBMAGIC?=		${DESTDIR}/usr/lib/libmagic.a
13671.382Schristos		LIBMENU?=		${DESTDIR}/usr/lib/libmenu.a
13681.382Schristos		LIBNETPGPVERIFY?=	${DESTDIR}/usr/lib/libnetpgpverify.a
13691.382Schristos		LIBNS?=			${DESTDIR}/usr/lib/libns.a
13701.382Schristos		LIBOBJC?=		${DESTDIR}/usr/lib/libobjc.a
13711.382Schristos		LIBOSSAUDIO?=		${DESTDIR}/usr/lib/libossaudio.a
13721.382Schristos		LIBPAM?=		${DESTDIR}/usr/lib/libpam.a
13731.382Schristos		LIBPANEL?=		${DESTDIR}/usr/lib/libpanel.a
13741.382Schristos		LIBPCAP?=		${DESTDIR}/usr/lib/libpcap.a
13751.382Schristos		LIBPCI?=		${DESTDIR}/usr/lib/libpci.a
13761.382Schristos		LIBPOSIX?=		${DESTDIR}/usr/lib/libposix.a
13771.382Schristos		LIBPTHREAD?=		${DESTDIR}/usr/lib/libpthread.a
13781.382Schristos		LIBPUFFS?=		${DESTDIR}/usr/lib/libpuffs.a
13791.382Schristos		LIBQUOTA?=		${DESTDIR}/usr/lib/libquota.a
13801.382Schristos		LIBRADIUS?=		${DESTDIR}/usr/lib/libradius.a
13811.382Schristos		LIBREFUSE?=		${DESTDIR}/usr/lib/librefuse.a
13821.382Schristos		LIBRESOLV?=		${DESTDIR}/usr/lib/libresolv.a
13831.382Schristos		LIBRMT?=		${DESTDIR}/usr/lib/librmt.a
13841.382Schristos		LIBROKEN?=		${DESTDIR}/usr/lib/libroken.a
13851.382Schristos		LIBRPCSVC?=		${DESTDIR}/usr/lib/librpcsvc.a
13861.382Schristos		LIBRT?=			${DESTDIR}/usr/lib/librt.a
13871.382Schristos		LIBRUMP?=		${DESTDIR}/usr/lib/librump.a
13881.396Schristos		LIBRUMPFS_CD9660?=	${DESTDIR}/usr/lib/librumpfs_cd9660.a
13891.382Schristos		LIBRUMPFS_EFS?=		${DESTDIR}/usr/lib/librumpfs_efs.a
13901.382Schristos		LIBRUMPFS_EXT2FS?=	${DESTDIR}/usr/lib/librumpfs_ext2fs.a
13911.382Schristos		LIBRUMPFS_FFS?=		${DESTDIR}/usr/lib/librumpfs_ffs.a
13921.382Schristos		LIBRUMPFS_HFS?=		${DESTDIR}/usr/lib/librumpfs_hfs.a
13931.382Schristos		LIBRUMPFS_LFS?=		${DESTDIR}/usr/lib/librumpfs_lfs.a
13941.396Schristos		LIBRUMPFS_MSDOS?=	${DESTDIR}/usr/lib/librumpfs_msdos.a
13951.382Schristos		LIBRUMPFS_NFS?=		${DESTDIR}/usr/lib/librumpfs_nfs.a
13961.382Schristos		LIBRUMPFS_NTFS?=	${DESTDIR}/usr/lib/librumpfs_ntfs.a
13971.382Schristos		LIBRUMPFS_SYSPUFFS?=	${DESTDIR}/usr/lib/librumpfs_syspuffs.a
13981.382Schristos		LIBRUMPFS_TMPFS?=	${DESTDIR}/usr/lib/librumpfs_tmpfs.a
13991.382Schristos		LIBRUMPFS_UDF?=		${DESTDIR}/usr/lib/librumpfs_udf.a
14001.382Schristos		LIBRUMPUSER?=		${DESTDIR}/usr/lib/librumpuser.a
14011.382Schristos		LIBSASLC?=		${DESTDIR}/usr/lib/libsaslc.a
14021.382Schristos		LIBSKEY?=		${DESTDIR}/usr/lib/libskey.a
14031.382Schristos		LIBSL?=			${DESTDIR}/usr/lib/libsl.a
14041.382Schristos		LIBSQLITE3?=		${DESTDIR}/usr/lib/libsqlite3.a
14051.382Schristos		LIBSSH?=		${DESTDIR}/usr/lib/libssh.a
14061.382Schristos		LIBSSL?=		${DESTDIR}/usr/lib/libssl.a
14071.382Schristos		LIBSTDCXX?=		${DESTDIR}/usr/lib/libstdc++.a
14081.382Schristos		LIBSUPCXX?=		${DESTDIR}/usr/lib/libsupc++.a
14091.382Schristos		LIBTERMINFO?=		${DESTDIR}/usr/lib/libterminfo.a
14101.382Schristos		LIBTRE?=		${DESTDIR}/usr/lib/libtre.a
14111.382Schristos		LIBUNBOUND?=		${DESTDIR}/usr/lib/libunbound.a
14121.382Schristos		LIBUSBHID?=		${DESTDIR}/usr/lib/libusbhid.a
14131.382Schristos		LIBUTIL?=		${DESTDIR}/usr/lib/libutil.a
14141.382Schristos		LIBWIND?=		${DESTDIR}/usr/lib/libwind.a
14151.382Schristos		LIBWRAP?=		${DESTDIR}/usr/lib/libwrap.a
14161.382Schristos		LIBY?=			${DESTDIR}/usr/lib/liby.a
14171.382Schristos		LIBZ?=			${DESTDIR}/usr/lib/libz.a
14181.382Schristos
14191.382Schristos		The following c startup files.
14201.382Schristos
14211.382Schristos		LIBCRT0?=		${DESTDIR}/usr/lib/crt0.o
14221.382Schristos		LIBCRTI?=		${DESTDIR}/usr/lib/crti.o
14231.382Schristos		LIBCRTBEGIN?=		${DESTDIR}/usr/lib/crti.o
14241.382Schristos		LIBCRTEND?=		${DESTDIR}/usr/lib/crtn.o
14251.1Scgd
14261.288Schristos		The following X-Windows libraries are predefined for DPADD:
14271.288Schristos
14281.394Schristos		LIBDPS?=		${DESTDIR}/usr/X11R7/lib/libdps.a
14291.450Schristos		LIBEGL?=		${DESTDIR}/usr/X11R7/lib/libEGL.a
14301.394Schristos		LIBFNTSTUBS?=		${DESTDIR}/usr/X11R7/lib/libfntstubs.a
14311.394Schristos		LIBFONTCACHE?=		${DESTDIR}/usr/X11R7/lib/libfontcache.a
14321.394Schristos		LIBFONTCONFIG?=		${DESTDIR}/usr/X11R7/lib/libfontconfig.a
14331.394Schristos		LIBFONTENC?=		${DESTDIR}/usr/X11R7/lib/libfontenc.a
14341.394Schristos		LIBFREETYPE?=		${DESTDIR}/usr/X11R7/lib/libfreetype.a
14351.382Schristos		LIBFS?=			${DESTDIR}/usr/X11R7/lib/libFS.a
14361.382Schristos		LIBGL?=			${DESTDIR}/usr/X11R7/lib/libGL.a
14371.382Schristos		LIBGLU?=		${DESTDIR}/usr/X11R7/lib/libGLU.a
14381.450Schristos		LIBGLW?=		${DESTDIR}/usr/X11R7/lib/libGLw.a
14391.450Schristos		LIBI810XVMC		4{DESTDIR}/usr/X11R7/lib/libI810XvMC.a
14401.382Schristos		LIBICE?=		${DESTDIR}/usr/X11R7/lib/libICE.a
14411.450Schristos		LIBINTELXVMC		${DESTDIR}/usr/X11R7/lib/libIntelXvMC.a
14421.394Schristos		LIBLBXUTIL?=		${DESTDIR}/usr/X11R7/lib/liblbxutil.a
14431.382Schristos		LIBSM?=			${DESTDIR}/usr/X11R7/lib/libSM.a
14441.450Schristos		LIBX11_XCB?=		${DESTDIR}/usr/X11R7/lib/libX11-xcb.a
14451.382Schristos		LIBX11?=		${DESTDIR}/usr/X11R7/lib/libX11.a
14461.450Schristos		LIBXRES?=		${DESTDIR}/usr/X11R7/lib/libXres.a
14471.382Schristos		LIBXAU?=		${DESTDIR}/usr/X11R7/lib/libXau.a
14481.450Schristos		LIBXAU7?=		${DESTDIR}/usr/X11R7/lib/libXau7.a
14491.382Schristos		LIBXAW?=		${DESTDIR}/usr/X11R7/lib/libXaw.a
14501.382Schristos		LIBXCB?=		${DESTDIR}/usr/X11R7/lib/libxcb.a
14511.412Snia		LIBXCOMPOSITE?=		${DESTDIR}/usr/X11R7/lib/libXcomposite.a
14521.450Schristos		LIBXCURSOR?=		${DESTDIR}/usr/X11R7/lib/libXcursor.a
14531.440Smrg		LIBXCVT?=		${DESTDIR}/usr/X11R7/lib/libxcvt.a
14541.412Snia		LIBXDAMAGE?=		${DESTDIR}/usr/X11R7/lib/libXdamage.a
14551.382Schristos		LIBXDMCP?=		${DESTDIR}/usr/X11R7/lib/libXdmcp.a
14561.382Schristos		LIBXEXT?=		${DESTDIR}/usr/X11R7/lib/libXext.a
14571.412Snia		LIBXFIXES?=		${DESTDIR}/usr/X11R7/lib/libXfixes.a
14581.394Schristos		LIBXFONT2?=		${DESTDIR}/usr/X11R7/lib/libXfont2.a
14591.382Schristos		LIBXFONT?=		${DESTDIR}/usr/X11R7/lib/libXfont.a
14601.382Schristos		LIBXFT?=		${DESTDIR}/usr/X11R7/lib/libXft.a
14611.382Schristos		LIBXI?=			${DESTDIR}/usr/X11R7/lib/libXi.a
14621.382Schristos		LIBXINERAMA?=		${DESTDIR}/usr/X11R7/lib/libXinerama.a
14631.394Schristos		LIBXKBFILE?=		${DESTDIR}/usr/X11R7/lib/libxkbfile.a
14641.382Schristos		LIBXMU?=		${DESTDIR}/usr/X11R7/lib/libXmu.a
14651.382Schristos		LIBXMUU?=		${DESTDIR}/usr/X11R7/lib/libXmuu.a
14661.382Schristos		LIBXPM?=		${DESTDIR}/usr/X11R7/lib/libXpm.a
14671.382Schristos		LIBXRANDR?=		${DESTDIR}/usr/X11R7/lib/libXrandr.a
14681.382Schristos		LIBXRENDER?=		${DESTDIR}/usr/X11R7/lib/libXrender.a
14691.382Schristos		LIBXSS?=		${DESTDIR}/usr/X11R7/lib/libXss.a
14701.382Schristos		LIBXT?=			${DESTDIR}/usr/X11R7/lib/libXt.a
14711.394Schristos		LIBXTRAP?=		${DESTDIR}/usr/X11R7/lib/libXTrap.a
14721.382Schristos		LIBXTST?=		${DESTDIR}/usr/X11R7/lib/libXtst.a
14731.382Schristos		LIBXV?=			${DESTDIR}/usr/X11R7/lib/libXv.a
14741.382Schristos		LIBXXF86DGA?=		${DESTDIR}/usr/X11R7/lib/libXxf86dga.a
14751.382Schristos		LIBXXF86MISC?=		${DESTDIR}/usr/X11R7/lib/libXxf86misc.a
14761.382Schristos		LIBXXF86VM?=		${DESTDIR}/usr/X11R7/lib/libXxf86vm.a
14771.288Schristos
14781.445SlukemSTRIPFLAG	The option passed to the install program to cause the binary
14791.1Scgd		to be stripped.
14801.1Scgd
14811.1ScgdSUBDIR		A list of subdirectories that should be built as well.
14821.1Scgd		Each of the targets will execute the same target in the
14831.1Scgd		subdirectories.
14841.1Scgd
14851.21SchristosSCRIPTS		A list of interpreter scripts [file.{sh,csh,pl,awk,...}].
14861.21Schristos		These are installed exactly like programs.
14871.21Schristos
14881.166SrtrSCRIPTSDIR	The location to install the scripts.  Each script can be
14891.166Srtr		installed to a separate path by setting SCRIPTSDIR_<script>.
14901.166Srtr
14911.21SchristosSCRIPTSNAME	The name that the above program will be installed as, if
14921.21Schristos		different from ${SCRIPTS}. These can be further specialized
14931.21Schristos		by setting SCRIPTSNAME_<script>.
14941.21Schristos
14951.124SlukemFILES		See description of <bsd.files.mk>.
14961.21Schristos
14971.106SthorpejSHLINKDIR	Target directory for shared linker.  See description of
14981.106Sthorpej		<bsd.own.mk> for additional information about this variable.
14991.130Slukem
15001.1ScgdThe include file <bsd.prog.mk> includes the file named "../Makefile.inc"
15011.1Scgdif it exists, as well as the include file <bsd.man.mk>.
15021.1Scgd
15031.1ScgdSome simple examples:
15041.1Scgd
15051.1ScgdTo build foo from foo.c with a manual page foo.1, use:
15061.1Scgd
15071.1Scgd	PROG=	foo
15081.1Scgd
15091.1Scgd	.include <bsd.prog.mk>
15101.1Scgd
15111.1ScgdTo build foo from foo.c with a manual page foo.2, add the line:
15121.1Scgd
15131.9Scgd	MAN=	foo.2
15141.1Scgd
15151.445SlukemIf foo does not have a manual page at all, add the line
15161.445Slukembefore any make(1) .include directives:
15171.1Scgd
15181.445Slukem	NOMAN=
15191.1Scgd
15201.1ScgdIf foo has multiple source files, add the line:
15211.1Scgd
15221.1Scgd	SRCS=	a.c b.c c.c d.c
15231.1Scgd
15241.1Scgd
15251.118Slukem=-=-=-=-=   bsd.rpc.mk   =-=-=-=-=
15261.118Slukem
15271.118SlukemThe include file <bsd.rpc.mk> contains a makefile fragment used to
15281.118Slukemconstruct source files built by rpcgen.
15291.72Ssommerfe
15301.118SlukemThe following macros may be defined in makefiles which include
15311.118Slukem<bsd.rpc.mk> in order to control which files get built and how they
15321.118Slukemare to be built:
15331.21Schristos
15341.444SlukemRPC_INCS	construct .h file from .x file
15351.444SlukemRPC_XDRFILES	construct _xdr.c from .x file
15361.118Slukem		(for marshalling/unmarshalling data types)
15371.444SlukemRPC_SVCFILES	construct _svc.c from .x file
15381.118Slukem		(server-side stubs)
15391.445SlukemRPC_SVCFLAGS	Additional options passed to builds of RPC_SVCFILES.
15401.21Schristos
15411.444SlukemRPC_XDIR	Directory containing .x/.h files
15421.23Schristos
15431.23Schristos
15441.118Slukem=-=-=-=-=   bsd.shlib.mk   =-=-=-=-=
15451.21Schristos
15461.118SlukemThe include file <bsd.shlib.mk> computes parameters for shared library
15471.118Slukeminstallation and use.  It defines no targets.  <bsd.own.mk> MUST be
15481.134Slukemincluded before <bsd.shlib.mk>.
15491.21Schristos
15501.134Slukem<bsd.own.mk> sets the following variables, if they are not already defined
15511.118Slukem(defaults are in brackets):
15521.21Schristos
15531.444SlukemSHLIBINSTALLDIR If ${USE_SHLIBDIR} is not "no", use ${SHLIBINSTALLDIR}
15541.300Sjoerg		instead of ${LIBDIR} as the base path for shared library
15551.300Sjoerg		installation.  [/lib]
15561.300Sjoerg
15571.118SlukemSHLIBDIR	The path to USE_SHLIBDIR shared libraries to use when building
15581.118Slukem		a program.  [/lib for programs in /bin and /sbin, /usr/lib
15591.118Slukem		for all others.]
15601.81Swiz
15611.300Sjoerg_LIBSODIR	Set to ${SHLIBINSTALLDIR} if ${USE_SHLIBDIR} is not "no",
15621.118Slukem		otherwise set to ${LIBDIR}
15631.81Swiz
15641.300SjoergSHLINKINSTALLDIR Base path for shared linker.  [/libexec]
15651.300Sjoerg
15661.118SlukemSHLINKDIR	Path to use for shared linker when building a program.
15671.118Slukem		[/libexec for programs in /bin and /sbin, /usr/libexec for
15681.118Slukem		all others.]
15691.39Scgd
15701.13Schristos
15711.118Slukem=-=-=-=-=   bsd.subdir.mk   =-=-=-=-=
15721.13Schristos
15731.118SlukemThe include file <bsd.subdir.mk> contains the default targets for building
15741.120Slukemsubdirectories.  It has the same eight targets as <bsd.prog.mk>: all,
15751.233Sapbclean, cleandir, depend, includes, install, lint, and tags.  It uses the
15761.233Sapbfollowing variables:
15771.233Sapb
15781.233SapbNOSUBDIR	If this variable is defined, then the SUBDIR variable
15791.233Sapb		will be ignored and subdirectories will not be processed.
15801.233Sapb
15811.233SapbSUBDIR		For all of the directories listed in ${SUBDIR}, the
15821.233Sapb		specified directory will be visited and the target made.
15831.233Sapb
15841.233Sapb		As a special case, the use of a token .WAIT as an
15851.233Sapb		entry in SUBDIR acts as a synchronization barrier
15861.233Sapb		when multiple make jobs are run; subdirs before the
15871.233Sapb		.WAIT must complete before any subdirs after .WAIT are
15881.233Sapb		started.  See make(1) for some caveats on use of .WAIT
15891.233Sapb		and other special sources.
15901.47Stv
15911.47Stv
15921.326Schristos=-=-=-=-=   bsd.x11.mk   =-=-=-=-=
15931.326Schristos
15941.326SchristosThe include file <bsd.x11.mk> contains parameters and targets for
15951.346Smrgcross-building X11 from ${X11SRCDIR.<package>}.  It should be included
15961.346Smrgafter the general Makefile contents but before the include files such as
15971.346Smrg<bsd.prog.mk> and <bsd.lib.mk>.
15981.326Schristos
15991.326SchristosIt provides the following targets:
16001.326Schristos	.man.1 .man.3 .man.4 .man.5 .man.7:
16011.326Schristos		If ${MAN} or ${PROG} is set and ${MKMAN} != "no",
16021.326Schristos		these rules convert from X11's manual page source
16031.326Schristos		into an mdoc.old source file.
16041.326Schristos
16051.326SchristosIt sets the following variables:
16061.326Schristos
16071.326SchristosBINDIR			Set to ${X11BINDIR}.
16081.326Schristos			To override, define after including <bsd.x11.mk>
16091.326Schristos
16101.326SchristosLIBDIR			Set to ${X11USRLIBDIR}.
16111.326Schristos			To override, define after including <bsd.x11.mk>
16121.326Schristos
16131.326SchristosMANDIR			Set to ${X11MANDIR}.
16141.326Schristos			To override, define after including <bsd.x11.mk>
16151.326Schristos
16161.326SchristosCPPFLAGS		Appended with definitions to include from
16171.326Schristos			${DESTDIR}${X11INCDIR}
16181.326Schristos
16191.326SchristosLDFLAGS			Appended with definitions to link from
16201.326Schristos			${DESTDIR}${X11USRLIBDIR}
16211.326Schristos
16221.326SchristosX11FLAGS.CONNECTION	Equivalent to X11's CONNECTION_FLAGS.
16231.326Schristos
16241.326SchristosX11FLAGS.EXTENSION	Equivalent to X11's EXT_DEFINES.
16251.326Schristos
16261.326SchristosX11FLAGS.LOADABLE	Equivalent to X11's LOADABLE.
16271.326Schristos
16281.326SchristosX11FLAGS.OS_DEFINES	Equivalent to X11's OS_DEFINES.
16291.326Schristos
16301.326SchristosX11FLAGS.SERVER		Equivalent to X11's ServerDefines.
16311.326Schristos
16321.326SchristosX11FLAGS.THREADLIB	Equivalent to X11's THREADS_DEFINES for libraries.
16331.326Schristos
16341.326SchristosX11FLAGS.THREADS	Equivalent to X11's THREADS_DEFINES.
16351.326Schristos
16361.326SchristosX11FLAGS.VERSION	cpp(1) definitions of OSMAJORVERSION and OSMINORVERSION.
16371.326Schristos
16381.326SchristosX11FLAGS.DIX		Equivalent to X11's DIX_DEFINES.
16391.326Schristos
16401.326SchristosX11TOOL_UNXCOMM		Commandline to convert `XCOMM' comments to `#'
16411.326Schristos
16421.326SchristosIt uses the following variables:
16431.326Schristos
16441.326SchristosAPPDEFS			List of app-default files to install.
16451.326Schristos
16461.326SchristosCPPSCRIPTS		List of files/scripts to run through cpp(1)
16471.326Schristos			and then ${X11TOOL_UNXCOMM}.  The source files
16481.326Schristos			have a `.cpp' suffix, the generated files do not.
16491.326Schristos
16501.445SlukemCPPSCRIPTFLAGS		Additional options to cpp(1) when building CPPSCRIPTS.
16511.326Schristos
16521.445SlukemCPPSCRIPTFLAGS_<fn>	Additional options to cpp(1) when building CPPSCRIPT <fn>.
16531.326Schristos
16541.326Schristos
16551.326Schristos=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
16561.326Schristos
16571.326SchristosThe following files are described here for completion, but they are not
16581.326Schristossupposed to be included directly from other Makefiles; they are used
16591.326Schristosinternally by other system files.
16601.326Schristos
16611.118Slukem=-=-=-=-=   bsd.sys.mk   =-=-=-=-=
16621.47Stv
16631.326SchristosThe include file <bsd.sys.mk> is used by other system mk files and
16641.326Schristosit is not intended to be included standalone. It contains rules and
16651.326Schristossystem build variables. It requires bsd.own.mk to be included first.
16661.326SchristosIt contains overrides that are used when building the NetBSD source tree.
16671.133Slukem
16681.133SlukemThe following variables control how various files are compiled/built.
16691.142Slukem(Note that these may be overridden in <bsd.own.mk> if USETOOLS == "yes"):
16701.133Slukem
16711.133SlukemAR		Create, modify, and extract from archives.  [ar]
16721.133Slukem
16731.133SlukemARFLAGS		Options to ${AR}.  [rl]
16741.133Slukem
16751.387SchristosARM_ELF2AOUT	Convert ELF-format executable to a.out.  [elf2aout]
16761.387Schristos
16771.151SlukemAS		Assembler.  [as]
16781.151Slukem
16791.211SlukemAFLAGS		Options to ${CC} when compiling or linking .s or .S
16801.211Slukem		assembly source files.  []
16811.151Slukem
16821.445SlukemBUILDSEED	g++(1) uses random numbers when compiling C++ code.  This
16831.445Slukem		variable seeds the g++(1) random number generator using
16841.445Slukem		-frandom-seed with this value.  By default, it is set to
16851.445Slukem		"NetBSD-(majorversion)".  Using a fixed value causes C++
16861.445Slukem		binaries to be the same when built from the same sources,
16871.445Slukem		resulting in identical (reproducible) builds.  Additional
16881.445Slukem		information is available in the g++(1) documentation of
16891.445Slukem		-frandom-seed.
16901.445Slukem
16911.445Slukem		Default: Unset.
16921.217Sjoerg
16931.133SlukemCC		C compiler.  [cc]
16941.133Slukem
16951.133SlukemCFLAGS		Options to ${CC}.  [Usually -O or -O2]
16961.445Slukem		Note: CFLAGS should never be set in mk.conf(5).
16971.133Slukem
16981.133SlukemCPP		C Pre-Processor.  [cpp]
16991.133Slukem
17001.133SlukemCPPFLAGS	Options to ${CPP}.  []
17011.133Slukem
17021.445SlukemCPUFLAGS	Optimization options for ${CC}.  []
17031.133Slukem
17041.133SlukemCXX		C++ compiler.  [c++]
17051.133Slukem
17061.133SlukemCXXFLAGS	Options to ${CXX}.  [${CFLAGS}]
17071.133Slukem
17081.387SchristosM68K_ELF2AOUT	Convert ELF-format executable to a.out.  [elf2aout]
17091.387Schristos
17101.387SchristosMIPS_ELF2ECOFF	Convert ELF-format executable to ECOFF.  [elf2ecoff]
17111.133Slukem
17121.133SlukemFC		Fortran compiler.  [f77]
17131.133Slukem
17141.133SlukemFFLAGS		Options to {$FC}.  [-O]
17151.133Slukem
17161.444SlukemHOST_SH		Shell.  This must be an absolute path, because it may be
17171.444Slukem		substituted into "#!" lines in scripts.  [/bin/sh]
17181.235Sapb
17191.133SlukemINSTALL		install(1) command.  [install]
17201.133Slukem
17211.133SlukemLEX		Lexical analyzer.  [lex]
17221.133Slukem
17231.133SlukemLFLAGS		Options to ${LEX}.  []
17241.133Slukem
17251.145SjwiseLPREFIX		Symbol prefix for ${LEX} (see -P option in lex(1)) [yy]
17261.145Sjwise
17271.133SlukemLD		Linker.  [ld]
17281.133Slukem
17291.178SlukemLDFLAGS		Options to ${CC} during the link process.  []
17301.133Slukem
17311.133SlukemLINT		C program verifier.  [lint]
17321.133Slukem
17331.390SchristosLINTFLAGS	Options to ${LINT}.  [-chapbrxzgFS]
17341.133Slukem
17351.133SlukemLORDER		List dependencies for object files.  [lorder]
17361.133Slukem
17371.133SlukemMAKE		make(1).  [make]
17381.133Slukem
17391.133SlukemMKDEP		Construct Makefile dependency list.  [mkdep]
17401.133Slukem
17411.321SmrgMKDEPCXX	Construct Makefile dependency list for C++ files.  [mkdep]
17421.321Smrg
17431.133SlukemNM		List symbols from object files.  [nm]
17441.133Slukem
17451.444SlukemPC		Pascal compiler.  [pc]	(Not present)
17461.133Slukem
17471.133SlukemPFLAGS		Options to ${PC}.  []
17481.133Slukem
17491.133SlukemOBJC		Objective C compiler.  [${CC}]
17501.133Slukem
17511.133SlukemOBJCFLAGS	Options to ${OBJC}.  [${CFLAGS}]
17521.133Slukem
17531.133SlukemOBJCOPY		Copy and translate object files.  [objcopy]
17541.133Slukem
17551.445SlukemOBJCOPYLIBFLAGS Options to pass to objcopy when library objects are
17561.291Schristos		being built. [${.TARGET} =~ "*.po" ? -X : -x]
17571.291Schristos
17581.168SrizOBJDUMP		Display information from object files.  [objdump]
17591.168Sriz
17601.133SlukemRANLIB		Generate index to archive.  [ranlib]
17611.133Slukem
17621.343SpookaREADELF		Display information from ELF object files.  [readelf]
17631.343Spooka
17641.133SlukemSIZE		List section sizes and total size.  [size]
17651.133Slukem
17661.343SpookaSTRINGS		Display printable character sequences in files.  [strings]
17671.343Spooka
17681.133SlukemSTRIP		Discard symbols from object files.  [strip]
17691.133Slukem
17701.133SlukemTSORT		Topological sort of a directed graph.  [tsort -q]
17711.133Slukem
17721.133SlukemYACC		LALR(1) parser generator.  [yacc]
17731.133Slukem
17741.133SlukemYFLAGS		Options to ${YACC}.  []
17751.133Slukem
17761.133SlukemYHEADER		If defined, add "-d" to YFLAGS, and add dependencies
17771.133Slukem		from <file>.y to <file>.h and <file>.c, and add
17781.133Slukem		<foo>.h to CLEANFILES.
17791.133Slukem
17801.133SlukemYPREFIX		If defined, add "-p ${YPREFIX}" to YFLAGS.
17811.133Slukem
17821.116Slukem
17831.69SsommerfeOther variables of note (incomplete list):
17841.69Ssommerfe
17851.444SlukemNOCLANGERROR	If defined and clang is used as C compiler, -Werror is not
17861.444Slukem		passed to it.
17871.444Slukem
17881.213SlukemNOGCCERROR	If defined, prevents passing certain ${CFLAGS} to GCC
17891.213Slukem		that cause warnings to be fatal, such as:
17901.213Slukem			-Werror -Wa,--fatal-warnings
17911.213Slukem		(The latter being for as(1).)
17921.212Slukem
17931.296SplunkyWARNS		Crank up compiler warning options; the distinct levels are:
17941.82Slukem			WARNS=1
17951.82Slukem			WARNS=2
17961.82Slukem			WARNS=3
17971.164Smatt			WARNS=4
17981.296Splunky			WARNS=5
17991.336Schristos			WARNS=6
18001.69Ssommerfe
18011.444Slukem=-=-=-=-=   bsd.host.mk   =-=-=-=-=
18021.144Slukem
18031.326SchristosThis file is automatically included from bsd.own.mk. It contains settings
18041.326Schristosfor all the HOST_* variables that are used in host programs and libraries.
18051.144Slukem
18061.326SchristosHOST_AR			The host archive processing command
18071.144Slukem
18081.326SchristosHOST_CC			The host c compiler
18091.144Slukem
18101.445SlukemHOST_CFLAGS		The host c compiler options
18111.144Slukem
18121.445SlukemHOST_COMPILE.c		The host c compiler line with options
18131.144Slukem
18141.445SlukemHOST_COMPILE.cc		The host c++ compiler line with options
18151.144Slukem
18161.326SchristosHOST_CPP		The host c pre-processor
18171.144Slukem
18181.445SlukemHOST_CPPFLAGS		The host c pre-processor options
18191.144Slukem
18201.326SchristosHOST_CXX		The host c++ compiler
18211.144Slukem
18221.445SlukemHOST_CXXFLAGS		The host c++ compiler options
18231.144Slukem
18241.326SchristosHOST_INSTALL_DIR	The host command to install a directory
18251.144Slukem
18261.326SchristosHOST_INSTALL_FILE	The host command to install a file
18271.144Slukem
18281.326SchristosHOST_INSTALL_SYMLINK	The host command to install a symlink
18291.144Slukem
18301.326SchristosHOST_LD			The host linker command
18311.144Slukem
18321.445SlukemHOST_LDFLAGS		The host linker options
18331.144Slukem
18341.445SlukemHOST_LINK.c		The host c linker line with options
18351.221Smrg
18361.445SlukemHOST_LINK.cc		The host c++ linker line with options
18371.144Slukem
18381.326SchristosHOST_LN			The host command to link two files
18391.144Slukem
18401.326SchristosHOST_MKDEP		The host command to create dependencies for c programs
18411.144Slukem
18421.326SchristosHOST_MKDEPCXX		The host command to create dependencies for c++ programs
18431.144Slukem
18441.326SchristosHOST_OSTYPE		The host OSNAME-RELEASE-ARCH tupple
18451.144Slukem
18461.326SchristosHOST_RANLIB		The host command to create random access archives
18471.144Slukem
18481.326SchristosHOST_SH			The host Bourne shell interpreter name (absolute path)
18491.144Slukem
18501.30Sagc=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
1851