bsd.README revision 1.130
11.130Slukem#	$NetBSD: bsd.README,v 1.130 2003/07/28 08:53:53 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.129Slukem		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.47Stvthe 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.45SlukemMKPROFILE	If "no", don't build or install the profiling 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.120Slukem
2191.120SlukemMKUNPRIVED	If not "no", don't set the owner/group/mode when installing
2201.120Slukem		files or directories, and keep a metadata log of what
2211.120Slukem		the owner/group/mode should be.  This allows a
2221.120Slukem		non-root "make install".
2231.120Slukem		Default: no
2241.120Slukem
2251.120SlukemMKUPDATE 	If not "no", 'make install' only installs targets that are
2261.120Slukem		more recently modified in the source directories that their
2271.120Slukem		installed counterparts.
2281.120Slukem		Default: no
2291.45Slukem
2301.120SlukemMKYP		If "no", disables building of YP (NIS)
2311.120Slukem		infrastructure (libraries and support programs).
2321.120Slukem		Default: yes
2331.1Scgd
2341.129SlukemUSE_HESIOD	If "no", disables building Hesiod support into
2351.122Slukem		various system utilities/libraries that support it.
2361.129Slukem		If MKHESIOD is "no", USE_HESIOD will also be
2371.122Slukem		forced to "no".
2381.122Slukem
2391.129SlukemUSE_KERBEROS4	If "no", disables building Kerberos v4
2401.126Sitojun		support into various system utilities/libraries that
2411.129Slukem		support it.  If MKKERBEROS4 is "no", USE_KERBEROS4
2421.126Sitojun		will also be forced to "no".
2431.126Sitojun
2441.129SlukemUSE_KERBEROS	If "no", disables building Kerberos v4 or v5)
2451.122Slukem		support into various system utilities/libraries that
2461.129Slukem		support it.  If MKKERBEROS is "no", USE_KERBEROS
2471.122Slukem		will also be forced to "no".
2481.122Slukem
2491.129SlukemUSE_SKEY	If "no", disables building S/key authentication
2501.122Slukem		support into various system utilities/libraries that
2511.129Slukem		support it.  If MKSKEY is "no", USE_SKEY will
2521.122Slukem		also be forced to "no".
2531.122Slukem
2541.129SlukemUSE_YP		If "no", disables building YP (NIS) support into
2551.129Slukem		various system utilities/libraries that support it.
2561.129Slukem		If MKYP is "no", USE_YP will also be forced to "no".
2571.122Slukem
2581.118Slukem
2591.118Slukem=-=-=-=-=   sys.mk   =-=-=-=-=
2601.1Scgd
2611.1ScgdThe include file <sys.mk> has the default rules for all makes, in the BSD
2621.1Scgdenvironment or otherwise.  You probably don't want to touch this file.
2631.71SitojunIf you intend to run a cross build, you will need to supply the following
2641.71Sitojunhost tools, and configure the following variables properly:
2651.71Sitojun
2661.71SitojunOBJCOPY		objcopy - copy and translate object files
2671.71Sitojun
2681.71SitojunSTRIP		strip - Discard symbols from object files
2691.71Sitojun
2701.1Scgd
2711.118Slukem=-=-=-=-=   bsd.own.mk   =-=-=-=-=
2721.1Scgd
2731.17SthorpejThe include file <bsd.own.mk> contains source tree configuration parameters,
2741.17Sthorpejsuch as the owners, groups, etc. for both manual pages and binaries, and
2751.17Sthorpeja few global "feature configuration" parameters.
2761.1Scgd
2771.1ScgdIt has no targets.
2781.1Scgd
2791.29ScjsTo get system-specific configuration parameters, bsd.own.mk will try to
2801.29Scjsinclude the file specified by the "MAKECONF" variable.  If MAKECONF is not
2811.29Scjsset, or no such file exists, the system make configuration file, /etc/mk.conf
2821.29Scjsis included.  These files may define any of the variables described below.
2831.17Sthorpej
2841.17Sthorpejbsd.own.mk sets the following variables, if they are not already defined
2851.17Sthorpej(defaults are in brackets):
2861.15Scgd
2871.98SlukemNETBSDSRCDIR	Top of the NetBSD source tree.
2881.98Slukem		If _SRC_TOP_ != "", that will be used as the default,
2891.98Slukem		otherwise BSDSRCDIR will be used as the default.
2901.98Slukem		Various makefiles within the NetBSD source tree will
2911.98Slukem		use this to reference the top level of the source tree.
2921.98Slukem
2931.95Slukem_SRC_TOP_	Top of the system source tree, as determined by <bsd.own.mk>
2941.98Slukem		based on the presence of tools/ and build.sh.  This variable
2951.98Slukem		is "internal" to <bsd.own.mk>, although its value is only
2961.98Slukem		determined once and then propagated to all sub-makes.
2971.95Slukem
2981.15ScgdBSDSRCDIR	The real path to the system sources, so that 'make obj'
2991.116Slukem		will work correctly.  [/usr/src]
3001.15Scgd
3011.15ScgdBSDOBJDIR	The real path to the system 'obj' tree, so that 'make obj'
3021.116Slukem		will work correctly.  [/usr/obj]
3031.15Scgd
3041.116SlukemBINGRP		Binary group.  [wheel]
3051.15Scgd
3061.116SlukemBINOWN		Binary owner.  [root]
3071.15Scgd
3081.116SlukemBINMODE		Binary mode.  [555]
3091.15Scgd
3101.116SlukemNONBINMODE	Mode for non-executable files.  [444]
3111.15Scgd
3121.116SlukemMANDIR		Base path for manual installation.  [/usr/share/man/cat]
3131.15Scgd
3141.116SlukemMANGRP		Manual group.  [wheel]
3151.15Scgd
3161.116SlukemMANOWN		Manual owner.  [root]
3171.15Scgd
3181.116SlukemMANMODE		Manual mode.  [${NONBINMODE}]
3191.15Scgd
3201.21SchristosMANINSTALL	Manual installation type: maninstall, catinstall, or both
3211.76Sfair
3221.76SfairLDSTATIC	Control program linking; if set blank, link everything
3231.129Slukem		dynamically.  If set to "-static", link everything statically.
3241.76Sfair		If not set, programs link according to their makefile.
3251.21Schristos
3261.116SlukemLIBDIR		Base path for library installation.  [/usr/lib]
3271.15Scgd
3281.116SlukemLINTLIBDIR	Base path for lint(1) library installation.  [/usr/libdata/lint]
3291.15Scgd
3301.116SlukemLIBGRP		Library group.  [${BINGRP}]
3311.15Scgd
3321.116SlukemLIBOWN		Library owner.  [${BINOWN}]
3331.15Scgd
3341.116SlukemLIBMODE		Library mode.  [${NONBINMODE}]
3351.15Scgd
3361.15ScgdDOCDIR		Base path for system documentation (e.g. PSD, USD, etc.)
3371.116Slukem	        installation.  [/usr/share/doc]
3381.62Ssimonb
3391.62SsimonbHTMLDOCDIR	Base path for html system documentation installation.
3401.62Ssimonb		[/usr/share/doc/html]
3411.15Scgd
3421.116SlukemDOCGRP		Documentation group.  [wheel]
3431.15Scgd
3441.116SlukemDOCOWN		Documentation owner.  [root]
3451.15Scgd
3461.116SlukemDOCMODE		Documentation mode.  [${NONBINMODE}]
3471.15Scgd
3481.84SkleinkNLSDIR		Base path for Native Language Support files installation.
3491.15Scgd		[/usr/share/nls]
3501.1Scgd
3511.116SlukemNLSGRP		Native Language Support files group.  [wheel]
3521.1Scgd
3531.116SlukemNLSOWN		Native Language Support files owner.  [root]
3541.1Scgd
3551.116SlukemNLSMODE		Native Language Support files mode.  [${NONBINMODE}]
3561.1Scgd
3571.32SmikelSTRIPFLAG	The flag passed to the install program to cause the binary
3581.1Scgd		to be stripped.  This is to be used when building your
3591.1Scgd		own install script so that the entire system can be made
3601.116Slukem		stripped/not-stripped using a single knob.  [-s]
3611.1Scgd
3621.2ScgdCOPY		The flag passed to the install program to cause the binary
3631.2Scgd		to be copied rather than moved.  This is to be used when
3641.2Scgd		building our own install script so that the entire system
3651.2Scgd		can either be installed with copies, or with moves using
3661.116Slukem		a single knob.  [-c]
3671.15Scgd
3681.17SthorpejAdditionally, the following variables may be set by bsd.own.mk or in a
3691.17Sthorpejmake configuration file to modify the behaviour of the system build
3701.17Sthorpejprocess (default values are in brackets along with comments, if set by
3711.17Sthorpejbsd.own.mk):
3721.33Sjonathan
3731.116SlukemOBJECT_FMT	Object file format.  [set to "ELF" on architectures that
3741.50Sthorpej		use ELF -- currently if ${MACHINE_ARCH} is "alpha",
3751.50Sthorpej		"mipsel", "mipseb", "powerpc", "sparc", "sparc64",
3761.77Ssimonb		"i386" and some m68k machines, or set to "a.out" on
3771.77Ssimonb		other architectures].
3781.33Sjonathan
3791.103SthorpejTOOLCHAIN_MISSING
3801.103Sthorpej		If "yes", this indicates that the platform being built
3811.103Sthorpej		does not have a working in-tree toolchain.  If the
3821.103Sthorpej		MACHINE_ARCH in question falls into this category, the
3831.103Sthorpej		variable is conditionally assigned the value "yes".
3841.103Sthorpej		Otherwise, the variable is unconditionally assigned the
3851.103Sthorpej		value "no".
3861.103Sthorpej
3871.103Sthorpej		If TOOLCHAIN_MISSING is "yes", the variables MKBFD, MKGCC,
3881.103Sthorpej		and MKGDB are unconditionally assigned the value "no".
3891.103Sthorpej
3901.103SthorpejEXTERNAL_TOOLCHAIN
3911.103Sthorpej		This variable is not directly set by <bsd.own.mk>, but
3921.103Sthorpej		including <bsd.own.mk> is the canonical way to gain
3931.103Sthorpej		access to this variable.  The variable should be defined
3941.103Sthorpej		either in the user's environment or in the user's mk.conf
3951.103Sthorpej		file.  If defined, this variable indicates the root of
3961.103Sthorpej		an external toolchain which will be used to build the
3971.103Sthorpej		tree.  For example, if a platform is a TOOLCHAIN_MISSING
3981.103Sthorpej		platform, EXTERNAL_TOOLCHAIN can be used to re-enable the
3991.103Sthorpej		cross-compile framework.
4001.103Sthorpej
4011.103Sthorpej		If EXTERNAL_TOOLCHAIN is defined, the variable MKGCC is
4021.103Sthorpej		unconditionally assigned the value "no", since the external
4031.103Sthorpej		version of the compiler may not be able to build the library
4041.103Sthorpej		components of the in-tree compiler.
4051.103Sthorpej
4061.103Sthorpej		NOTE: This variable is not yet used in as many places as
4071.103Sthorpej		it should be.  Expect the exact semantics of this variable
4081.103Sthorpej		to change in the short term as parts of the cross-compile
4091.103Sthorpej		framework continue to be cleaned up.
4101.1Scgd
4111.17Sthorpejbsd.own.mk is generally useful when building your own Makefiles so that
4121.1Scgdthey use the same default owners etc. as the rest of the tree.
4131.1Scgd
4141.1Scgd
4151.118Slukem=-=-=-=-=   bsd.files.mk   =-=-=-=-=
4161.106Sthorpej
4171.118SlukemThe include file <bsd.files.mk> handles the FILES variables and is included
4181.124Slukemfrom bsd.lib.mk and bsd.prog.mk, and uses the following variables:
4191.124Slukem
4201.124SlukemFILES		The list of files to install.
4211.124Slukem
4221.124SlukemFILESOWN	File owner.  [${BINOWN}]
4231.124Slukem
4241.124SlukemFILESGRP	File group.  [${BINGRP}]
4251.124Slukem
4261.124SlukemFILESMODE	File mode.  [${BINMODE}]
4271.124Slukem
4281.124SlukemFILESDIR	The location to install the files.
4291.124Slukem
4301.124SlukemFILESNAME	Optional name to install each file as.
4311.124Slukem
4321.124SlukemFILESDIR.<fn>	The location to install the specific file <fn>.
4331.124Slukem
4341.124SlukemFILESNAME.<fn>	Optional name to install <fn> as.
4351.106Sthorpej
4361.106Sthorpej
4371.118Slukem=-=-=-=-=   bsd.gcc.mk   =-=-=-=-=
4381.113Sthorpej
4391.113SthorpejThe include file <bsd.gcc.mk> computes various parameters related to GCC
4401.113Sthorpejsupport libraries.  It defines no targets.  <bsd.own.mk> MUST be included
4411.113Sthorpejbefore bsd.gcc.mk.
4421.113Sthorpej
4431.113SthorpejThe primary users of bsd.gcc.mk are <bsd.prog.mk> and <bsd.lib.mk>, each
4441.113Sthorpejof which need to know where to find certain GCC support libraries.
4451.113Sthorpej
4461.113SthorpejThe behavior of bsd.gcc.mk is influenced by the EXTERNAL_TOOLCHAIN variable,
4471.113Sthorpejwhich is generally set by the user.  If EXTERNAL_TOOLCHAIN it set, then
4481.113Sthorpejthe compiler is asked where to find the support libraries, otherwise the
4491.113Sthorpejsupport libraries are found in ${DESTDIR}/usr/lib.
4501.113Sthorpej
4511.113Sthorpejbsd.gcc.mk sets the following variables:
4521.113Sthorpej
4531.118Slukem_GCC_CRTBEGIN	The full path name to crtbegin.o.
4541.118Slukem
4551.118Slukem_GCC_CRTBEGINS	The full path name to crtbeginS.o.
4561.118Slukem
4571.118Slukem_GCC_CRTEND	The full path name to crtend.o.
4581.118Slukem
4591.118Slukem_GCC_CRTENDS	The full path name to crtendS.o.
4601.118Slukem
4611.118Slukem_GCC_LIBGCCDIR	The directory where libgcc.a is located.
4621.118Slukem
4631.118Slukem
4641.118Slukem=-=-=-=-=   bsd.inc.mk   =-=-=-=-=
4651.118Slukem
4661.118SlukemThe include file <bsd.inc.mk> defines the includes target and uses two
4671.118Slukemvariables:
4681.118Slukem
4691.124SlukemINCS		The list of include files.
4701.118Slukem
4711.118SlukemINCSDIR		The location to install the include files.
4721.118Slukem
4731.118SlukemINCSNAME	Target name of the include file, if only one; same as
4741.118Slukem		FILESNAME, but for include files.
4751.118Slukem
4761.118SlukemINCSNAME_<file>	The name file <file> should be installed as, if not <file>,
4771.118Slukem		same as FILESNAME_<file>, but for include files.
4781.118Slukem
4791.118Slukem
4801.118Slukem=-=-=-=-=   bsd.info.mk   =-=-=-=-=
4811.118Slukem
4821.118SlukemThe include file <bsd.info.mk> is used to generate and install GNU Info
4831.118Slukemdocumentation from respective Texinfo source files.  It defines three
4841.118Slukemimplicit targets (.txi.info, .texi.info, and .texinfo.info), and uses the
4851.118Slukemfollowing variables:
4861.118Slukem
4871.118SlukemTEXINFO		List of Texinfo source files.  Info documentation will
4881.118Slukem		consist of single files with the extension replaced by
4891.118Slukem		.info.
4901.118Slukem
4911.118SlukemINFOFLAGS	Flags to pass to makeinfo.  []
4921.118Slukem
4931.118Slukem
4941.118Slukem=-=-=-=-=   bsd.kernobj.mk   =-=-=-=-=
4951.118Slukem
4961.118SlukemThe include file <bsd.kernobj.mk> defines variables related to the
4971.118Slukemlocation of kernel sources and object directories.
4981.118Slukem
4991.118SlukemKERNSRCDIR	Is the location of the top of the kernel src.
5001.124Slukem		[${_SRC_TOP_}/sys]
5011.118Slukem
5021.124SlukemKERNARCHDIR	Is the location of the machine dependent kernel sources.
5031.124Slukem		[arch/${MACHINE}]
5041.120Slukem
5051.124SlukemKERNCONFDIR	Is where the configuration files for kernels are found.
5061.124Slukem		[${KERNSRCDIR}/${KERNARCHDIR}/conf]
5071.118Slukem
5081.118SlukemKERNOBJDIR	Is the kernel build directory.  The kernel GENERIC for
5091.118Slukem		instance will be compiled in ${KERNOBJDIR}/GENERIC.
5101.118Slukem		The default value is
5111.118Slukem		${MAKEOBJDIRPREFIX}${KERNSRCDIR}/${KERNARCHDIR}/compile
5121.118Slukem		if it exists or the target 'obj' is being made.
5131.118Slukem		Otherwise the default is
5141.118Slukem		${KERNSRCDIR}/${KERNARCHDIR}/compile.
5151.118Slukem
5161.118SlukemIt is important that Makefiles (such as those under src/distrib) that
5171.118Slukemwish to find compiled kernels use bsd.kernobj.mk and ${KERNOBJDIR}
5181.118Slukemrather than make assumptions about the location of the compiled kernel.
5191.118Slukem
5201.118Slukem
5211.118Slukem=-=-=-=-=   bsd.kinc.mk   =-=-=-=-=
5221.118Slukem
5231.118SlukemThe include file <bsd.kinc.mk> defines the many targets (includes,
5241.118Slukemsubdirectories, etc.), and is used by kernel makefiles to handle
5251.118Slukeminclude file installation.  It is intended to be included alone, by
5261.118Slukemkernel Makefiles.  Please see bsd.kinc.mk for more details, and keep
5271.118Slukemthe documentation in that file up to date.
5281.118Slukem
5291.118Slukem
5301.118Slukem=-=-=-=-=   bsd.lib.mk   =-=-=-=-=
5311.118Slukem
5321.118SlukemThe include file <bsd.lib.mk> has support for building libraries.  It has
5331.118Slukemthe same eight targets as <bsd.prog.mk>: all, clean, cleandir, depend,
5341.118Slukemincludes, install, lint, and tags.  Additionally, it has a checkver target
5351.118Slukemwhich checks for installed shared object libraries whose version is greater
5361.118Slukemthat the version of the source. It has a limited number of suffixes,
5371.118Slukemconsistent with the current needs of the BSD tree.  bsd.lib.mk includes
5381.118Slukem<bsd.shlib.mk> to get shared library parameters.
5391.118Slukem
5401.118SlukemIt sets/uses the following variables:
5411.118Slukem
5421.118SlukemLIB		The name of the library to build.
5431.118Slukem
5441.118SlukemLIBDIR		Target directory for libraries.
5451.118Slukem
5461.118SlukemSHLIBINSTALLDIR	Target directory for shared libraries if ${USE_SHLIBDIR}
5471.118Slukem		is "yes".
5481.118Slukem
5491.118SlukemUSE_SHLIBDIR	If "yes", use ${SHLIBINSTALLDIR} instead of ${LIBDIR}
5501.118Slukem		as the path to install shared libraries to.
5511.118Slukem		USE_SHLIBDIR must be defined before <bsd.own.mk> is included.
5521.130Slukem		Default: no
5531.118Slukem
5541.118SlukemLINTLIBDIR	Target directory for lint libraries.
5551.118Slukem
5561.118SlukemLIBGRP		Library group.
5571.118Slukem
5581.118SlukemLIBOWN		Library owner.
5591.118Slukem
5601.118SlukemLIBMODE		Library mode.
5611.118Slukem
5621.118SlukemLDADD		Additional loader objects.
5631.118Slukem
5641.118SlukemMAN		The manual pages to be installed (use a .1 - .9 suffix).
5651.118Slukem
5661.118SlukemNOCHECKVER_<library>
5671.118SlukemNOCHECKVER	If set, disables checking for installed shared object
5681.118Slukem		libraries with versions greater than the source.  A
5691.118Slukem		particular library name, without the "lib" prefix, may
5701.118Slukem		be appended to the variable name to disable the check for
5711.118Slukem		only that library.
5721.118Slukem
5731.118SlukemSRCS		List of source files to build the library.  Suffix types
5741.118Slukem		.s, .c, and .f are supported.  Note, .s files are preferred
5751.118Slukem		to .c files of the same name.  (This is not the default for
5761.118Slukem		versions of make.)
5771.118Slukem
5781.118SlukemThe include file <bsd.lib.mk> includes the file named "../Makefile.inc"
5791.118Slukemif it exists, as well as the include file <bsd.man.mk>.
5801.118Slukem
5811.118SlukemIt has rules for building profiled objects; profiled libraries are
5821.118Slukembuilt by default.
5831.118Slukem
5841.118SlukemLibraries are ranlib'd when made.
5851.118Slukem
5861.118Slukem
5871.118Slukem=-=-=-=-=   bsd.links.mk   =-=-=-=-=
5881.118Slukem
5891.118SlukemThe include file <bsd.links.mk> handles the LINKS and SYMLINKS variables
5901.118Slukemand is included from from bsd.lib.mk and bsd.prog.mk.
5911.118Slukem
5921.118Slukem
5931.118Slukem=-=-=-=-=   bsd.man.mk   =-=-=-=-=
5941.118Slukem
5951.118SlukemThe include file <bsd.man.mk> handles installing manual pages and their
5961.118Slukemlinks.
5971.118Slukem
5981.118SlukemIt has a two targets:
5991.118Slukem
6001.118Slukem	maninstall:
6011.118Slukem		Install the manual page sources and their links.
6021.118Slukem	catinstall:
6031.118Slukem		Install the preformatted manual pages and their links.
6041.118Slukem
6051.118SlukemIt sets/uses the following variables:
6061.118Slukem
6071.118SlukemMANDIR		Base path for manual installation.
6081.118Slukem
6091.118SlukemMANGRP		Manual group.
6101.118Slukem
6111.118SlukemMANOWN		Manual owner.
6121.118Slukem
6131.118SlukemMANMODE		Manual mode.
6141.118Slukem
6151.118SlukemMANSUBDIR	Subdirectory under the manual page section, i.e. "/vax"
6161.118Slukem		or "/tahoe" for machine specific manual pages.
6171.118Slukem
6181.118SlukemMAN		The manual pages to be installed (use a .1 - .9 suffix).
6191.118Slukem
6201.118SlukemMLINKS		List of manual page links (using a .1 - .9 suffix).  The
6211.118Slukem		linked-to file must come first, the linked file second,
6221.118Slukem		and there may be multiple pairs.  The files are soft-linked.
6231.118Slukem
6241.118SlukemThe include file <bsd.man.mk> includes a file named "../Makefile.inc" if
6251.118Slukemit exists.
6261.118Slukem
6271.118Slukem
6281.118Slukem=-=-=-=-=   bsd.obj.mk   =-=-=-=-=
6291.118Slukem
6301.118SlukemThe include file <bsd.obj.mk> defines targets related to the creation
6311.118Slukemand use of separated object and source directories.
6321.118Slukem
6331.118SlukemIf an environment variable named MAKEOBJDIRPREFIX is set, make(1) uses
6341.118Slukem${MAKEOBJDIRPREFIX}${.CURDIR} as the name of the object directory if
6351.118Slukemit exists.  Otherwise make(1) looks for the existence of a
6361.118Slukemsubdirectory (or a symlink to a directory) of the source directory
6371.118Slukeminto which built targets should be placed.  If an environment variable
6381.118Slukemnamed MAKEOBJDIR is set, make(1) uses its value as the name of the
6391.118Slukemobject directory; failing that, make first looks for a subdirectory
6401.118Slukemnamed "obj.${MACHINE}", and if that doesn't exist, it looks for "obj".
6411.118Slukem
6421.118SlukemObject directories are not created automatically by make(1) if they
6431.118Slukemdon't exist; you need to run a separate "make obj".  (This will happen
6441.118Slukemduring a top-level build if "MKOBJDIRS" is set to a value other than
6451.118Slukem"no").  When the source directory is a subdirectory of ${BSDSRCDIR} --
6461.118Slukemand this is determined by a simple string prefix comparison -- object
6471.118Slukemdirectories are created in a separate object directory tree, and a
6481.118Slukemsymlink to the object directory in that tree is created in the source
6491.118Slukemdirectory; otherwise, "make obj" assumes that you're not in the main
6501.118Slukemsource tree and that it's not safe to use a separate object tree.
6511.118Slukem
6521.118SlukemSeveral variables used by <bsd.obj.mk> control exactly what
6531.118Slukemdirectories and links get created during a "make obj":
6541.118Slukem
6551.118SlukemMAKEOBJDIR	If set, this is the component name of the object
6561.118Slukem		directory.
6571.118Slukem
6581.118SlukemOBJMACHINE	If this is set but MAKEOBJDIR is not set, creates
6591.118Slukem		object directories or links named "obj.${MACHINE}";
6601.118Slukem		otherwise, just creates ones named "obj".
6611.118Slukem
6621.118SlukemUSR_OBJMACHINE  If set, and the current directory is a subdirectory of
6631.118Slukem		${BSDSRCDIR}, create object directory in the
6641.118Slukem		corresponding subdirectory of ${BSDOBJDIR}.${MACHINE};
6651.118Slukem		otherwise, create it in the corresponding subdirectory
6661.118Slukem		of ${BSDOBJDIR}
6671.113Sthorpej
6681.118SlukemBUILDID		If set, the contents of this variable are appended
6691.118Slukem		to the object directory name.  If OBJMACHINE is also
6701.118Slukem		set, ".${BUILDID}" is added after ".${MACHINE}".
6711.113Sthorpej
6721.106Sthorpej
6731.118Slukem=-=-=-=-=   bsd.prog.mk   =-=-=-=-=
6741.106Sthorpej
6751.1ScgdThe include file <bsd.prog.mk> handles building programs from one or
6761.1Scgdmore source files, along with their manual pages.  It has a limited number
6771.106Sthorpejof suffixes, consistent with the current needs of the BSD tree.  bsd.prog.mk
6781.106Sthorpejincludes <bsd.shlib.mk> to get shared library parameters.
6791.1Scgd
6801.16SjtcIt has eight targets:
6811.1Scgd
6821.1Scgd	all:
6831.102Sthorpej		build the program and its manual page.  This also
6841.102Sthorpej		creates a GDB initialization file (.gdbinit) in
6851.102Sthorpej		the objdir.  The .gdbinit file sets the shared library
6861.102Sthorpej		prefix to ${DESTDIR} to facilitate cross-debugging.
6871.1Scgd	clean:
6881.1Scgd		remove the program, any object files and the files a.out,
6891.24Smikel		Errs, errs, mklog, and ${PROG}.core.
6901.1Scgd	cleandir:
6911.1Scgd		remove all of the files removed by the target clean, as
6921.1Scgd		well as .depend, tags, and any manual pages.
6931.42Slukem		`distclean' is a synonym for `cleandir'.
6941.1Scgd	depend:
6951.1Scgd		make the dependencies for the source files, and store
6961.1Scgd		them in the file .depend.
6971.16Sjtc	includes:
6981.16Sjtc		install any header files.
6991.1Scgd	install:
7001.1Scgd		install the program and its manual pages; if the Makefile
7011.1Scgd		does not itself define the target install, the targets
7021.1Scgd		beforeinstall and afterinstall may also be used to cause
7031.1Scgd		actions immediately before and after the install target
7041.1Scgd		is executed.
7051.1Scgd	lint:
7061.1Scgd		run lint on the source files
7071.1Scgd	tags:
7081.1Scgd		create a tags file for the source files.
7091.1Scgd
7101.1ScgdIt sets/uses the following variables:
7111.1Scgd
7121.1ScgdBINGRP		Binary group.
7131.1Scgd
7141.1ScgdBINOWN		Binary owner.
7151.1Scgd
7161.1ScgdBINMODE		Binary mode.
7171.1Scgd
7181.1ScgdCLEANFILES	Additional files to remove for the clean and cleandir targets.
7191.1Scgd
7201.1ScgdCOPTS		Additional flags to the compiler when creating C objects.
7211.112Sthorpej
7221.125SlukemCOPTS.<fn>	Additional flags to the compiler when creating the
7231.125Slukem		C objects for <fn>.
7241.125Slukem		For <fn>.[ly], "<fn>.c" must be used.
7251.125Slukem
7261.112SthorpejCPUFLAGS	Additional flags to the compiler/assembler to select
7271.112Sthorpej		CPU instruction set options, CPU tuning options, etc.
7281.35Slukem
7291.125SlukemCPUFLAGS.<fn>	Additional flags to the compiler/assembler for <fn>.
7301.125Slukem		For <fn>.[ly], "<fn>.c" must be used.
7311.125Slukem
7321.124SlukemCPPFLAGS	Additional flags to the C pre-processor.
7331.125Slukem
7341.125SlukemCPPFLAGS.<fn>	Additional flags to the C pre-processor for <fn>.
7351.125Slukem		For <fn>.[ly], "<fn>.c" must be used.
7361.102Sthorpej
7371.102SthorpejGDBINIT		List of GDB initialization files to add to "source"
7381.102Sthorpej		directives in the .gdbinit file that is created in the
7391.102Sthorpej		objdir.
7401.1Scgd
7411.1ScgdLDADD		Additional loader objects.  Usually used for libraries.
7421.1Scgd		For example, to load with the compatibility and utility
7431.1Scgd		libraries, use:
7441.1Scgd
7451.5Sjtc			LDADD+=-lutil -lcompat
7461.1Scgd
7471.1ScgdLDFLAGS		Additional loader flags.
7481.1Scgd
7491.1ScgdLINKS		The list of binary links; should be full pathnames, the
7501.1Scgd		linked-to file coming first, followed by the linked
7511.1Scgd		file.  The files are hard-linked.  For example, to link
7521.1Scgd		/bin/test and /bin/[, use:
7531.1Scgd
7541.1Scgd			LINKS=	${DESTDIR}/bin/test ${DESTDIR}/bin/[
7551.19Sperry
7561.19SperrySYMLINKS	The list of symbolic links; should be full pathnames.
7571.20Sperry                Syntax is identical to LINKS. Note that DESTDIR is not
7581.20Sperry		automatically included in the link.
7591.1Scgd
7601.15ScgdMAN		Manual pages (should end in .1 - .9).  If no MAN variable is
7611.8Scgd		defined, "MAN=${PROG}.1" is assumed.
7621.1Scgd
7631.1ScgdPROG		The name of the program to build.  If not supplied, nothing
7641.1Scgd		is built.
7651.1Scgd
7661.88SthorpejPROG_CXX	If defined, the name of the program to build.  Also
7671.88Sthorpej		causes <bsd.prog.mk> to link the program with the C++
7681.88Sthorpej		compiler rather than the C compiler.  PROG_CXX overrides
7691.88Sthorpej		the value of PROG if PROG is also set.
7701.87Sthorpej
7711.21SchristosPROGNAME	The name that the above program will be installed as, if
7721.21Schristos		different from ${PROG}.
7731.21Schristos
7741.37StvSRCS		List of source files to build the program.  If SRCS is not
7751.1Scgd		defined, it's assumed to be ${PROG}.c.
7761.108Sjwise
7771.108SjwiseDPSRCS		List of source files which are needed for generating
7781.108Sjwise		dependencies, but are not needed in ${SRCS}.
7791.1Scgd
7801.1ScgdDPADD		Additional dependencies for the program.  Usually used for
7811.1Scgd		libraries.  For example, to depend on the compatibility and
7821.1Scgd		utility libraries use:
7831.1Scgd
7841.5Sjtc			DPADD+=${LIBCOMPAT} ${LIBUTIL}
7851.1Scgd
7861.1Scgd		The following libraries are predefined for DPADD:
7871.1Scgd
7881.21Schristos		LIBCRT0?=	${DESTDIR}/usr/lib/crt0.o
7891.99Sitojun		LIBBZ2?=	${DESTDIR}/usr/lib/libbz2.a
7901.21Schristos		LIBC?=		${DESTDIR}/usr/lib/libc.a
7911.21Schristos		LIBC_PIC?=	${DESTDIR}/usr/lib/libc_pic.a
7921.99Sitojun		LIBCDK?=	${DESTDIR}/usr/lib/libcdk.a
7931.99Sitojun		LIBCOM_ERR?=	${DESTDIR}/usr/lib/libcom_err.a
7941.21Schristos		LIBCOMPAT?=	${DESTDIR}/usr/lib/libcompat.a
7951.21Schristos		LIBCRYPT?=	${DESTDIR}/usr/lib/libcrypt.a
7961.99Sitojun		LIBCRYPTO?=	${DESTDIR}/usr/lib/libcrypto.a
7971.99Sitojun		LIBCRYPTO_IDEA?=${DESTDIR}/usr/lib/libcrypto_idea.a
7981.105Sitojun		LIBCRYPTO_MDC2?=${DESTDIR}/usr/lib/libcrypto_mdc2.a
7991.99Sitojun		LIBCRYPTO_RC5?=	${DESTDIR}/usr/lib/libcrypto_rc5.a
8001.21Schristos		LIBCURSES?=	${DESTDIR}/usr/lib/libcurses.a
8011.21Schristos		LIBDBM?=	${DESTDIR}/usr/lib/libdbm.a
8021.21Schristos		LIBDES?=	${DESTDIR}/usr/lib/libdes.a
8031.21Schristos		LIBEDIT?=	${DESTDIR}/usr/lib/libedit.a
8041.114Sprovos		LIBEVENT?=	${DESTDIR}/usr/lib/libevent.a
8051.73Sblymn		LIBFORM?=	${DESTDIR}/usr/lib/libform.a
8061.21Schristos		LIBGCC?=	${DESTDIR}/usr/lib/libgcc.a
8071.21Schristos		LIBGNUMALLOC?=	${DESTDIR}/usr/lib/libgnumalloc.a
8081.99Sitojun		LIBGSSAPI?=	${DESTDIR}/usr/lib/libgssapi.a
8091.99Sitojun		LIBHDB?=	${DESTDIR}/usr/lib/libhdb.a
8101.70Sitojun		LIBINTL?=	${DESTDIR}/usr/lib/libintl.a
8111.49Sitojun		LIBIPSEC?=	${DESTDIR}/usr/lib/libipsec.a
8121.99Sitojun		LIBKADM?=	${DESTDIR}/usr/lib/libkadm.a
8131.99Sitojun		LIBKADM5CLNT?=	${DESTDIR}/usr/lib/libkadm5clnt.a
8141.99Sitojun		LIBKADM5SRV?=	${DESTDIR}/usr/lib/libkadm5srv.a
8151.99Sitojun		LIBKAFS?=	${DESTDIR}/usr/lib/libkafs.a
8161.21Schristos		LIBKDB?=	${DESTDIR}/usr/lib/libkdb.a
8171.21Schristos		LIBKRB?=	${DESTDIR}/usr/lib/libkrb.a
8181.99Sitojun		LIBKRB5?=	${DESTDIR}/usr/lib/libkrb5.a
8191.99Sitojun		LIBKSTREAM?=	${DESTDIR}/usr/lib/libkstream.a
8201.21Schristos		LIBKVM?=	${DESTDIR}/usr/lib/libkvm.a
8211.21Schristos		LIBL?=		${DESTDIR}/usr/lib/libl.a
8221.21Schristos		LIBM?=		${DESTDIR}/usr/lib/libm.a
8231.53Sblymn		LIBMENU?=	${DESTDIR}/usr/lib/libmenu.a
8241.21Schristos		LIBMP?=		${DESTDIR}/usr/lib/libmp.a
8251.25Schristos		LIBNTP?=	${DESTDIR}/usr/lib/libntp.a
8261.99Sitojun		LIBOBJC?=	${DESTDIR}/usr/lib/libobjc.a
8271.99Sitojun		LIBOSSAUDIO?=	${DESTDIR}/usr/lib/libossaudio.a
8281.21Schristos		LIBPC?=		${DESTDIR}/usr/lib/libpc.a
8291.21Schristos		LIBPCAP?=	${DESTDIR}/usr/lib/libpcap.a
8301.99Sitojun		LIBPCI?=	${DESTDIR}/usr/lib/libpci.a
8311.21Schristos		LIBPLOT?=	${DESTDIR}/usr/lib/libplot.a
8321.100Sthorpej		LIBPMC?=	${DESTDIR}/usr/lib/libpmc.a
8331.26Skleink		LIBPOSIX?=	${DESTDIR}/usr/lib/libposix.a
8341.110Sthorpej		LIBPTHREAD?=	${DESTDIR}/usr/lib/libpthread.a
8351.110Sthorpej		LIBPTHREAD_DBG?=${DESTDIR}/usr/lib/libpthread_dbg.a
8361.21Schristos		LIBRESOLV?=	${DESTDIR}/usr/lib/libresolv.a
8371.99Sitojun		LIBRMT?=	${DESTDIR}/usr/lib/librmt.a
8381.99Sitojun		LIBROKEN?=	${DESTDIR}/usr/lib/libroken.a
8391.21Schristos		LIBRPCSVC?=	${DESTDIR}/usr/lib/librpcsvc.a
8401.110Sthorpej		LIBRT?=		${DESTDIR}/usr/lib/librt.a
8411.21Schristos		LIBSKEY?=	${DESTDIR}/usr/lib/libskey.a
8421.99Sitojun		LIBSS?=		${DESTDIR}/usr/lib/libss.a
8431.99Sitojun		LIBSSL?=	${DESTDIR}/usr/lib/libssl.a
8441.99Sitojun		LIBSKEY?=	${DESTDIR}/usr/lib/libskey.a
8451.99Sitojun		LIBSL?=		${DESTDIR}/usr/lib/libsl.a
8461.21Schristos		LIBTERMCAP?=	${DESTDIR}/usr/lib/libtermcap.a
8471.99Sitojun		LIBUSBHID?=	${DESTDIR}/usr/lib/libusbhid.a
8481.21Schristos		LIBUTIL?=	${DESTDIR}/usr/lib/libutil.a
8491.21Schristos		LIBWRAP?=	${DESTDIR}/usr/lib/libwrap.a
8501.21Schristos		LIBY?=		${DESTDIR}/usr/lib/liby.a
8511.21Schristos		LIBZ?=		${DESTDIR}/usr/lib/libz.a
8521.1Scgd
8531.1ScgdSHAREDSTRINGS	If defined, a new .c.o rule is used that results in shared
8541.12Schristos		strings, using xstr(1). Note that this will not work with
8551.12Schristos		parallel makes.
8561.1Scgd
8571.59SjlamSTRIPFLAG	The flag passed to the install program to cause the binary
8581.1Scgd		to be stripped.
8591.1Scgd
8601.1ScgdSUBDIR		A list of subdirectories that should be built as well.
8611.1Scgd		Each of the targets will execute the same target in the
8621.1Scgd		subdirectories.
8631.1Scgd
8641.21SchristosSCRIPTS		A list of interpreter scripts [file.{sh,csh,pl,awk,...}].
8651.21Schristos		These are installed exactly like programs.
8661.21Schristos
8671.21SchristosSCRIPTSNAME	The name that the above program will be installed as, if
8681.21Schristos		different from ${SCRIPTS}. These can be further specialized
8691.21Schristos		by setting SCRIPTSNAME_<script>.
8701.21Schristos
8711.124SlukemFILES		See description of <bsd.files.mk>.
8721.21Schristos
8731.106SthorpejSHLINKDIR	Target directory for shared linker.  See description of
8741.106Sthorpej		<bsd.own.mk> for additional information about this variable.
8751.130Slukem
8761.130SlukemUSE_LIBSTDCXX	If "no", the support libraries needed for C++ programs
8771.130Slukem		are set to `-lsupc++ -lm', rather than `-lstdc++ -lm'.
8781.130Slukem		Default: yes
8791.85Slukem
8801.1ScgdThe include file <bsd.prog.mk> includes the file named "../Makefile.inc"
8811.1Scgdif it exists, as well as the include file <bsd.man.mk>.
8821.1Scgd
8831.1ScgdSome simple examples:
8841.1Scgd
8851.1ScgdTo build foo from foo.c with a manual page foo.1, use:
8861.1Scgd
8871.1Scgd	PROG=	foo
8881.1Scgd
8891.1Scgd	.include <bsd.prog.mk>
8901.1Scgd
8911.1ScgdTo build foo from foo.c with a manual page foo.2, add the line:
8921.1Scgd
8931.9Scgd	MAN=	foo.2
8941.1Scgd
8951.1ScgdIf foo does not have a manual page at all, add the line:
8961.1Scgd
8971.75Sagc	MKMAN=	no
8981.1Scgd
8991.1ScgdIf foo has multiple source files, add the line:
9001.1Scgd
9011.1Scgd	SRCS=	a.c b.c c.c d.c
9021.1Scgd
9031.1Scgd
9041.118Slukem=-=-=-=-=   bsd.rpc.mk   =-=-=-=-=
9051.118Slukem
9061.118SlukemThe include file <bsd.rpc.mk> contains a makefile fragment used to
9071.118Slukemconstruct source files built by rpcgen.
9081.72Ssommerfe
9091.118SlukemThe following macros may be defined in makefiles which include
9101.118Slukem<bsd.rpc.mk> in order to control which files get built and how they
9111.118Slukemare to be built:
9121.21Schristos
9131.118SlukemRPC_INCS:	construct .h file from .x file
9141.120SlukemRPC_XDRFILES:	construct _xdr.c from .x file
9151.118Slukem		(for marshalling/unmarshalling data types)
9161.118SlukemRPC_SVCFILES:	construct _svc.c from .x file
9171.118Slukem		(server-side stubs)
9181.118SlukemRPC_SVCFLAGS:	Additional flags passed to builds of RPC_SVCFILES.
9191.21Schristos
9201.118SlukemRPC_XDIR:	Directory containing .x/.h files
9211.23Schristos
9221.23Schristos
9231.118Slukem=-=-=-=-=   bsd.shlib.mk   =-=-=-=-=
9241.21Schristos
9251.118SlukemThe include file <bsd.shlib.mk> computes parameters for shared library
9261.118Slukeminstallation and use.  It defines no targets.  <bsd.own.mk> MUST be
9271.118Slukemincluded before bsd.shlib.mk.
9281.21Schristos
9291.118Slukembsd.own.mk sets the following variables, if they are not already defined
9301.118Slukem(defaults are in brackets):
9311.21Schristos
9321.118SlukemSHLIBINSTALLDIR	If ${USE_SHLIBDIR} is "yes", use ${SHLIBINSTALLDIR} instead of
9331.118Slukem		${LIBDIR} as the base path for shared library installation.
9341.118Slukem		[/lib]
9351.21Schristos
9361.118SlukemSHLIBDIR	The path to USE_SHLIBDIR shared libraries to use when building
9371.118Slukem		a program.  [/lib for programs in /bin and /sbin, /usr/lib
9381.118Slukem		for all others.]
9391.81Swiz
9401.118Slukem_LIBSODIR	Set to ${SHLIBINSTALLDIR} if ${USE_SHLIBDIR} is "yes",
9411.118Slukem		otherwise set to ${LIBDIR}
9421.81Swiz
9431.118SlukemSHLINKINSTALLDIR Base path for shared linker.  [/libexec]
9441.39Scgd
9451.118SlukemSHLINKDIR	Path to use for shared linker when building a program.
9461.118Slukem		[/libexec for programs in /bin and /sbin, /usr/libexec for
9471.118Slukem		all others.]
9481.39Scgd
9491.13Schristos
9501.118Slukem=-=-=-=-=   bsd.subdir.mk   =-=-=-=-=
9511.13Schristos
9521.118SlukemThe include file <bsd.subdir.mk> contains the default targets for building
9531.120Slukemsubdirectories.  It has the same eight targets as <bsd.prog.mk>: all,
9541.118Slukemclean, cleandir, depend, includes, install, lint, and tags.  For all of
9551.120Slukemthe directories listed in the variable SUBDIR, the specified directory
9561.118Slukemwill be visited and the target made.  There is also a default target which
9571.118Slukemallows the command "make subdir" where subdir is any directory listed in
9581.118Slukemthe variable SUBDIR.
9591.47Stv
9601.118SlukemAs a special case, the use of a token .WAIT as an entry in SUBDIR acts
9611.118Slukemas a synchronization barrier when multiple make jobs are run; subdirs
9621.118Slukembefore the .WAIT must complete before any subdirs after .WAIT are
9631.118Slukemstarted.  See make(1) for some caveats on use of .WAIT and other
9641.118Slukemspecial sources.
9651.47Stv
9661.47Stv
9671.118Slukem=-=-=-=-=   bsd.sys.mk   =-=-=-=-=
9681.47Stv
9691.13SchristosThe include file <bsd.sys.mk> is used by <bsd.prog.mk> and
9701.14Scgd<bsd.lib.mk>.  It contains overrides that are used when building
9711.14Scgdthe NetBSD source tree.  For instance, if "PARALLEL" is defined by
9721.14Scgdthe program/library Makefile, it includes a set of rules for lex and
9731.14Scgdyacc that allow multiple lex and yacc targets to be built in parallel.
9741.116Slukem
9751.116SlukemThe following variables are defined to commands to perform the
9761.116Slukemappropriate operation, with the default in [brackets].
9771.116Slukem(Note that these are overridden in <bsd.own.mk> if USETOOLS=yes):
9781.116Slukem
9791.116SlukemTOOL_ASN1_COMPILE	ASN1 compiler.  [asn1_compile]
9801.116Slukem
9811.116SlukemTOOL_CAP_MKDB		Create capability database.  [cap_mkdb]
9821.116Slukem
9831.116SlukemTOOL_CAT		Concatenate and print files.  [cat]
9841.116Slukem
9851.116SlukemTOOL_CKSUM		Display file checksums.  [cksum]
9861.116Slukem
9871.116SlukemTOOL_COMPILE_ET		Error table compiler.  [compile_et]
9881.116Slukem
9891.116SlukemTOOL_CONFIG		Build kernel compilation directories.  [config]
9901.116Slukem
9911.116SlukemTOOL_CRUNCHGEN		Generate crunched binary build environment.  [crunchgen]
9921.116Slukem
9931.116SlukemTOOL_CTAGS		Create a tags file.  [ctags]
9941.116Slukem
9951.116SlukemTOOL_DB			Manipulate db(3) databases.  [db]
9961.116Slukem
9971.116SlukemTOOL_EQN		Format equations for groff.  [eqn]
9981.116Slukem
9991.116SlukemTOOL_FGEN		IEEE 1275 Open Firmware FCode Tokenizer.  [fgen]
10001.116Slukem
10011.116SlukemTOOL_GENCAT		Generate NLS message catalogs.  [gencat]
10021.116Slukem
10031.116SlukemTOOL_GROFF		Front end for groff document formatting system.  [groff]
10041.116Slukem
10051.116SlukemTOOL_HEXDUMP		Ascii, decimal, hexadecimal, octal dump.  [hexdump]
10061.116Slukem
10071.116SlukemTOOL_INDXBIB		Make bibliographic database's inverted index.  [indxbib]
10081.116Slukem
10091.116SlukemTOOL_INSTALLBOOT	Install disk bootstrap software.  [installboot]
10101.116Slukem
10111.116SlukemTOOL_INSTALL_INFO	Update info/dir entries.  [install-info]
10121.116Slukem
10131.116SlukemTOOL_M4			M4 macro language processor.  [m4]
10141.116Slukem
10151.116SlukemTOOL_MAKEFS		Create file system image from directory tree.  [makefs]
10161.116Slukem
10171.116SlukemTOOL_MAKEINFO		Translate Texinfo documents.  [makeinfo]
10181.116Slukem
10191.116SlukemTOOL_MAKEWHATIS		Create a whatis.db database.  [makewhatis]
10201.116Slukem
10211.116SlukemTOOL_MDSETIMAGE		Set kernel RAM disk image.  [mdsetimage]
10221.116Slukem
10231.116SlukemTOOL_MENUC		Menu compiler.  [menuc]
10241.116Slukem
10251.116SlukemTOOL_MKCSMAPPER		Make charset mapping table.  [mkcsmapper]
10261.116Slukem
10271.116SlukemTOOL_MKESDB		Make encoding scheme database.  [mkesdb]
10281.116Slukem
10291.116SlukemTOOL_MKLOCALE		Make LC_CTYPE locale files.  [mklocale]
10301.116Slukem
10311.116SlukemTOOL_MKMAGIC		Create database for file(1).  [file]
10321.116Slukem
10331.116SlukemTOOL_MKTEMP		Make (unique) temporary file name.  [mktemp]
10341.116Slukem
10351.116SlukemTOOL_MSGC		Simple message list compiler.  [msgc]
10361.116Slukem
10371.116SlukemTOOL_MTREE		Map a directory hierarchy.  [mtree]
10381.116Slukem
10391.116SlukemTOOL_PAX		Manipulate file archives and copy directories.  [pax]
10401.116Slukem
10411.116SlukemTOOL_PIC		Compile pictures for groff.  [pic]
10421.116Slukem
10431.116SlukemTOOL_PREPMKBOOTIMAGE	prep-mkbootimage (XXXBUILDSH).  [prep-mkbootimage]
10441.116Slukem
10451.116SlukemTOOL_PWD_MKDB		Generate the password databases.  [pwd_mkdb]
10461.116Slukem
10471.116SlukemTOOL_REFER		Preprocess bibliographic references for groff.  [refer]
10481.116Slukem
10491.116SlukemTOOL_ROFF_ASCII		Generate ASCII groff output.  [nroff]
10501.116Slukem
10511.116SlukemTOOL_ROFF_DVI		Generate DVI groff output.  [${TOOL_GROFF} -Tdvi]
10521.116Slukem
10531.116SlukemTOOL_ROFF_HTML		Generate HTML groff output.
10541.119Slukem			[${TOOL_GROFF} -Tlatin1 -mdoc2html]
10551.116Slukem
10561.116SlukemTOOL_ROFF_PS		Generate PS groff output.  [${TOOL_GROFF} -Tps]
10571.116Slukem
10581.116SlukemTOOL_ROFF_RAW		Generate "raw" groff output.  [${TOOL_GROFF} -Z]
10591.116Slukem
10601.116SlukemTOOL_RPCGEN		Remote Procedure Call (RPC) protocol compiler.  [rpcgen]
10611.116Slukem
10621.116SlukemTOOL_SOELIM		Eliminate .so's from groff input.  [soelim]
10631.123Slukem
10641.123SlukemTOOL_STAT		Display file status.  [stat]
10651.116Slukem
10661.116SlukemTOOL_SUNLABEL		Read or modify a SunOS disk label.  [sunlabel]
10671.116Slukem
10681.116SlukemTOOL_TBL		Format tables for groff.  [tbl]
10691.116Slukem
10701.116SlukemTOOL_UUDECODE		Uudecode a binary file.  [uudecode]
10711.116Slukem
10721.116SlukemTOOL_VGRIND		Grind nice listings of programs.  [vgrind -f]
10731.116Slukem
10741.116SlukemTOOL_ZIC		Time zone compiler.  [zic]
10751.116Slukem
10761.69Ssommerfe
10771.69SsommerfeOther variables of note (incomplete list):
10781.69Ssommerfe
10791.82SlukemWARNS		Crank up gcc warning options; the distinct levels are:
10801.82Slukem			WARNS=1
10811.82Slukem			WARNS=2
10821.82Slukem			WARNS=3
10831.69Ssommerfe
10841.69SsommerfeFORMAT_AUDIT	If FORMAT_AUDIT is set, and WFORMAT is set and > 1, turn on
10851.69SsommerfeWFORMAT 	-Wnetbsd-format-audit for extra-stringent format checking.
10861.75Sagc		WFORMAT belongs in individual makefiles and/or
10871.75Sagc		Makefile.inc files.  (set WFORMAT=1 in individual
10881.75Sagc		makefiles if a program is not security critical and is
10891.75Sagc		doing bizarre things with format strings which would
10901.75Sagc		be even uglier if rewritten) FORMAT_AUDIT should go in
10911.120Slukem		mk.conf if you're doing format-string auditing.
10921.69Ssommerfe		FORMAT_AUDIT may go away in time.
10931.30Sagc
10941.30Sagc=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
1095