bsd.README revision 1.116
11.116Slukem#	$NetBSD: bsd.README,v 1.116 2003/07/10 10:34:35 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.97SitojunMKxxx		Can be set to `no' by a user to disable functionality.
651.97Sitojun		Defaults to `yes' (or usually does)
661.97Sitojun
671.116SlukemNOxxx		If defined, disables a feature.
681.116Slukem		Not intended for users.
691.116Slukem		This is to allow Makefiles to disable functionality
701.116Slukem		that they don't support (such as missing man pages).
711.101Slukem		NOxxx variables must be defined before <bsd.own.mk>
721.101Slukem		is included.
731.21Schristos
741.45SlukemThe following variables that control how things are made/installed that
751.47Stvare not set by default. These should not be set by Makefiles; they're for
761.47Stvthe user to define in MAKECONF (see bsd.own.mk, below) or on the make(1)
771.47Stvcommand line:
781.21Schristos
791.45SlukemBUILD 		If defined, 'make install' checks that the targets in the
801.45Slukem		source directories are up-to-date and remakes them if they
811.21Schristos                are out of date, instead of blindly trying to install
821.79Swiz                out of date or non-existent targets.
831.21Schristos
841.45SlukemUPDATE 		If defined, 'make install' only installs targets that are
851.45Slukem		more recently modified in the source directories that their
861.45Slukem		installed counterparts.
871.52Ssimonb
881.83SperryUNPRIVED	If defined, don't set the owner/group/mode when installing
891.83Sperry		files or directories, and keep a metadata log of what
901.83Sperry		the owner/group/mode should be.  This allows a
911.83Sperry		non-root "make install".
921.45Slukem
931.86SthorpejMKBFD		If "no", don't build libbfd, libiberty, or any of
941.86Sthorpej		the things that depend on them (binutils/gas/ld,
951.103Sthorpej		gdb, dbsym, mdsetimage).
961.86Sthorpej
971.45SlukemMKCATPAGES	If "no", don't build or install the catman pages.
981.45Slukem
991.45SlukemMKDOC		If "no", don't build or install the documentation.
1001.86Sthorpej
1011.104SlukemMKDYNAMICROOT	If "no", build programs in /bin and /sbin statically,
1021.104Slukem		don't install certain libraries in /lib, and don't
1031.104Slukem		install the shared linker into /libexec.
1041.104Slukem
1051.103SthorpejMKGDB		If "no", don't build gdb.
1061.86Sthorpej
1071.86SthorpejMKGCC		If "no", don't build gcc or any of the gcc-related
1081.86Sthorpej		libraries (libg2c, libgcc, libobjc, libstdc++).
1091.92Sross
1101.92SrossMKIEEEFP	If "no", don't add code for IEEE754/IEC60559 conformance.
1111.92Sross		Has no effect on most platforms.
1121.45Slukem
1131.47StvMKINFO		If "no", don't build or install Info documentation from
1141.47Stv		Texinfo source files.
1151.45Slukem
1161.45SlukemMKLINT		If "no", don't build or install the lint libraries.
1171.45Slukem
1181.45SlukemMKMAN		If "no", don't build or install the man or catman pages.
1191.46Slukem		Also acts as "MKCATPAGES=no"
1201.45Slukem
1211.74SitojunMKNLS		If "no", don't build or install the NLS files and locale
1221.74Sitojun		definition files.
1231.45Slukem
1241.55SsommerfeMKOBJ		If "no", don't enable the rule which creates objdirs.
1251.55Ssommerfe		"yes" by default.
1261.55Ssommerfe
1271.55SsommerfeMKOBJDIRS	If "no", don't create objdirs during a "make build".
1281.55Ssommerfe		"no" by default.
1291.45Slukem
1301.45SlukemMKPIC		If "no", don't build or install shared libraries.
1311.45Slukem
1321.45SlukemMKPICINSTALL	If "no", don't install the *_pic.a libraries.
1331.45Slukem
1341.45SlukemMKPROFILE	If "no", don't build or install the profiling libraries.
1351.45Slukem
1361.48SlukemMKSHARE		If "no", act as "MKCATPAGES=no MKDOC=no MKINFO=no MKMAN=no
1371.48Slukem		MKNLS=no".  I.e, don't build catman pages, documentation,
1381.48Slukem		Info documentation, man pages, NLS files, ...
1391.1Scgd
1401.1Scgd=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
1411.1Scgd
1421.1ScgdThe include file <sys.mk> has the default rules for all makes, in the BSD
1431.1Scgdenvironment or otherwise.  You probably don't want to touch this file.
1441.71SitojunIf you intend to run a cross build, you will need to supply the following
1451.71Sitojunhost tools, and configure the following variables properly:
1461.71Sitojun
1471.71SitojunOBJCOPY		objcopy - copy and translate object files
1481.71Sitojun
1491.71SitojunSTRIP		strip - Discard symbols from object files
1501.71Sitojun
1511.1Scgd=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
1521.1Scgd
1531.1ScgdThe include file <bsd.man.mk> handles installing manual pages and their
1541.1Scgdlinks.
1551.1Scgd
1561.21SchristosIt has a two targets:
1571.1Scgd
1581.1Scgd	maninstall:
1591.21Schristos		Install the manual page sources and their links.
1601.21Schristos	catinstall:
1611.21Schristos		Install the preformatted manual pages and their links.
1621.1Scgd
1631.1ScgdIt sets/uses the following variables:
1641.1Scgd
1651.1ScgdMANDIR		Base path for manual installation.
1661.1Scgd
1671.1ScgdMANGRP		Manual group.
1681.1Scgd
1691.1ScgdMANOWN		Manual owner.
1701.1Scgd
1711.1ScgdMANMODE		Manual mode.
1721.1Scgd
1731.1ScgdMANSUBDIR	Subdirectory under the manual page section, i.e. "/vax"
1741.1Scgd		or "/tahoe" for machine specific manual pages.
1751.1Scgd
1761.15ScgdMAN		The manual pages to be installed (use a .1 - .9 suffix).
1771.1Scgd
1781.15ScgdMLINKS		List of manual page links (using a .1 - .9 suffix).  The
1791.1Scgd		linked-to file must come first, the linked file second,
1801.1Scgd		and there may be multiple pairs.  The files are soft-linked.
1811.1Scgd
1821.1ScgdThe include file <bsd.man.mk> includes a file named "../Makefile.inc" if
1831.1Scgdit exists.
1841.1Scgd
1851.1Scgd=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
1861.1Scgd
1871.17SthorpejThe include file <bsd.own.mk> contains source tree configuration parameters,
1881.17Sthorpejsuch as the owners, groups, etc. for both manual pages and binaries, and
1891.17Sthorpeja few global "feature configuration" parameters.
1901.1Scgd
1911.1ScgdIt has no targets.
1921.1Scgd
1931.29ScjsTo get system-specific configuration parameters, bsd.own.mk will try to
1941.29Scjsinclude the file specified by the "MAKECONF" variable.  If MAKECONF is not
1951.29Scjsset, or no such file exists, the system make configuration file, /etc/mk.conf
1961.29Scjsis included.  These files may define any of the variables described below.
1971.17Sthorpej
1981.17Sthorpejbsd.own.mk sets the following variables, if they are not already defined
1991.17Sthorpej(defaults are in brackets):
2001.15Scgd
2011.98SlukemNETBSDSRCDIR	Top of the NetBSD source tree.
2021.98Slukem		If _SRC_TOP_ != "", that will be used as the default,
2031.98Slukem		otherwise BSDSRCDIR will be used as the default.
2041.98Slukem		Various makefiles within the NetBSD source tree will
2051.98Slukem		use this to reference the top level of the source tree.
2061.98Slukem
2071.95Slukem_SRC_TOP_	Top of the system source tree, as determined by <bsd.own.mk>
2081.98Slukem		based on the presence of tools/ and build.sh.  This variable
2091.98Slukem		is "internal" to <bsd.own.mk>, although its value is only
2101.98Slukem		determined once and then propagated to all sub-makes.
2111.95Slukem
2121.15ScgdBSDSRCDIR	The real path to the system sources, so that 'make obj'
2131.116Slukem		will work correctly.  [/usr/src]
2141.15Scgd
2151.15ScgdBSDOBJDIR	The real path to the system 'obj' tree, so that 'make obj'
2161.116Slukem		will work correctly.  [/usr/obj]
2171.15Scgd
2181.116SlukemBINGRP		Binary group.  [wheel]
2191.15Scgd
2201.116SlukemBINOWN		Binary owner.  [root]
2211.15Scgd
2221.116SlukemBINMODE		Binary mode.  [555]
2231.15Scgd
2241.116SlukemNONBINMODE	Mode for non-executable files.  [444]
2251.15Scgd
2261.116SlukemMANDIR		Base path for manual installation.  [/usr/share/man/cat]
2271.15Scgd
2281.116SlukemMANGRP		Manual group.  [wheel]
2291.15Scgd
2301.116SlukemMANOWN		Manual owner.  [root]
2311.15Scgd
2321.116SlukemMANMODE		Manual mode.  [${NONBINMODE}]
2331.15Scgd
2341.21SchristosMANINSTALL	Manual installation type: maninstall, catinstall, or both
2351.76Sfair
2361.76SfairLDSTATIC	Control program linking; if set blank, link everything
2371.76Sfair		dynamically. If set to "-static", link everything statically.
2381.76Sfair		If not set, programs link according to their makefile.
2391.21Schristos
2401.116SlukemLIBDIR		Base path for library installation.  [/usr/lib]
2411.15Scgd
2421.116SlukemLINTLIBDIR	Base path for lint(1) library installation.  [/usr/libdata/lint]
2431.15Scgd
2441.116SlukemLIBGRP		Library group.  [${BINGRP}]
2451.15Scgd
2461.116SlukemLIBOWN		Library owner.  [${BINOWN}]
2471.15Scgd
2481.116SlukemLIBMODE		Library mode.  [${NONBINMODE}]
2491.15Scgd
2501.15ScgdDOCDIR		Base path for system documentation (e.g. PSD, USD, etc.)
2511.116Slukem	        installation.  [/usr/share/doc]
2521.62Ssimonb
2531.62SsimonbHTMLDOCDIR	Base path for html system documentation installation.
2541.62Ssimonb		[/usr/share/doc/html]
2551.15Scgd
2561.116SlukemDOCGRP		Documentation group.  [wheel]
2571.15Scgd
2581.116SlukemDOCOWN		Documentation owner.  [root]
2591.15Scgd
2601.116SlukemDOCMODE		Documentation mode.  [${NONBINMODE}]
2611.15Scgd
2621.84SkleinkNLSDIR		Base path for Native Language Support files installation.
2631.15Scgd		[/usr/share/nls]
2641.1Scgd
2651.116SlukemNLSGRP		Native Language Support files group.  [wheel]
2661.1Scgd
2671.116SlukemNLSOWN		Native Language Support files owner.  [root]
2681.1Scgd
2691.116SlukemNLSMODE		Native Language Support files mode.  [${NONBINMODE}]
2701.1Scgd
2711.32SmikelSTRIPFLAG	The flag passed to the install program to cause the binary
2721.1Scgd		to be stripped.  This is to be used when building your
2731.1Scgd		own install script so that the entire system can be made
2741.116Slukem		stripped/not-stripped using a single knob.  [-s]
2751.1Scgd
2761.2ScgdCOPY		The flag passed to the install program to cause the binary
2771.2Scgd		to be copied rather than moved.  This is to be used when
2781.2Scgd		building our own install script so that the entire system
2791.2Scgd		can either be installed with copies, or with moves using
2801.116Slukem		a single knob.  [-c]
2811.15Scgd
2821.17SthorpejAdditionally, the following variables may be set by bsd.own.mk or in a
2831.17Sthorpejmake configuration file to modify the behaviour of the system build
2841.17Sthorpejprocess (default values are in brackets along with comments, if set by
2851.17Sthorpejbsd.own.mk):
2861.111Sthorpej
2871.111SthorpejMKPICLIB	bsd.own.mk provides a default for this variable, which is
2881.111Sthorpej		used by bsd.lib.mk.  The default value is provided by
2891.111Sthorpej		bsd.own.mk since non-library Makefiles may need to check
2901.111Sthorpej		its value in order to generate proper dependencies against
2911.111Sthorpej		libraries used only during the build process (which would
2921.111Sthorpej		not be installed into the destination directory).
2931.15Scgd
2941.64SthorpejMKCRYPTO	If set to "no", no cryptography support will be built
2951.64Sthorpej		into the system.  Defaults to "yes".
2961.64Sthorpej
2971.66SitojunMKCRYPTO_IDEA	If set to "yes", IDEA support will be built into
2981.66Sitojun		libcrypto_idea.a.  Defaults to "no".
2991.64Sthorpej
3001.105SitojunMKCRYPTO_MDC2	If set to "yes", MDC2 support will be built into
3011.105Sitojun		libcrypto_mdc2.a.  Defaults to "no".
3021.105Sitojun
3031.66SitojunMKCRYPTO_RC5	If set to "yes", RC5 support will be built into
3041.66Sitojun		libcrypto_rc5.a.  Defaults to "no".
3051.64Sthorpej
3061.94SthorpejMKHESIOD	If set to "no", disables building of Hesiod infrastructure
3071.94Sthorpej		(libraries and support programs).
3081.64Sthorpej
3091.94SthorpejMKKERBEROS	If set to "no", disables building of Kerberos (v4 or v5)
3101.94Sthorpej		infrastructure (libraries and support programs).
3111.2Scgd
3121.94SthorpejMKSKEY		If set to "no", disables building of S/key authentication
3131.94Sthorpej		infrastructure (libraries and support programs).
3141.94Sthorpej
3151.94SthorpejMKYP		If set to "no", disables building of YP (NIS)
3161.94Sthorpej		infrastructure (libraries and support programs).
3171.94Sthorpej
3181.94SthorpejUSE_HESIOD	If set to "no", disables building Hesiod support into
3191.94Sthorpej		various system utilities/libraries that support it.
3201.94Sthorpej		If MKHESIOD is set to "no", USE_HESIOD will also be
3211.94Sthorpej		forced to "no".
3221.94Sthorpej
3231.94SthorpejUSE_KERBEROS	If set to "no", disables building Kerberos (v4 or v5)
3241.94Sthorpej		support into various system utilities/libraries that
3251.94Sthorpej		support it.  If MKKERBEROS is set to "no", USE_KERBEROS
3261.94Sthorpej		will also be forced to "no".
3271.94Sthorpej
3281.94SthorpejUSE_SKEY	If set to "no", disables building S/key authentication
3291.94Sthorpej		support into various system utilities/libraries that
3301.94Sthorpej		support it.  If MKSKEY is set to "no", USE_SKEY will
3311.94Sthorpej		also be forced to "no".
3321.94Sthorpej
3331.94SthorpejUSE_YP		If set to "no", disables building YP (NIS) support into
3341.94Sthorpej		various system utilities/libraries that support it.  If
3351.94Sthorpej		MKYP is set to "no", USE_YP will also be forced to "no".
3361.15Scgd
3371.15ScgdMANZ		Compress manual pages at installation time.
3381.1Scgd
3391.15ScgdNOPROFILE	Do not build profiled versions of system libraries
3401.1Scgd
3411.15ScgdNOPIC		Do not build PIC versions of system libraries, and
3421.15Scgd		do not build shared libraries.  [set if ${MACHINE_ARCH}
3431.65Sjlam		is "sh3" and ${OBJECT_FMT} is "COFF", unset otherwise.]
3441.1Scgd
3451.40SperryNOLINT		Do not build lint libraries.
3461.33Sjonathan
3471.116SlukemOBJECT_FMT	Object file format.  [set to "ELF" on architectures that
3481.50Sthorpej		use ELF -- currently if ${MACHINE_ARCH} is "alpha",
3491.50Sthorpej		"mipsel", "mipseb", "powerpc", "sparc", "sparc64",
3501.77Ssimonb		"i386" and some m68k machines, or set to "a.out" on
3511.77Ssimonb		other architectures].
3521.33Sjonathan
3531.78SsimonbMKSOFTFLOAT	If "yes", build with options to enable the compiler to
3541.78Ssimonb		generate output containing library calls for floating
3551.78Ssimonb		point and possibly soft-float library support.  Defaults
3561.78Ssimonb		to "no".
3571.103Sthorpej
3581.103SthorpejTOOLCHAIN_MISSING
3591.103Sthorpej		If "yes", this indicates that the platform being built
3601.103Sthorpej		does not have a working in-tree toolchain.  If the
3611.103Sthorpej		MACHINE_ARCH in question falls into this category, the
3621.103Sthorpej		variable is conditionally assigned the value "yes".
3631.103Sthorpej		Otherwise, the variable is unconditionally assigned the
3641.103Sthorpej		value "no".
3651.103Sthorpej
3661.103Sthorpej		If TOOLCHAIN_MISSING is "yes", the variables MKBFD, MKGCC,
3671.103Sthorpej		and MKGDB are unconditionally assigned the value "no".
3681.103Sthorpej
3691.103SthorpejEXTERNAL_TOOLCHAIN
3701.103Sthorpej		This variable is not directly set by <bsd.own.mk>, but
3711.103Sthorpej		including <bsd.own.mk> is the canonical way to gain
3721.103Sthorpej		access to this variable.  The variable should be defined
3731.103Sthorpej		either in the user's environment or in the user's mk.conf
3741.103Sthorpej		file.  If defined, this variable indicates the root of
3751.103Sthorpej		an external toolchain which will be used to build the
3761.103Sthorpej		tree.  For example, if a platform is a TOOLCHAIN_MISSING
3771.103Sthorpej		platform, EXTERNAL_TOOLCHAIN can be used to re-enable the
3781.103Sthorpej		cross-compile framework.
3791.103Sthorpej
3801.103Sthorpej		If EXTERNAL_TOOLCHAIN is defined, the variable MKGCC is
3811.103Sthorpej		unconditionally assigned the value "no", since the external
3821.103Sthorpej		version of the compiler may not be able to build the library
3831.103Sthorpej		components of the in-tree compiler.
3841.103Sthorpej
3851.103Sthorpej		NOTE: This variable is not yet used in as many places as
3861.103Sthorpej		it should be.  Expect the exact semantics of this variable
3871.103Sthorpej		to change in the short term as parts of the cross-compile
3881.103Sthorpej		framework continue to be cleaned up.
3891.1Scgd
3901.17Sthorpejbsd.own.mk is generally useful when building your own Makefiles so that
3911.1Scgdthey use the same default owners etc. as the rest of the tree.
3921.1Scgd
3931.1Scgd=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
3941.1Scgd
3951.106SthorpejThe include file <bsd.shlib.mk> computes parameters for shared library
3961.106Sthorpejinstallation and use.  It defines no targets.  <bsd.own.mk> MUST be
3971.106Sthorpejincluded before bsd.shlib.mk.
3981.106Sthorpej
3991.106Sthorpejbsd.own.mk sets the following variables, if they are not already defined
4001.106Sthorpej(defaults are in brackets):
4011.106Sthorpej
4021.106SthorpejSHLIBINSTALLDIR	If ${USE_SHLIBDIR} is "yes", use ${SHLIBINSTALLDIR} instead of
4031.106Sthorpej		${LIBDIR} as the base path for shared library installation.
4041.106Sthorpej		[/lib]
4051.106Sthorpej
4061.106SthorpejSHLIBDIR	The path to USE_SHLIBDIR shared libraries to use when building
4071.106Sthorpej		a program.  [/lib for programs in /bin and /sbin, /usr/lib
4081.106Sthorpej		for all others.]
4091.106Sthorpej
4101.106Sthorpej_LIBSODIR	Set to ${SHLIBINSTALLDIR} if ${USE_SHLIBDIR} is "yes",
4111.106Sthorpej		otherwise set to ${LIBDIR}
4121.106Sthorpej
4131.116SlukemSHLINKINSTALLDIR Base path for shared linker.  [/libexec]
4141.106Sthorpej
4151.106SthorpejSHLINKDIR	Path to use for shared linker when building a program.
4161.106Sthorpej		[/libexec for programs in /bin and /sbin, /usr/libexec for
4171.106Sthorpej		all others.]
4181.113Sthorpej
4191.113Sthorpej=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
4201.113Sthorpej
4211.113SthorpejThe include file <bsd.gcc.mk> computes various parameters related to GCC
4221.113Sthorpejsupport libraries.  It defines no targets.  <bsd.own.mk> MUST be included
4231.113Sthorpejbefore bsd.gcc.mk.
4241.113Sthorpej
4251.113SthorpejThe primary users of bsd.gcc.mk are <bsd.prog.mk> and <bsd.lib.mk>, each
4261.113Sthorpejof which need to know where to find certain GCC support libraries.
4271.113Sthorpej
4281.113SthorpejThe behavior of bsd.gcc.mk is influenced by the EXTERNAL_TOOLCHAIN variable,
4291.113Sthorpejwhich is generally set by the user.  If EXTERNAL_TOOLCHAIN it set, then
4301.113Sthorpejthe compiler is asked where to find the support libraries, otherwise the
4311.113Sthorpejsupport libraries are found in ${DESTDIR}/usr/lib.
4321.113Sthorpej
4331.113Sthorpejbsd.gcc.mk sets the following variables:
4341.113Sthorpej
4351.113Sthorpej_GCC_CRTBEGIN	The full path name to crtbegin.o.
4361.113Sthorpej
4371.113Sthorpej_GCC_CRTBEGINS	The full path name to crtbeginS.o.
4381.113Sthorpej
4391.113Sthorpej_GCC_CRTEND	The full path name to crtend.o.
4401.113Sthorpej
4411.113Sthorpej_GCC_CRTENDS	The full path name to crtendS.o.
4421.113Sthorpej
4431.113Sthorpej_GCC_LIBGCCDIR	The directory where libgcc.a is located.
4441.106Sthorpej
4451.106Sthorpej=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
4461.106Sthorpej
4471.1ScgdThe include file <bsd.prog.mk> handles building programs from one or
4481.1Scgdmore source files, along with their manual pages.  It has a limited number
4491.106Sthorpejof suffixes, consistent with the current needs of the BSD tree.  bsd.prog.mk
4501.106Sthorpejincludes <bsd.shlib.mk> to get shared library parameters.
4511.1Scgd
4521.16SjtcIt has eight targets:
4531.1Scgd
4541.1Scgd	all:
4551.102Sthorpej		build the program and its manual page.  This also
4561.102Sthorpej		creates a GDB initialization file (.gdbinit) in
4571.102Sthorpej		the objdir.  The .gdbinit file sets the shared library
4581.102Sthorpej		prefix to ${DESTDIR} to facilitate cross-debugging.
4591.1Scgd	clean:
4601.1Scgd		remove the program, any object files and the files a.out,
4611.24Smikel		Errs, errs, mklog, and ${PROG}.core.
4621.1Scgd	cleandir:
4631.1Scgd		remove all of the files removed by the target clean, as
4641.1Scgd		well as .depend, tags, and any manual pages.
4651.42Slukem		`distclean' is a synonym for `cleandir'.
4661.1Scgd	depend:
4671.1Scgd		make the dependencies for the source files, and store
4681.1Scgd		them in the file .depend.
4691.16Sjtc	includes:
4701.16Sjtc		install any header files.
4711.1Scgd	install:
4721.1Scgd		install the program and its manual pages; if the Makefile
4731.1Scgd		does not itself define the target install, the targets
4741.1Scgd		beforeinstall and afterinstall may also be used to cause
4751.1Scgd		actions immediately before and after the install target
4761.1Scgd		is executed.
4771.1Scgd	lint:
4781.1Scgd		run lint on the source files
4791.1Scgd	tags:
4801.1Scgd		create a tags file for the source files.
4811.1Scgd
4821.1ScgdIt sets/uses the following variables:
4831.1Scgd
4841.1ScgdBINGRP		Binary group.
4851.1Scgd
4861.1ScgdBINOWN		Binary owner.
4871.1Scgd
4881.1ScgdBINMODE		Binary mode.
4891.1Scgd
4901.1ScgdCLEANFILES	Additional files to remove for the clean and cleandir targets.
4911.1Scgd
4921.1ScgdCOPTS		Additional flags to the compiler when creating C objects.
4931.112Sthorpej
4941.112SthorpejCPUFLAGS	Additional flags to the compiler/assembler to select
4951.112Sthorpej		CPU instruction set options, CPU tuning options, etc.
4961.35Slukem
4971.35SlukemCPPFLAGS	Additional flags to the C pre-processor
4981.102Sthorpej
4991.102SthorpejGDBINIT		List of GDB initialization files to add to "source"
5001.102Sthorpej		directives in the .gdbinit file that is created in the
5011.102Sthorpej		objdir.
5021.1Scgd
5031.1ScgdLDADD		Additional loader objects.  Usually used for libraries.
5041.1Scgd		For example, to load with the compatibility and utility
5051.1Scgd		libraries, use:
5061.1Scgd
5071.5Sjtc			LDADD+=-lutil -lcompat
5081.1Scgd
5091.1ScgdLDFLAGS		Additional loader flags.
5101.1Scgd
5111.1ScgdLINKS		The list of binary links; should be full pathnames, the
5121.1Scgd		linked-to file coming first, followed by the linked
5131.1Scgd		file.  The files are hard-linked.  For example, to link
5141.1Scgd		/bin/test and /bin/[, use:
5151.1Scgd
5161.1Scgd			LINKS=	${DESTDIR}/bin/test ${DESTDIR}/bin/[
5171.19Sperry
5181.19SperrySYMLINKS	The list of symbolic links; should be full pathnames.
5191.20Sperry                Syntax is identical to LINKS. Note that DESTDIR is not
5201.20Sperry		automatically included in the link.
5211.1Scgd
5221.15ScgdMAN		Manual pages (should end in .1 - .9).  If no MAN variable is
5231.8Scgd		defined, "MAN=${PROG}.1" is assumed.
5241.1Scgd
5251.1ScgdPROG		The name of the program to build.  If not supplied, nothing
5261.1Scgd		is built.
5271.1Scgd
5281.88SthorpejPROG_CXX	If defined, the name of the program to build.  Also
5291.88Sthorpej		causes <bsd.prog.mk> to link the program with the C++
5301.88Sthorpej		compiler rather than the C compiler.  PROG_CXX overrides
5311.88Sthorpej		the value of PROG if PROG is also set.
5321.87Sthorpej
5331.21SchristosPROGNAME	The name that the above program will be installed as, if
5341.21Schristos		different from ${PROG}.
5351.21Schristos
5361.37StvSRCS		List of source files to build the program.  If SRCS is not
5371.1Scgd		defined, it's assumed to be ${PROG}.c.
5381.108Sjwise
5391.108SjwiseDPSRCS		List of source files which are needed for generating
5401.108Sjwise		dependencies, but are not needed in ${SRCS}.
5411.1Scgd
5421.1ScgdDPADD		Additional dependencies for the program.  Usually used for
5431.1Scgd		libraries.  For example, to depend on the compatibility and
5441.1Scgd		utility libraries use:
5451.1Scgd
5461.5Sjtc			DPADD+=${LIBCOMPAT} ${LIBUTIL}
5471.1Scgd
5481.1Scgd		The following libraries are predefined for DPADD:
5491.1Scgd
5501.21Schristos		LIBCRT0?=	${DESTDIR}/usr/lib/crt0.o
5511.99Sitojun		LIBBZ2?=	${DESTDIR}/usr/lib/libbz2.a
5521.21Schristos		LIBC?=		${DESTDIR}/usr/lib/libc.a
5531.21Schristos		LIBC_PIC?=	${DESTDIR}/usr/lib/libc_pic.a
5541.99Sitojun		LIBCDK?=	${DESTDIR}/usr/lib/libcdk.a
5551.99Sitojun		LIBCOM_ERR?=	${DESTDIR}/usr/lib/libcom_err.a
5561.21Schristos		LIBCOMPAT?=	${DESTDIR}/usr/lib/libcompat.a
5571.21Schristos		LIBCRYPT?=	${DESTDIR}/usr/lib/libcrypt.a
5581.99Sitojun		LIBCRYPTO?=	${DESTDIR}/usr/lib/libcrypto.a
5591.99Sitojun		LIBCRYPTO_IDEA?=${DESTDIR}/usr/lib/libcrypto_idea.a
5601.105Sitojun		LIBCRYPTO_MDC2?=${DESTDIR}/usr/lib/libcrypto_mdc2.a
5611.99Sitojun		LIBCRYPTO_RC5?=	${DESTDIR}/usr/lib/libcrypto_rc5.a
5621.21Schristos		LIBCURSES?=	${DESTDIR}/usr/lib/libcurses.a
5631.21Schristos		LIBDBM?=	${DESTDIR}/usr/lib/libdbm.a
5641.21Schristos		LIBDES?=	${DESTDIR}/usr/lib/libdes.a
5651.21Schristos		LIBEDIT?=	${DESTDIR}/usr/lib/libedit.a
5661.114Sprovos		LIBEVENT?=	${DESTDIR}/usr/lib/libevent.a
5671.73Sblymn		LIBFORM?=	${DESTDIR}/usr/lib/libform.a
5681.21Schristos		LIBGCC?=	${DESTDIR}/usr/lib/libgcc.a
5691.21Schristos		LIBGNUMALLOC?=	${DESTDIR}/usr/lib/libgnumalloc.a
5701.99Sitojun		LIBGSSAPI?=	${DESTDIR}/usr/lib/libgssapi.a
5711.99Sitojun		LIBHDB?=	${DESTDIR}/usr/lib/libhdb.a
5721.70Sitojun		LIBINTL?=	${DESTDIR}/usr/lib/libintl.a
5731.49Sitojun		LIBIPSEC?=	${DESTDIR}/usr/lib/libipsec.a
5741.99Sitojun		LIBKADM?=	${DESTDIR}/usr/lib/libkadm.a
5751.99Sitojun		LIBKADM5CLNT?=	${DESTDIR}/usr/lib/libkadm5clnt.a
5761.99Sitojun		LIBKADM5SRV?=	${DESTDIR}/usr/lib/libkadm5srv.a
5771.99Sitojun		LIBKAFS?=	${DESTDIR}/usr/lib/libkafs.a
5781.21Schristos		LIBKDB?=	${DESTDIR}/usr/lib/libkdb.a
5791.21Schristos		LIBKRB?=	${DESTDIR}/usr/lib/libkrb.a
5801.99Sitojun		LIBKRB5?=	${DESTDIR}/usr/lib/libkrb5.a
5811.99Sitojun		LIBKSTREAM?=	${DESTDIR}/usr/lib/libkstream.a
5821.21Schristos		LIBKVM?=	${DESTDIR}/usr/lib/libkvm.a
5831.21Schristos		LIBL?=		${DESTDIR}/usr/lib/libl.a
5841.21Schristos		LIBM?=		${DESTDIR}/usr/lib/libm.a
5851.53Sblymn		LIBMENU?=	${DESTDIR}/usr/lib/libmenu.a
5861.21Schristos		LIBMP?=		${DESTDIR}/usr/lib/libmp.a
5871.25Schristos		LIBNTP?=	${DESTDIR}/usr/lib/libntp.a
5881.99Sitojun		LIBOBJC?=	${DESTDIR}/usr/lib/libobjc.a
5891.99Sitojun		LIBOSSAUDIO?=	${DESTDIR}/usr/lib/libossaudio.a
5901.21Schristos		LIBPC?=		${DESTDIR}/usr/lib/libpc.a
5911.21Schristos		LIBPCAP?=	${DESTDIR}/usr/lib/libpcap.a
5921.99Sitojun		LIBPCI?=	${DESTDIR}/usr/lib/libpci.a
5931.21Schristos		LIBPLOT?=	${DESTDIR}/usr/lib/libplot.a
5941.100Sthorpej		LIBPMC?=	${DESTDIR}/usr/lib/libpmc.a
5951.26Skleink		LIBPOSIX?=	${DESTDIR}/usr/lib/libposix.a
5961.110Sthorpej		LIBPTHREAD?=	${DESTDIR}/usr/lib/libpthread.a
5971.110Sthorpej		LIBPTHREAD_DBG?=${DESTDIR}/usr/lib/libpthread_dbg.a
5981.21Schristos		LIBRESOLV?=	${DESTDIR}/usr/lib/libresolv.a
5991.99Sitojun		LIBRMT?=	${DESTDIR}/usr/lib/librmt.a
6001.99Sitojun		LIBROKEN?=	${DESTDIR}/usr/lib/libroken.a
6011.21Schristos		LIBRPCSVC?=	${DESTDIR}/usr/lib/librpcsvc.a
6021.110Sthorpej		LIBRT?=		${DESTDIR}/usr/lib/librt.a
6031.21Schristos		LIBSKEY?=	${DESTDIR}/usr/lib/libskey.a
6041.99Sitojun		LIBSS?=		${DESTDIR}/usr/lib/libss.a
6051.99Sitojun		LIBSSL?=	${DESTDIR}/usr/lib/libssl.a
6061.99Sitojun		LIBSKEY?=	${DESTDIR}/usr/lib/libskey.a
6071.99Sitojun		LIBSL?=		${DESTDIR}/usr/lib/libsl.a
6081.21Schristos		LIBTERMCAP?=	${DESTDIR}/usr/lib/libtermcap.a
6091.21Schristos		LIBTELNET?=	${DESTDIR}/usr/lib/libtelnet.a
6101.99Sitojun		LIBUSBHID?=	${DESTDIR}/usr/lib/libusbhid.a
6111.21Schristos		LIBUTIL?=	${DESTDIR}/usr/lib/libutil.a
6121.21Schristos		LIBWRAP?=	${DESTDIR}/usr/lib/libwrap.a
6131.21Schristos		LIBY?=		${DESTDIR}/usr/lib/liby.a
6141.21Schristos		LIBZ?=		${DESTDIR}/usr/lib/libz.a
6151.1Scgd
6161.1ScgdSHAREDSTRINGS	If defined, a new .c.o rule is used that results in shared
6171.12Schristos		strings, using xstr(1). Note that this will not work with
6181.12Schristos		parallel makes.
6191.1Scgd
6201.59SjlamSTRIPFLAG	The flag passed to the install program to cause the binary
6211.1Scgd		to be stripped.
6221.1Scgd
6231.1ScgdSUBDIR		A list of subdirectories that should be built as well.
6241.1Scgd		Each of the targets will execute the same target in the
6251.1Scgd		subdirectories.
6261.1Scgd
6271.21SchristosSCRIPTS		A list of interpreter scripts [file.{sh,csh,pl,awk,...}].
6281.21Schristos		These are installed exactly like programs.
6291.21Schristos
6301.21SchristosSCRIPTSNAME	The name that the above program will be installed as, if
6311.21Schristos		different from ${SCRIPTS}. These can be further specialized
6321.21Schristos		by setting SCRIPTSNAME_<script>.
6331.21Schristos
6341.21SchristosFILES		A list of files to install. The installation is controlled
6351.21Schristos		by the FILESNAME, FILESOWN, FILESGRP, FILESMODE, FILESDIR
6361.21Schristos		variables that can be further specialized by FILES<VAR>_<file>
6371.21Schristos
6381.106SthorpejSHLINKDIR	Target directory for shared linker.  See description of
6391.106Sthorpej		<bsd.own.mk> for additional information about this variable.
6401.85Slukem
6411.1ScgdThe include file <bsd.prog.mk> includes the file named "../Makefile.inc"
6421.1Scgdif it exists, as well as the include file <bsd.man.mk>.
6431.1Scgd
6441.1ScgdSome simple examples:
6451.1Scgd
6461.1ScgdTo build foo from foo.c with a manual page foo.1, use:
6471.1Scgd
6481.1Scgd	PROG=	foo
6491.1Scgd
6501.1Scgd	.include <bsd.prog.mk>
6511.1Scgd
6521.1ScgdTo build foo from foo.c with a manual page foo.2, add the line:
6531.1Scgd
6541.9Scgd	MAN=	foo.2
6551.1Scgd
6561.1ScgdIf foo does not have a manual page at all, add the line:
6571.1Scgd
6581.75Sagc	MKMAN=	no
6591.1Scgd
6601.1ScgdIf foo has multiple source files, add the line:
6611.1Scgd
6621.1Scgd	SRCS=	a.c b.c c.c d.c
6631.1Scgd
6641.1Scgd=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
6651.1Scgd
6661.1ScgdThe include file <bsd.subdir.mk> contains the default targets for building
6671.16Sjtcsubdirectories.  It has the same eight targets as <bsd.prog.mk>: all, 
6681.16Sjtcclean, cleandir, depend, includes, install, lint, and tags.  For all of
6691.72Ssommerfethe directories listed in the variable SUBDIR, the specified directory 
6701.16Sjtcwill be visited and the target made.  There is also a default target which
6711.16Sjtcallows the command "make subdir" where subdir is any directory listed in
6721.72Ssommerfethe variable SUBDIR.
6731.72Ssommerfe
6741.72SsommerfeAs a special case, the use of a token .WAIT as an entry in SUBDIR acts
6751.72Ssommerfeas a synchronization barrier when multiple make jobs are run; subdirs
6761.72Ssommerfebefore the .WAIT must complete before any subdirs after .WAIT are
6771.75Sagcstarted.  See make(1) for some caveats on use of .WAIT and other
6781.75Sagcspecial sources.
6791.21Schristos
6801.21Schristos=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
6811.21Schristos
6821.23SchristosThe include file <bsd.links.mk> handles the LINKS and SYMLINKS variables
6831.23Schristosand is included from from bsd.lib.mk and bsd.prog.mk.
6841.23Schristos
6851.23Schristos=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
6861.23Schristos
6871.23SchristosThe include file <bsd.files.mk> handles the FILES variables and is included
6881.23Schristosfrom bsd.lib.mk and bsd.prog.mk.
6891.21Schristos
6901.21Schristos=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
6911.21Schristos
6921.29ScjsThe include file <bsd.inc.mk> defines the includes target and uses two
6931.29Scjsvariables:
6941.21Schristos
6951.81SwizINCS		The list of include files
6961.21Schristos
6971.81SwizINCSDIR		The location to install the include files.
6981.81Swiz
6991.81SwizINCSNAME	Target name of the include file, if only one; same as
7001.81Swiz		FILESNAME, but for include files.
7011.81Swiz
7021.81SwizINCSNAME_<file>	The name file <file> should be installed as, if not <file>,
7031.81Swiz		same as FILESNAME_<file>, but for include files.
7041.39Scgd
7051.39Scgd=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
7061.39Scgd
7071.39ScgdThe include file <bsd.kinc.mk> defines the many targets (includes,
7081.39Scgdsubdirectories, etc.), and is used by kernel makefiles to handle
7091.39Scgdinclude file installation.  It is intended to be included alone, by
7101.39Scgdkernel Makefiles.  Please see bsd.kinc.mk for more details, and keep
7111.39Scgdthe documentation in that file up to date.
7121.13Schristos
7131.13Schristos=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
7141.13Schristos
7151.47StvThe include file <bsd.info.mk> is used to generate and install GNU Info
7161.47Stvdocumentation from respective Texinfo source files.  It defines three
7171.47Stvimplicit targets (.txi.info, .texi.info, and .texinfo.info), and uses the
7181.47Stvfollowing variables:
7191.47Stv
7201.47StvTEXINFO		List of Texinfo source files.  Info documentation will
7211.47Stv		consist of single files with the extension replaced by
7221.47Stv		.info.
7231.47Stv
7241.47StvINFOFLAGS	Flags to pass to makeinfo.  []
7251.47Stv
7261.47Stv=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
7271.47Stv
7281.13SchristosThe include file <bsd.sys.mk> is used by <bsd.prog.mk> and
7291.14Scgd<bsd.lib.mk>.  It contains overrides that are used when building
7301.14Scgdthe NetBSD source tree.  For instance, if "PARALLEL" is defined by
7311.14Scgdthe program/library Makefile, it includes a set of rules for lex and
7321.14Scgdyacc that allow multiple lex and yacc targets to be built in parallel.
7331.116Slukem
7341.116SlukemThe following variables are defined to commands to perform the
7351.116Slukemappropriate operation, with the default in [brackets].
7361.116Slukem(Note that these are overridden in <bsd.own.mk> if USETOOLS=yes):
7371.116Slukem
7381.116SlukemTOOL_ASN1_COMPILE	ASN1 compiler.  [asn1_compile]
7391.116Slukem
7401.116SlukemTOOL_CAP_MKDB		Create capability database.  [cap_mkdb]
7411.116Slukem
7421.116SlukemTOOL_CAT		Concatenate and print files.  [cat]
7431.116Slukem
7441.116SlukemTOOL_CKSUM		Display file checksums.  [cksum]
7451.116Slukem
7461.116SlukemTOOL_COMPILE_ET		Error table compiler.  [compile_et]
7471.116Slukem
7481.116SlukemTOOL_CONFIG		Build kernel compilation directories.  [config]
7491.116Slukem
7501.116SlukemTOOL_CRUNCHGEN		Generate crunched binary build environment.  [crunchgen]
7511.116Slukem
7521.116SlukemTOOL_CTAGS		Create a tags file.  [ctags]
7531.116Slukem
7541.116SlukemTOOL_DB			Manipulate db(3) databases.  [db]
7551.116Slukem
7561.116SlukemTOOL_EQN		Format equations for groff.  [eqn]
7571.116Slukem
7581.116SlukemTOOL_FGEN		IEEE 1275 Open Firmware FCode Tokenizer.  [fgen]
7591.116Slukem
7601.116SlukemTOOL_GENCAT		Generate NLS message catalogs.  [gencat]
7611.116Slukem
7621.116SlukemTOOL_GROFF		Front end for groff document formatting system.  [groff]
7631.116Slukem
7641.116SlukemTOOL_HEXDUMP		Ascii, decimal, hexadecimal, octal dump.  [hexdump]
7651.116Slukem
7661.116SlukemTOOL_INDXBIB		Make bibliographic database's inverted index.  [indxbib]
7671.116Slukem
7681.116SlukemTOOL_INSTALLBOOT	Install disk bootstrap software.  [installboot]
7691.116Slukem
7701.116SlukemTOOL_INSTALL_INFO	Update info/dir entries.  [install-info]
7711.116Slukem
7721.116SlukemTOOL_M4			M4 macro language processor.  [m4]
7731.116Slukem
7741.116SlukemTOOL_MAKEFS		Create file system image from directory tree.  [makefs]
7751.116Slukem
7761.116SlukemTOOL_MAKEINFO		Translate Texinfo documents.  [makeinfo]
7771.116Slukem
7781.116SlukemTOOL_MAKEWHATIS		Create a whatis.db database.  [makewhatis]
7791.116Slukem
7801.116SlukemTOOL_MDSETIMAGE		Set kernel RAM disk image.  [mdsetimage]
7811.116Slukem
7821.116SlukemTOOL_MENUC		Menu compiler.  [menuc]
7831.116Slukem
7841.116SlukemTOOL_MKCSMAPPER		Make charset mapping table.  [mkcsmapper]
7851.116Slukem
7861.116SlukemTOOL_MKESDB		Make encoding scheme database.  [mkesdb]
7871.116Slukem
7881.116SlukemTOOL_MKLOCALE		Make LC_CTYPE locale files.  [mklocale]
7891.116Slukem
7901.116SlukemTOOL_MKMAGIC		Create database for file(1).  [file]
7911.116Slukem
7921.116SlukemTOOL_MKTEMP		Make (unique) temporary file name.  [mktemp]
7931.116Slukem
7941.116SlukemTOOL_MSGC		Simple message list compiler.  [msgc]
7951.116Slukem
7961.116SlukemTOOL_MTREE		Map a directory hierarchy.  [mtree]
7971.116Slukem
7981.116SlukemTOOL_PAX		Manipulate file archives and copy directories.  [pax]
7991.116Slukem
8001.116SlukemTOOL_PIC		Compile pictures for groff.  [pic]
8011.116Slukem
8021.116SlukemTOOL_PREPMKBOOTIMAGE	prep-mkbootimage (XXXBUILDSH).  [prep-mkbootimage]
8031.116Slukem
8041.116SlukemTOOL_PWD_MKDB		Generate the password databases.  [pwd_mkdb]
8051.116Slukem
8061.116SlukemTOOL_REFER		Preprocess bibliographic references for groff.  [refer]
8071.116Slukem
8081.116SlukemTOOL_ROFF_ASCII		Generate ASCII groff output.  [nroff]
8091.116Slukem
8101.116SlukemTOOL_ROFF_DVI		Generate DVI groff output.  [${TOOL_GROFF} -Tdvi]
8111.116Slukem
8121.116SlukemTOOL_ROFF_HTML		Generate HTML groff output.
8131.116Slukem			[${TOOL_GROFF} -Tlatin1 -mdoc2html -P-b -P-o -P-u]
8141.116Slukem
8151.116SlukemTOOL_ROFF_PS		Generate PS groff output.  [${TOOL_GROFF} -Tps]
8161.116Slukem
8171.116SlukemTOOL_ROFF_RAW		Generate "raw" groff output.  [${TOOL_GROFF} -Z]
8181.116Slukem
8191.116SlukemTOOL_RPCGEN		Remote Procedure Call (RPC) protocol compiler.  [rpcgen]
8201.116Slukem
8211.116SlukemTOOL_SOELIM		Eliminate .so's from groff input.  [soelim]
8221.116Slukem
8231.116SlukemTOOL_SUNLABEL		Read or modify a SunOS disk label.  [sunlabel]
8241.116Slukem
8251.116SlukemTOOL_TBL		Format tables for groff.  [tbl]
8261.116Slukem
8271.116SlukemTOOL_UUDECODE		Uudecode a binary file.  [uudecode]
8281.116Slukem
8291.116SlukemTOOL_VGRIND		Grind nice listings of programs.  [vgrind -f]
8301.116Slukem
8311.116SlukemTOOL_ZIC		Time zone compiler.  [zic]
8321.116Slukem
8331.69Ssommerfe
8341.69SsommerfeOther variables of note (incomplete list):
8351.69Ssommerfe
8361.82SlukemWARNS		Crank up gcc warning options; the distinct levels are:
8371.82Slukem			WARNS=1
8381.82Slukem			WARNS=2
8391.82Slukem			WARNS=3
8401.69Ssommerfe
8411.69SsommerfeFORMAT_AUDIT	If FORMAT_AUDIT is set, and WFORMAT is set and > 1, turn on
8421.69SsommerfeWFORMAT 	-Wnetbsd-format-audit for extra-stringent format checking.
8431.75Sagc		WFORMAT belongs in individual makefiles and/or
8441.75Sagc		Makefile.inc files.  (set WFORMAT=1 in individual
8451.75Sagc		makefiles if a program is not security critical and is
8461.75Sagc		doing bizarre things with format strings which would
8471.75Sagc		be even uglier if rewritten) FORMAT_AUDIT should go in
8481.75Sagc		mk.conf if you're doing format-string auditing. 
8491.69Ssommerfe		FORMAT_AUDIT may go away in time.
8501.1Scgd
8511.1Scgd=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
8521.1Scgd
8531.1ScgdThe include file <bsd.lib.mk> has support for building libraries.  It has
8541.16Sjtcthe same eight targets as <bsd.prog.mk>: all, clean, cleandir, depend,
8551.44Serhincludes, install, lint, and tags.  Additionally, it has a checkver target
8561.44Serhwhich checks for installed shared object libraries whose version is greater
8571.44Serhthat the version of the source. It has a limited number of suffixes,
8581.106Sthorpejconsistent with the current needs of the BSD tree.  bsd.lib.mk includes
8591.106Sthorpej<bsd.shlib.mk> to get shared library parameters.
8601.1Scgd
8611.1ScgdIt sets/uses the following variables:
8621.10Scgd
8631.10ScgdLIB		The name of the library to build.
8641.1Scgd
8651.1ScgdLIBDIR		Target directory for libraries.
8661.85Slukem
8671.106SthorpejSHLIBINSTALLDIR	Target directory for shared libraries if ${USE_SHLIBDIR}
8681.85Slukem		is "yes".
8691.85Slukem
8701.106SthorpejUSE_SHLIBDIR	If "yes", use ${SHLIBINSTALLDIR} instead of ${LIBDIR}
8711.85Slukem		as the path to install shared libraries to.
8721.101Slukem		USE_SHLIBDIR must be defined before <bsd.own.mk> is included.
8731.1Scgd
8741.1ScgdLINTLIBDIR	Target directory for lint libraries.
8751.1Scgd
8761.1ScgdLIBGRP		Library group.
8771.1Scgd
8781.1ScgdLIBOWN		Library owner.
8791.1Scgd
8801.1ScgdLIBMODE		Library mode.
8811.1Scgd
8821.1ScgdLDADD		Additional loader objects.
8831.1Scgd
8841.15ScgdMAN		The manual pages to be installed (use a .1 - .9 suffix).
8851.47Stv
8861.47StvMKLINKLIB	If "no", act as "MKPICINSTALL=no MKPROFILE=no".
8871.47Stv		Also:
8881.47Stv			- don't install the .a libraries
8891.47Stv			- don't install _pic.a libraries on PIC systems
8901.47Stv			- don't build .a libraries on PIC systems
8911.47Stv			- don't install the .so symlink on ELF systems
8921.47Stv		I.e, only install the shared library (and the .so.major
8931.47Stv		symlink on ELF).
8941.54Ssimonb
8951.54SsimonbMKPICLIB	If "no", don't build _pic.a libraries, and build the
8961.54Ssimonb		shared object libraries from the .a libraries.  A
8971.54Ssimonb		symlink is installed in ${DESTDIR}/usr/lib for the
8981.54Ssimonb		_pic.a library pointing to the .a library.
8991.44Serh
9001.44SerhNOCHECKVER_<library>
9011.44SerhNOCHECKVER	If set, disables checking for installed shared object
9021.44Serh		libraries with versions greater than the source.  A
9031.44Serh		particular library name, without the "lib" prefix, may
9041.44Serh		be appended to the variable name to disable the check for
9051.44Serh		only that library.
9061.1Scgd
9071.1ScgdSRCS		List of source files to build the library.  Suffix types
9081.1Scgd		.s, .c, and .f are supported.  Note, .s files are preferred
9091.1Scgd		to .c files of the same name.  (This is not the default for
9101.1Scgd		versions of make.)
9111.1Scgd
9121.1ScgdThe include file <bsd.lib.mk> includes the file named "../Makefile.inc"
9131.1Scgdif it exists, as well as the include file <bsd.man.mk>.
9141.1Scgd
9151.1ScgdIt has rules for building profiled objects; profiled libraries are
9161.1Scgdbuilt by default.
9171.1Scgd
9181.4ScgdLibraries are ranlib'd when made.
9191.56Ssommerfe
9201.56Ssommerfe=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
9211.56Ssommerfe
9221.56SsommerfeThe include file <bsd.obj.mk> defines targets related to the creation
9231.56Ssommerfeand use of separated object and source directories.
9241.56Ssommerfe
9251.63SsjgIf an environment variable named MAKEOBJDIRPREFIX is set, make(1) uses
9261.63Ssjg${MAKEOBJDIRPREFIX}${.CURDIR} as the name of the object directory if
9271.75Sagcit exists.  Otherwise make(1) looks for the existence of a
9281.63Ssjgsubdirectory (or a symlink to a directory) of the source directory
9291.63Ssjginto which built targets should be placed.  If an environment variable
9301.63Ssjgnamed MAKEOBJDIR is set, make(1) uses its value as the name of the
9311.63Ssjgobject directory; failing that, make first looks for a subdirectory
9321.63Ssjgnamed "obj.${MACHINE}", and if that doesn't exist, it looks for "obj".
9331.56Ssommerfe
9341.56SsommerfeObject directories are not created automatically by make(1) if they
9351.56Ssommerfedon't exist; you need to run a separate "make obj".  (This will happen
9361.56Ssommerfeduring a top-level build if "MKOBJDIRS" is set to a value other than
9371.58Ssommerfe"no").  When the source directory is a subdirectory of ${BSDSRCDIR} --
9381.58Ssommerfeand this is determined by a simple string prefix comparison -- object
9391.58Ssommerfedirectories are created in a separate object directory tree, and a
9401.58Ssommerfesymlink to the object directory in that tree is created in the source
9411.58Ssommerfedirectory; otherwise, "make obj" assumes that you're not in the main
9421.58Ssommerfesource tree and that it's not safe to use a separate object tree.
9431.56Ssommerfe
9441.56SsommerfeSeveral variables used by <bsd.obj.mk> control exactly what
9451.56Ssommerfedirectories and links get created during a "make obj":
9461.56Ssommerfe
9471.56SsommerfeMAKEOBJDIR	If set, this is the component name of the object
9481.56Ssommerfe		directory.
9491.56Ssommerfe
9501.56SsommerfeOBJMACHINE	If this is set but MAKEOBJDIR is not set, creates
9511.56Ssommerfe		object directories or links named "obj.${MACHINE}";
9521.56Ssommerfe		otherwise, just creates ones named "obj".
9531.56Ssommerfe
9541.56SsommerfeUSR_OBJMACHINE  If set, and the current directory is a subdirectory of
9551.56Ssommerfe		${BSDSRCDIR}, create object directory in the
9561.56Ssommerfe		corresponding subdirectory of ${BSDOBJDIR}.${MACHINE};
9571.56Ssommerfe		otherwise, create it in the corresponding subdirectory
9581.56Ssommerfe		of ${BSDOBJDIR}
9591.93Sthorpej
9601.93SthorpejBUILDID		If set, the contents of this variable are appended
9611.93Sthorpej		to the object directory name.  If OBJMACHINE is also
9621.93Sthorpej		set, ".${BUILDID}" is added after ".${MACHINE}".
9631.63Ssjg
9641.63Ssjg=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
9651.63Ssjg
9661.63SsjgThe include file <bsd.kernobj.mk> defines variables related to the
9671.63Ssjglocation of kernel sources and object directories.
9681.63Ssjg
9691.63SsjgKERNSRCDIR	Is the location of the top of the kernel src.
9701.95Slukem		It defaults to ${_SRC_TOP_}/sys
9711.63Ssjg
9721.63SsjgKERNARCHDIR	Is the location of the machine dependent kernel
9731.63Ssjg		sources.  It defaults to arch/${MACHINE}
9741.63Ssjg		
9751.63SsjgKERNCONFDIR	Is where the configuration files for kernels are
9761.63Ssjg		found; default is ${KERNSRCDIR}/${KERNARCHDIR}/conf.
9771.63Ssjg
9781.63SsjgKERNOBJDIR	Is the kernel build directory.  The kernel GENERIC for
9791.63Ssjg		instance will be compiled in ${KERNOBJDIR}/GENERIC.
9801.63Ssjg		The default value is
9811.63Ssjg		${MAKEOBJDIRPREFIX}${KERNSRCDIR}/${KERNARCHDIR}/compile
9821.63Ssjg		if it exists or the target 'obj' is being made.
9831.63Ssjg		Otherwise the default is
9841.63Ssjg		${KERNSRCDIR}/${KERNARCHDIR}/compile.
9851.63Ssjg
9861.63SsjgIt is important that Makefiles (such as those under src/distrib) that
9871.63Ssjgwish to find compiled kernels use bsd.kernobj.mk and ${KERNOBJDIR}
9881.63Ssjgrather than make assumptions about the location of the compiled kernel.
9891.109Ssommerfe
9901.109Ssommerfe=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
9911.109Ssommerfe
9921.109SsommerfeThe include file <bsd.rpc.mk> contains a makefile fragment used to
9931.109Ssommerfeconstruct source files built by rpcgen.
9941.109Ssommerfe
9951.109SsommerfeThe following macros may be defined in makefiles which include
9961.109Ssommerfe<bsd.rpc.mk> in order to control which files get built and how they
9971.109Ssommerfeare to be built:
9981.109Ssommerfe
9991.109SsommerfeRPC_INCS:	construct .h file from .x file
10001.109SsommerfeRPC_XDRFILES:	construct _xdr.c from .x file 
10011.109Ssommerfe		(for marshalling/unmarshalling data types)
10021.109SsommerfeRPC_SVCFILES:	construct _svc.c from .x file
10031.109Ssommerfe		(server-side stubs)
10041.109SsommerfeRPC_SVCFLAGS:	Additional flags passed to builds of RPC_SVCFILES.
10051.109Ssommerfe
10061.109SsommerfeRPC_XDIR:	Directory containing .x/.h files
10071.109Ssommerfe
10081.109Ssommerfe
10091.30Sagc
10101.30Sagc=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
1011