bsd.README revision 1.139
11.139Slukem#	$NetBSD: bsd.README,v 1.139 2003/09/20 06:20:41 lukem Exp $
21.24Smikel#	@(#)bsd.README	8.2 (Berkeley) 4/2/94
31.1Scgd
41.1ScgdThis is the README file for the new make "include" files for the BSD
51.1Scgdsource tree.  The files are installed in /usr/share/mk, and are, by
61.11Sjtcconvention, named with the suffix ".mk".
71.1Scgd
81.1ScgdNote, this file is not intended to replace reading through the .mk
91.1Scgdfiles for anything tricky.
101.1Scgd
111.1Scgd=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
121.1Scgd
131.1ScgdRANDOM THINGS WORTH KNOWING:
141.1Scgd
151.1ScgdThe files are simply C-style #include files, and pretty much behave like
161.1Scgdyou'd expect.  The syntax is slightly different in that a single '.' is
171.1Scgdused instead of the hash mark, i.e. ".include <bsd.prog.mk>".
181.1Scgd
191.1ScgdOne difference that will save you lots of debugging time is that inclusion
201.1Scgdof the file is normally done at the *end* of the Makefile.  The reason for
211.1Scgdthis is because .mk files often modify variables and behavior based on the
221.1Scgdvalues of variables set in the Makefile.  To make this work, remember that
231.1Scgdthe FIRST target found is the target that is used, i.e. if the Makefile has:
241.1Scgd
251.1Scgd	a:
261.1Scgd		echo a
271.1Scgd	a:
281.1Scgd		echo a number two
291.1Scgd
301.1Scgdthe command "make a" will echo "a".  To make things confusing, the SECOND
311.1Scgdvariable assignment is the overriding one, i.e. if the Makefile has:
321.1Scgd
331.1Scgd	a=	foo
341.1Scgd	a=	bar
351.1Scgd
361.1Scgd	b:
371.1Scgd		echo ${a}
381.1Scgd
391.1Scgdthe command "make b" will echo "bar".  This is for compatibility with the
401.1Scgdway the V7 make behaved.
411.1Scgd
421.1ScgdIt's fairly difficult to make the BSD .mk files work when you're building
431.75Sagcmultiple programs in a single directory.  It's a lot easier to split up the
441.1Scgdprograms than to deal with the problem.  Most of the agony comes from making
451.36Srossthe "obj" directory stuff work right, not because we switched to a new version
461.1Scgdof make.  So, don't get mad at us, figure out a better way to handle multiple
471.1Scgdarchitectures so we can quit using the symbolic link stuff.  (Imake doesn't
481.1Scgdcount.)
491.1Scgd
501.1ScgdThe file .depend in the source directory is expected to contain dependencies
511.1Scgdfor the source files.  This file is read automatically by make after reading
521.1Scgdthe Makefile.
531.1Scgd
541.1ScgdThe variable DESTDIR works as before.  It's not set anywhere but will change
551.1Scgdthe tree where the file gets installed.
561.1Scgd
571.1ScgdThe profiled libraries are no longer built in a different directory than
581.1Scgdthe regular libraries.  A new suffix, ".po", is used to denote a profiled
591.21Schristosobject, and ".so" denotes a shared (position-independent) object.
601.97Sitojun
611.97SitojunThere are various make variables used during the build.  Basic rule for
621.97Sitojunthe variable naming scheme is as follows:
631.97Sitojun
641.129SlukemMKxxx		Can be set to "no" to disable functionality, or
651.129Slukem		"yes" to enable it.
661.129Slukem		Usually defaults to "yes", although some variables
671.129Slukem		default to "no".
681.129Slukem		Due to make(1) implementation issues, if a temporary
691.134Slukem		command-line override of a mk.conf or <bsd.own.mk> setting
701.129Slukem		is required whilst still honouring a particular
711.129Slukem		Makefile's setting of MKxxx, use
721.129Slukem			env MKxxx=value make
731.129Slukem		instead of
741.129Slukem			make MKxxx=value
751.97Sitojun
761.116SlukemNOxxx		If defined, disables a feature.
771.116Slukem		Not intended for users.
781.116Slukem		This is to allow Makefiles to disable functionality
791.116Slukem		that they don't support (such as missing man pages).
801.101Slukem		NOxxx variables must be defined before <bsd.own.mk>
811.101Slukem		is included.
821.21Schristos
831.45SlukemThe following variables that control how things are made/installed that
841.47Stvare not set by default. These should not be set by Makefiles; they're for
851.134Slukemthe user to define in MAKECONF (see <bsd.own.mk>, below) or on the make(1)
861.47Stvcommand line:
871.21Schristos
881.45SlukemBUILD 		If defined, 'make install' checks that the targets in the
891.45Slukem		source directories are up-to-date and remakes them if they
901.21Schristos                are out of date, instead of blindly trying to install
911.79Swiz                out of date or non-existent targets.
921.21Schristos
931.120SlukemMKBFD		If "no", don't build libbfd, libiberty, or any of the things
941.120Slukem		that depend on them (binutils/gas/ld, gdb, dbsym, mdsetimage).
951.120Slukem		Default: yes
961.120Slukem
971.121SlukemMKCATPAGES	If "no", don't build or install the catman pages.
981.121Slukem		Default: yes
991.121Slukem
1001.120SlukemMKCRYPTO	If "no", no cryptography support will be built into the system,
1011.127Slukem		and also acts as MKKERBEROS=no MKKERBEROS4=no.
1021.120Slukem		Default: yes
1031.120Slukem
1041.120SlukemMKCRYPTO_IDEA	If not "no", IDEA support will be built into libcrypto_idea.a.
1051.120Slukem		Default: no
1061.52Ssimonb
1071.120SlukemMKCRYPTO_MDC2	If not "no", MDC2 support will be built into libcrypto_mdc2.a
1081.120Slukem		Default: no
1091.45Slukem
1101.120SlukemMKCRYPTO_RC5	If not "no", RC5 support will be built into libcrypto_rc5.a.
1111.120Slukem		Default: no
1121.86Sthorpej
1131.45SlukemMKDOC		If "no", don't build or install the documentation.
1141.120Slukem		Default: yes
1151.86Sthorpej
1161.104SlukemMKDYNAMICROOT	If "no", build programs in /bin and /sbin statically,
1171.104Slukem		don't install certain libraries in /lib, and don't
1181.104Slukem		install the shared linker into /libexec.
1191.120Slukem		Default: yes
1201.120Slukem
1211.120SlukemMKGCC		If "no", don't build gcc or any of the gcc-related
1221.120Slukem		libraries (libg2c, libgcc, libobjc, libstdc++).
1231.120Slukem		Default: yes
1241.104Slukem
1251.103SthorpejMKGDB		If "no", don't build gdb.
1261.120Slukem		Default: yes
1271.120Slukem
1281.120SlukemMKHESIOD	If "no", disables building of Hesiod infrastructure
1291.120Slukem		(libraries and support programs).
1301.120Slukem		Default: yes
1311.121Slukem
1321.121SlukemMKHOSTOBJ	If "yes", for programs intended to be run on the compile host,
1331.121Slukem		the name, release, and architecture of the host operating
1341.121Slukem		system will be suffixed to the name of the object directory
1351.121Slukem		created by "make obj".
1361.121Slukem		Default: no
1371.86Sthorpej
1381.120SlukemMKHTML		If "no", don't build or install the html man pages.
1391.120Slukem		Default: yes
1401.92Sross
1411.92SrossMKIEEEFP	If "no", don't add code for IEEE754/IEC60559 conformance.
1421.92Sross		Has no effect on most platforms.
1431.120Slukem		Default: yes
1441.45Slukem
1451.47StvMKINFO		If "no", don't build or install Info documentation from
1461.47Stv		Texinfo source files.
1471.120Slukem		Default: yes
1481.120Slukem
1491.126SitojunMKKERBEROS4	If "no", disables building of Kerberos v4
1501.126Sitojun		infrastructure (libraries and support programs).
1511.126Sitojun		Default: yes
1521.126Sitojun
1531.126SitojunMKKERBEROS	If "no", disables building of Kerberos v5
1541.120Slukem		infrastructure (libraries and support programs).
1551.120Slukem		Default: yes
1561.120Slukem
1571.120SlukemMKLINKLIB	If "no", act as "MKPICINSTALL=no MKPROFILE=no".
1581.120Slukem		Also:
1591.120Slukem			- don't install the .a libraries
1601.120Slukem			- don't install _pic.a libraries on PIC systems
1611.120Slukem			- don't build .a libraries on PIC systems
1621.120Slukem			- don't install the .so symlink on ELF systems
1631.120Slukem		I.e, only install the shared library (and the .so.major
1641.120Slukem		symlink on ELF).
1651.120Slukem		Default: yes
1661.45Slukem
1671.45SlukemMKLINT		If "no", don't build or install the lint libraries.
1681.120Slukem		Default: yes
1691.45Slukem
1701.120SlukemMKMAN		If "no", don't build or install the man or catman pages,
1711.120Slukem		and also acts as "MKCATPAGES=no MKHTML=no"
1721.120Slukem		Default: yes
1731.45Slukem
1741.119SlukemMKMANZ		If not "no", compress manual pages at installation time.
1751.120Slukem		Default: no
1761.119Slukem
1771.74SitojunMKNLS		If "no", don't build or install the NLS files and locale
1781.74Sitojun		definition files.
1791.120Slukem		Default: yes
1801.45Slukem
1811.120SlukemMKOBJ		If "no", don't enable the rule which creates objdirs,
1821.120Slukem		and also acts as "MKOBJDIRS=no"
1831.120Slukem		Default: yes
1841.55Ssommerfe
1851.55SsommerfeMKOBJDIRS	If "no", don't create objdirs during a "make build".
1861.120Slukem		Default: no
1871.45Slukem
1881.120SlukemMKPIC		If "no", don't build or install shared libraries, and
1891.120Slukem		also acts as "MKPICLIB=no"
1901.122Slukem		Default: yes, except for ${MACHINE_ARCH} == "sh3"
1911.45Slukem
1921.45SlukemMKPICINSTALL	If "no", don't install the *_pic.a libraries.
1931.120Slukem		Default: yes
1941.120Slukem
1951.120SlukemMKPICLIB	If "no", don't build *_pic.a libraries, and build the
1961.120Slukem		shared object libraries from the .a libraries.
1971.120Slukem		A symlink is installed in ${DESTDIR}/usr/lib for the
1981.120Slukem		_pic.a library pointing to the .a library.
1991.120Slukem		Default: yes
2001.45Slukem
2011.138SlukemMKPROFILE	If "no", don't build or install the profiling (*_p.a) libraries.
2021.120Slukem		Default: yes
2031.120Slukem
2041.120SlukemMKSHARE		If "no", act as "MKCATPAGES=no MKDOC=no MKHTML=no MKINFO=no
2051.120Slukem		MKMAN=no MKNLS=no".
2061.120Slukem		I.e, don't build catman pages, documentation, Info
2071.120Slukem		documentation, man pages, NLS files, ...
2081.120Slukem		Default: yes
2091.120Slukem
2101.120SlukemMKSKEY		If "no", disables building of S/key authentication
2111.120Slukem		infrastructure (libraries and support programs).
2121.120Slukem		Default: yes
2131.120Slukem
2141.120SlukemMKSOFTFLOAT	If not "no", build with options to enable the compiler to
2151.120Slukem		generate output containing library calls for floating
2161.120Slukem		point and possibly soft-float library support.
2171.120Slukem		Default: no
2181.138Slukem
2191.138SlukemMKSTATICLIB	If "no", don't build or install the normal static (*.a)
2201.138Slukem		libraries.
2211.138Slukem		Default: yes
2221.120Slukem
2231.120SlukemMKUNPRIVED	If not "no", don't set the owner/group/mode when installing
2241.120Slukem		files or directories, and keep a metadata log of what
2251.120Slukem		the owner/group/mode should be.  This allows a
2261.120Slukem		non-root "make install".
2271.120Slukem		Default: no
2281.120Slukem
2291.120SlukemMKUPDATE 	If not "no", 'make install' only installs targets that are
2301.120Slukem		more recently modified in the source directories that their
2311.120Slukem		installed counterparts.
2321.120Slukem		Default: no
2331.45Slukem
2341.120SlukemMKYP		If "no", disables building of YP (NIS)
2351.120Slukem		infrastructure (libraries and support programs).
2361.120Slukem		Default: yes
2371.1Scgd
2381.129SlukemUSE_HESIOD	If "no", disables building Hesiod support into
2391.122Slukem		various system utilities/libraries that support it.
2401.129Slukem		If MKHESIOD is "no", USE_HESIOD will also be
2411.122Slukem		forced to "no".
2421.122Slukem
2431.129SlukemUSE_KERBEROS4	If "no", disables building Kerberos v4
2441.126Sitojun		support into various system utilities/libraries that
2451.129Slukem		support it.  If MKKERBEROS4 is "no", USE_KERBEROS4
2461.126Sitojun		will also be forced to "no".
2471.126Sitojun
2481.129SlukemUSE_KERBEROS	If "no", disables building Kerberos v4 or v5)
2491.122Slukem		support into various system utilities/libraries that
2501.129Slukem		support it.  If MKKERBEROS is "no", USE_KERBEROS
2511.122Slukem		will also be forced to "no".
2521.122Slukem
2531.129SlukemUSE_SKEY	If "no", disables building S/key authentication
2541.122Slukem		support into various system utilities/libraries that
2551.129Slukem		support it.  If MKSKEY is "no", USE_SKEY will
2561.122Slukem		also be forced to "no".
2571.122Slukem
2581.129SlukemUSE_YP		If "no", disables building YP (NIS) support into
2591.129Slukem		various system utilities/libraries that support it.
2601.129Slukem		If MKYP is "no", USE_YP will also be forced to "no".
2611.122Slukem
2621.136SerhCOPTS.lib<lib>
2631.136SerhLDADD.lib<lib>
2641.136SerhCPPFLAGS.lib<lib>
2651.136SerhCXXFLAGS.lib<lib>
2661.136SerhCOPTS.<prog>
2671.136SerhLDADD.<prog>
2681.136SerhCPPFLAGS.<prog>
2691.137SsimonbCXXFLAGS.<prog>	These provide a way to specify additions to the associated
2701.137Ssimonb		variables in a way that applies only to a particular library
2711.137Ssimonb		or program.  <lib> corresponds to the LIB variable set in
2721.137Ssimonb		the library's makefile.  <prog> corresponds to either PROG
2731.137Ssimonb		or PROG_CXX (if set).  For example, if COPTS.libcrypto is
2741.137Ssimonb		set to "-g", "-g" will be added to COPTS only when compiling
2751.137Ssimonb		the crypto library.
2761.118Slukem
2771.118Slukem=-=-=-=-=   sys.mk   =-=-=-=-=
2781.1Scgd
2791.1ScgdThe include file <sys.mk> has the default rules for all makes, in the BSD
2801.1Scgdenvironment or otherwise.  You probably don't want to touch this file.
2811.1Scgd
2821.118Slukem=-=-=-=-=   bsd.own.mk   =-=-=-=-=
2831.1Scgd
2841.17SthorpejThe include file <bsd.own.mk> contains source tree configuration parameters,
2851.17Sthorpejsuch as the owners, groups, etc. for both manual pages and binaries, and
2861.17Sthorpeja few global "feature configuration" parameters.
2871.1Scgd
2881.1ScgdIt has no targets.
2891.1Scgd
2901.134SlukemTo get system-specific configuration parameters, <bsd.own.mk> will try to
2911.29Scjsinclude the file specified by the "MAKECONF" variable.  If MAKECONF is not
2921.29Scjsset, or no such file exists, the system make configuration file, /etc/mk.conf
2931.29Scjsis included.  These files may define any of the variables described below.
2941.17Sthorpej
2951.134Slukem<bsd.own.mk> sets the following variables, if they are not already defined
2961.17Sthorpej(defaults are in brackets):
2971.15Scgd
2981.98SlukemNETBSDSRCDIR	Top of the NetBSD source tree.
2991.98Slukem		If _SRC_TOP_ != "", that will be used as the default,
3001.98Slukem		otherwise BSDSRCDIR will be used as the default.
3011.98Slukem		Various makefiles within the NetBSD source tree will
3021.98Slukem		use this to reference the top level of the source tree.
3031.98Slukem
3041.95Slukem_SRC_TOP_	Top of the system source tree, as determined by <bsd.own.mk>
3051.98Slukem		based on the presence of tools/ and build.sh.  This variable
3061.98Slukem		is "internal" to <bsd.own.mk>, although its value is only
3071.98Slukem		determined once and then propagated to all sub-makes.
3081.95Slukem
3091.15ScgdBSDSRCDIR	The real path to the system sources, so that 'make obj'
3101.116Slukem		will work correctly.  [/usr/src]
3111.15Scgd
3121.15ScgdBSDOBJDIR	The real path to the system 'obj' tree, so that 'make obj'
3131.116Slukem		will work correctly.  [/usr/obj]
3141.15Scgd
3151.116SlukemBINGRP		Binary group.  [wheel]
3161.15Scgd
3171.116SlukemBINOWN		Binary owner.  [root]
3181.15Scgd
3191.116SlukemBINMODE		Binary mode.  [555]
3201.15Scgd
3211.116SlukemNONBINMODE	Mode for non-executable files.  [444]
3221.15Scgd
3231.116SlukemMANDIR		Base path for manual installation.  [/usr/share/man/cat]
3241.15Scgd
3251.116SlukemMANGRP		Manual group.  [wheel]
3261.15Scgd
3271.116SlukemMANOWN		Manual owner.  [root]
3281.15Scgd
3291.116SlukemMANMODE		Manual mode.  [${NONBINMODE}]
3301.15Scgd
3311.21SchristosMANINSTALL	Manual installation type: maninstall, catinstall, or both
3321.76Sfair
3331.76SfairLDSTATIC	Control program linking; if set blank, link everything
3341.129Slukem		dynamically.  If set to "-static", link everything statically.
3351.76Sfair		If not set, programs link according to their makefile.
3361.21Schristos
3371.116SlukemLIBDIR		Base path for library installation.  [/usr/lib]
3381.15Scgd
3391.116SlukemLINTLIBDIR	Base path for lint(1) library installation.  [/usr/libdata/lint]
3401.15Scgd
3411.116SlukemLIBGRP		Library group.  [${BINGRP}]
3421.15Scgd
3431.116SlukemLIBOWN		Library owner.  [${BINOWN}]
3441.15Scgd
3451.116SlukemLIBMODE		Library mode.  [${NONBINMODE}]
3461.15Scgd
3471.15ScgdDOCDIR		Base path for system documentation (e.g. PSD, USD, etc.)
3481.116Slukem	        installation.  [/usr/share/doc]
3491.62Ssimonb
3501.62SsimonbHTMLDOCDIR	Base path for html system documentation installation.
3511.62Ssimonb		[/usr/share/doc/html]
3521.15Scgd
3531.116SlukemDOCGRP		Documentation group.  [wheel]
3541.15Scgd
3551.116SlukemDOCOWN		Documentation owner.  [root]
3561.15Scgd
3571.116SlukemDOCMODE		Documentation mode.  [${NONBINMODE}]
3581.15Scgd
3591.84SkleinkNLSDIR		Base path for Native Language Support files installation.
3601.15Scgd		[/usr/share/nls]
3611.1Scgd
3621.116SlukemNLSGRP		Native Language Support files group.  [wheel]
3631.1Scgd
3641.116SlukemNLSOWN		Native Language Support files owner.  [root]
3651.1Scgd
3661.116SlukemNLSMODE		Native Language Support files mode.  [${NONBINMODE}]
3671.1Scgd
3681.32SmikelSTRIPFLAG	The flag passed to the install program to cause the binary
3691.1Scgd		to be stripped.  This is to be used when building your
3701.1Scgd		own install script so that the entire system can be made
3711.116Slukem		stripped/not-stripped using a single knob.  [-s]
3721.1Scgd
3731.2ScgdCOPY		The flag passed to the install program to cause the binary
3741.2Scgd		to be copied rather than moved.  This is to be used when
3751.2Scgd		building our own install script so that the entire system
3761.2Scgd		can either be installed with copies, or with moves using
3771.116Slukem		a single knob.  [-c]
3781.15Scgd
3791.134SlukemAdditionally, the following variables may be set by <bsd.own.mk> or in a
3801.17Sthorpejmake configuration file to modify the behaviour of the system build
3811.17Sthorpejprocess (default values are in brackets along with comments, if set by
3821.134Slukem<bsd.own.mk>):
3831.33Sjonathan
3841.116SlukemOBJECT_FMT	Object file format.  [set to "ELF" on architectures that
3851.50Sthorpej		use ELF -- currently if ${MACHINE_ARCH} is "alpha",
3861.50Sthorpej		"mipsel", "mipseb", "powerpc", "sparc", "sparc64",
3871.77Ssimonb		"i386" and some m68k machines, or set to "a.out" on
3881.77Ssimonb		other architectures].
3891.33Sjonathan
3901.103SthorpejTOOLCHAIN_MISSING
3911.103Sthorpej		If "yes", this indicates that the platform being built
3921.103Sthorpej		does not have a working in-tree toolchain.  If the
3931.103Sthorpej		MACHINE_ARCH in question falls into this category, the
3941.103Sthorpej		variable is conditionally assigned the value "yes".
3951.103Sthorpej		Otherwise, the variable is unconditionally assigned the
3961.103Sthorpej		value "no".
3971.103Sthorpej
3981.103Sthorpej		If TOOLCHAIN_MISSING is "yes", the variables MKBFD, MKGCC,
3991.103Sthorpej		and MKGDB are unconditionally assigned the value "no".
4001.103Sthorpej
4011.103SthorpejEXTERNAL_TOOLCHAIN
4021.103Sthorpej		This variable is not directly set by <bsd.own.mk>, but
4031.103Sthorpej		including <bsd.own.mk> is the canonical way to gain
4041.103Sthorpej		access to this variable.  The variable should be defined
4051.103Sthorpej		either in the user's environment or in the user's mk.conf
4061.103Sthorpej		file.  If defined, this variable indicates the root of
4071.103Sthorpej		an external toolchain which will be used to build the
4081.103Sthorpej		tree.  For example, if a platform is a TOOLCHAIN_MISSING
4091.103Sthorpej		platform, EXTERNAL_TOOLCHAIN can be used to re-enable the
4101.103Sthorpej		cross-compile framework.
4111.103Sthorpej
4121.103Sthorpej		If EXTERNAL_TOOLCHAIN is defined, the variable MKGCC is
4131.103Sthorpej		unconditionally assigned the value "no", since the external
4141.103Sthorpej		version of the compiler may not be able to build the library
4151.103Sthorpej		components of the in-tree compiler.
4161.103Sthorpej
4171.103Sthorpej		NOTE: This variable is not yet used in as many places as
4181.103Sthorpej		it should be.  Expect the exact semantics of this variable
4191.103Sthorpej		to change in the short term as parts of the cross-compile
4201.103Sthorpej		framework continue to be cleaned up.
4211.1Scgd
4221.134Slukem<bsd.own.mk> is generally useful when building your own Makefiles so that
4231.1Scgdthey use the same default owners etc. as the rest of the tree.
4241.131Slukem
4251.131Slukem
4261.131Slukem=-=-=-=-=   bsd.dep.mk   =-=-=-=-=
4271.131Slukem
4281.131SlukemThe include file <bsd.dep.mk> contains the default targets for building
4291.133Slukem.depend files.  It creates .d files from entries in SRCS and DPSRCS
4301.133Slukemthat are C, C++, or Objective C source files, and builds .depend from the
4311.133Slukem.d files.  All other files in SRCS and all of DPSRCS will be used as
4321.133Slukemdependencies for the .d files.  In order for this to function correctly,
4331.132Slukemit should be .included after all other .mk files and directives that may
4341.132Slukemmodify SRCS or DPSRCS.  It uses the following variables:
4351.132Slukem
4361.132SlukemSRCS		List of source files to build the program.
4371.132Slukem
4381.132SlukemDPSRCS		List of source files which are needed for generating
4391.132Slukem		dependencies, but are not needed in ${SRCS}.
4401.1Scgd
4411.1Scgd
4421.118Slukem=-=-=-=-=   bsd.files.mk   =-=-=-=-=
4431.106Sthorpej
4441.118SlukemThe include file <bsd.files.mk> handles the FILES variables and is included
4451.134Slukemfrom <bsd.lib.mk> and <bsd.prog.mk>, and uses the following variables:
4461.124Slukem
4471.124SlukemFILES		The list of files to install.
4481.124Slukem
4491.124SlukemFILESOWN	File owner.  [${BINOWN}]
4501.124Slukem
4511.124SlukemFILESGRP	File group.  [${BINGRP}]
4521.124Slukem
4531.124SlukemFILESMODE	File mode.  [${BINMODE}]
4541.124Slukem
4551.124SlukemFILESDIR	The location to install the files.
4561.124Slukem
4571.124SlukemFILESNAME	Optional name to install each file as.
4581.124Slukem
4591.124SlukemFILESDIR.<fn>	The location to install the specific file <fn>.
4601.124Slukem
4611.124SlukemFILESNAME.<fn>	Optional name to install <fn> as.
4621.135Slukem
4631.139SlukemBUILDSYMLINKS	List of two word items:
4641.135Slukem			lnsrc lntgt
4651.135Slukem		For each lnsrc item, create a symlink named lntgt.
4661.135Slukem		The lntgt symlinks are removed by the cleandir target.
4671.106Sthorpej
4681.106Sthorpej
4691.118Slukem=-=-=-=-=   bsd.gcc.mk   =-=-=-=-=
4701.113Sthorpej
4711.113SthorpejThe include file <bsd.gcc.mk> computes various parameters related to GCC
4721.113Sthorpejsupport libraries.  It defines no targets.  <bsd.own.mk> MUST be included
4731.134Slukembefore <bsd.gcc.mk>.
4741.113Sthorpej
4751.134SlukemThe primary users of <bsd.gcc.mk> are <bsd.prog.mk> and <bsd.lib.mk>, each
4761.113Sthorpejof which need to know where to find certain GCC support libraries.
4771.113Sthorpej
4781.134SlukemThe behavior of <bsd.gcc.mk> is influenced by the EXTERNAL_TOOLCHAIN variable,
4791.113Sthorpejwhich is generally set by the user.  If EXTERNAL_TOOLCHAIN it set, then
4801.113Sthorpejthe compiler is asked where to find the support libraries, otherwise the
4811.113Sthorpejsupport libraries are found in ${DESTDIR}/usr/lib.
4821.113Sthorpej
4831.134Slukem<bsd.gcc.mk> sets the following variables:
4841.113Sthorpej
4851.118Slukem_GCC_CRTBEGIN	The full path name to crtbegin.o.
4861.118Slukem
4871.118Slukem_GCC_CRTBEGINS	The full path name to crtbeginS.o.
4881.118Slukem
4891.118Slukem_GCC_CRTEND	The full path name to crtend.o.
4901.118Slukem
4911.118Slukem_GCC_CRTENDS	The full path name to crtendS.o.
4921.118Slukem
4931.118Slukem_GCC_LIBGCCDIR	The directory where libgcc.a is located.
4941.118Slukem
4951.118Slukem
4961.118Slukem=-=-=-=-=   bsd.inc.mk   =-=-=-=-=
4971.118Slukem
4981.134SlukemThe include file <bsd.inc.mk> defines the includes target and uses the
4991.118Slukemvariables:
5001.118Slukem
5011.124SlukemINCS		The list of include files.
5021.118Slukem
5031.118SlukemINCSDIR		The location to install the include files.
5041.118Slukem
5051.118SlukemINCSNAME	Target name of the include file, if only one; same as
5061.118Slukem		FILESNAME, but for include files.
5071.118Slukem
5081.134SlukemINCSYMLINKS	Similar to SYMLINKS in <bsd.links.mk>, except that these
5091.134Slukem		are installed in the 'includes' target and not the
5101.134Slukem		(much later) 'install' target.
5111.134Slukem
5121.118SlukemINCSNAME_<file>	The name file <file> should be installed as, if not <file>,
5131.118Slukem		same as FILESNAME_<file>, but for include files.
5141.118Slukem
5151.118Slukem
5161.118Slukem=-=-=-=-=   bsd.info.mk   =-=-=-=-=
5171.118Slukem
5181.118SlukemThe include file <bsd.info.mk> is used to generate and install GNU Info
5191.118Slukemdocumentation from respective Texinfo source files.  It defines three
5201.118Slukemimplicit targets (.txi.info, .texi.info, and .texinfo.info), and uses the
5211.118Slukemfollowing variables:
5221.118Slukem
5231.118SlukemTEXINFO		List of Texinfo source files.  Info documentation will
5241.118Slukem		consist of single files with the extension replaced by
5251.118Slukem		.info.
5261.118Slukem
5271.118SlukemINFOFLAGS	Flags to pass to makeinfo.  []
5281.118Slukem
5291.118Slukem
5301.118Slukem=-=-=-=-=   bsd.kernobj.mk   =-=-=-=-=
5311.118Slukem
5321.118SlukemThe include file <bsd.kernobj.mk> defines variables related to the
5331.118Slukemlocation of kernel sources and object directories.
5341.118Slukem
5351.118SlukemKERNSRCDIR	Is the location of the top of the kernel src.
5361.124Slukem		[${_SRC_TOP_}/sys]
5371.118Slukem
5381.124SlukemKERNARCHDIR	Is the location of the machine dependent kernel sources.
5391.124Slukem		[arch/${MACHINE}]
5401.120Slukem
5411.124SlukemKERNCONFDIR	Is where the configuration files for kernels are found.
5421.124Slukem		[${KERNSRCDIR}/${KERNARCHDIR}/conf]
5431.118Slukem
5441.118SlukemKERNOBJDIR	Is the kernel build directory.  The kernel GENERIC for
5451.118Slukem		instance will be compiled in ${KERNOBJDIR}/GENERIC.
5461.118Slukem		The default value is
5471.118Slukem		${MAKEOBJDIRPREFIX}${KERNSRCDIR}/${KERNARCHDIR}/compile
5481.118Slukem		if it exists or the target 'obj' is being made.
5491.118Slukem		Otherwise the default is
5501.118Slukem		${KERNSRCDIR}/${KERNARCHDIR}/compile.
5511.118Slukem
5521.118SlukemIt is important that Makefiles (such as those under src/distrib) that
5531.134Slukemwish to find compiled kernels use <bsd.kernobj.mk> and ${KERNOBJDIR}
5541.118Slukemrather than make assumptions about the location of the compiled kernel.
5551.118Slukem
5561.118Slukem
5571.118Slukem=-=-=-=-=   bsd.kinc.mk   =-=-=-=-=
5581.118Slukem
5591.118SlukemThe include file <bsd.kinc.mk> defines the many targets (includes,
5601.118Slukemsubdirectories, etc.), and is used by kernel makefiles to handle
5611.118Slukeminclude file installation.  It is intended to be included alone, by
5621.134Slukemkernel Makefiles.  It uses similar variables to <bsd.inc.mk>.
5631.134SlukemPlease see <bsd.kinc.mk> for more details, and keep the documentation
5641.134Slukemin that file up to date.
5651.118Slukem
5661.118Slukem
5671.118Slukem=-=-=-=-=   bsd.lib.mk   =-=-=-=-=
5681.118Slukem
5691.118SlukemThe include file <bsd.lib.mk> has support for building libraries.  It has
5701.118Slukemthe same eight targets as <bsd.prog.mk>: all, clean, cleandir, depend,
5711.118Slukemincludes, install, lint, and tags.  Additionally, it has a checkver target
5721.118Slukemwhich checks for installed shared object libraries whose version is greater
5731.118Slukemthat the version of the source. It has a limited number of suffixes,
5741.134Slukemconsistent with the current needs of the BSD tree.  <bsd.lib.mk> includes
5751.118Slukem<bsd.shlib.mk> to get shared library parameters.
5761.118Slukem
5771.118SlukemIt sets/uses the following variables:
5781.118Slukem
5791.118SlukemLIB		The name of the library to build.
5801.118Slukem
5811.118SlukemLIBDIR		Target directory for libraries.
5821.118Slukem
5831.118SlukemSHLIBINSTALLDIR	Target directory for shared libraries if ${USE_SHLIBDIR}
5841.118Slukem		is "yes".
5851.118Slukem
5861.118SlukemUSE_SHLIBDIR	If "yes", use ${SHLIBINSTALLDIR} instead of ${LIBDIR}
5871.118Slukem		as the path to install shared libraries to.
5881.118Slukem		USE_SHLIBDIR must be defined before <bsd.own.mk> is included.
5891.130Slukem		Default: no
5901.118Slukem
5911.118SlukemLINTLIBDIR	Target directory for lint libraries.
5921.118Slukem
5931.118SlukemLIBGRP		Library group.
5941.118Slukem
5951.118SlukemLIBOWN		Library owner.
5961.118Slukem
5971.118SlukemLIBMODE		Library mode.
5981.118Slukem
5991.118SlukemLDADD		Additional loader objects.
6001.118Slukem
6011.118SlukemMAN		The manual pages to be installed (use a .1 - .9 suffix).
6021.118Slukem
6031.118SlukemNOCHECKVER_<library>
6041.118SlukemNOCHECKVER	If set, disables checking for installed shared object
6051.118Slukem		libraries with versions greater than the source.  A
6061.118Slukem		particular library name, without the "lib" prefix, may
6071.118Slukem		be appended to the variable name to disable the check for
6081.118Slukem		only that library.
6091.118Slukem
6101.118SlukemSRCS		List of source files to build the library.  Suffix types
6111.118Slukem		.s, .c, and .f are supported.  Note, .s files are preferred
6121.118Slukem		to .c files of the same name.  (This is not the default for
6131.118Slukem		versions of make.)
6141.118Slukem
6151.118SlukemThe include file <bsd.lib.mk> includes the file named "../Makefile.inc"
6161.118Slukemif it exists, as well as the include file <bsd.man.mk>.
6171.118Slukem
6181.118SlukemIt has rules for building profiled objects; profiled libraries are
6191.118Slukembuilt by default.
6201.118Slukem
6211.118SlukemLibraries are ranlib'd when made.
6221.118Slukem
6231.118Slukem
6241.118Slukem=-=-=-=-=   bsd.links.mk   =-=-=-=-=
6251.118Slukem
6261.118SlukemThe include file <bsd.links.mk> handles the LINKS and SYMLINKS variables
6271.134Slukemand is included from from <bsd.lib.mk> and <bsd.prog.mk>.
6281.134Slukem
6291.134SlukemLINKS		The list of hard links, consisting of pairs of paths:
6301.134Slukem			source-file target-file
6311.134Slukem		${DESTDIR} is prepended to both paths before linking.
6321.134Slukem		For example, to link /bin/test and /bin/[, use:
6331.134Slukem			LINKS=/bin/test /bin/[
6341.134Slukem
6351.134SlukemSYMLINKS	The list of symbolic links, consisting of pairs of paths:
6361.134Slukem			source-file target-file
6371.134Slukem		${DESTDIR} is only prepended to target-file before linking.
6381.134Slukem		For example, to symlink /usr/bin/tar to /bin/tar resulting
6391.134Slukem		in ${DESTDIR}/usr/bin/tar -> /bin/tar:
6401.134Slukem			SYMLINKS=/bin/tar /usr/bin/tar
6411.118Slukem
6421.118Slukem
6431.118Slukem=-=-=-=-=   bsd.man.mk   =-=-=-=-=
6441.118Slukem
6451.118SlukemThe include file <bsd.man.mk> handles installing manual pages and their
6461.118Slukemlinks.
6471.118Slukem
6481.118SlukemIt has a two targets:
6491.118Slukem
6501.118Slukem	maninstall:
6511.118Slukem		Install the manual page sources and their links.
6521.118Slukem	catinstall:
6531.118Slukem		Install the preformatted manual pages and their links.
6541.118Slukem
6551.118SlukemIt sets/uses the following variables:
6561.118Slukem
6571.118SlukemMANDIR		Base path for manual installation.
6581.118Slukem
6591.118SlukemMANGRP		Manual group.
6601.118Slukem
6611.118SlukemMANOWN		Manual owner.
6621.118Slukem
6631.118SlukemMANMODE		Manual mode.
6641.118Slukem
6651.118SlukemMANSUBDIR	Subdirectory under the manual page section, i.e. "/vax"
6661.118Slukem		or "/tahoe" for machine specific manual pages.
6671.118Slukem
6681.118SlukemMAN		The manual pages to be installed (use a .1 - .9 suffix).
6691.118Slukem
6701.118SlukemMLINKS		List of manual page links (using a .1 - .9 suffix).  The
6711.118Slukem		linked-to file must come first, the linked file second,
6721.118Slukem		and there may be multiple pairs.  The files are soft-linked.
6731.118Slukem
6741.118SlukemThe include file <bsd.man.mk> includes a file named "../Makefile.inc" if
6751.118Slukemit exists.
6761.118Slukem
6771.118Slukem
6781.118Slukem=-=-=-=-=   bsd.obj.mk   =-=-=-=-=
6791.118Slukem
6801.118SlukemThe include file <bsd.obj.mk> defines targets related to the creation
6811.118Slukemand use of separated object and source directories.
6821.118Slukem
6831.118SlukemIf an environment variable named MAKEOBJDIRPREFIX is set, make(1) uses
6841.118Slukem${MAKEOBJDIRPREFIX}${.CURDIR} as the name of the object directory if
6851.118Slukemit exists.  Otherwise make(1) looks for the existence of a
6861.118Slukemsubdirectory (or a symlink to a directory) of the source directory
6871.118Slukeminto which built targets should be placed.  If an environment variable
6881.118Slukemnamed MAKEOBJDIR is set, make(1) uses its value as the name of the
6891.118Slukemobject directory; failing that, make first looks for a subdirectory
6901.118Slukemnamed "obj.${MACHINE}", and if that doesn't exist, it looks for "obj".
6911.118Slukem
6921.118SlukemObject directories are not created automatically by make(1) if they
6931.118Slukemdon't exist; you need to run a separate "make obj".  (This will happen
6941.118Slukemduring a top-level build if "MKOBJDIRS" is set to a value other than
6951.118Slukem"no").  When the source directory is a subdirectory of ${BSDSRCDIR} --
6961.118Slukemand this is determined by a simple string prefix comparison -- object
6971.118Slukemdirectories are created in a separate object directory tree, and a
6981.118Slukemsymlink to the object directory in that tree is created in the source
6991.118Slukemdirectory; otherwise, "make obj" assumes that you're not in the main
7001.118Slukemsource tree and that it's not safe to use a separate object tree.
7011.118Slukem
7021.118SlukemSeveral variables used by <bsd.obj.mk> control exactly what
7031.118Slukemdirectories and links get created during a "make obj":
7041.118Slukem
7051.118SlukemMAKEOBJDIR	If set, this is the component name of the object
7061.118Slukem		directory.
7071.118Slukem
7081.118SlukemOBJMACHINE	If this is set but MAKEOBJDIR is not set, creates
7091.118Slukem		object directories or links named "obj.${MACHINE}";
7101.118Slukem		otherwise, just creates ones named "obj".
7111.118Slukem
7121.118SlukemUSR_OBJMACHINE  If set, and the current directory is a subdirectory of
7131.118Slukem		${BSDSRCDIR}, create object directory in the
7141.118Slukem		corresponding subdirectory of ${BSDOBJDIR}.${MACHINE};
7151.118Slukem		otherwise, create it in the corresponding subdirectory
7161.118Slukem		of ${BSDOBJDIR}
7171.113Sthorpej
7181.118SlukemBUILDID		If set, the contents of this variable are appended
7191.118Slukem		to the object directory name.  If OBJMACHINE is also
7201.118Slukem		set, ".${BUILDID}" is added after ".${MACHINE}".
7211.113Sthorpej
7221.106Sthorpej
7231.118Slukem=-=-=-=-=   bsd.prog.mk   =-=-=-=-=
7241.106Sthorpej
7251.1ScgdThe include file <bsd.prog.mk> handles building programs from one or
7261.1Scgdmore source files, along with their manual pages.  It has a limited number
7271.134Slukemof suffixes, consistent with the current needs of the BSD tree. 
7281.134Slukem<bsd.prog.mk> includes <bsd.shlib.mk> to get shared library parameters.
7291.1Scgd
7301.16SjtcIt has eight targets:
7311.1Scgd
7321.1Scgd	all:
7331.102Sthorpej		build the program and its manual page.  This also
7341.102Sthorpej		creates a GDB initialization file (.gdbinit) in
7351.102Sthorpej		the objdir.  The .gdbinit file sets the shared library
7361.102Sthorpej		prefix to ${DESTDIR} to facilitate cross-debugging.
7371.1Scgd	clean:
7381.1Scgd		remove the program, any object files and the files a.out,
7391.24Smikel		Errs, errs, mklog, and ${PROG}.core.
7401.1Scgd	cleandir:
7411.1Scgd		remove all of the files removed by the target clean, as
7421.1Scgd		well as .depend, tags, and any manual pages.
7431.42Slukem		`distclean' is a synonym for `cleandir'.
7441.1Scgd	depend:
7451.1Scgd		make the dependencies for the source files, and store
7461.1Scgd		them in the file .depend.
7471.16Sjtc	includes:
7481.16Sjtc		install any header files.
7491.1Scgd	install:
7501.1Scgd		install the program and its manual pages; if the Makefile
7511.1Scgd		does not itself define the target install, the targets
7521.1Scgd		beforeinstall and afterinstall may also be used to cause
7531.1Scgd		actions immediately before and after the install target
7541.1Scgd		is executed.
7551.1Scgd	lint:
7561.1Scgd		run lint on the source files
7571.1Scgd	tags:
7581.1Scgd		create a tags file for the source files.
7591.1Scgd
7601.1ScgdIt sets/uses the following variables:
7611.1Scgd
7621.1ScgdBINGRP		Binary group.
7631.1Scgd
7641.1ScgdBINOWN		Binary owner.
7651.1Scgd
7661.1ScgdBINMODE		Binary mode.
7671.1Scgd
7681.1ScgdCLEANFILES	Additional files to remove for the clean and cleandir targets.
7691.1Scgd
7701.1ScgdCOPTS		Additional flags to the compiler when creating C objects.
7711.112Sthorpej
7721.125SlukemCOPTS.<fn>	Additional flags to the compiler when creating the
7731.125Slukem		C objects for <fn>.
7741.125Slukem		For <fn>.[ly], "<fn>.c" must be used.
7751.125Slukem
7761.112SthorpejCPUFLAGS	Additional flags to the compiler/assembler to select
7771.112Sthorpej		CPU instruction set options, CPU tuning options, etc.
7781.35Slukem
7791.125SlukemCPUFLAGS.<fn>	Additional flags to the compiler/assembler for <fn>.
7801.125Slukem		For <fn>.[ly], "<fn>.c" must be used.
7811.125Slukem
7821.124SlukemCPPFLAGS	Additional flags to the C pre-processor.
7831.125Slukem
7841.125SlukemCPPFLAGS.<fn>	Additional flags to the C pre-processor for <fn>.
7851.125Slukem		For <fn>.[ly], "<fn>.c" must be used.
7861.102Sthorpej
7871.102SthorpejGDBINIT		List of GDB initialization files to add to "source"
7881.102Sthorpej		directives in the .gdbinit file that is created in the
7891.102Sthorpej		objdir.
7901.1Scgd
7911.1ScgdLDADD		Additional loader objects.  Usually used for libraries.
7921.1Scgd		For example, to load with the compatibility and utility
7931.1Scgd		libraries, use:
7941.1Scgd
7951.5Sjtc			LDADD+=-lutil -lcompat
7961.1Scgd
7971.1ScgdLDFLAGS		Additional loader flags.
7981.1Scgd
7991.134SlukemLINKS		See <bsd.links.mk>
8001.134Slukem
8011.134SlukemSYMLINKS	See <bsd.links.mk>
8021.1Scgd
8031.15ScgdMAN		Manual pages (should end in .1 - .9).  If no MAN variable is
8041.8Scgd		defined, "MAN=${PROG}.1" is assumed.
8051.1Scgd
8061.1ScgdPROG		The name of the program to build.  If not supplied, nothing
8071.1Scgd		is built.
8081.1Scgd
8091.88SthorpejPROG_CXX	If defined, the name of the program to build.  Also
8101.88Sthorpej		causes <bsd.prog.mk> to link the program with the C++
8111.88Sthorpej		compiler rather than the C compiler.  PROG_CXX overrides
8121.88Sthorpej		the value of PROG if PROG is also set.
8131.87Sthorpej
8141.21SchristosPROGNAME	The name that the above program will be installed as, if
8151.21Schristos		different from ${PROG}.
8161.21Schristos
8171.37StvSRCS		List of source files to build the program.  If SRCS is not
8181.1Scgd		defined, it's assumed to be ${PROG}.c.
8191.108Sjwise
8201.108SjwiseDPSRCS		List of source files which are needed for generating
8211.108Sjwise		dependencies, but are not needed in ${SRCS}.
8221.1Scgd
8231.1ScgdDPADD		Additional dependencies for the program.  Usually used for
8241.1Scgd		libraries.  For example, to depend on the compatibility and
8251.1Scgd		utility libraries use:
8261.1Scgd
8271.5Sjtc			DPADD+=${LIBCOMPAT} ${LIBUTIL}
8281.1Scgd
8291.1Scgd		The following libraries are predefined for DPADD:
8301.1Scgd
8311.21Schristos		LIBCRT0?=	${DESTDIR}/usr/lib/crt0.o
8321.99Sitojun		LIBBZ2?=	${DESTDIR}/usr/lib/libbz2.a
8331.21Schristos		LIBC?=		${DESTDIR}/usr/lib/libc.a
8341.21Schristos		LIBC_PIC?=	${DESTDIR}/usr/lib/libc_pic.a
8351.99Sitojun		LIBCDK?=	${DESTDIR}/usr/lib/libcdk.a
8361.99Sitojun		LIBCOM_ERR?=	${DESTDIR}/usr/lib/libcom_err.a
8371.21Schristos		LIBCOMPAT?=	${DESTDIR}/usr/lib/libcompat.a
8381.21Schristos		LIBCRYPT?=	${DESTDIR}/usr/lib/libcrypt.a
8391.99Sitojun		LIBCRYPTO?=	${DESTDIR}/usr/lib/libcrypto.a
8401.99Sitojun		LIBCRYPTO_IDEA?=${DESTDIR}/usr/lib/libcrypto_idea.a
8411.105Sitojun		LIBCRYPTO_MDC2?=${DESTDIR}/usr/lib/libcrypto_mdc2.a
8421.99Sitojun		LIBCRYPTO_RC5?=	${DESTDIR}/usr/lib/libcrypto_rc5.a
8431.21Schristos		LIBCURSES?=	${DESTDIR}/usr/lib/libcurses.a
8441.21Schristos		LIBDBM?=	${DESTDIR}/usr/lib/libdbm.a
8451.21Schristos		LIBDES?=	${DESTDIR}/usr/lib/libdes.a
8461.21Schristos		LIBEDIT?=	${DESTDIR}/usr/lib/libedit.a
8471.114Sprovos		LIBEVENT?=	${DESTDIR}/usr/lib/libevent.a
8481.73Sblymn		LIBFORM?=	${DESTDIR}/usr/lib/libform.a
8491.21Schristos		LIBGCC?=	${DESTDIR}/usr/lib/libgcc.a
8501.21Schristos		LIBGNUMALLOC?=	${DESTDIR}/usr/lib/libgnumalloc.a
8511.99Sitojun		LIBGSSAPI?=	${DESTDIR}/usr/lib/libgssapi.a
8521.99Sitojun		LIBHDB?=	${DESTDIR}/usr/lib/libhdb.a
8531.70Sitojun		LIBINTL?=	${DESTDIR}/usr/lib/libintl.a
8541.49Sitojun		LIBIPSEC?=	${DESTDIR}/usr/lib/libipsec.a
8551.99Sitojun		LIBKADM?=	${DESTDIR}/usr/lib/libkadm.a
8561.99Sitojun		LIBKADM5CLNT?=	${DESTDIR}/usr/lib/libkadm5clnt.a
8571.99Sitojun		LIBKADM5SRV?=	${DESTDIR}/usr/lib/libkadm5srv.a
8581.99Sitojun		LIBKAFS?=	${DESTDIR}/usr/lib/libkafs.a
8591.21Schristos		LIBKDB?=	${DESTDIR}/usr/lib/libkdb.a
8601.21Schristos		LIBKRB?=	${DESTDIR}/usr/lib/libkrb.a
8611.99Sitojun		LIBKRB5?=	${DESTDIR}/usr/lib/libkrb5.a
8621.99Sitojun		LIBKSTREAM?=	${DESTDIR}/usr/lib/libkstream.a
8631.21Schristos		LIBKVM?=	${DESTDIR}/usr/lib/libkvm.a
8641.21Schristos		LIBL?=		${DESTDIR}/usr/lib/libl.a
8651.21Schristos		LIBM?=		${DESTDIR}/usr/lib/libm.a
8661.53Sblymn		LIBMENU?=	${DESTDIR}/usr/lib/libmenu.a
8671.21Schristos		LIBMP?=		${DESTDIR}/usr/lib/libmp.a
8681.25Schristos		LIBNTP?=	${DESTDIR}/usr/lib/libntp.a
8691.99Sitojun		LIBOBJC?=	${DESTDIR}/usr/lib/libobjc.a
8701.99Sitojun		LIBOSSAUDIO?=	${DESTDIR}/usr/lib/libossaudio.a
8711.21Schristos		LIBPC?=		${DESTDIR}/usr/lib/libpc.a
8721.21Schristos		LIBPCAP?=	${DESTDIR}/usr/lib/libpcap.a
8731.99Sitojun		LIBPCI?=	${DESTDIR}/usr/lib/libpci.a
8741.21Schristos		LIBPLOT?=	${DESTDIR}/usr/lib/libplot.a
8751.100Sthorpej		LIBPMC?=	${DESTDIR}/usr/lib/libpmc.a
8761.26Skleink		LIBPOSIX?=	${DESTDIR}/usr/lib/libposix.a
8771.110Sthorpej		LIBPTHREAD?=	${DESTDIR}/usr/lib/libpthread.a
8781.110Sthorpej		LIBPTHREAD_DBG?=${DESTDIR}/usr/lib/libpthread_dbg.a
8791.21Schristos		LIBRESOLV?=	${DESTDIR}/usr/lib/libresolv.a
8801.99Sitojun		LIBRMT?=	${DESTDIR}/usr/lib/librmt.a
8811.99Sitojun		LIBROKEN?=	${DESTDIR}/usr/lib/libroken.a
8821.21Schristos		LIBRPCSVC?=	${DESTDIR}/usr/lib/librpcsvc.a
8831.110Sthorpej		LIBRT?=		${DESTDIR}/usr/lib/librt.a
8841.21Schristos		LIBSKEY?=	${DESTDIR}/usr/lib/libskey.a
8851.99Sitojun		LIBSS?=		${DESTDIR}/usr/lib/libss.a
8861.99Sitojun		LIBSSL?=	${DESTDIR}/usr/lib/libssl.a
8871.99Sitojun		LIBSKEY?=	${DESTDIR}/usr/lib/libskey.a
8881.99Sitojun		LIBSL?=		${DESTDIR}/usr/lib/libsl.a
8891.21Schristos		LIBTERMCAP?=	${DESTDIR}/usr/lib/libtermcap.a
8901.99Sitojun		LIBUSBHID?=	${DESTDIR}/usr/lib/libusbhid.a
8911.21Schristos		LIBUTIL?=	${DESTDIR}/usr/lib/libutil.a
8921.21Schristos		LIBWRAP?=	${DESTDIR}/usr/lib/libwrap.a
8931.21Schristos		LIBY?=		${DESTDIR}/usr/lib/liby.a
8941.21Schristos		LIBZ?=		${DESTDIR}/usr/lib/libz.a
8951.1Scgd
8961.1ScgdSHAREDSTRINGS	If defined, a new .c.o rule is used that results in shared
8971.12Schristos		strings, using xstr(1). Note that this will not work with
8981.12Schristos		parallel makes.
8991.1Scgd
9001.59SjlamSTRIPFLAG	The flag passed to the install program to cause the binary
9011.1Scgd		to be stripped.
9021.1Scgd
9031.1ScgdSUBDIR		A list of subdirectories that should be built as well.
9041.1Scgd		Each of the targets will execute the same target in the
9051.1Scgd		subdirectories.
9061.1Scgd
9071.21SchristosSCRIPTS		A list of interpreter scripts [file.{sh,csh,pl,awk,...}].
9081.21Schristos		These are installed exactly like programs.
9091.21Schristos
9101.21SchristosSCRIPTSNAME	The name that the above program will be installed as, if
9111.21Schristos		different from ${SCRIPTS}. These can be further specialized
9121.21Schristos		by setting SCRIPTSNAME_<script>.
9131.21Schristos
9141.124SlukemFILES		See description of <bsd.files.mk>.
9151.21Schristos
9161.106SthorpejSHLINKDIR	Target directory for shared linker.  See description of
9171.106Sthorpej		<bsd.own.mk> for additional information about this variable.
9181.130Slukem
9191.130SlukemUSE_LIBSTDCXX	If "no", the support libraries needed for C++ programs
9201.130Slukem		are set to `-lsupc++ -lm', rather than `-lstdc++ -lm'.
9211.130Slukem		Default: yes
9221.85Slukem
9231.1ScgdThe include file <bsd.prog.mk> includes the file named "../Makefile.inc"
9241.1Scgdif it exists, as well as the include file <bsd.man.mk>.
9251.1Scgd
9261.1ScgdSome simple examples:
9271.1Scgd
9281.1ScgdTo build foo from foo.c with a manual page foo.1, use:
9291.1Scgd
9301.1Scgd	PROG=	foo
9311.1Scgd
9321.1Scgd	.include <bsd.prog.mk>
9331.1Scgd
9341.1ScgdTo build foo from foo.c with a manual page foo.2, add the line:
9351.1Scgd
9361.9Scgd	MAN=	foo.2
9371.1Scgd
9381.1ScgdIf foo does not have a manual page at all, add the line:
9391.1Scgd
9401.75Sagc	MKMAN=	no
9411.1Scgd
9421.1ScgdIf foo has multiple source files, add the line:
9431.1Scgd
9441.1Scgd	SRCS=	a.c b.c c.c d.c
9451.1Scgd
9461.1Scgd
9471.118Slukem=-=-=-=-=   bsd.rpc.mk   =-=-=-=-=
9481.118Slukem
9491.118SlukemThe include file <bsd.rpc.mk> contains a makefile fragment used to
9501.118Slukemconstruct source files built by rpcgen.
9511.72Ssommerfe
9521.118SlukemThe following macros may be defined in makefiles which include
9531.118Slukem<bsd.rpc.mk> in order to control which files get built and how they
9541.118Slukemare to be built:
9551.21Schristos
9561.118SlukemRPC_INCS:	construct .h file from .x file
9571.120SlukemRPC_XDRFILES:	construct _xdr.c from .x file
9581.118Slukem		(for marshalling/unmarshalling data types)
9591.118SlukemRPC_SVCFILES:	construct _svc.c from .x file
9601.118Slukem		(server-side stubs)
9611.118SlukemRPC_SVCFLAGS:	Additional flags passed to builds of RPC_SVCFILES.
9621.21Schristos
9631.118SlukemRPC_XDIR:	Directory containing .x/.h files
9641.23Schristos
9651.23Schristos
9661.118Slukem=-=-=-=-=   bsd.shlib.mk   =-=-=-=-=
9671.21Schristos
9681.118SlukemThe include file <bsd.shlib.mk> computes parameters for shared library
9691.118Slukeminstallation and use.  It defines no targets.  <bsd.own.mk> MUST be
9701.134Slukemincluded before <bsd.shlib.mk>.
9711.21Schristos
9721.134Slukem<bsd.own.mk> sets the following variables, if they are not already defined
9731.118Slukem(defaults are in brackets):
9741.21Schristos
9751.118SlukemSHLIBINSTALLDIR	If ${USE_SHLIBDIR} is "yes", use ${SHLIBINSTALLDIR} instead of
9761.118Slukem		${LIBDIR} as the base path for shared library installation.
9771.118Slukem		[/lib]
9781.21Schristos
9791.118SlukemSHLIBDIR	The path to USE_SHLIBDIR shared libraries to use when building
9801.118Slukem		a program.  [/lib for programs in /bin and /sbin, /usr/lib
9811.118Slukem		for all others.]
9821.81Swiz
9831.118Slukem_LIBSODIR	Set to ${SHLIBINSTALLDIR} if ${USE_SHLIBDIR} is "yes",
9841.118Slukem		otherwise set to ${LIBDIR}
9851.81Swiz
9861.118SlukemSHLINKINSTALLDIR Base path for shared linker.  [/libexec]
9871.39Scgd
9881.118SlukemSHLINKDIR	Path to use for shared linker when building a program.
9891.118Slukem		[/libexec for programs in /bin and /sbin, /usr/libexec for
9901.118Slukem		all others.]
9911.39Scgd
9921.13Schristos
9931.118Slukem=-=-=-=-=   bsd.subdir.mk   =-=-=-=-=
9941.13Schristos
9951.118SlukemThe include file <bsd.subdir.mk> contains the default targets for building
9961.120Slukemsubdirectories.  It has the same eight targets as <bsd.prog.mk>: all,
9971.118Slukemclean, cleandir, depend, includes, install, lint, and tags.  For all of
9981.120Slukemthe directories listed in the variable SUBDIR, the specified directory
9991.118Slukemwill be visited and the target made.  There is also a default target which
10001.118Slukemallows the command "make subdir" where subdir is any directory listed in
10011.118Slukemthe variable SUBDIR.
10021.47Stv
10031.118SlukemAs a special case, the use of a token .WAIT as an entry in SUBDIR acts
10041.118Slukemas a synchronization barrier when multiple make jobs are run; subdirs
10051.118Slukembefore the .WAIT must complete before any subdirs after .WAIT are
10061.118Slukemstarted.  See make(1) for some caveats on use of .WAIT and other
10071.118Slukemspecial sources.
10081.47Stv
10091.47Stv
10101.118Slukem=-=-=-=-=   bsd.sys.mk   =-=-=-=-=
10111.47Stv
10121.13SchristosThe include file <bsd.sys.mk> is used by <bsd.prog.mk> and
10131.14Scgd<bsd.lib.mk>.  It contains overrides that are used when building
10141.133Slukemthe NetBSD source tree.
10151.133Slukem
10161.133SlukemThe following variables control how various files are compiled/built.
10171.133Slukem(Note that these may be overridden in <bsd.own.mk> if USETOOLS=yes):
10181.133Slukem
10191.133SlukemAR		Create, modify, and extract from archives.  [ar]
10201.133Slukem
10211.133SlukemARFLAGS		Options to ${AR}.  [rl]
10221.133Slukem
10231.133SlukemCC		C compiler.  [cc]
10241.133Slukem
10251.133SlukemCFLAGS		Options to ${CC}.  [Usually -O or -O2]
10261.133Slukem
10271.133SlukemCPP		C Pre-Processor.  [cpp]
10281.133Slukem
10291.133SlukemCPPFLAGS	Options to ${CPP}.  []
10301.133Slukem
10311.133SlukemCPUFLAGS	Optimization flags for ${CC}
10321.133Slukem
10331.133SlukemCXX		C++ compiler.  [c++]
10341.133Slukem
10351.133SlukemCXXFLAGS	Options to ${CXX}.  [${CFLAGS}]
10361.133Slukem
10371.133SlukemELF2ECOFF	Convert ELF-format executable to ECOFF.  [elf2ecoff]
10381.133Slukem
10391.133SlukemFC		Fortran compiler.  [f77]
10401.133Slukem
10411.133SlukemFFLAGS		Options to {$FC}.  [-O]
10421.133Slukem
10431.133SlukemINSTALL		install(1) command.  [install]
10441.133Slukem
10451.133SlukemLEX		Lexical analyzer.  [lex]
10461.133Slukem
10471.133SlukemLFLAGS		Options to ${LEX}.  []
10481.133Slukem
10491.133SlukemLD		Linker.  [ld]
10501.133Slukem
10511.133SlukemLDFLAGS		Options to ${LD}.  []
10521.133Slukem
10531.133SlukemLINT		C program verifier.  [lint]
10541.133Slukem
10551.133SlukemLINTFLAGS	Options to ${LINT}.  [-chapbxzF]
10561.133Slukem
10571.133SlukemLORDER		List dependencies for object files.  [lorder]
10581.133Slukem
10591.133SlukemMAKE		make(1).  [make]
10601.133Slukem
10611.133SlukemMKDEP		Construct Makefile dependency list.  [mkdep]
10621.133Slukem
10631.133SlukemNM		List symbols from object files.  [nm]
10641.133Slukem
10651.133SlukemPC		Pascal compiler.  [pc]  (Not present)
10661.133Slukem
10671.133SlukemPFLAGS		Options to ${PC}.  []
10681.133Slukem
10691.133SlukemOBJC		Objective C compiler.  [${CC}]
10701.133Slukem
10711.133SlukemOBJCFLAGS	Options to ${OBJC}.  [${CFLAGS}]
10721.133Slukem
10731.133SlukemOBJCOPY		Copy and translate object files.  [objcopy]
10741.133Slukem
10751.133SlukemRANLIB		Generate index to archive.  [ranlib]
10761.133Slukem
10771.133SlukemSHELL		Shell.  [sh]
10781.133Slukem
10791.133SlukemSIZE		List section sizes and total size.  [size]
10801.133Slukem
10811.133SlukemSTRIP		Discard symbols from object files.  [strip]
10821.133Slukem
10831.133SlukemTSORT		Topological sort of a directed graph.  [tsort -q]
10841.133Slukem
10851.133SlukemYACC		LALR(1) parser generator.  [yacc]
10861.133Slukem
10871.133SlukemYFLAGS		Options to ${YACC}.  []
10881.133Slukem
10891.133SlukemYHEADER		If defined, add "-d" to YFLAGS, and add dependencies
10901.133Slukem		from <file>.y to <file>.h and <file>.c, and add
10911.133Slukem		<foo>.h to CLEANFILES.
10921.133Slukem
10931.133SlukemYPREFIX		If defined, add "-p ${YPREFIX}" to YFLAGS.
10941.133Slukem
10951.116Slukem
10961.116SlukemThe following variables are defined to commands to perform the
10971.116Slukemappropriate operation, with the default in [brackets].
10981.116Slukem(Note that these are overridden in <bsd.own.mk> if USETOOLS=yes):
10991.116Slukem
11001.116SlukemTOOL_ASN1_COMPILE	ASN1 compiler.  [asn1_compile]
11011.116Slukem
11021.116SlukemTOOL_CAP_MKDB		Create capability database.  [cap_mkdb]
11031.116Slukem
11041.116SlukemTOOL_CAT		Concatenate and print files.  [cat]
11051.116Slukem
11061.116SlukemTOOL_CKSUM		Display file checksums.  [cksum]
11071.116Slukem
11081.116SlukemTOOL_COMPILE_ET		Error table compiler.  [compile_et]
11091.116Slukem
11101.116SlukemTOOL_CONFIG		Build kernel compilation directories.  [config]
11111.116Slukem
11121.116SlukemTOOL_CRUNCHGEN		Generate crunched binary build environment.  [crunchgen]
11131.116Slukem
11141.116SlukemTOOL_CTAGS		Create a tags file.  [ctags]
11151.116Slukem
11161.116SlukemTOOL_DB			Manipulate db(3) databases.  [db]
11171.116Slukem
11181.116SlukemTOOL_EQN		Format equations for groff.  [eqn]
11191.116Slukem
11201.116SlukemTOOL_FGEN		IEEE 1275 Open Firmware FCode Tokenizer.  [fgen]
11211.116Slukem
11221.116SlukemTOOL_GENCAT		Generate NLS message catalogs.  [gencat]
11231.116Slukem
11241.116SlukemTOOL_GROFF		Front end for groff document formatting system.  [groff]
11251.116Slukem
11261.116SlukemTOOL_HEXDUMP		Ascii, decimal, hexadecimal, octal dump.  [hexdump]
11271.116Slukem
11281.116SlukemTOOL_INDXBIB		Make bibliographic database's inverted index.  [indxbib]
11291.116Slukem
11301.116SlukemTOOL_INSTALLBOOT	Install disk bootstrap software.  [installboot]
11311.116Slukem
11321.116SlukemTOOL_INSTALL_INFO	Update info/dir entries.  [install-info]
11331.116Slukem
11341.116SlukemTOOL_M4			M4 macro language processor.  [m4]
11351.116Slukem
11361.116SlukemTOOL_MAKEFS		Create file system image from directory tree.  [makefs]
11371.116Slukem
11381.116SlukemTOOL_MAKEINFO		Translate Texinfo documents.  [makeinfo]
11391.116Slukem
11401.116SlukemTOOL_MAKEWHATIS		Create a whatis.db database.  [makewhatis]
11411.116Slukem
11421.116SlukemTOOL_MDSETIMAGE		Set kernel RAM disk image.  [mdsetimage]
11431.116Slukem
11441.116SlukemTOOL_MENUC		Menu compiler.  [menuc]
11451.116Slukem
11461.116SlukemTOOL_MKCSMAPPER		Make charset mapping table.  [mkcsmapper]
11471.116Slukem
11481.116SlukemTOOL_MKESDB		Make encoding scheme database.  [mkesdb]
11491.116Slukem
11501.116SlukemTOOL_MKLOCALE		Make LC_CTYPE locale files.  [mklocale]
11511.116Slukem
11521.116SlukemTOOL_MKMAGIC		Create database for file(1).  [file]
11531.116Slukem
11541.116SlukemTOOL_MKTEMP		Make (unique) temporary file name.  [mktemp]
11551.116Slukem
11561.116SlukemTOOL_MSGC		Simple message list compiler.  [msgc]
11571.116Slukem
11581.116SlukemTOOL_MTREE		Map a directory hierarchy.  [mtree]
11591.116Slukem
11601.116SlukemTOOL_PAX		Manipulate file archives and copy directories.  [pax]
11611.116Slukem
11621.116SlukemTOOL_PIC		Compile pictures for groff.  [pic]
11631.116Slukem
11641.116SlukemTOOL_PREPMKBOOTIMAGE	prep-mkbootimage (XXXBUILDSH).  [prep-mkbootimage]
11651.116Slukem
11661.116SlukemTOOL_PWD_MKDB		Generate the password databases.  [pwd_mkdb]
11671.116Slukem
11681.116SlukemTOOL_REFER		Preprocess bibliographic references for groff.  [refer]
11691.116Slukem
11701.116SlukemTOOL_ROFF_ASCII		Generate ASCII groff output.  [nroff]
11711.116Slukem
11721.116SlukemTOOL_ROFF_DVI		Generate DVI groff output.  [${TOOL_GROFF} -Tdvi]
11731.116Slukem
11741.116SlukemTOOL_ROFF_HTML		Generate HTML groff output.
11751.119Slukem			[${TOOL_GROFF} -Tlatin1 -mdoc2html]
11761.116Slukem
11771.116SlukemTOOL_ROFF_PS		Generate PS groff output.  [${TOOL_GROFF} -Tps]
11781.116Slukem
11791.116SlukemTOOL_ROFF_RAW		Generate "raw" groff output.  [${TOOL_GROFF} -Z]
11801.116Slukem
11811.116SlukemTOOL_RPCGEN		Remote Procedure Call (RPC) protocol compiler.  [rpcgen]
11821.116Slukem
11831.116SlukemTOOL_SOELIM		Eliminate .so's from groff input.  [soelim]
11841.123Slukem
11851.123SlukemTOOL_STAT		Display file status.  [stat]
11861.116Slukem
11871.116SlukemTOOL_SUNLABEL		Read or modify a SunOS disk label.  [sunlabel]
11881.116Slukem
11891.116SlukemTOOL_TBL		Format tables for groff.  [tbl]
11901.116Slukem
11911.116SlukemTOOL_UUDECODE		Uudecode a binary file.  [uudecode]
11921.116Slukem
11931.116SlukemTOOL_VGRIND		Grind nice listings of programs.  [vgrind -f]
11941.116Slukem
11951.116SlukemTOOL_ZIC		Time zone compiler.  [zic]
11961.116Slukem
11971.69Ssommerfe
11981.69SsommerfeOther variables of note (incomplete list):
11991.69Ssommerfe
12001.82SlukemWARNS		Crank up gcc warning options; the distinct levels are:
12011.82Slukem			WARNS=1
12021.82Slukem			WARNS=2
12031.82Slukem			WARNS=3
12041.69Ssommerfe
12051.69SsommerfeFORMAT_AUDIT	If FORMAT_AUDIT is set, and WFORMAT is set and > 1, turn on
12061.69SsommerfeWFORMAT 	-Wnetbsd-format-audit for extra-stringent format checking.
12071.75Sagc		WFORMAT belongs in individual makefiles and/or
12081.75Sagc		Makefile.inc files.  (set WFORMAT=1 in individual
12091.75Sagc		makefiles if a program is not security critical and is
12101.75Sagc		doing bizarre things with format strings which would
12111.75Sagc		be even uglier if rewritten) FORMAT_AUDIT should go in
12121.120Slukem		mk.conf if you're doing format-string auditing.
12131.69Ssommerfe		FORMAT_AUDIT may go away in time.
12141.30Sagc
12151.30Sagc=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
1216