bsd.README revision 1.120
11.120Slukem#	$NetBSD: bsd.README,v 1.120 2003/07/18 08:26:05 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.120SlukemMKxxx		Can be set to "no" by a user to disable functionality.
651.120Slukem		Usually defaults to "yes".
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.120SlukemMKBFD		If "no", don't build libbfd, libiberty, or any of the things
851.120Slukem		that depend on them (binutils/gas/ld, gdb, dbsym, mdsetimage).
861.120Slukem		Default: yes
871.120Slukem
881.120SlukemMKCRYPTO	If "no", no cryptography support will be built into the system,
891.120Slukem		and also acts as MKKERBEROS=no.
901.120Slukem		Default: yes
911.120Slukem
921.120SlukemMKCRYPTO_IDEA	If not "no", IDEA support will be built into libcrypto_idea.a.
931.120Slukem		Default: no
941.52Ssimonb
951.120SlukemMKCRYPTO_MDC2	If not "no", MDC2 support will be built into libcrypto_mdc2.a
961.120Slukem		Default: no
971.45Slukem
981.120SlukemMKCRYPTO_RC5	If not "no", RC5 support will be built into libcrypto_rc5.a.
991.120Slukem		Default: no
1001.86Sthorpej
1011.45SlukemMKCATPAGES	If "no", don't build or install the catman pages.
1021.120Slukem		Default: yes
1031.45Slukem
1041.45SlukemMKDOC		If "no", don't build or install the documentation.
1051.120Slukem		Default: yes
1061.86Sthorpej
1071.104SlukemMKDYNAMICROOT	If "no", build programs in /bin and /sbin statically,
1081.104Slukem		don't install certain libraries in /lib, and don't
1091.104Slukem		install the shared linker into /libexec.
1101.120Slukem		Default: yes
1111.120Slukem
1121.120SlukemMKGCC		If "no", don't build gcc or any of the gcc-related
1131.120Slukem		libraries (libg2c, libgcc, libobjc, libstdc++).
1141.120Slukem		Default: yes
1151.104Slukem
1161.103SthorpejMKGDB		If "no", don't build gdb.
1171.120Slukem		Default: yes
1181.120Slukem
1191.120SlukemMKHESIOD	If "no", disables building of Hesiod infrastructure
1201.120Slukem		(libraries and support programs).
1211.120Slukem		Default: yes
1221.86Sthorpej
1231.120SlukemMKHTML		If "no", don't build or install the html man pages.
1241.120Slukem		Default: yes
1251.92Sross
1261.92SrossMKIEEEFP	If "no", don't add code for IEEE754/IEC60559 conformance.
1271.92Sross		Has no effect on most platforms.
1281.120Slukem		Default: yes
1291.45Slukem
1301.47StvMKINFO		If "no", don't build or install Info documentation from
1311.47Stv		Texinfo source files.
1321.120Slukem		Default: yes
1331.120Slukem
1341.120SlukemMKKERBEROS	If "no", disables building of Kerberos (v4 or v5)
1351.120Slukem		infrastructure (libraries and support programs).
1361.120Slukem		Default: yes
1371.120Slukem
1381.120SlukemMKLINKLIB	If "no", act as "MKPICINSTALL=no MKPROFILE=no".
1391.120Slukem		Also:
1401.120Slukem			- don't install the .a libraries
1411.120Slukem			- don't install _pic.a libraries on PIC systems
1421.120Slukem			- don't build .a libraries on PIC systems
1431.120Slukem			- don't install the .so symlink on ELF systems
1441.120Slukem		I.e, only install the shared library (and the .so.major
1451.120Slukem		symlink on ELF).
1461.120Slukem		Default: yes
1471.45Slukem
1481.45SlukemMKLINT		If "no", don't build or install the lint libraries.
1491.120Slukem		Default: yes
1501.45Slukem
1511.120SlukemMKMAN		If "no", don't build or install the man or catman pages,
1521.120Slukem		and also acts as "MKCATPAGES=no MKHTML=no"
1531.120Slukem		Default: yes
1541.45Slukem
1551.119SlukemMKMANZ		If not "no", compress manual pages at installation time.
1561.120Slukem		Default: no
1571.119Slukem
1581.74SitojunMKNLS		If "no", don't build or install the NLS files and locale
1591.74Sitojun		definition files.
1601.120Slukem		Default: yes
1611.45Slukem
1621.120SlukemMKOBJ		If "no", don't enable the rule which creates objdirs,
1631.120Slukem		and also acts as "MKOBJDIRS=no"
1641.120Slukem		Default: yes
1651.55Ssommerfe
1661.55SsommerfeMKOBJDIRS	If "no", don't create objdirs during a "make build".
1671.120Slukem		Default: no
1681.45Slukem
1691.120SlukemMKPIC		If "no", don't build or install shared libraries, and
1701.120Slukem		also acts as "MKPICLIB=no"
1711.120Slukem		Default: yes
1721.45Slukem
1731.45SlukemMKPICINSTALL	If "no", don't install the *_pic.a libraries.
1741.120Slukem		Default: yes
1751.120Slukem
1761.120SlukemMKPICLIB	If "no", don't build *_pic.a libraries, and build the
1771.120Slukem		shared object libraries from the .a libraries.
1781.120Slukem		A symlink is installed in ${DESTDIR}/usr/lib for the
1791.120Slukem		_pic.a library pointing to the .a library.
1801.120Slukem		Default: yes
1811.45Slukem
1821.45SlukemMKPROFILE	If "no", don't build or install the profiling libraries.
1831.120Slukem		Default: yes
1841.120Slukem
1851.120SlukemMKSHARE		If "no", act as "MKCATPAGES=no MKDOC=no MKHTML=no MKINFO=no
1861.120Slukem		MKMAN=no MKNLS=no".
1871.120Slukem		I.e, don't build catman pages, documentation, Info
1881.120Slukem		documentation, man pages, NLS files, ...
1891.120Slukem		Default: yes
1901.120Slukem
1911.120SlukemMKSKEY		If "no", disables building of S/key authentication
1921.120Slukem		infrastructure (libraries and support programs).
1931.120Slukem		Default: yes
1941.120Slukem
1951.120SlukemMKSOFTFLOAT	If not "no", build with options to enable the compiler to
1961.120Slukem		generate output containing library calls for floating
1971.120Slukem		point and possibly soft-float library support.
1981.120Slukem		Default: no
1991.120Slukem
2001.120SlukemMKUNPRIVED	If not "no", don't set the owner/group/mode when installing
2011.120Slukem		files or directories, and keep a metadata log of what
2021.120Slukem		the owner/group/mode should be.  This allows a
2031.120Slukem		non-root "make install".
2041.120Slukem		Default: no
2051.120Slukem
2061.120SlukemMKUPDATE 	If not "no", 'make install' only installs targets that are
2071.120Slukem		more recently modified in the source directories that their
2081.120Slukem		installed counterparts.
2091.120Slukem		Default: no
2101.45Slukem
2111.120SlukemMKYP		If "no", disables building of YP (NIS)
2121.120Slukem		infrastructure (libraries and support programs).
2131.120Slukem		Default: yes
2141.1Scgd
2151.118Slukem
2161.118Slukem=-=-=-=-=   sys.mk   =-=-=-=-=
2171.1Scgd
2181.1ScgdThe include file <sys.mk> has the default rules for all makes, in the BSD
2191.1Scgdenvironment or otherwise.  You probably don't want to touch this file.
2201.71SitojunIf you intend to run a cross build, you will need to supply the following
2211.71Sitojunhost tools, and configure the following variables properly:
2221.71Sitojun
2231.71SitojunOBJCOPY		objcopy - copy and translate object files
2241.71Sitojun
2251.71SitojunSTRIP		strip - Discard symbols from object files
2261.71Sitojun
2271.1Scgd
2281.118Slukem=-=-=-=-=   bsd.own.mk   =-=-=-=-=
2291.1Scgd
2301.17SthorpejThe include file <bsd.own.mk> contains source tree configuration parameters,
2311.17Sthorpejsuch as the owners, groups, etc. for both manual pages and binaries, and
2321.17Sthorpeja few global "feature configuration" parameters.
2331.1Scgd
2341.1ScgdIt has no targets.
2351.1Scgd
2361.29ScjsTo get system-specific configuration parameters, bsd.own.mk will try to
2371.29Scjsinclude the file specified by the "MAKECONF" variable.  If MAKECONF is not
2381.29Scjsset, or no such file exists, the system make configuration file, /etc/mk.conf
2391.29Scjsis included.  These files may define any of the variables described below.
2401.17Sthorpej
2411.17Sthorpejbsd.own.mk sets the following variables, if they are not already defined
2421.17Sthorpej(defaults are in brackets):
2431.15Scgd
2441.98SlukemNETBSDSRCDIR	Top of the NetBSD source tree.
2451.98Slukem		If _SRC_TOP_ != "", that will be used as the default,
2461.98Slukem		otherwise BSDSRCDIR will be used as the default.
2471.98Slukem		Various makefiles within the NetBSD source tree will
2481.98Slukem		use this to reference the top level of the source tree.
2491.98Slukem
2501.95Slukem_SRC_TOP_	Top of the system source tree, as determined by <bsd.own.mk>
2511.98Slukem		based on the presence of tools/ and build.sh.  This variable
2521.98Slukem		is "internal" to <bsd.own.mk>, although its value is only
2531.98Slukem		determined once and then propagated to all sub-makes.
2541.95Slukem
2551.15ScgdBSDSRCDIR	The real path to the system sources, so that 'make obj'
2561.116Slukem		will work correctly.  [/usr/src]
2571.15Scgd
2581.15ScgdBSDOBJDIR	The real path to the system 'obj' tree, so that 'make obj'
2591.116Slukem		will work correctly.  [/usr/obj]
2601.15Scgd
2611.116SlukemBINGRP		Binary group.  [wheel]
2621.15Scgd
2631.116SlukemBINOWN		Binary owner.  [root]
2641.15Scgd
2651.116SlukemBINMODE		Binary mode.  [555]
2661.15Scgd
2671.116SlukemNONBINMODE	Mode for non-executable files.  [444]
2681.15Scgd
2691.116SlukemMANDIR		Base path for manual installation.  [/usr/share/man/cat]
2701.15Scgd
2711.116SlukemMANGRP		Manual group.  [wheel]
2721.15Scgd
2731.116SlukemMANOWN		Manual owner.  [root]
2741.15Scgd
2751.116SlukemMANMODE		Manual mode.  [${NONBINMODE}]
2761.15Scgd
2771.21SchristosMANINSTALL	Manual installation type: maninstall, catinstall, or both
2781.76Sfair
2791.76SfairLDSTATIC	Control program linking; if set blank, link everything
2801.76Sfair		dynamically. If set to "-static", link everything statically.
2811.76Sfair		If not set, programs link according to their makefile.
2821.21Schristos
2831.116SlukemLIBDIR		Base path for library installation.  [/usr/lib]
2841.15Scgd
2851.116SlukemLINTLIBDIR	Base path for lint(1) library installation.  [/usr/libdata/lint]
2861.15Scgd
2871.116SlukemLIBGRP		Library group.  [${BINGRP}]
2881.15Scgd
2891.116SlukemLIBOWN		Library owner.  [${BINOWN}]
2901.15Scgd
2911.116SlukemLIBMODE		Library mode.  [${NONBINMODE}]
2921.15Scgd
2931.15ScgdDOCDIR		Base path for system documentation (e.g. PSD, USD, etc.)
2941.116Slukem	        installation.  [/usr/share/doc]
2951.62Ssimonb
2961.62SsimonbHTMLDOCDIR	Base path for html system documentation installation.
2971.62Ssimonb		[/usr/share/doc/html]
2981.15Scgd
2991.116SlukemDOCGRP		Documentation group.  [wheel]
3001.15Scgd
3011.116SlukemDOCOWN		Documentation owner.  [root]
3021.15Scgd
3031.116SlukemDOCMODE		Documentation mode.  [${NONBINMODE}]
3041.15Scgd
3051.84SkleinkNLSDIR		Base path for Native Language Support files installation.
3061.15Scgd		[/usr/share/nls]
3071.1Scgd
3081.116SlukemNLSGRP		Native Language Support files group.  [wheel]
3091.1Scgd
3101.116SlukemNLSOWN		Native Language Support files owner.  [root]
3111.1Scgd
3121.116SlukemNLSMODE		Native Language Support files mode.  [${NONBINMODE}]
3131.1Scgd
3141.32SmikelSTRIPFLAG	The flag passed to the install program to cause the binary
3151.1Scgd		to be stripped.  This is to be used when building your
3161.1Scgd		own install script so that the entire system can be made
3171.116Slukem		stripped/not-stripped using a single knob.  [-s]
3181.1Scgd
3191.2ScgdCOPY		The flag passed to the install program to cause the binary
3201.2Scgd		to be copied rather than moved.  This is to be used when
3211.2Scgd		building our own install script so that the entire system
3221.2Scgd		can either be installed with copies, or with moves using
3231.116Slukem		a single knob.  [-c]
3241.15Scgd
3251.17SthorpejAdditionally, the following variables may be set by bsd.own.mk or in a
3261.17Sthorpejmake configuration file to modify the behaviour of the system build
3271.17Sthorpejprocess (default values are in brackets along with comments, if set by
3281.17Sthorpejbsd.own.mk):
3291.111Sthorpej
3301.94SthorpejUSE_HESIOD	If set to "no", disables building Hesiod support into
3311.94Sthorpej		various system utilities/libraries that support it.
3321.94Sthorpej		If MKHESIOD is set to "no", USE_HESIOD will also be
3331.94Sthorpej		forced to "no".
3341.94Sthorpej
3351.94SthorpejUSE_KERBEROS	If set to "no", disables building Kerberos (v4 or v5)
3361.94Sthorpej		support into various system utilities/libraries that
3371.94Sthorpej		support it.  If MKKERBEROS is set to "no", USE_KERBEROS
3381.94Sthorpej		will also be forced to "no".
3391.94Sthorpej
3401.94SthorpejUSE_SKEY	If set to "no", disables building S/key authentication
3411.94Sthorpej		support into various system utilities/libraries that
3421.94Sthorpej		support it.  If MKSKEY is set to "no", USE_SKEY will
3431.94Sthorpej		also be forced to "no".
3441.94Sthorpej
3451.94SthorpejUSE_YP		If set to "no", disables building YP (NIS) support into
3461.94Sthorpej		various system utilities/libraries that support it.  If
3471.94Sthorpej		MKYP is set to "no", USE_YP will also be forced to "no".
3481.15Scgd
3491.15ScgdNOPROFILE	Do not build profiled versions of system libraries
3501.1Scgd
3511.15ScgdNOPIC		Do not build PIC versions of system libraries, and
3521.15Scgd		do not build shared libraries.  [set if ${MACHINE_ARCH}
3531.65Sjlam		is "sh3" and ${OBJECT_FMT} is "COFF", unset otherwise.]
3541.1Scgd
3551.40SperryNOLINT		Do not build lint libraries.
3561.33Sjonathan
3571.116SlukemOBJECT_FMT	Object file format.  [set to "ELF" on architectures that
3581.50Sthorpej		use ELF -- currently if ${MACHINE_ARCH} is "alpha",
3591.50Sthorpej		"mipsel", "mipseb", "powerpc", "sparc", "sparc64",
3601.77Ssimonb		"i386" and some m68k machines, or set to "a.out" on
3611.77Ssimonb		other architectures].
3621.33Sjonathan
3631.103SthorpejTOOLCHAIN_MISSING
3641.103Sthorpej		If "yes", this indicates that the platform being built
3651.103Sthorpej		does not have a working in-tree toolchain.  If the
3661.103Sthorpej		MACHINE_ARCH in question falls into this category, the
3671.103Sthorpej		variable is conditionally assigned the value "yes".
3681.103Sthorpej		Otherwise, the variable is unconditionally assigned the
3691.103Sthorpej		value "no".
3701.103Sthorpej
3711.103Sthorpej		If TOOLCHAIN_MISSING is "yes", the variables MKBFD, MKGCC,
3721.103Sthorpej		and MKGDB are unconditionally assigned the value "no".
3731.103Sthorpej
3741.103SthorpejEXTERNAL_TOOLCHAIN
3751.103Sthorpej		This variable is not directly set by <bsd.own.mk>, but
3761.103Sthorpej		including <bsd.own.mk> is the canonical way to gain
3771.103Sthorpej		access to this variable.  The variable should be defined
3781.103Sthorpej		either in the user's environment or in the user's mk.conf
3791.103Sthorpej		file.  If defined, this variable indicates the root of
3801.103Sthorpej		an external toolchain which will be used to build the
3811.103Sthorpej		tree.  For example, if a platform is a TOOLCHAIN_MISSING
3821.103Sthorpej		platform, EXTERNAL_TOOLCHAIN can be used to re-enable the
3831.103Sthorpej		cross-compile framework.
3841.103Sthorpej
3851.103Sthorpej		If EXTERNAL_TOOLCHAIN is defined, the variable MKGCC is
3861.103Sthorpej		unconditionally assigned the value "no", since the external
3871.103Sthorpej		version of the compiler may not be able to build the library
3881.103Sthorpej		components of the in-tree compiler.
3891.103Sthorpej
3901.103Sthorpej		NOTE: This variable is not yet used in as many places as
3911.103Sthorpej		it should be.  Expect the exact semantics of this variable
3921.103Sthorpej		to change in the short term as parts of the cross-compile
3931.103Sthorpej		framework continue to be cleaned up.
3941.1Scgd
3951.17Sthorpejbsd.own.mk is generally useful when building your own Makefiles so that
3961.1Scgdthey use the same default owners etc. as the rest of the tree.
3971.1Scgd
3981.1Scgd
3991.118Slukem=-=-=-=-=   bsd.files.mk   =-=-=-=-=
4001.106Sthorpej
4011.118SlukemThe include file <bsd.files.mk> handles the FILES variables and is included
4021.118Slukemfrom bsd.lib.mk and bsd.prog.mk.
4031.106Sthorpej
4041.106Sthorpej
4051.118Slukem=-=-=-=-=   bsd.gcc.mk   =-=-=-=-=
4061.113Sthorpej
4071.113SthorpejThe include file <bsd.gcc.mk> computes various parameters related to GCC
4081.113Sthorpejsupport libraries.  It defines no targets.  <bsd.own.mk> MUST be included
4091.113Sthorpejbefore bsd.gcc.mk.
4101.113Sthorpej
4111.113SthorpejThe primary users of bsd.gcc.mk are <bsd.prog.mk> and <bsd.lib.mk>, each
4121.113Sthorpejof which need to know where to find certain GCC support libraries.
4131.113Sthorpej
4141.113SthorpejThe behavior of bsd.gcc.mk is influenced by the EXTERNAL_TOOLCHAIN variable,
4151.113Sthorpejwhich is generally set by the user.  If EXTERNAL_TOOLCHAIN it set, then
4161.113Sthorpejthe compiler is asked where to find the support libraries, otherwise the
4171.113Sthorpejsupport libraries are found in ${DESTDIR}/usr/lib.
4181.113Sthorpej
4191.113Sthorpejbsd.gcc.mk sets the following variables:
4201.113Sthorpej
4211.118Slukem_GCC_CRTBEGIN	The full path name to crtbegin.o.
4221.118Slukem
4231.118Slukem_GCC_CRTBEGINS	The full path name to crtbeginS.o.
4241.118Slukem
4251.118Slukem_GCC_CRTEND	The full path name to crtend.o.
4261.118Slukem
4271.118Slukem_GCC_CRTENDS	The full path name to crtendS.o.
4281.118Slukem
4291.118Slukem_GCC_LIBGCCDIR	The directory where libgcc.a is located.
4301.118Slukem
4311.118Slukem
4321.118Slukem=-=-=-=-=   bsd.inc.mk   =-=-=-=-=
4331.118Slukem
4341.118SlukemThe include file <bsd.inc.mk> defines the includes target and uses two
4351.118Slukemvariables:
4361.118Slukem
4371.118SlukemINCS		The list of include files
4381.118Slukem
4391.118SlukemINCSDIR		The location to install the include files.
4401.118Slukem
4411.118SlukemINCSNAME	Target name of the include file, if only one; same as
4421.118Slukem		FILESNAME, but for include files.
4431.118Slukem
4441.118SlukemINCSNAME_<file>	The name file <file> should be installed as, if not <file>,
4451.118Slukem		same as FILESNAME_<file>, but for include files.
4461.118Slukem
4471.118Slukem
4481.118Slukem=-=-=-=-=   bsd.info.mk   =-=-=-=-=
4491.118Slukem
4501.118SlukemThe include file <bsd.info.mk> is used to generate and install GNU Info
4511.118Slukemdocumentation from respective Texinfo source files.  It defines three
4521.118Slukemimplicit targets (.txi.info, .texi.info, and .texinfo.info), and uses the
4531.118Slukemfollowing variables:
4541.118Slukem
4551.118SlukemTEXINFO		List of Texinfo source files.  Info documentation will
4561.118Slukem		consist of single files with the extension replaced by
4571.118Slukem		.info.
4581.118Slukem
4591.118SlukemINFOFLAGS	Flags to pass to makeinfo.  []
4601.118Slukem
4611.118Slukem
4621.118Slukem=-=-=-=-=   bsd.kernobj.mk   =-=-=-=-=
4631.118Slukem
4641.118SlukemThe include file <bsd.kernobj.mk> defines variables related to the
4651.118Slukemlocation of kernel sources and object directories.
4661.118Slukem
4671.118SlukemKERNSRCDIR	Is the location of the top of the kernel src.
4681.118Slukem		It defaults to ${_SRC_TOP_}/sys
4691.118Slukem
4701.118SlukemKERNARCHDIR	Is the location of the machine dependent kernel
4711.118Slukem		sources.  It defaults to arch/${MACHINE}
4721.120Slukem
4731.118SlukemKERNCONFDIR	Is where the configuration files for kernels are
4741.118Slukem		found; default is ${KERNSRCDIR}/${KERNARCHDIR}/conf.
4751.118Slukem
4761.118SlukemKERNOBJDIR	Is the kernel build directory.  The kernel GENERIC for
4771.118Slukem		instance will be compiled in ${KERNOBJDIR}/GENERIC.
4781.118Slukem		The default value is
4791.118Slukem		${MAKEOBJDIRPREFIX}${KERNSRCDIR}/${KERNARCHDIR}/compile
4801.118Slukem		if it exists or the target 'obj' is being made.
4811.118Slukem		Otherwise the default is
4821.118Slukem		${KERNSRCDIR}/${KERNARCHDIR}/compile.
4831.118Slukem
4841.118SlukemIt is important that Makefiles (such as those under src/distrib) that
4851.118Slukemwish to find compiled kernels use bsd.kernobj.mk and ${KERNOBJDIR}
4861.118Slukemrather than make assumptions about the location of the compiled kernel.
4871.118Slukem
4881.118Slukem
4891.118Slukem=-=-=-=-=   bsd.kinc.mk   =-=-=-=-=
4901.118Slukem
4911.118SlukemThe include file <bsd.kinc.mk> defines the many targets (includes,
4921.118Slukemsubdirectories, etc.), and is used by kernel makefiles to handle
4931.118Slukeminclude file installation.  It is intended to be included alone, by
4941.118Slukemkernel Makefiles.  Please see bsd.kinc.mk for more details, and keep
4951.118Slukemthe documentation in that file up to date.
4961.118Slukem
4971.118Slukem
4981.118Slukem=-=-=-=-=   bsd.lib.mk   =-=-=-=-=
4991.118Slukem
5001.118SlukemThe include file <bsd.lib.mk> has support for building libraries.  It has
5011.118Slukemthe same eight targets as <bsd.prog.mk>: all, clean, cleandir, depend,
5021.118Slukemincludes, install, lint, and tags.  Additionally, it has a checkver target
5031.118Slukemwhich checks for installed shared object libraries whose version is greater
5041.118Slukemthat the version of the source. It has a limited number of suffixes,
5051.118Slukemconsistent with the current needs of the BSD tree.  bsd.lib.mk includes
5061.118Slukem<bsd.shlib.mk> to get shared library parameters.
5071.118Slukem
5081.118SlukemIt sets/uses the following variables:
5091.118Slukem
5101.118SlukemLIB		The name of the library to build.
5111.118Slukem
5121.118SlukemLIBDIR		Target directory for libraries.
5131.118Slukem
5141.118SlukemSHLIBINSTALLDIR	Target directory for shared libraries if ${USE_SHLIBDIR}
5151.118Slukem		is "yes".
5161.118Slukem
5171.118SlukemUSE_SHLIBDIR	If "yes", use ${SHLIBINSTALLDIR} instead of ${LIBDIR}
5181.118Slukem		as the path to install shared libraries to.
5191.118Slukem		USE_SHLIBDIR must be defined before <bsd.own.mk> is included.
5201.118Slukem
5211.118SlukemLINTLIBDIR	Target directory for lint libraries.
5221.118Slukem
5231.118SlukemLIBGRP		Library group.
5241.118Slukem
5251.118SlukemLIBOWN		Library owner.
5261.118Slukem
5271.118SlukemLIBMODE		Library mode.
5281.118Slukem
5291.118SlukemLDADD		Additional loader objects.
5301.118Slukem
5311.118SlukemMAN		The manual pages to be installed (use a .1 - .9 suffix).
5321.118Slukem
5331.118SlukemNOCHECKVER_<library>
5341.118SlukemNOCHECKVER	If set, disables checking for installed shared object
5351.118Slukem		libraries with versions greater than the source.  A
5361.118Slukem		particular library name, without the "lib" prefix, may
5371.118Slukem		be appended to the variable name to disable the check for
5381.118Slukem		only that library.
5391.118Slukem
5401.118SlukemSRCS		List of source files to build the library.  Suffix types
5411.118Slukem		.s, .c, and .f are supported.  Note, .s files are preferred
5421.118Slukem		to .c files of the same name.  (This is not the default for
5431.118Slukem		versions of make.)
5441.118Slukem
5451.118SlukemThe include file <bsd.lib.mk> includes the file named "../Makefile.inc"
5461.118Slukemif it exists, as well as the include file <bsd.man.mk>.
5471.118Slukem
5481.118SlukemIt has rules for building profiled objects; profiled libraries are
5491.118Slukembuilt by default.
5501.118Slukem
5511.118SlukemLibraries are ranlib'd when made.
5521.118Slukem
5531.118Slukem
5541.118Slukem=-=-=-=-=   bsd.links.mk   =-=-=-=-=
5551.118Slukem
5561.118SlukemThe include file <bsd.links.mk> handles the LINKS and SYMLINKS variables
5571.118Slukemand is included from from bsd.lib.mk and bsd.prog.mk.
5581.118Slukem
5591.118Slukem
5601.118Slukem=-=-=-=-=   bsd.man.mk   =-=-=-=-=
5611.118Slukem
5621.118SlukemThe include file <bsd.man.mk> handles installing manual pages and their
5631.118Slukemlinks.
5641.118Slukem
5651.118SlukemIt has a two targets:
5661.118Slukem
5671.118Slukem	maninstall:
5681.118Slukem		Install the manual page sources and their links.
5691.118Slukem	catinstall:
5701.118Slukem		Install the preformatted manual pages and their links.
5711.118Slukem
5721.118SlukemIt sets/uses the following variables:
5731.118Slukem
5741.118SlukemMANDIR		Base path for manual installation.
5751.118Slukem
5761.118SlukemMANGRP		Manual group.
5771.118Slukem
5781.118SlukemMANOWN		Manual owner.
5791.118Slukem
5801.118SlukemMANMODE		Manual mode.
5811.118Slukem
5821.118SlukemMANSUBDIR	Subdirectory under the manual page section, i.e. "/vax"
5831.118Slukem		or "/tahoe" for machine specific manual pages.
5841.118Slukem
5851.118SlukemMAN		The manual pages to be installed (use a .1 - .9 suffix).
5861.118Slukem
5871.118SlukemMLINKS		List of manual page links (using a .1 - .9 suffix).  The
5881.118Slukem		linked-to file must come first, the linked file second,
5891.118Slukem		and there may be multiple pairs.  The files are soft-linked.
5901.118Slukem
5911.118SlukemThe include file <bsd.man.mk> includes a file named "../Makefile.inc" if
5921.118Slukemit exists.
5931.118Slukem
5941.118Slukem
5951.118Slukem=-=-=-=-=   bsd.obj.mk   =-=-=-=-=
5961.118Slukem
5971.118SlukemThe include file <bsd.obj.mk> defines targets related to the creation
5981.118Slukemand use of separated object and source directories.
5991.118Slukem
6001.118SlukemIf an environment variable named MAKEOBJDIRPREFIX is set, make(1) uses
6011.118Slukem${MAKEOBJDIRPREFIX}${.CURDIR} as the name of the object directory if
6021.118Slukemit exists.  Otherwise make(1) looks for the existence of a
6031.118Slukemsubdirectory (or a symlink to a directory) of the source directory
6041.118Slukeminto which built targets should be placed.  If an environment variable
6051.118Slukemnamed MAKEOBJDIR is set, make(1) uses its value as the name of the
6061.118Slukemobject directory; failing that, make first looks for a subdirectory
6071.118Slukemnamed "obj.${MACHINE}", and if that doesn't exist, it looks for "obj".
6081.118Slukem
6091.118SlukemObject directories are not created automatically by make(1) if they
6101.118Slukemdon't exist; you need to run a separate "make obj".  (This will happen
6111.118Slukemduring a top-level build if "MKOBJDIRS" is set to a value other than
6121.118Slukem"no").  When the source directory is a subdirectory of ${BSDSRCDIR} --
6131.118Slukemand this is determined by a simple string prefix comparison -- object
6141.118Slukemdirectories are created in a separate object directory tree, and a
6151.118Slukemsymlink to the object directory in that tree is created in the source
6161.118Slukemdirectory; otherwise, "make obj" assumes that you're not in the main
6171.118Slukemsource tree and that it's not safe to use a separate object tree.
6181.118Slukem
6191.118SlukemSeveral variables used by <bsd.obj.mk> control exactly what
6201.118Slukemdirectories and links get created during a "make obj":
6211.118Slukem
6221.118SlukemMAKEOBJDIR	If set, this is the component name of the object
6231.118Slukem		directory.
6241.118Slukem
6251.118SlukemOBJMACHINE	If this is set but MAKEOBJDIR is not set, creates
6261.118Slukem		object directories or links named "obj.${MACHINE}";
6271.118Slukem		otherwise, just creates ones named "obj".
6281.118Slukem
6291.118SlukemUSR_OBJMACHINE  If set, and the current directory is a subdirectory of
6301.118Slukem		${BSDSRCDIR}, create object directory in the
6311.118Slukem		corresponding subdirectory of ${BSDOBJDIR}.${MACHINE};
6321.118Slukem		otherwise, create it in the corresponding subdirectory
6331.118Slukem		of ${BSDOBJDIR}
6341.113Sthorpej
6351.118SlukemBUILDID		If set, the contents of this variable are appended
6361.118Slukem		to the object directory name.  If OBJMACHINE is also
6371.118Slukem		set, ".${BUILDID}" is added after ".${MACHINE}".
6381.113Sthorpej
6391.106Sthorpej
6401.118Slukem=-=-=-=-=   bsd.prog.mk   =-=-=-=-=
6411.106Sthorpej
6421.1ScgdThe include file <bsd.prog.mk> handles building programs from one or
6431.1Scgdmore source files, along with their manual pages.  It has a limited number
6441.106Sthorpejof suffixes, consistent with the current needs of the BSD tree.  bsd.prog.mk
6451.106Sthorpejincludes <bsd.shlib.mk> to get shared library parameters.
6461.1Scgd
6471.16SjtcIt has eight targets:
6481.1Scgd
6491.1Scgd	all:
6501.102Sthorpej		build the program and its manual page.  This also
6511.102Sthorpej		creates a GDB initialization file (.gdbinit) in
6521.102Sthorpej		the objdir.  The .gdbinit file sets the shared library
6531.102Sthorpej		prefix to ${DESTDIR} to facilitate cross-debugging.
6541.1Scgd	clean:
6551.1Scgd		remove the program, any object files and the files a.out,
6561.24Smikel		Errs, errs, mklog, and ${PROG}.core.
6571.1Scgd	cleandir:
6581.1Scgd		remove all of the files removed by the target clean, as
6591.1Scgd		well as .depend, tags, and any manual pages.
6601.42Slukem		`distclean' is a synonym for `cleandir'.
6611.1Scgd	depend:
6621.1Scgd		make the dependencies for the source files, and store
6631.1Scgd		them in the file .depend.
6641.16Sjtc	includes:
6651.16Sjtc		install any header files.
6661.1Scgd	install:
6671.1Scgd		install the program and its manual pages; if the Makefile
6681.1Scgd		does not itself define the target install, the targets
6691.1Scgd		beforeinstall and afterinstall may also be used to cause
6701.1Scgd		actions immediately before and after the install target
6711.1Scgd		is executed.
6721.1Scgd	lint:
6731.1Scgd		run lint on the source files
6741.1Scgd	tags:
6751.1Scgd		create a tags file for the source files.
6761.1Scgd
6771.1ScgdIt sets/uses the following variables:
6781.1Scgd
6791.1ScgdBINGRP		Binary group.
6801.1Scgd
6811.1ScgdBINOWN		Binary owner.
6821.1Scgd
6831.1ScgdBINMODE		Binary mode.
6841.1Scgd
6851.1ScgdCLEANFILES	Additional files to remove for the clean and cleandir targets.
6861.1Scgd
6871.1ScgdCOPTS		Additional flags to the compiler when creating C objects.
6881.112Sthorpej
6891.112SthorpejCPUFLAGS	Additional flags to the compiler/assembler to select
6901.112Sthorpej		CPU instruction set options, CPU tuning options, etc.
6911.35Slukem
6921.35SlukemCPPFLAGS	Additional flags to the C pre-processor
6931.102Sthorpej
6941.102SthorpejGDBINIT		List of GDB initialization files to add to "source"
6951.102Sthorpej		directives in the .gdbinit file that is created in the
6961.102Sthorpej		objdir.
6971.1Scgd
6981.1ScgdLDADD		Additional loader objects.  Usually used for libraries.
6991.1Scgd		For example, to load with the compatibility and utility
7001.1Scgd		libraries, use:
7011.1Scgd
7021.5Sjtc			LDADD+=-lutil -lcompat
7031.1Scgd
7041.1ScgdLDFLAGS		Additional loader flags.
7051.1Scgd
7061.1ScgdLINKS		The list of binary links; should be full pathnames, the
7071.1Scgd		linked-to file coming first, followed by the linked
7081.1Scgd		file.  The files are hard-linked.  For example, to link
7091.1Scgd		/bin/test and /bin/[, use:
7101.1Scgd
7111.1Scgd			LINKS=	${DESTDIR}/bin/test ${DESTDIR}/bin/[
7121.19Sperry
7131.19SperrySYMLINKS	The list of symbolic links; should be full pathnames.
7141.20Sperry                Syntax is identical to LINKS. Note that DESTDIR is not
7151.20Sperry		automatically included in the link.
7161.1Scgd
7171.15ScgdMAN		Manual pages (should end in .1 - .9).  If no MAN variable is
7181.8Scgd		defined, "MAN=${PROG}.1" is assumed.
7191.1Scgd
7201.1ScgdPROG		The name of the program to build.  If not supplied, nothing
7211.1Scgd		is built.
7221.1Scgd
7231.88SthorpejPROG_CXX	If defined, the name of the program to build.  Also
7241.88Sthorpej		causes <bsd.prog.mk> to link the program with the C++
7251.88Sthorpej		compiler rather than the C compiler.  PROG_CXX overrides
7261.88Sthorpej		the value of PROG if PROG is also set.
7271.87Sthorpej
7281.21SchristosPROGNAME	The name that the above program will be installed as, if
7291.21Schristos		different from ${PROG}.
7301.21Schristos
7311.37StvSRCS		List of source files to build the program.  If SRCS is not
7321.1Scgd		defined, it's assumed to be ${PROG}.c.
7331.108Sjwise
7341.108SjwiseDPSRCS		List of source files which are needed for generating
7351.108Sjwise		dependencies, but are not needed in ${SRCS}.
7361.1Scgd
7371.1ScgdDPADD		Additional dependencies for the program.  Usually used for
7381.1Scgd		libraries.  For example, to depend on the compatibility and
7391.1Scgd		utility libraries use:
7401.1Scgd
7411.5Sjtc			DPADD+=${LIBCOMPAT} ${LIBUTIL}
7421.1Scgd
7431.1Scgd		The following libraries are predefined for DPADD:
7441.1Scgd
7451.21Schristos		LIBCRT0?=	${DESTDIR}/usr/lib/crt0.o
7461.99Sitojun		LIBBZ2?=	${DESTDIR}/usr/lib/libbz2.a
7471.21Schristos		LIBC?=		${DESTDIR}/usr/lib/libc.a
7481.21Schristos		LIBC_PIC?=	${DESTDIR}/usr/lib/libc_pic.a
7491.99Sitojun		LIBCDK?=	${DESTDIR}/usr/lib/libcdk.a
7501.99Sitojun		LIBCOM_ERR?=	${DESTDIR}/usr/lib/libcom_err.a
7511.21Schristos		LIBCOMPAT?=	${DESTDIR}/usr/lib/libcompat.a
7521.21Schristos		LIBCRYPT?=	${DESTDIR}/usr/lib/libcrypt.a
7531.99Sitojun		LIBCRYPTO?=	${DESTDIR}/usr/lib/libcrypto.a
7541.99Sitojun		LIBCRYPTO_IDEA?=${DESTDIR}/usr/lib/libcrypto_idea.a
7551.105Sitojun		LIBCRYPTO_MDC2?=${DESTDIR}/usr/lib/libcrypto_mdc2.a
7561.99Sitojun		LIBCRYPTO_RC5?=	${DESTDIR}/usr/lib/libcrypto_rc5.a
7571.21Schristos		LIBCURSES?=	${DESTDIR}/usr/lib/libcurses.a
7581.21Schristos		LIBDBM?=	${DESTDIR}/usr/lib/libdbm.a
7591.21Schristos		LIBDES?=	${DESTDIR}/usr/lib/libdes.a
7601.21Schristos		LIBEDIT?=	${DESTDIR}/usr/lib/libedit.a
7611.114Sprovos		LIBEVENT?=	${DESTDIR}/usr/lib/libevent.a
7621.73Sblymn		LIBFORM?=	${DESTDIR}/usr/lib/libform.a
7631.21Schristos		LIBGCC?=	${DESTDIR}/usr/lib/libgcc.a
7641.21Schristos		LIBGNUMALLOC?=	${DESTDIR}/usr/lib/libgnumalloc.a
7651.99Sitojun		LIBGSSAPI?=	${DESTDIR}/usr/lib/libgssapi.a
7661.99Sitojun		LIBHDB?=	${DESTDIR}/usr/lib/libhdb.a
7671.70Sitojun		LIBINTL?=	${DESTDIR}/usr/lib/libintl.a
7681.49Sitojun		LIBIPSEC?=	${DESTDIR}/usr/lib/libipsec.a
7691.99Sitojun		LIBKADM?=	${DESTDIR}/usr/lib/libkadm.a
7701.99Sitojun		LIBKADM5CLNT?=	${DESTDIR}/usr/lib/libkadm5clnt.a
7711.99Sitojun		LIBKADM5SRV?=	${DESTDIR}/usr/lib/libkadm5srv.a
7721.99Sitojun		LIBKAFS?=	${DESTDIR}/usr/lib/libkafs.a
7731.21Schristos		LIBKDB?=	${DESTDIR}/usr/lib/libkdb.a
7741.21Schristos		LIBKRB?=	${DESTDIR}/usr/lib/libkrb.a
7751.99Sitojun		LIBKRB5?=	${DESTDIR}/usr/lib/libkrb5.a
7761.99Sitojun		LIBKSTREAM?=	${DESTDIR}/usr/lib/libkstream.a
7771.21Schristos		LIBKVM?=	${DESTDIR}/usr/lib/libkvm.a
7781.21Schristos		LIBL?=		${DESTDIR}/usr/lib/libl.a
7791.21Schristos		LIBM?=		${DESTDIR}/usr/lib/libm.a
7801.53Sblymn		LIBMENU?=	${DESTDIR}/usr/lib/libmenu.a
7811.21Schristos		LIBMP?=		${DESTDIR}/usr/lib/libmp.a
7821.25Schristos		LIBNTP?=	${DESTDIR}/usr/lib/libntp.a
7831.99Sitojun		LIBOBJC?=	${DESTDIR}/usr/lib/libobjc.a
7841.99Sitojun		LIBOSSAUDIO?=	${DESTDIR}/usr/lib/libossaudio.a
7851.21Schristos		LIBPC?=		${DESTDIR}/usr/lib/libpc.a
7861.21Schristos		LIBPCAP?=	${DESTDIR}/usr/lib/libpcap.a
7871.99Sitojun		LIBPCI?=	${DESTDIR}/usr/lib/libpci.a
7881.21Schristos		LIBPLOT?=	${DESTDIR}/usr/lib/libplot.a
7891.100Sthorpej		LIBPMC?=	${DESTDIR}/usr/lib/libpmc.a
7901.26Skleink		LIBPOSIX?=	${DESTDIR}/usr/lib/libposix.a
7911.110Sthorpej		LIBPTHREAD?=	${DESTDIR}/usr/lib/libpthread.a
7921.110Sthorpej		LIBPTHREAD_DBG?=${DESTDIR}/usr/lib/libpthread_dbg.a
7931.21Schristos		LIBRESOLV?=	${DESTDIR}/usr/lib/libresolv.a
7941.99Sitojun		LIBRMT?=	${DESTDIR}/usr/lib/librmt.a
7951.99Sitojun		LIBROKEN?=	${DESTDIR}/usr/lib/libroken.a
7961.21Schristos		LIBRPCSVC?=	${DESTDIR}/usr/lib/librpcsvc.a
7971.110Sthorpej		LIBRT?=		${DESTDIR}/usr/lib/librt.a
7981.21Schristos		LIBSKEY?=	${DESTDIR}/usr/lib/libskey.a
7991.99Sitojun		LIBSS?=		${DESTDIR}/usr/lib/libss.a
8001.99Sitojun		LIBSSL?=	${DESTDIR}/usr/lib/libssl.a
8011.99Sitojun		LIBSKEY?=	${DESTDIR}/usr/lib/libskey.a
8021.99Sitojun		LIBSL?=		${DESTDIR}/usr/lib/libsl.a
8031.21Schristos		LIBTERMCAP?=	${DESTDIR}/usr/lib/libtermcap.a
8041.99Sitojun		LIBUSBHID?=	${DESTDIR}/usr/lib/libusbhid.a
8051.21Schristos		LIBUTIL?=	${DESTDIR}/usr/lib/libutil.a
8061.21Schristos		LIBWRAP?=	${DESTDIR}/usr/lib/libwrap.a
8071.21Schristos		LIBY?=		${DESTDIR}/usr/lib/liby.a
8081.21Schristos		LIBZ?=		${DESTDIR}/usr/lib/libz.a
8091.1Scgd
8101.1ScgdSHAREDSTRINGS	If defined, a new .c.o rule is used that results in shared
8111.12Schristos		strings, using xstr(1). Note that this will not work with
8121.12Schristos		parallel makes.
8131.1Scgd
8141.59SjlamSTRIPFLAG	The flag passed to the install program to cause the binary
8151.1Scgd		to be stripped.
8161.1Scgd
8171.1ScgdSUBDIR		A list of subdirectories that should be built as well.
8181.1Scgd		Each of the targets will execute the same target in the
8191.1Scgd		subdirectories.
8201.1Scgd
8211.21SchristosSCRIPTS		A list of interpreter scripts [file.{sh,csh,pl,awk,...}].
8221.21Schristos		These are installed exactly like programs.
8231.21Schristos
8241.21SchristosSCRIPTSNAME	The name that the above program will be installed as, if
8251.21Schristos		different from ${SCRIPTS}. These can be further specialized
8261.21Schristos		by setting SCRIPTSNAME_<script>.
8271.21Schristos
8281.21SchristosFILES		A list of files to install. The installation is controlled
8291.21Schristos		by the FILESNAME, FILESOWN, FILESGRP, FILESMODE, FILESDIR
8301.21Schristos		variables that can be further specialized by FILES<VAR>_<file>
8311.21Schristos
8321.106SthorpejSHLINKDIR	Target directory for shared linker.  See description of
8331.106Sthorpej		<bsd.own.mk> for additional information about this variable.
8341.85Slukem
8351.1ScgdThe include file <bsd.prog.mk> includes the file named "../Makefile.inc"
8361.1Scgdif it exists, as well as the include file <bsd.man.mk>.
8371.1Scgd
8381.1ScgdSome simple examples:
8391.1Scgd
8401.1ScgdTo build foo from foo.c with a manual page foo.1, use:
8411.1Scgd
8421.1Scgd	PROG=	foo
8431.1Scgd
8441.1Scgd	.include <bsd.prog.mk>
8451.1Scgd
8461.1ScgdTo build foo from foo.c with a manual page foo.2, add the line:
8471.1Scgd
8481.9Scgd	MAN=	foo.2
8491.1Scgd
8501.1ScgdIf foo does not have a manual page at all, add the line:
8511.1Scgd
8521.75Sagc	MKMAN=	no
8531.1Scgd
8541.1ScgdIf foo has multiple source files, add the line:
8551.1Scgd
8561.1Scgd	SRCS=	a.c b.c c.c d.c
8571.1Scgd
8581.1Scgd
8591.118Slukem=-=-=-=-=   bsd.rpc.mk   =-=-=-=-=
8601.118Slukem
8611.118SlukemThe include file <bsd.rpc.mk> contains a makefile fragment used to
8621.118Slukemconstruct source files built by rpcgen.
8631.72Ssommerfe
8641.118SlukemThe following macros may be defined in makefiles which include
8651.118Slukem<bsd.rpc.mk> in order to control which files get built and how they
8661.118Slukemare to be built:
8671.21Schristos
8681.118SlukemRPC_INCS:	construct .h file from .x file
8691.120SlukemRPC_XDRFILES:	construct _xdr.c from .x file
8701.118Slukem		(for marshalling/unmarshalling data types)
8711.118SlukemRPC_SVCFILES:	construct _svc.c from .x file
8721.118Slukem		(server-side stubs)
8731.118SlukemRPC_SVCFLAGS:	Additional flags passed to builds of RPC_SVCFILES.
8741.21Schristos
8751.118SlukemRPC_XDIR:	Directory containing .x/.h files
8761.23Schristos
8771.23Schristos
8781.118Slukem=-=-=-=-=   bsd.shlib.mk   =-=-=-=-=
8791.21Schristos
8801.118SlukemThe include file <bsd.shlib.mk> computes parameters for shared library
8811.118Slukeminstallation and use.  It defines no targets.  <bsd.own.mk> MUST be
8821.118Slukemincluded before bsd.shlib.mk.
8831.21Schristos
8841.118Slukembsd.own.mk sets the following variables, if they are not already defined
8851.118Slukem(defaults are in brackets):
8861.21Schristos
8871.118SlukemSHLIBINSTALLDIR	If ${USE_SHLIBDIR} is "yes", use ${SHLIBINSTALLDIR} instead of
8881.118Slukem		${LIBDIR} as the base path for shared library installation.
8891.118Slukem		[/lib]
8901.21Schristos
8911.118SlukemSHLIBDIR	The path to USE_SHLIBDIR shared libraries to use when building
8921.118Slukem		a program.  [/lib for programs in /bin and /sbin, /usr/lib
8931.118Slukem		for all others.]
8941.81Swiz
8951.118Slukem_LIBSODIR	Set to ${SHLIBINSTALLDIR} if ${USE_SHLIBDIR} is "yes",
8961.118Slukem		otherwise set to ${LIBDIR}
8971.81Swiz
8981.118SlukemSHLINKINSTALLDIR Base path for shared linker.  [/libexec]
8991.39Scgd
9001.118SlukemSHLINKDIR	Path to use for shared linker when building a program.
9011.118Slukem		[/libexec for programs in /bin and /sbin, /usr/libexec for
9021.118Slukem		all others.]
9031.39Scgd
9041.13Schristos
9051.118Slukem=-=-=-=-=   bsd.subdir.mk   =-=-=-=-=
9061.13Schristos
9071.118SlukemThe include file <bsd.subdir.mk> contains the default targets for building
9081.120Slukemsubdirectories.  It has the same eight targets as <bsd.prog.mk>: all,
9091.118Slukemclean, cleandir, depend, includes, install, lint, and tags.  For all of
9101.120Slukemthe directories listed in the variable SUBDIR, the specified directory
9111.118Slukemwill be visited and the target made.  There is also a default target which
9121.118Slukemallows the command "make subdir" where subdir is any directory listed in
9131.118Slukemthe variable SUBDIR.
9141.47Stv
9151.118SlukemAs a special case, the use of a token .WAIT as an entry in SUBDIR acts
9161.118Slukemas a synchronization barrier when multiple make jobs are run; subdirs
9171.118Slukembefore the .WAIT must complete before any subdirs after .WAIT are
9181.118Slukemstarted.  See make(1) for some caveats on use of .WAIT and other
9191.118Slukemspecial sources.
9201.47Stv
9211.47Stv
9221.118Slukem=-=-=-=-=   bsd.sys.mk   =-=-=-=-=
9231.47Stv
9241.13SchristosThe include file <bsd.sys.mk> is used by <bsd.prog.mk> and
9251.14Scgd<bsd.lib.mk>.  It contains overrides that are used when building
9261.14Scgdthe NetBSD source tree.  For instance, if "PARALLEL" is defined by
9271.14Scgdthe program/library Makefile, it includes a set of rules for lex and
9281.14Scgdyacc that allow multiple lex and yacc targets to be built in parallel.
9291.116Slukem
9301.116SlukemThe following variables are defined to commands to perform the
9311.116Slukemappropriate operation, with the default in [brackets].
9321.116Slukem(Note that these are overridden in <bsd.own.mk> if USETOOLS=yes):
9331.116Slukem
9341.116SlukemTOOL_ASN1_COMPILE	ASN1 compiler.  [asn1_compile]
9351.116Slukem
9361.116SlukemTOOL_CAP_MKDB		Create capability database.  [cap_mkdb]
9371.116Slukem
9381.116SlukemTOOL_CAT		Concatenate and print files.  [cat]
9391.116Slukem
9401.116SlukemTOOL_CKSUM		Display file checksums.  [cksum]
9411.116Slukem
9421.116SlukemTOOL_COMPILE_ET		Error table compiler.  [compile_et]
9431.116Slukem
9441.116SlukemTOOL_CONFIG		Build kernel compilation directories.  [config]
9451.116Slukem
9461.116SlukemTOOL_CRUNCHGEN		Generate crunched binary build environment.  [crunchgen]
9471.116Slukem
9481.116SlukemTOOL_CTAGS		Create a tags file.  [ctags]
9491.116Slukem
9501.116SlukemTOOL_DB			Manipulate db(3) databases.  [db]
9511.116Slukem
9521.116SlukemTOOL_EQN		Format equations for groff.  [eqn]
9531.116Slukem
9541.116SlukemTOOL_FGEN		IEEE 1275 Open Firmware FCode Tokenizer.  [fgen]
9551.116Slukem
9561.116SlukemTOOL_GENCAT		Generate NLS message catalogs.  [gencat]
9571.116Slukem
9581.116SlukemTOOL_GROFF		Front end for groff document formatting system.  [groff]
9591.116Slukem
9601.116SlukemTOOL_HEXDUMP		Ascii, decimal, hexadecimal, octal dump.  [hexdump]
9611.116Slukem
9621.116SlukemTOOL_INDXBIB		Make bibliographic database's inverted index.  [indxbib]
9631.116Slukem
9641.116SlukemTOOL_INSTALLBOOT	Install disk bootstrap software.  [installboot]
9651.116Slukem
9661.116SlukemTOOL_INSTALL_INFO	Update info/dir entries.  [install-info]
9671.116Slukem
9681.116SlukemTOOL_M4			M4 macro language processor.  [m4]
9691.116Slukem
9701.116SlukemTOOL_MAKEFS		Create file system image from directory tree.  [makefs]
9711.116Slukem
9721.116SlukemTOOL_MAKEINFO		Translate Texinfo documents.  [makeinfo]
9731.116Slukem
9741.116SlukemTOOL_MAKEWHATIS		Create a whatis.db database.  [makewhatis]
9751.116Slukem
9761.116SlukemTOOL_MDSETIMAGE		Set kernel RAM disk image.  [mdsetimage]
9771.116Slukem
9781.116SlukemTOOL_MENUC		Menu compiler.  [menuc]
9791.116Slukem
9801.116SlukemTOOL_MKCSMAPPER		Make charset mapping table.  [mkcsmapper]
9811.116Slukem
9821.116SlukemTOOL_MKESDB		Make encoding scheme database.  [mkesdb]
9831.116Slukem
9841.116SlukemTOOL_MKLOCALE		Make LC_CTYPE locale files.  [mklocale]
9851.116Slukem
9861.116SlukemTOOL_MKMAGIC		Create database for file(1).  [file]
9871.116Slukem
9881.116SlukemTOOL_MKTEMP		Make (unique) temporary file name.  [mktemp]
9891.116Slukem
9901.116SlukemTOOL_MSGC		Simple message list compiler.  [msgc]
9911.116Slukem
9921.116SlukemTOOL_MTREE		Map a directory hierarchy.  [mtree]
9931.116Slukem
9941.116SlukemTOOL_PAX		Manipulate file archives and copy directories.  [pax]
9951.116Slukem
9961.116SlukemTOOL_PIC		Compile pictures for groff.  [pic]
9971.116Slukem
9981.116SlukemTOOL_PREPMKBOOTIMAGE	prep-mkbootimage (XXXBUILDSH).  [prep-mkbootimage]
9991.116Slukem
10001.116SlukemTOOL_PWD_MKDB		Generate the password databases.  [pwd_mkdb]
10011.116Slukem
10021.116SlukemTOOL_REFER		Preprocess bibliographic references for groff.  [refer]
10031.116Slukem
10041.116SlukemTOOL_ROFF_ASCII		Generate ASCII groff output.  [nroff]
10051.116Slukem
10061.116SlukemTOOL_ROFF_DVI		Generate DVI groff output.  [${TOOL_GROFF} -Tdvi]
10071.116Slukem
10081.116SlukemTOOL_ROFF_HTML		Generate HTML groff output.
10091.119Slukem			[${TOOL_GROFF} -Tlatin1 -mdoc2html]
10101.116Slukem
10111.116SlukemTOOL_ROFF_PS		Generate PS groff output.  [${TOOL_GROFF} -Tps]
10121.116Slukem
10131.116SlukemTOOL_ROFF_RAW		Generate "raw" groff output.  [${TOOL_GROFF} -Z]
10141.116Slukem
10151.116SlukemTOOL_RPCGEN		Remote Procedure Call (RPC) protocol compiler.  [rpcgen]
10161.116Slukem
10171.116SlukemTOOL_SOELIM		Eliminate .so's from groff input.  [soelim]
10181.116Slukem
10191.116SlukemTOOL_SUNLABEL		Read or modify a SunOS disk label.  [sunlabel]
10201.116Slukem
10211.116SlukemTOOL_TBL		Format tables for groff.  [tbl]
10221.116Slukem
10231.116SlukemTOOL_UUDECODE		Uudecode a binary file.  [uudecode]
10241.116Slukem
10251.116SlukemTOOL_VGRIND		Grind nice listings of programs.  [vgrind -f]
10261.116Slukem
10271.116SlukemTOOL_ZIC		Time zone compiler.  [zic]
10281.116Slukem
10291.69Ssommerfe
10301.69SsommerfeOther variables of note (incomplete list):
10311.69Ssommerfe
10321.82SlukemWARNS		Crank up gcc warning options; the distinct levels are:
10331.82Slukem			WARNS=1
10341.82Slukem			WARNS=2
10351.82Slukem			WARNS=3
10361.69Ssommerfe
10371.69SsommerfeFORMAT_AUDIT	If FORMAT_AUDIT is set, and WFORMAT is set and > 1, turn on
10381.69SsommerfeWFORMAT 	-Wnetbsd-format-audit for extra-stringent format checking.
10391.75Sagc		WFORMAT belongs in individual makefiles and/or
10401.75Sagc		Makefile.inc files.  (set WFORMAT=1 in individual
10411.75Sagc		makefiles if a program is not security critical and is
10421.75Sagc		doing bizarre things with format strings which would
10431.75Sagc		be even uglier if rewritten) FORMAT_AUDIT should go in
10441.120Slukem		mk.conf if you're doing format-string auditing.
10451.69Ssommerfe		FORMAT_AUDIT may go away in time.
10461.30Sagc
10471.30Sagc=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
1048