Makefile revision 1.129
11.129Stv# $NetBSD: Makefile,v 1.129 2001/09/21 21:01:13 tv Exp $ 21.95Scjs 31.95Scjs# This is the top-level makefile for building NetBSD. For an outline of 41.95Scjs# how to build a snapshot or release, as well as other release engineering 51.95Scjs# information, see http://www.netbsd.org/developers/releng/index.html 61.95Scjs# 71.95Scjs# Not everything you can set or do is documented in this makefile. In 81.95Scjs# particular, you should review the files in /usr/share/mk (especially 91.95Scjs# bsd.README) for general information on building programs and writing 101.95Scjs# Makefiles within this structure, and see the comments in src/etc/Makefile 111.95Scjs# for further information on installation and release set options. 121.95Scjs# 131.95Scjs# Variables listed below can be set on the make command line (highest 141.95Scjs# priority), in /etc/mk.conf (middle priority), or in the environment 151.95Scjs# (lowest priority). 161.95Scjs# 171.95Scjs# Variables: 181.101Ssommerfe# DESTDIR is the target directory for installation of the compiled 191.101Ssommerfe# software. It defaults to /. Note that programs are built against 201.101Ssommerfe# libraries installed in DESTDIR. 211.95Scjs# MKMAN, if set to `no', will prevent building of manual pages. 221.101Ssommerfe# MKOBJDIRS, if not set to `no', will build object directories at 231.101Ssommerfe# an appropriate point in a build. 241.95Scjs# MKSHARE, if set to `no', will prevent building and installing 251.95Scjs# anything in /usr/share. 261.101Ssommerfe# NBUILDJOBS is the number of jobs to start in parallel during a 271.127Stv# `make build'. It defaults to 1. 281.125Smrg# UPDATE, if defined, will avoid a `make cleandir' at the start of 291.125Smrg# `make build', as well as having the effects listed in 301.125Smrg# /usr/share/mk/bsd.README. 311.125Smrg# NOCLEANDIR, if defined, will avoid a `make cleandir' at the start 321.125Smrg# of the `make build'. 331.119Stoddpw# NOINCLUDES will avoid the `make includes' usually done by `make build'. 341.125Smrg 351.95Scjs# 361.95Scjs# Targets: 371.110Sjlam# build: builds a full release of netbsd in DESTDIR. If BUILD_DONE is 381.110Sjlam# set, this is an empty target. 391.95Scjs# release: does a `make build,' and then tars up the DESTDIR files 401.95Scjs# into RELEASEDIR, in release(7) format. (See etc/Makefile for 411.95Scjs# more information on this.) 421.95Scjs# snapshot: a synonym for release. 431.123Smrg# 441.123Smrg# Sub targets of `make build,' in order: 451.123Smrg# buildstartmsg: displays the start time of the build. 461.123Smrg# beforeinstall: creates the distribution directories. 471.123Smrg# do-force-domestic: check's that FORCE_DOMESTIC isn't set (deprecated.) 481.123Smrg# do-share-mk: installs /usr/share/mk files. 491.127Stv# do-cleandir: cleans the tree. 501.127Stv# do-make-obj: creates object directories if required. 511.127Stv# do-make-tools: builds host toolchain. 521.123Smrg# do-make-includes: install include files. 531.123Smrg# do-lib-csu: build & install startup object files. 541.123Smrg# do-lib: build & install system libraries. 551.123Smrg# do-gnu-lib: build & install gnu system libraries. 561.123Smrg# do-dependall: builds & install the entire system. 571.123Smrg# do-domestic: build & install the domestic tree (deprecated.) 581.123Smrg# do-whatisdb: build & install the `whatis.db' man database. 591.123Smrg# buildendmsg: displays the end time of the build. 601.32Scgd 611.118Sthorpej.include <bsd.own.mk> 621.4Scgd 631.100SsommerfeMKOBJDIRS ?= no 641.58Stv 651.76Sbouyer.if defined(NBUILDJOBS) 661.76Sbouyer_J= -j${NBUILDJOBS} 671.76Sbouyer.endif 681.76Sbouyer 691.112Smrg.if defined(DESTDIR) 701.112Smrg_M=-m ${DESTDIR}/usr/share/mk 711.112Smrg.endif 721.112Smrg 731.4Scgd# NOTE THAT etc *DOES NOT* BELONG IN THE LIST BELOW 741.2Scgd 751.52SmycroftSUBDIR+= lib include bin libexec sbin usr.bin usr.sbin share sys 761.120Sfredb.if make(cleandir) || make(obj) 771.109ScjsSUBDIR+= distrib 781.114Ssjg.ifdef MAKEOBJDIRPREFIX 791.114SsjgSUBDIR+= etc 801.114Ssjg.endif 811.109Scjs.endif 821.105Sassar 831.105Sassarincludes-lib: includes-include includes-sys 841.36Sexplorer 851.36Sexplorer.if exists(games) 861.36SexplorerSUBDIR+= games 871.36Sexplorer.endif 881.36Sexplorer 891.8ScgdSUBDIR+= gnu 901.52Smycroft# This is needed for libstdc++ and gen-params. 911.52Smycroftincludes-gnu: includes-include includes-sys 921.21Scgd 931.13Sbrezak.if exists(regress) 941.9Scgd.ifmake !(install) 951.9ScgdSUBDIR+= regress 961.9Scgd.endif 971.9Scgd 981.10Scgdregression-tests: 991.10Scgd @echo Running regression tests... 1001.112Smrg @(cd ${.CURDIR}/regress && ${MAKE} ${_M} regress) 1011.13Sbrezak.endif 1021.20Scgd 1031.123Smrgbuildstartmsg: 1041.45Sperry @echo -n "Build started at: " 1051.45Sperry @date 1061.108Serh 1071.123Smrgbuildendmsg: 1081.123Smrg @echo -n "Build finished at: " 1091.123Smrg @date 1101.123Smrg 1111.121Sdeberg# If sharesrc is around, use its share/mk files to bootstrap until the 1121.121Sdeberg# mk files are installed (first step of make build). If installing to 1131.121Sdeberg# DESTDIR, don't bother, since the build will fail later on anyway. 1141.121Sdeberg 1151.108Serhbeforeinstall: 1161.112Smrg.ifndef NODISTRIBDIRS 1171.26Stls.ifndef DESTDIR 1181.121Sdeberg.if exists(share/mk) 1191.126Senami (cd ${.CURDIR}/etc && \ 1201.126Senami ${MAKE} -m ${.CURDIR}/share/mk DESTDIR=/ distrib-dirs) 1211.121Sdeberg.else 1221.26Stls (cd ${.CURDIR}/etc && ${MAKE} DESTDIR=/ distrib-dirs) 1231.121Sdeberg.endif 1241.31Stls.else 1251.128Sthorpej (cd ${.CURDIR}/etc && ${MAKE} DESTDIR=${DESTDIR} distrib-dirs) 1261.26Stls.endif 1271.112Smrg.endif 1281.15Scgd 1291.15Scgdafterinstall: 1301.86Slukem.if ${MKMAN} != "no" && !defined(_BUILD) 1311.112Smrg ${MAKE} ${_M} whatis.db 1321.81Sscottr.endif 1331.81Sscottr 1341.81Sscottrwhatis.db: 1351.112Smrg (cd ${.CURDIR}/share/man && ${MAKE} ${_M} makedb) 1361.15Scgd 1371.84Stv# wrt info/dir below: It's safe to move this over top of /usr/share/info/dir, 1381.84Stv# as the build will automatically remove/replace the non-pkg entries there. 1391.84Stv 1401.110Sjlam.if defined(BUILD_DONE) 1411.110Sjlambuild: 1421.110Sjlam @echo "Build installed into ${DESTDIR}" 1431.110Sjlam.else 1441.124Smrgbuild: 1451.124Smrg @${MAKE} ${_M} buildstartmsg 1461.124Smrg @${MAKE} ${_M} beforeinstall 1471.124Smrg @${MAKE} ${_M} do-force-domestic 1481.124Smrg @${MAKE} ${_M} do-share-mk 1491.124Smrg @${MAKE} ${_M} do-cleandir 1501.124Smrg @${MAKE} ${_M} do-make-obj 1511.127Stv @${MAKE} ${_M} do-make-tools 1521.124Smrg @${MAKE} ${_M} do-make-includes 1531.124Smrg @${MAKE} ${_M} do-lib-csu 1541.124Smrg @${MAKE} ${_M} do-lib 1551.124Smrg @${MAKE} ${_M} do-gnu-lib 1561.124Smrg @${MAKE} ${_M} do-dependall 1571.124Smrg @${MAKE} ${_M} do-domestic 1581.124Smrg @${MAKE} ${_M} do-whatisdb 1591.124Smrg @${MAKE} ${_M} buildendmsg 1601.123Smrg.endif 1611.123Smrg 1621.123Smrgdo-force-domestic: 1631.96Sscottr.if defined(FORCE_DOMESTIC) 1641.96Sscottr @echo '*** CAPUTE!' 1651.96Sscottr @echo ' The FORCE_DOMESTIC flag is not compatible with "make build".' 1661.96Sscottr @echo ' Please correct the problem and try again.' 1671.96Sscottr @false 1681.96Sscottr.endif 1691.123Smrg 1701.123Smrgdo-share-mk: 1711.86Slukem.if ${MKSHARE} != "no" 1721.117Smrg (cd ${.CURDIR}/share/mk && ${MAKE} install) 1731.68Slukem.endif 1741.123Smrg 1751.123Smrgdo-cleandir: 1761.112Smrg.if !defined(UPDATE) && !defined(NOCLEANDIR) 1771.117Smrg ${MAKE} ${_J} ${_M} cleandir 1781.39Schristos.endif 1791.123Smrg 1801.123Smrgdo-make-obj: 1811.103Ssimonb.if ${MKOBJDIRS} != "no" 1821.122Ssommerfe ${MAKE} ${_J} ${_M} obj 1831.127Stv.if defined(USE_NEW_TOOLCHAIN) 1841.127Stv cd ${.CURDIR}/tools && ${MAKE} ${_M} obj 1851.127Stv.endif 1861.103Ssimonb.endif 1871.123Smrg 1881.127Stvdo-make-tools: 1891.127Stv.if defined(USE_NEW_TOOLCHAIN) 1901.127Stv cd ${.CURDIR}/tools && ${MAKE} ${_M} build 1911.71Smycroft.endif 1921.123Smrg 1931.123Smrgdo-make-includes: 1941.112Smrg.if !defined(NOINCLUDES) 1951.112Smrg ${MAKE} ${_M} includes 1961.71Smycroft.endif 1971.123Smrg 1981.123Smrgdo-lib-csu: 1991.61Smycroft (cd ${.CURDIR}/lib/csu && \ 2001.113Smrg ${MAKE} ${_M} ${_J} MKSHARE=no dependall && \ 2011.113Smrg ${MAKE} ${_M} MKSHARE=no install) 2021.123Smrg 2031.123Smrgdo-lib: 2041.61Smycroft (cd ${.CURDIR}/lib && \ 2051.113Smrg ${MAKE} ${_M} ${_J} MKSHARE=no dependall && \ 2061.113Smrg ${MAKE} ${_M} MKSHARE=no install) 2071.123Smrg 2081.123Smrgdo-gnu-lib: 2091.61Smycroft (cd ${.CURDIR}/gnu/lib && \ 2101.113Smrg ${MAKE} ${_M} ${_J} MKSHARE=no dependall && \ 2111.113Smrg ${MAKE} ${_M} MKSHARE=no install) 2121.123Smrg 2131.123Smrgdo-dependall: 2141.112Smrg ${MAKE} ${_M} ${_J} dependall && ${MAKE} ${_M} _BUILD= install 2151.123Smrg 2161.123Smrgdo-domestic: 2171.97Schristos.if defined(DOMESTIC) && !defined(EXPORTABLE_SYSTEM) 2181.112Smrg (cd ${.CURDIR}/${DOMESTIC} && ${MAKE} ${_M} ${_J} _SLAVE_BUILD= build) 2191.49Slukem.endif 2201.123Smrg 2211.123Smrgdo-whatisdb: 2221.112Smrg ${MAKE} ${_M} whatis.db 2231.87Scjs 2241.87Scjsrelease snapshot: build 2251.112Smrg (cd ${.CURDIR}/etc && ${MAKE} ${_M} INSTALL_DONE=1 release) 2261.129Stv 2271.129Stv# Speedup stubs for some subtrees that don't need to run these rules 2281.129Stvincludes-bin includes-games includes-libexec includes-regress \ 2291.129Stvincludes-sbin includes-usr.sbin: 2301.129Stv @${TRUE} 2311.1Scgd 2321.1Scgd.include <bsd.subdir.mk> 233