bsd.README revision 1.118
11.118Slukem# $NetBSD: bsd.README,v 1.118 2003/07/18 00:33:18 lukem Exp $ 21.24Smikel# @(#)bsd.README 8.2 (Berkeley) 4/2/94 31.1Scgd 41.1ScgdThis is the README file for the new make "include" files for the BSD 51.1Scgdsource tree. The files are installed in /usr/share/mk, and are, by 61.11Sjtcconvention, named with the suffix ".mk". 71.1Scgd 81.1ScgdNote, this file is not intended to replace reading through the .mk 91.1Scgdfiles for anything tricky. 101.1Scgd 111.1Scgd=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= 121.1Scgd 131.1ScgdRANDOM THINGS WORTH KNOWING: 141.1Scgd 151.1ScgdThe files are simply C-style #include files, and pretty much behave like 161.1Scgdyou'd expect. The syntax is slightly different in that a single '.' is 171.1Scgdused instead of the hash mark, i.e. ".include <bsd.prog.mk>". 181.1Scgd 191.1ScgdOne difference that will save you lots of debugging time is that inclusion 201.1Scgdof the file is normally done at the *end* of the Makefile. The reason for 211.1Scgdthis is because .mk files often modify variables and behavior based on the 221.1Scgdvalues of variables set in the Makefile. To make this work, remember that 231.1Scgdthe FIRST target found is the target that is used, i.e. if the Makefile has: 241.1Scgd 251.1Scgd a: 261.1Scgd echo a 271.1Scgd a: 281.1Scgd echo a number two 291.1Scgd 301.1Scgdthe command "make a" will echo "a". To make things confusing, the SECOND 311.1Scgdvariable assignment is the overriding one, i.e. if the Makefile has: 321.1Scgd 331.1Scgd a= foo 341.1Scgd a= bar 351.1Scgd 361.1Scgd b: 371.1Scgd echo ${a} 381.1Scgd 391.1Scgdthe command "make b" will echo "bar". This is for compatibility with the 401.1Scgdway the V7 make behaved. 411.1Scgd 421.1ScgdIt's fairly difficult to make the BSD .mk files work when you're building 431.75Sagcmultiple programs in a single directory. It's a lot easier to split up the 441.1Scgdprograms than to deal with the problem. Most of the agony comes from making 451.36Srossthe "obj" directory stuff work right, not because we switched to a new version 461.1Scgdof make. So, don't get mad at us, figure out a better way to handle multiple 471.1Scgdarchitectures so we can quit using the symbolic link stuff. (Imake doesn't 481.1Scgdcount.) 491.1Scgd 501.1ScgdThe file .depend in the source directory is expected to contain dependencies 511.1Scgdfor the source files. This file is read automatically by make after reading 521.1Scgdthe Makefile. 531.1Scgd 541.1ScgdThe variable DESTDIR works as before. It's not set anywhere but will change 551.1Scgdthe tree where the file gets installed. 561.1Scgd 571.1ScgdThe profiled libraries are no longer built in a different directory than 581.1Scgdthe regular libraries. A new suffix, ".po", is used to denote a profiled 591.21Schristosobject, and ".so" denotes a shared (position-independent) object. 601.97Sitojun 611.97SitojunThere are various make variables used during the build. Basic rule for 621.97Sitojunthe variable naming scheme is as follows: 631.97Sitojun 641.97SitojunMKxxx Can be set to `no' by a user to disable functionality. 651.97Sitojun Defaults to `yes' (or usually does) 661.97Sitojun 671.116SlukemNOxxx If defined, disables a feature. 681.116Slukem Not intended for users. 691.116Slukem This is to allow Makefiles to disable functionality 701.116Slukem that they don't support (such as missing man pages). 711.101Slukem NOxxx variables must be defined before <bsd.own.mk> 721.101Slukem is included. 731.21Schristos 741.45SlukemThe following variables that control how things are made/installed that 751.47Stvare not set by default. These should not be set by Makefiles; they're for 761.47Stvthe user to define in MAKECONF (see bsd.own.mk, below) or on the make(1) 771.47Stvcommand line: 781.21Schristos 791.45SlukemBUILD If defined, 'make install' checks that the targets in the 801.45Slukem source directories are up-to-date and remakes them if they 811.21Schristos are out of date, instead of blindly trying to install 821.79Swiz out of date or non-existent targets. 831.21Schristos 841.45SlukemUPDATE If defined, 'make install' only installs targets that are 851.45Slukem more recently modified in the source directories that their 861.45Slukem installed counterparts. 871.52Ssimonb 881.83SperryUNPRIVED If defined, don't set the owner/group/mode when installing 891.83Sperry files or directories, and keep a metadata log of what 901.83Sperry the owner/group/mode should be. This allows a 911.83Sperry non-root "make install". 921.45Slukem 931.86SthorpejMKBFD If "no", don't build libbfd, libiberty, or any of 941.86Sthorpej the things that depend on them (binutils/gas/ld, 951.103Sthorpej gdb, dbsym, mdsetimage). 961.86Sthorpej 971.45SlukemMKCATPAGES If "no", don't build or install the catman pages. 981.45Slukem 991.45SlukemMKDOC If "no", don't build or install the documentation. 1001.86Sthorpej 1011.104SlukemMKDYNAMICROOT If "no", build programs in /bin and /sbin statically, 1021.104Slukem don't install certain libraries in /lib, and don't 1031.104Slukem install the shared linker into /libexec. 1041.104Slukem 1051.103SthorpejMKGDB If "no", don't build gdb. 1061.86Sthorpej 1071.86SthorpejMKGCC If "no", don't build gcc or any of the gcc-related 1081.86Sthorpej libraries (libg2c, libgcc, libobjc, libstdc++). 1091.92Sross 1101.92SrossMKIEEEFP If "no", don't add code for IEEE754/IEC60559 conformance. 1111.92Sross Has no effect on most platforms. 1121.45Slukem 1131.47StvMKINFO If "no", don't build or install Info documentation from 1141.47Stv Texinfo source files. 1151.45Slukem 1161.45SlukemMKLINT If "no", don't build or install the lint libraries. 1171.45Slukem 1181.45SlukemMKMAN If "no", don't build or install the man or catman pages. 1191.46Slukem Also acts as "MKCATPAGES=no" 1201.45Slukem 1211.74SitojunMKNLS If "no", don't build or install the NLS files and locale 1221.74Sitojun definition files. 1231.45Slukem 1241.55SsommerfeMKOBJ If "no", don't enable the rule which creates objdirs. 1251.55Ssommerfe "yes" by default. 1261.55Ssommerfe 1271.55SsommerfeMKOBJDIRS If "no", don't create objdirs during a "make build". 1281.55Ssommerfe "no" by default. 1291.45Slukem 1301.45SlukemMKPIC If "no", don't build or install shared libraries. 1311.45Slukem 1321.45SlukemMKPICINSTALL If "no", don't install the *_pic.a libraries. 1331.45Slukem 1341.45SlukemMKPROFILE If "no", don't build or install the profiling libraries. 1351.45Slukem 1361.48SlukemMKSHARE If "no", act as "MKCATPAGES=no MKDOC=no MKINFO=no MKMAN=no 1371.48Slukem MKNLS=no". I.e, don't build catman pages, documentation, 1381.48Slukem Info documentation, man pages, NLS files, ... 1391.1Scgd 1401.118Slukem 1411.118Slukem=-=-=-=-= sys.mk =-=-=-=-= 1421.1Scgd 1431.1ScgdThe include file <sys.mk> has the default rules for all makes, in the BSD 1441.1Scgdenvironment or otherwise. You probably don't want to touch this file. 1451.71SitojunIf you intend to run a cross build, you will need to supply the following 1461.71Sitojunhost tools, and configure the following variables properly: 1471.71Sitojun 1481.71SitojunOBJCOPY objcopy - copy and translate object files 1491.71Sitojun 1501.71SitojunSTRIP strip - Discard symbols from object files 1511.71Sitojun 1521.1Scgd 1531.118Slukem=-=-=-=-= bsd.own.mk =-=-=-=-= 1541.1Scgd 1551.17SthorpejThe include file <bsd.own.mk> contains source tree configuration parameters, 1561.17Sthorpejsuch as the owners, groups, etc. for both manual pages and binaries, and 1571.17Sthorpeja few global "feature configuration" parameters. 1581.1Scgd 1591.1ScgdIt has no targets. 1601.1Scgd 1611.29ScjsTo get system-specific configuration parameters, bsd.own.mk will try to 1621.29Scjsinclude the file specified by the "MAKECONF" variable. If MAKECONF is not 1631.29Scjsset, or no such file exists, the system make configuration file, /etc/mk.conf 1641.29Scjsis included. These files may define any of the variables described below. 1651.17Sthorpej 1661.17Sthorpejbsd.own.mk sets the following variables, if they are not already defined 1671.17Sthorpej(defaults are in brackets): 1681.15Scgd 1691.98SlukemNETBSDSRCDIR Top of the NetBSD source tree. 1701.98Slukem If _SRC_TOP_ != "", that will be used as the default, 1711.98Slukem otherwise BSDSRCDIR will be used as the default. 1721.98Slukem Various makefiles within the NetBSD source tree will 1731.98Slukem use this to reference the top level of the source tree. 1741.98Slukem 1751.95Slukem_SRC_TOP_ Top of the system source tree, as determined by <bsd.own.mk> 1761.98Slukem based on the presence of tools/ and build.sh. This variable 1771.98Slukem is "internal" to <bsd.own.mk>, although its value is only 1781.98Slukem determined once and then propagated to all sub-makes. 1791.95Slukem 1801.15ScgdBSDSRCDIR The real path to the system sources, so that 'make obj' 1811.116Slukem will work correctly. [/usr/src] 1821.15Scgd 1831.15ScgdBSDOBJDIR The real path to the system 'obj' tree, so that 'make obj' 1841.116Slukem will work correctly. [/usr/obj] 1851.15Scgd 1861.116SlukemBINGRP Binary group. [wheel] 1871.15Scgd 1881.116SlukemBINOWN Binary owner. [root] 1891.15Scgd 1901.116SlukemBINMODE Binary mode. [555] 1911.15Scgd 1921.116SlukemNONBINMODE Mode for non-executable files. [444] 1931.15Scgd 1941.116SlukemMANDIR Base path for manual installation. [/usr/share/man/cat] 1951.15Scgd 1961.116SlukemMANGRP Manual group. [wheel] 1971.15Scgd 1981.116SlukemMANOWN Manual owner. [root] 1991.15Scgd 2001.116SlukemMANMODE Manual mode. [${NONBINMODE}] 2011.15Scgd 2021.21SchristosMANINSTALL Manual installation type: maninstall, catinstall, or both 2031.76Sfair 2041.76SfairLDSTATIC Control program linking; if set blank, link everything 2051.76Sfair dynamically. If set to "-static", link everything statically. 2061.76Sfair If not set, programs link according to their makefile. 2071.21Schristos 2081.116SlukemLIBDIR Base path for library installation. [/usr/lib] 2091.15Scgd 2101.116SlukemLINTLIBDIR Base path for lint(1) library installation. [/usr/libdata/lint] 2111.15Scgd 2121.116SlukemLIBGRP Library group. [${BINGRP}] 2131.15Scgd 2141.116SlukemLIBOWN Library owner. [${BINOWN}] 2151.15Scgd 2161.116SlukemLIBMODE Library mode. [${NONBINMODE}] 2171.15Scgd 2181.15ScgdDOCDIR Base path for system documentation (e.g. PSD, USD, etc.) 2191.116Slukem installation. [/usr/share/doc] 2201.62Ssimonb 2211.62SsimonbHTMLDOCDIR Base path for html system documentation installation. 2221.62Ssimonb [/usr/share/doc/html] 2231.15Scgd 2241.116SlukemDOCGRP Documentation group. [wheel] 2251.15Scgd 2261.116SlukemDOCOWN Documentation owner. [root] 2271.15Scgd 2281.116SlukemDOCMODE Documentation mode. [${NONBINMODE}] 2291.15Scgd 2301.84SkleinkNLSDIR Base path for Native Language Support files installation. 2311.15Scgd [/usr/share/nls] 2321.1Scgd 2331.116SlukemNLSGRP Native Language Support files group. [wheel] 2341.1Scgd 2351.116SlukemNLSOWN Native Language Support files owner. [root] 2361.1Scgd 2371.116SlukemNLSMODE Native Language Support files mode. [${NONBINMODE}] 2381.1Scgd 2391.32SmikelSTRIPFLAG The flag passed to the install program to cause the binary 2401.1Scgd to be stripped. This is to be used when building your 2411.1Scgd own install script so that the entire system can be made 2421.116Slukem stripped/not-stripped using a single knob. [-s] 2431.1Scgd 2441.2ScgdCOPY The flag passed to the install program to cause the binary 2451.2Scgd to be copied rather than moved. This is to be used when 2461.2Scgd building our own install script so that the entire system 2471.2Scgd can either be installed with copies, or with moves using 2481.116Slukem a single knob. [-c] 2491.15Scgd 2501.17SthorpejAdditionally, the following variables may be set by bsd.own.mk or in a 2511.17Sthorpejmake configuration file to modify the behaviour of the system build 2521.17Sthorpejprocess (default values are in brackets along with comments, if set by 2531.17Sthorpejbsd.own.mk): 2541.111Sthorpej 2551.111SthorpejMKPICLIB bsd.own.mk provides a default for this variable, which is 2561.111Sthorpej used by bsd.lib.mk. The default value is provided by 2571.111Sthorpej bsd.own.mk since non-library Makefiles may need to check 2581.111Sthorpej its value in order to generate proper dependencies against 2591.111Sthorpej libraries used only during the build process (which would 2601.111Sthorpej not be installed into the destination directory). 2611.15Scgd 2621.64SthorpejMKCRYPTO If set to "no", no cryptography support will be built 2631.64Sthorpej into the system. Defaults to "yes". 2641.64Sthorpej 2651.66SitojunMKCRYPTO_IDEA If set to "yes", IDEA support will be built into 2661.66Sitojun libcrypto_idea.a. Defaults to "no". 2671.64Sthorpej 2681.105SitojunMKCRYPTO_MDC2 If set to "yes", MDC2 support will be built into 2691.105Sitojun libcrypto_mdc2.a. Defaults to "no". 2701.105Sitojun 2711.66SitojunMKCRYPTO_RC5 If set to "yes", RC5 support will be built into 2721.66Sitojun libcrypto_rc5.a. Defaults to "no". 2731.64Sthorpej 2741.94SthorpejMKHESIOD If set to "no", disables building of Hesiod infrastructure 2751.94Sthorpej (libraries and support programs). 2761.64Sthorpej 2771.94SthorpejMKKERBEROS If set to "no", disables building of Kerberos (v4 or v5) 2781.94Sthorpej infrastructure (libraries and support programs). 2791.2Scgd 2801.94SthorpejMKSKEY If set to "no", disables building of S/key authentication 2811.94Sthorpej infrastructure (libraries and support programs). 2821.94Sthorpej 2831.94SthorpejMKYP If set to "no", disables building of YP (NIS) 2841.94Sthorpej infrastructure (libraries and support programs). 2851.94Sthorpej 2861.94SthorpejUSE_HESIOD If set to "no", disables building Hesiod support into 2871.94Sthorpej various system utilities/libraries that support it. 2881.94Sthorpej If MKHESIOD is set to "no", USE_HESIOD will also be 2891.94Sthorpej forced to "no". 2901.94Sthorpej 2911.94SthorpejUSE_KERBEROS If set to "no", disables building Kerberos (v4 or v5) 2921.94Sthorpej support into various system utilities/libraries that 2931.94Sthorpej support it. If MKKERBEROS is set to "no", USE_KERBEROS 2941.94Sthorpej will also be forced to "no". 2951.94Sthorpej 2961.94SthorpejUSE_SKEY If set to "no", disables building S/key authentication 2971.94Sthorpej support into various system utilities/libraries that 2981.94Sthorpej support it. If MKSKEY is set to "no", USE_SKEY will 2991.94Sthorpej also be forced to "no". 3001.94Sthorpej 3011.94SthorpejUSE_YP If set to "no", disables building YP (NIS) support into 3021.94Sthorpej various system utilities/libraries that support it. If 3031.94Sthorpej MKYP is set to "no", USE_YP will also be forced to "no". 3041.15Scgd 3051.15ScgdMANZ Compress manual pages at installation time. 3061.1Scgd 3071.15ScgdNOPROFILE Do not build profiled versions of system libraries 3081.1Scgd 3091.15ScgdNOPIC Do not build PIC versions of system libraries, and 3101.15Scgd do not build shared libraries. [set if ${MACHINE_ARCH} 3111.65Sjlam is "sh3" and ${OBJECT_FMT} is "COFF", unset otherwise.] 3121.1Scgd 3131.40SperryNOLINT Do not build lint libraries. 3141.33Sjonathan 3151.116SlukemOBJECT_FMT Object file format. [set to "ELF" on architectures that 3161.50Sthorpej use ELF -- currently if ${MACHINE_ARCH} is "alpha", 3171.50Sthorpej "mipsel", "mipseb", "powerpc", "sparc", "sparc64", 3181.77Ssimonb "i386" and some m68k machines, or set to "a.out" on 3191.77Ssimonb other architectures]. 3201.33Sjonathan 3211.78SsimonbMKSOFTFLOAT If "yes", build with options to enable the compiler to 3221.78Ssimonb generate output containing library calls for floating 3231.78Ssimonb point and possibly soft-float library support. Defaults 3241.78Ssimonb to "no". 3251.103Sthorpej 3261.103SthorpejTOOLCHAIN_MISSING 3271.103Sthorpej If "yes", this indicates that the platform being built 3281.103Sthorpej does not have a working in-tree toolchain. If the 3291.103Sthorpej MACHINE_ARCH in question falls into this category, the 3301.103Sthorpej variable is conditionally assigned the value "yes". 3311.103Sthorpej Otherwise, the variable is unconditionally assigned the 3321.103Sthorpej value "no". 3331.103Sthorpej 3341.103Sthorpej If TOOLCHAIN_MISSING is "yes", the variables MKBFD, MKGCC, 3351.103Sthorpej and MKGDB are unconditionally assigned the value "no". 3361.103Sthorpej 3371.103SthorpejEXTERNAL_TOOLCHAIN 3381.103Sthorpej This variable is not directly set by <bsd.own.mk>, but 3391.103Sthorpej including <bsd.own.mk> is the canonical way to gain 3401.103Sthorpej access to this variable. The variable should be defined 3411.103Sthorpej either in the user's environment or in the user's mk.conf 3421.103Sthorpej file. If defined, this variable indicates the root of 3431.103Sthorpej an external toolchain which will be used to build the 3441.103Sthorpej tree. For example, if a platform is a TOOLCHAIN_MISSING 3451.103Sthorpej platform, EXTERNAL_TOOLCHAIN can be used to re-enable the 3461.103Sthorpej cross-compile framework. 3471.103Sthorpej 3481.103Sthorpej If EXTERNAL_TOOLCHAIN is defined, the variable MKGCC is 3491.103Sthorpej unconditionally assigned the value "no", since the external 3501.103Sthorpej version of the compiler may not be able to build the library 3511.103Sthorpej components of the in-tree compiler. 3521.103Sthorpej 3531.103Sthorpej NOTE: This variable is not yet used in as many places as 3541.103Sthorpej it should be. Expect the exact semantics of this variable 3551.103Sthorpej to change in the short term as parts of the cross-compile 3561.103Sthorpej framework continue to be cleaned up. 3571.1Scgd 3581.17Sthorpejbsd.own.mk is generally useful when building your own Makefiles so that 3591.1Scgdthey use the same default owners etc. as the rest of the tree. 3601.1Scgd 3611.1Scgd 3621.118Slukem=-=-=-=-= bsd.files.mk =-=-=-=-= 3631.106Sthorpej 3641.118SlukemThe include file <bsd.files.mk> handles the FILES variables and is included 3651.118Slukemfrom bsd.lib.mk and bsd.prog.mk. 3661.106Sthorpej 3671.106Sthorpej 3681.118Slukem=-=-=-=-= bsd.gcc.mk =-=-=-=-= 3691.113Sthorpej 3701.113SthorpejThe include file <bsd.gcc.mk> computes various parameters related to GCC 3711.113Sthorpejsupport libraries. It defines no targets. <bsd.own.mk> MUST be included 3721.113Sthorpejbefore bsd.gcc.mk. 3731.113Sthorpej 3741.113SthorpejThe primary users of bsd.gcc.mk are <bsd.prog.mk> and <bsd.lib.mk>, each 3751.113Sthorpejof which need to know where to find certain GCC support libraries. 3761.113Sthorpej 3771.113SthorpejThe behavior of bsd.gcc.mk is influenced by the EXTERNAL_TOOLCHAIN variable, 3781.113Sthorpejwhich is generally set by the user. If EXTERNAL_TOOLCHAIN it set, then 3791.113Sthorpejthe compiler is asked where to find the support libraries, otherwise the 3801.113Sthorpejsupport libraries are found in ${DESTDIR}/usr/lib. 3811.113Sthorpej 3821.113Sthorpejbsd.gcc.mk sets the following variables: 3831.113Sthorpej 3841.118Slukem_GCC_CRTBEGIN The full path name to crtbegin.o. 3851.118Slukem 3861.118Slukem_GCC_CRTBEGINS The full path name to crtbeginS.o. 3871.118Slukem 3881.118Slukem_GCC_CRTEND The full path name to crtend.o. 3891.118Slukem 3901.118Slukem_GCC_CRTENDS The full path name to crtendS.o. 3911.118Slukem 3921.118Slukem_GCC_LIBGCCDIR The directory where libgcc.a is located. 3931.118Slukem 3941.118Slukem 3951.118Slukem=-=-=-=-= bsd.inc.mk =-=-=-=-= 3961.118Slukem 3971.118SlukemThe include file <bsd.inc.mk> defines the includes target and uses two 3981.118Slukemvariables: 3991.118Slukem 4001.118SlukemINCS The list of include files 4011.118Slukem 4021.118SlukemINCSDIR The location to install the include files. 4031.118Slukem 4041.118SlukemINCSNAME Target name of the include file, if only one; same as 4051.118Slukem FILESNAME, but for include files. 4061.118Slukem 4071.118SlukemINCSNAME_<file> The name file <file> should be installed as, if not <file>, 4081.118Slukem same as FILESNAME_<file>, but for include files. 4091.118Slukem 4101.118Slukem 4111.118Slukem=-=-=-=-= bsd.info.mk =-=-=-=-= 4121.118Slukem 4131.118SlukemThe include file <bsd.info.mk> is used to generate and install GNU Info 4141.118Slukemdocumentation from respective Texinfo source files. It defines three 4151.118Slukemimplicit targets (.txi.info, .texi.info, and .texinfo.info), and uses the 4161.118Slukemfollowing variables: 4171.118Slukem 4181.118SlukemTEXINFO List of Texinfo source files. Info documentation will 4191.118Slukem consist of single files with the extension replaced by 4201.118Slukem .info. 4211.118Slukem 4221.118SlukemINFOFLAGS Flags to pass to makeinfo. [] 4231.118Slukem 4241.118Slukem 4251.118Slukem=-=-=-=-= bsd.kernobj.mk =-=-=-=-= 4261.118Slukem 4271.118SlukemThe include file <bsd.kernobj.mk> defines variables related to the 4281.118Slukemlocation of kernel sources and object directories. 4291.118Slukem 4301.118SlukemKERNSRCDIR Is the location of the top of the kernel src. 4311.118Slukem It defaults to ${_SRC_TOP_}/sys 4321.118Slukem 4331.118SlukemKERNARCHDIR Is the location of the machine dependent kernel 4341.118Slukem sources. It defaults to arch/${MACHINE} 4351.118Slukem 4361.118SlukemKERNCONFDIR Is where the configuration files for kernels are 4371.118Slukem found; default is ${KERNSRCDIR}/${KERNARCHDIR}/conf. 4381.118Slukem 4391.118SlukemKERNOBJDIR Is the kernel build directory. The kernel GENERIC for 4401.118Slukem instance will be compiled in ${KERNOBJDIR}/GENERIC. 4411.118Slukem The default value is 4421.118Slukem ${MAKEOBJDIRPREFIX}${KERNSRCDIR}/${KERNARCHDIR}/compile 4431.118Slukem if it exists or the target 'obj' is being made. 4441.118Slukem Otherwise the default is 4451.118Slukem ${KERNSRCDIR}/${KERNARCHDIR}/compile. 4461.118Slukem 4471.118SlukemIt is important that Makefiles (such as those under src/distrib) that 4481.118Slukemwish to find compiled kernels use bsd.kernobj.mk and ${KERNOBJDIR} 4491.118Slukemrather than make assumptions about the location of the compiled kernel. 4501.118Slukem 4511.118Slukem 4521.118Slukem=-=-=-=-= bsd.kinc.mk =-=-=-=-= 4531.118Slukem 4541.118SlukemThe include file <bsd.kinc.mk> defines the many targets (includes, 4551.118Slukemsubdirectories, etc.), and is used by kernel makefiles to handle 4561.118Slukeminclude file installation. It is intended to be included alone, by 4571.118Slukemkernel Makefiles. Please see bsd.kinc.mk for more details, and keep 4581.118Slukemthe documentation in that file up to date. 4591.118Slukem 4601.118Slukem 4611.118Slukem=-=-=-=-= bsd.lib.mk =-=-=-=-= 4621.118Slukem 4631.118SlukemThe include file <bsd.lib.mk> has support for building libraries. It has 4641.118Slukemthe same eight targets as <bsd.prog.mk>: all, clean, cleandir, depend, 4651.118Slukemincludes, install, lint, and tags. Additionally, it has a checkver target 4661.118Slukemwhich checks for installed shared object libraries whose version is greater 4671.118Slukemthat the version of the source. It has a limited number of suffixes, 4681.118Slukemconsistent with the current needs of the BSD tree. bsd.lib.mk includes 4691.118Slukem<bsd.shlib.mk> to get shared library parameters. 4701.118Slukem 4711.118SlukemIt sets/uses the following variables: 4721.118Slukem 4731.118SlukemLIB The name of the library to build. 4741.118Slukem 4751.118SlukemLIBDIR Target directory for libraries. 4761.118Slukem 4771.118SlukemSHLIBINSTALLDIR Target directory for shared libraries if ${USE_SHLIBDIR} 4781.118Slukem is "yes". 4791.118Slukem 4801.118SlukemUSE_SHLIBDIR If "yes", use ${SHLIBINSTALLDIR} instead of ${LIBDIR} 4811.118Slukem as the path to install shared libraries to. 4821.118Slukem USE_SHLIBDIR must be defined before <bsd.own.mk> is included. 4831.118Slukem 4841.118SlukemLINTLIBDIR Target directory for lint libraries. 4851.118Slukem 4861.118SlukemLIBGRP Library group. 4871.118Slukem 4881.118SlukemLIBOWN Library owner. 4891.118Slukem 4901.118SlukemLIBMODE Library mode. 4911.118Slukem 4921.118SlukemLDADD Additional loader objects. 4931.118Slukem 4941.118SlukemMAN The manual pages to be installed (use a .1 - .9 suffix). 4951.118Slukem 4961.118SlukemMKLINKLIB If "no", act as "MKPICINSTALL=no MKPROFILE=no". 4971.118Slukem Also: 4981.118Slukem - don't install the .a libraries 4991.118Slukem - don't install _pic.a libraries on PIC systems 5001.118Slukem - don't build .a libraries on PIC systems 5011.118Slukem - don't install the .so symlink on ELF systems 5021.118Slukem I.e, only install the shared library (and the .so.major 5031.118Slukem symlink on ELF). 5041.118Slukem 5051.118SlukemMKPICLIB If "no", don't build _pic.a libraries, and build the 5061.118Slukem shared object libraries from the .a libraries. A 5071.118Slukem symlink is installed in ${DESTDIR}/usr/lib for the 5081.118Slukem _pic.a library pointing to the .a library. 5091.118Slukem 5101.118SlukemNOCHECKVER_<library> 5111.118SlukemNOCHECKVER If set, disables checking for installed shared object 5121.118Slukem libraries with versions greater than the source. A 5131.118Slukem particular library name, without the "lib" prefix, may 5141.118Slukem be appended to the variable name to disable the check for 5151.118Slukem only that library. 5161.118Slukem 5171.118SlukemSRCS List of source files to build the library. Suffix types 5181.118Slukem .s, .c, and .f are supported. Note, .s files are preferred 5191.118Slukem to .c files of the same name. (This is not the default for 5201.118Slukem versions of make.) 5211.118Slukem 5221.118SlukemThe include file <bsd.lib.mk> includes the file named "../Makefile.inc" 5231.118Slukemif it exists, as well as the include file <bsd.man.mk>. 5241.118Slukem 5251.118SlukemIt has rules for building profiled objects; profiled libraries are 5261.118Slukembuilt by default. 5271.118Slukem 5281.118SlukemLibraries are ranlib'd when made. 5291.118Slukem 5301.118Slukem 5311.118Slukem=-=-=-=-= bsd.links.mk =-=-=-=-= 5321.118Slukem 5331.118SlukemThe include file <bsd.links.mk> handles the LINKS and SYMLINKS variables 5341.118Slukemand is included from from bsd.lib.mk and bsd.prog.mk. 5351.118Slukem 5361.118Slukem 5371.118Slukem=-=-=-=-= bsd.man.mk =-=-=-=-= 5381.118Slukem 5391.118SlukemThe include file <bsd.man.mk> handles installing manual pages and their 5401.118Slukemlinks. 5411.118Slukem 5421.118SlukemIt has a two targets: 5431.118Slukem 5441.118Slukem maninstall: 5451.118Slukem Install the manual page sources and their links. 5461.118Slukem catinstall: 5471.118Slukem Install the preformatted manual pages and their links. 5481.118Slukem 5491.118SlukemIt sets/uses the following variables: 5501.118Slukem 5511.118SlukemMANDIR Base path for manual installation. 5521.118Slukem 5531.118SlukemMANGRP Manual group. 5541.118Slukem 5551.118SlukemMANOWN Manual owner. 5561.118Slukem 5571.118SlukemMANMODE Manual mode. 5581.118Slukem 5591.118SlukemMANSUBDIR Subdirectory under the manual page section, i.e. "/vax" 5601.118Slukem or "/tahoe" for machine specific manual pages. 5611.118Slukem 5621.118SlukemMAN The manual pages to be installed (use a .1 - .9 suffix). 5631.118Slukem 5641.118SlukemMLINKS List of manual page links (using a .1 - .9 suffix). The 5651.118Slukem linked-to file must come first, the linked file second, 5661.118Slukem and there may be multiple pairs. The files are soft-linked. 5671.118Slukem 5681.118SlukemThe include file <bsd.man.mk> includes a file named "../Makefile.inc" if 5691.118Slukemit exists. 5701.118Slukem 5711.118Slukem 5721.118Slukem=-=-=-=-= bsd.obj.mk =-=-=-=-= 5731.118Slukem 5741.118SlukemThe include file <bsd.obj.mk> defines targets related to the creation 5751.118Slukemand use of separated object and source directories. 5761.118Slukem 5771.118SlukemIf an environment variable named MAKEOBJDIRPREFIX is set, make(1) uses 5781.118Slukem${MAKEOBJDIRPREFIX}${.CURDIR} as the name of the object directory if 5791.118Slukemit exists. Otherwise make(1) looks for the existence of a 5801.118Slukemsubdirectory (or a symlink to a directory) of the source directory 5811.118Slukeminto which built targets should be placed. If an environment variable 5821.118Slukemnamed MAKEOBJDIR is set, make(1) uses its value as the name of the 5831.118Slukemobject directory; failing that, make first looks for a subdirectory 5841.118Slukemnamed "obj.${MACHINE}", and if that doesn't exist, it looks for "obj". 5851.118Slukem 5861.118SlukemObject directories are not created automatically by make(1) if they 5871.118Slukemdon't exist; you need to run a separate "make obj". (This will happen 5881.118Slukemduring a top-level build if "MKOBJDIRS" is set to a value other than 5891.118Slukem"no"). When the source directory is a subdirectory of ${BSDSRCDIR} -- 5901.118Slukemand this is determined by a simple string prefix comparison -- object 5911.118Slukemdirectories are created in a separate object directory tree, and a 5921.118Slukemsymlink to the object directory in that tree is created in the source 5931.118Slukemdirectory; otherwise, "make obj" assumes that you're not in the main 5941.118Slukemsource tree and that it's not safe to use a separate object tree. 5951.118Slukem 5961.118SlukemSeveral variables used by <bsd.obj.mk> control exactly what 5971.118Slukemdirectories and links get created during a "make obj": 5981.118Slukem 5991.118SlukemMAKEOBJDIR If set, this is the component name of the object 6001.118Slukem directory. 6011.118Slukem 6021.118SlukemOBJMACHINE If this is set but MAKEOBJDIR is not set, creates 6031.118Slukem object directories or links named "obj.${MACHINE}"; 6041.118Slukem otherwise, just creates ones named "obj". 6051.118Slukem 6061.118SlukemUSR_OBJMACHINE If set, and the current directory is a subdirectory of 6071.118Slukem ${BSDSRCDIR}, create object directory in the 6081.118Slukem corresponding subdirectory of ${BSDOBJDIR}.${MACHINE}; 6091.118Slukem otherwise, create it in the corresponding subdirectory 6101.118Slukem of ${BSDOBJDIR} 6111.113Sthorpej 6121.118SlukemBUILDID If set, the contents of this variable are appended 6131.118Slukem to the object directory name. If OBJMACHINE is also 6141.118Slukem set, ".${BUILDID}" is added after ".${MACHINE}". 6151.113Sthorpej 6161.106Sthorpej 6171.118Slukem=-=-=-=-= bsd.prog.mk =-=-=-=-= 6181.106Sthorpej 6191.1ScgdThe include file <bsd.prog.mk> handles building programs from one or 6201.1Scgdmore source files, along with their manual pages. It has a limited number 6211.106Sthorpejof suffixes, consistent with the current needs of the BSD tree. bsd.prog.mk 6221.106Sthorpejincludes <bsd.shlib.mk> to get shared library parameters. 6231.1Scgd 6241.16SjtcIt has eight targets: 6251.1Scgd 6261.1Scgd all: 6271.102Sthorpej build the program and its manual page. This also 6281.102Sthorpej creates a GDB initialization file (.gdbinit) in 6291.102Sthorpej the objdir. The .gdbinit file sets the shared library 6301.102Sthorpej prefix to ${DESTDIR} to facilitate cross-debugging. 6311.1Scgd clean: 6321.1Scgd remove the program, any object files and the files a.out, 6331.24Smikel Errs, errs, mklog, and ${PROG}.core. 6341.1Scgd cleandir: 6351.1Scgd remove all of the files removed by the target clean, as 6361.1Scgd well as .depend, tags, and any manual pages. 6371.42Slukem `distclean' is a synonym for `cleandir'. 6381.1Scgd depend: 6391.1Scgd make the dependencies for the source files, and store 6401.1Scgd them in the file .depend. 6411.16Sjtc includes: 6421.16Sjtc install any header files. 6431.1Scgd install: 6441.1Scgd install the program and its manual pages; if the Makefile 6451.1Scgd does not itself define the target install, the targets 6461.1Scgd beforeinstall and afterinstall may also be used to cause 6471.1Scgd actions immediately before and after the install target 6481.1Scgd is executed. 6491.1Scgd lint: 6501.1Scgd run lint on the source files 6511.1Scgd tags: 6521.1Scgd create a tags file for the source files. 6531.1Scgd 6541.1ScgdIt sets/uses the following variables: 6551.1Scgd 6561.1ScgdBINGRP Binary group. 6571.1Scgd 6581.1ScgdBINOWN Binary owner. 6591.1Scgd 6601.1ScgdBINMODE Binary mode. 6611.1Scgd 6621.1ScgdCLEANFILES Additional files to remove for the clean and cleandir targets. 6631.1Scgd 6641.1ScgdCOPTS Additional flags to the compiler when creating C objects. 6651.112Sthorpej 6661.112SthorpejCPUFLAGS Additional flags to the compiler/assembler to select 6671.112Sthorpej CPU instruction set options, CPU tuning options, etc. 6681.35Slukem 6691.35SlukemCPPFLAGS Additional flags to the C pre-processor 6701.102Sthorpej 6711.102SthorpejGDBINIT List of GDB initialization files to add to "source" 6721.102Sthorpej directives in the .gdbinit file that is created in the 6731.102Sthorpej objdir. 6741.1Scgd 6751.1ScgdLDADD Additional loader objects. Usually used for libraries. 6761.1Scgd For example, to load with the compatibility and utility 6771.1Scgd libraries, use: 6781.1Scgd 6791.5Sjtc LDADD+=-lutil -lcompat 6801.1Scgd 6811.1ScgdLDFLAGS Additional loader flags. 6821.1Scgd 6831.1ScgdLINKS The list of binary links; should be full pathnames, the 6841.1Scgd linked-to file coming first, followed by the linked 6851.1Scgd file. The files are hard-linked. For example, to link 6861.1Scgd /bin/test and /bin/[, use: 6871.1Scgd 6881.1Scgd LINKS= ${DESTDIR}/bin/test ${DESTDIR}/bin/[ 6891.19Sperry 6901.19SperrySYMLINKS The list of symbolic links; should be full pathnames. 6911.20Sperry Syntax is identical to LINKS. Note that DESTDIR is not 6921.20Sperry automatically included in the link. 6931.1Scgd 6941.15ScgdMAN Manual pages (should end in .1 - .9). If no MAN variable is 6951.8Scgd defined, "MAN=${PROG}.1" is assumed. 6961.1Scgd 6971.1ScgdPROG The name of the program to build. If not supplied, nothing 6981.1Scgd is built. 6991.1Scgd 7001.88SthorpejPROG_CXX If defined, the name of the program to build. Also 7011.88Sthorpej causes <bsd.prog.mk> to link the program with the C++ 7021.88Sthorpej compiler rather than the C compiler. PROG_CXX overrides 7031.88Sthorpej the value of PROG if PROG is also set. 7041.87Sthorpej 7051.21SchristosPROGNAME The name that the above program will be installed as, if 7061.21Schristos different from ${PROG}. 7071.21Schristos 7081.37StvSRCS List of source files to build the program. If SRCS is not 7091.1Scgd defined, it's assumed to be ${PROG}.c. 7101.108Sjwise 7111.108SjwiseDPSRCS List of source files which are needed for generating 7121.108Sjwise dependencies, but are not needed in ${SRCS}. 7131.1Scgd 7141.1ScgdDPADD Additional dependencies for the program. Usually used for 7151.1Scgd libraries. For example, to depend on the compatibility and 7161.1Scgd utility libraries use: 7171.1Scgd 7181.5Sjtc DPADD+=${LIBCOMPAT} ${LIBUTIL} 7191.1Scgd 7201.1Scgd The following libraries are predefined for DPADD: 7211.1Scgd 7221.21Schristos LIBCRT0?= ${DESTDIR}/usr/lib/crt0.o 7231.99Sitojun LIBBZ2?= ${DESTDIR}/usr/lib/libbz2.a 7241.21Schristos LIBC?= ${DESTDIR}/usr/lib/libc.a 7251.21Schristos LIBC_PIC?= ${DESTDIR}/usr/lib/libc_pic.a 7261.99Sitojun LIBCDK?= ${DESTDIR}/usr/lib/libcdk.a 7271.99Sitojun LIBCOM_ERR?= ${DESTDIR}/usr/lib/libcom_err.a 7281.21Schristos LIBCOMPAT?= ${DESTDIR}/usr/lib/libcompat.a 7291.21Schristos LIBCRYPT?= ${DESTDIR}/usr/lib/libcrypt.a 7301.99Sitojun LIBCRYPTO?= ${DESTDIR}/usr/lib/libcrypto.a 7311.99Sitojun LIBCRYPTO_IDEA?=${DESTDIR}/usr/lib/libcrypto_idea.a 7321.105Sitojun LIBCRYPTO_MDC2?=${DESTDIR}/usr/lib/libcrypto_mdc2.a 7331.99Sitojun LIBCRYPTO_RC5?= ${DESTDIR}/usr/lib/libcrypto_rc5.a 7341.21Schristos LIBCURSES?= ${DESTDIR}/usr/lib/libcurses.a 7351.21Schristos LIBDBM?= ${DESTDIR}/usr/lib/libdbm.a 7361.21Schristos LIBDES?= ${DESTDIR}/usr/lib/libdes.a 7371.21Schristos LIBEDIT?= ${DESTDIR}/usr/lib/libedit.a 7381.114Sprovos LIBEVENT?= ${DESTDIR}/usr/lib/libevent.a 7391.73Sblymn LIBFORM?= ${DESTDIR}/usr/lib/libform.a 7401.21Schristos LIBGCC?= ${DESTDIR}/usr/lib/libgcc.a 7411.21Schristos LIBGNUMALLOC?= ${DESTDIR}/usr/lib/libgnumalloc.a 7421.99Sitojun LIBGSSAPI?= ${DESTDIR}/usr/lib/libgssapi.a 7431.99Sitojun LIBHDB?= ${DESTDIR}/usr/lib/libhdb.a 7441.70Sitojun LIBINTL?= ${DESTDIR}/usr/lib/libintl.a 7451.49Sitojun LIBIPSEC?= ${DESTDIR}/usr/lib/libipsec.a 7461.99Sitojun LIBKADM?= ${DESTDIR}/usr/lib/libkadm.a 7471.99Sitojun LIBKADM5CLNT?= ${DESTDIR}/usr/lib/libkadm5clnt.a 7481.99Sitojun LIBKADM5SRV?= ${DESTDIR}/usr/lib/libkadm5srv.a 7491.99Sitojun LIBKAFS?= ${DESTDIR}/usr/lib/libkafs.a 7501.21Schristos LIBKDB?= ${DESTDIR}/usr/lib/libkdb.a 7511.21Schristos LIBKRB?= ${DESTDIR}/usr/lib/libkrb.a 7521.99Sitojun LIBKRB5?= ${DESTDIR}/usr/lib/libkrb5.a 7531.99Sitojun LIBKSTREAM?= ${DESTDIR}/usr/lib/libkstream.a 7541.21Schristos LIBKVM?= ${DESTDIR}/usr/lib/libkvm.a 7551.21Schristos LIBL?= ${DESTDIR}/usr/lib/libl.a 7561.21Schristos LIBM?= ${DESTDIR}/usr/lib/libm.a 7571.53Sblymn LIBMENU?= ${DESTDIR}/usr/lib/libmenu.a 7581.21Schristos LIBMP?= ${DESTDIR}/usr/lib/libmp.a 7591.25Schristos LIBNTP?= ${DESTDIR}/usr/lib/libntp.a 7601.99Sitojun LIBOBJC?= ${DESTDIR}/usr/lib/libobjc.a 7611.99Sitojun LIBOSSAUDIO?= ${DESTDIR}/usr/lib/libossaudio.a 7621.21Schristos LIBPC?= ${DESTDIR}/usr/lib/libpc.a 7631.21Schristos LIBPCAP?= ${DESTDIR}/usr/lib/libpcap.a 7641.99Sitojun LIBPCI?= ${DESTDIR}/usr/lib/libpci.a 7651.21Schristos LIBPLOT?= ${DESTDIR}/usr/lib/libplot.a 7661.100Sthorpej LIBPMC?= ${DESTDIR}/usr/lib/libpmc.a 7671.26Skleink LIBPOSIX?= ${DESTDIR}/usr/lib/libposix.a 7681.110Sthorpej LIBPTHREAD?= ${DESTDIR}/usr/lib/libpthread.a 7691.110Sthorpej LIBPTHREAD_DBG?=${DESTDIR}/usr/lib/libpthread_dbg.a 7701.21Schristos LIBRESOLV?= ${DESTDIR}/usr/lib/libresolv.a 7711.99Sitojun LIBRMT?= ${DESTDIR}/usr/lib/librmt.a 7721.99Sitojun LIBROKEN?= ${DESTDIR}/usr/lib/libroken.a 7731.21Schristos LIBRPCSVC?= ${DESTDIR}/usr/lib/librpcsvc.a 7741.110Sthorpej LIBRT?= ${DESTDIR}/usr/lib/librt.a 7751.21Schristos LIBSKEY?= ${DESTDIR}/usr/lib/libskey.a 7761.99Sitojun LIBSS?= ${DESTDIR}/usr/lib/libss.a 7771.99Sitojun LIBSSL?= ${DESTDIR}/usr/lib/libssl.a 7781.99Sitojun LIBSKEY?= ${DESTDIR}/usr/lib/libskey.a 7791.99Sitojun LIBSL?= ${DESTDIR}/usr/lib/libsl.a 7801.21Schristos LIBTERMCAP?= ${DESTDIR}/usr/lib/libtermcap.a 7811.99Sitojun LIBUSBHID?= ${DESTDIR}/usr/lib/libusbhid.a 7821.21Schristos LIBUTIL?= ${DESTDIR}/usr/lib/libutil.a 7831.21Schristos LIBWRAP?= ${DESTDIR}/usr/lib/libwrap.a 7841.21Schristos LIBY?= ${DESTDIR}/usr/lib/liby.a 7851.21Schristos LIBZ?= ${DESTDIR}/usr/lib/libz.a 7861.1Scgd 7871.1ScgdSHAREDSTRINGS If defined, a new .c.o rule is used that results in shared 7881.12Schristos strings, using xstr(1). Note that this will not work with 7891.12Schristos parallel makes. 7901.1Scgd 7911.59SjlamSTRIPFLAG The flag passed to the install program to cause the binary 7921.1Scgd to be stripped. 7931.1Scgd 7941.1ScgdSUBDIR A list of subdirectories that should be built as well. 7951.1Scgd Each of the targets will execute the same target in the 7961.1Scgd subdirectories. 7971.1Scgd 7981.21SchristosSCRIPTS A list of interpreter scripts [file.{sh,csh,pl,awk,...}]. 7991.21Schristos These are installed exactly like programs. 8001.21Schristos 8011.21SchristosSCRIPTSNAME The name that the above program will be installed as, if 8021.21Schristos different from ${SCRIPTS}. These can be further specialized 8031.21Schristos by setting SCRIPTSNAME_<script>. 8041.21Schristos 8051.21SchristosFILES A list of files to install. The installation is controlled 8061.21Schristos by the FILESNAME, FILESOWN, FILESGRP, FILESMODE, FILESDIR 8071.21Schristos variables that can be further specialized by FILES<VAR>_<file> 8081.21Schristos 8091.106SthorpejSHLINKDIR Target directory for shared linker. See description of 8101.106Sthorpej <bsd.own.mk> for additional information about this variable. 8111.85Slukem 8121.1ScgdThe include file <bsd.prog.mk> includes the file named "../Makefile.inc" 8131.1Scgdif it exists, as well as the include file <bsd.man.mk>. 8141.1Scgd 8151.1ScgdSome simple examples: 8161.1Scgd 8171.1ScgdTo build foo from foo.c with a manual page foo.1, use: 8181.1Scgd 8191.1Scgd PROG= foo 8201.1Scgd 8211.1Scgd .include <bsd.prog.mk> 8221.1Scgd 8231.1ScgdTo build foo from foo.c with a manual page foo.2, add the line: 8241.1Scgd 8251.9Scgd MAN= foo.2 8261.1Scgd 8271.1ScgdIf foo does not have a manual page at all, add the line: 8281.1Scgd 8291.75Sagc MKMAN= no 8301.1Scgd 8311.1ScgdIf foo has multiple source files, add the line: 8321.1Scgd 8331.1Scgd SRCS= a.c b.c c.c d.c 8341.1Scgd 8351.1Scgd 8361.118Slukem=-=-=-=-= bsd.rpc.mk =-=-=-=-= 8371.118Slukem 8381.118SlukemThe include file <bsd.rpc.mk> contains a makefile fragment used to 8391.118Slukemconstruct source files built by rpcgen. 8401.72Ssommerfe 8411.118SlukemThe following macros may be defined in makefiles which include 8421.118Slukem<bsd.rpc.mk> in order to control which files get built and how they 8431.118Slukemare to be built: 8441.21Schristos 8451.118SlukemRPC_INCS: construct .h file from .x file 8461.118SlukemRPC_XDRFILES: construct _xdr.c from .x file 8471.118Slukem (for marshalling/unmarshalling data types) 8481.118SlukemRPC_SVCFILES: construct _svc.c from .x file 8491.118Slukem (server-side stubs) 8501.118SlukemRPC_SVCFLAGS: Additional flags passed to builds of RPC_SVCFILES. 8511.21Schristos 8521.118SlukemRPC_XDIR: Directory containing .x/.h files 8531.23Schristos 8541.23Schristos 8551.118Slukem=-=-=-=-= bsd.shlib.mk =-=-=-=-= 8561.21Schristos 8571.118SlukemThe include file <bsd.shlib.mk> computes parameters for shared library 8581.118Slukeminstallation and use. It defines no targets. <bsd.own.mk> MUST be 8591.118Slukemincluded before bsd.shlib.mk. 8601.21Schristos 8611.118Slukembsd.own.mk sets the following variables, if they are not already defined 8621.118Slukem(defaults are in brackets): 8631.21Schristos 8641.118SlukemSHLIBINSTALLDIR If ${USE_SHLIBDIR} is "yes", use ${SHLIBINSTALLDIR} instead of 8651.118Slukem ${LIBDIR} as the base path for shared library installation. 8661.118Slukem [/lib] 8671.21Schristos 8681.118SlukemSHLIBDIR The path to USE_SHLIBDIR shared libraries to use when building 8691.118Slukem a program. [/lib for programs in /bin and /sbin, /usr/lib 8701.118Slukem for all others.] 8711.81Swiz 8721.118Slukem_LIBSODIR Set to ${SHLIBINSTALLDIR} if ${USE_SHLIBDIR} is "yes", 8731.118Slukem otherwise set to ${LIBDIR} 8741.81Swiz 8751.118SlukemSHLINKINSTALLDIR Base path for shared linker. [/libexec] 8761.39Scgd 8771.118SlukemSHLINKDIR Path to use for shared linker when building a program. 8781.118Slukem [/libexec for programs in /bin and /sbin, /usr/libexec for 8791.118Slukem all others.] 8801.39Scgd 8811.13Schristos 8821.118Slukem=-=-=-=-= bsd.subdir.mk =-=-=-=-= 8831.13Schristos 8841.118SlukemThe include file <bsd.subdir.mk> contains the default targets for building 8851.118Slukemsubdirectories. It has the same eight targets as <bsd.prog.mk>: all, 8861.118Slukemclean, cleandir, depend, includes, install, lint, and tags. For all of 8871.118Slukemthe directories listed in the variable SUBDIR, the specified directory 8881.118Slukemwill be visited and the target made. There is also a default target which 8891.118Slukemallows the command "make subdir" where subdir is any directory listed in 8901.118Slukemthe variable SUBDIR. 8911.47Stv 8921.118SlukemAs a special case, the use of a token .WAIT as an entry in SUBDIR acts 8931.118Slukemas a synchronization barrier when multiple make jobs are run; subdirs 8941.118Slukembefore the .WAIT must complete before any subdirs after .WAIT are 8951.118Slukemstarted. See make(1) for some caveats on use of .WAIT and other 8961.118Slukemspecial sources. 8971.47Stv 8981.47Stv 8991.118Slukem=-=-=-=-= bsd.sys.mk =-=-=-=-= 9001.47Stv 9011.13SchristosThe include file <bsd.sys.mk> is used by <bsd.prog.mk> and 9021.14Scgd<bsd.lib.mk>. It contains overrides that are used when building 9031.14Scgdthe NetBSD source tree. For instance, if "PARALLEL" is defined by 9041.14Scgdthe program/library Makefile, it includes a set of rules for lex and 9051.14Scgdyacc that allow multiple lex and yacc targets to be built in parallel. 9061.116Slukem 9071.116SlukemThe following variables are defined to commands to perform the 9081.116Slukemappropriate operation, with the default in [brackets]. 9091.116Slukem(Note that these are overridden in <bsd.own.mk> if USETOOLS=yes): 9101.116Slukem 9111.116SlukemTOOL_ASN1_COMPILE ASN1 compiler. [asn1_compile] 9121.116Slukem 9131.116SlukemTOOL_CAP_MKDB Create capability database. [cap_mkdb] 9141.116Slukem 9151.116SlukemTOOL_CAT Concatenate and print files. [cat] 9161.116Slukem 9171.116SlukemTOOL_CKSUM Display file checksums. [cksum] 9181.116Slukem 9191.116SlukemTOOL_COMPILE_ET Error table compiler. [compile_et] 9201.116Slukem 9211.116SlukemTOOL_CONFIG Build kernel compilation directories. [config] 9221.116Slukem 9231.116SlukemTOOL_CRUNCHGEN Generate crunched binary build environment. [crunchgen] 9241.116Slukem 9251.116SlukemTOOL_CTAGS Create a tags file. [ctags] 9261.116Slukem 9271.116SlukemTOOL_DB Manipulate db(3) databases. [db] 9281.116Slukem 9291.116SlukemTOOL_EQN Format equations for groff. [eqn] 9301.116Slukem 9311.116SlukemTOOL_FGEN IEEE 1275 Open Firmware FCode Tokenizer. [fgen] 9321.116Slukem 9331.116SlukemTOOL_GENCAT Generate NLS message catalogs. [gencat] 9341.116Slukem 9351.116SlukemTOOL_GROFF Front end for groff document formatting system. [groff] 9361.116Slukem 9371.116SlukemTOOL_HEXDUMP Ascii, decimal, hexadecimal, octal dump. [hexdump] 9381.116Slukem 9391.116SlukemTOOL_INDXBIB Make bibliographic database's inverted index. [indxbib] 9401.116Slukem 9411.116SlukemTOOL_INSTALLBOOT Install disk bootstrap software. [installboot] 9421.116Slukem 9431.116SlukemTOOL_INSTALL_INFO Update info/dir entries. [install-info] 9441.116Slukem 9451.116SlukemTOOL_M4 M4 macro language processor. [m4] 9461.116Slukem 9471.116SlukemTOOL_MAKEFS Create file system image from directory tree. [makefs] 9481.116Slukem 9491.116SlukemTOOL_MAKEINFO Translate Texinfo documents. [makeinfo] 9501.116Slukem 9511.116SlukemTOOL_MAKEWHATIS Create a whatis.db database. [makewhatis] 9521.116Slukem 9531.116SlukemTOOL_MDSETIMAGE Set kernel RAM disk image. [mdsetimage] 9541.116Slukem 9551.116SlukemTOOL_MENUC Menu compiler. [menuc] 9561.116Slukem 9571.116SlukemTOOL_MKCSMAPPER Make charset mapping table. [mkcsmapper] 9581.116Slukem 9591.116SlukemTOOL_MKESDB Make encoding scheme database. [mkesdb] 9601.116Slukem 9611.116SlukemTOOL_MKLOCALE Make LC_CTYPE locale files. [mklocale] 9621.116Slukem 9631.116SlukemTOOL_MKMAGIC Create database for file(1). [file] 9641.116Slukem 9651.116SlukemTOOL_MKTEMP Make (unique) temporary file name. [mktemp] 9661.116Slukem 9671.116SlukemTOOL_MSGC Simple message list compiler. [msgc] 9681.116Slukem 9691.116SlukemTOOL_MTREE Map a directory hierarchy. [mtree] 9701.116Slukem 9711.116SlukemTOOL_PAX Manipulate file archives and copy directories. [pax] 9721.116Slukem 9731.116SlukemTOOL_PIC Compile pictures for groff. [pic] 9741.116Slukem 9751.116SlukemTOOL_PREPMKBOOTIMAGE prep-mkbootimage (XXXBUILDSH). [prep-mkbootimage] 9761.116Slukem 9771.116SlukemTOOL_PWD_MKDB Generate the password databases. [pwd_mkdb] 9781.116Slukem 9791.116SlukemTOOL_REFER Preprocess bibliographic references for groff. [refer] 9801.116Slukem 9811.116SlukemTOOL_ROFF_ASCII Generate ASCII groff output. [nroff] 9821.116Slukem 9831.116SlukemTOOL_ROFF_DVI Generate DVI groff output. [${TOOL_GROFF} -Tdvi] 9841.116Slukem 9851.116SlukemTOOL_ROFF_HTML Generate HTML groff output. 9861.116Slukem [${TOOL_GROFF} -Tlatin1 -mdoc2html -P-b -P-o -P-u] 9871.116Slukem 9881.116SlukemTOOL_ROFF_PS Generate PS groff output. [${TOOL_GROFF} -Tps] 9891.116Slukem 9901.116SlukemTOOL_ROFF_RAW Generate "raw" groff output. [${TOOL_GROFF} -Z] 9911.116Slukem 9921.116SlukemTOOL_RPCGEN Remote Procedure Call (RPC) protocol compiler. [rpcgen] 9931.116Slukem 9941.116SlukemTOOL_SOELIM Eliminate .so's from groff input. [soelim] 9951.116Slukem 9961.116SlukemTOOL_SUNLABEL Read or modify a SunOS disk label. [sunlabel] 9971.116Slukem 9981.116SlukemTOOL_TBL Format tables for groff. [tbl] 9991.116Slukem 10001.116SlukemTOOL_UUDECODE Uudecode a binary file. [uudecode] 10011.116Slukem 10021.116SlukemTOOL_VGRIND Grind nice listings of programs. [vgrind -f] 10031.116Slukem 10041.116SlukemTOOL_ZIC Time zone compiler. [zic] 10051.116Slukem 10061.69Ssommerfe 10071.69SsommerfeOther variables of note (incomplete list): 10081.69Ssommerfe 10091.82SlukemWARNS Crank up gcc warning options; the distinct levels are: 10101.82Slukem WARNS=1 10111.82Slukem WARNS=2 10121.82Slukem WARNS=3 10131.69Ssommerfe 10141.69SsommerfeFORMAT_AUDIT If FORMAT_AUDIT is set, and WFORMAT is set and > 1, turn on 10151.69SsommerfeWFORMAT -Wnetbsd-format-audit for extra-stringent format checking. 10161.75Sagc WFORMAT belongs in individual makefiles and/or 10171.75Sagc Makefile.inc files. (set WFORMAT=1 in individual 10181.75Sagc makefiles if a program is not security critical and is 10191.75Sagc doing bizarre things with format strings which would 10201.75Sagc be even uglier if rewritten) FORMAT_AUDIT should go in 10211.75Sagc mk.conf if you're doing format-string auditing. 10221.69Ssommerfe FORMAT_AUDIT may go away in time. 10231.30Sagc 10241.30Sagc=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= 1025