Makefile revision 1.105
11.105Sassar# $NetBSD: Makefile,v 1.105 2000/02/01 01:22:05 assar 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.101Ssommerfe# 'make build'. It defaults to 1. 281.95Scjs# UPDATE will avoid a `make cleandir' at the start of `make build', 291.95Scjs# as well as having the effects listed in /usr/share/mk/bsd.README. 301.95Scjs# 311.95Scjs# Targets: 321.95Scjs# build: builds a full release of netbsd in DESTDIR. 331.95Scjs# release: does a `make build,' and then tars up the DESTDIR files 341.95Scjs# into RELEASEDIR, in release(7) format. (See etc/Makefile for 351.95Scjs# more information on this.) 361.95Scjs# snapshot: a synonym for release. 371.32Scgd 381.32Scgd.include <bsd.own.mk> # for configuration variables. 391.4Scgd 401.100SsommerfeMKOBJDIRS ?= no 411.58StvHAVE_GCC28!= ${CXX} --version | egrep "^(2\.8|egcs)" ; echo 421.58Stv 431.76Sbouyer.if defined(NBUILDJOBS) 441.76Sbouyer_J= -j${NBUILDJOBS} 451.76Sbouyer.endif 461.76Sbouyer 471.4Scgd# NOTE THAT etc *DOES NOT* BELONG IN THE LIST BELOW 481.2Scgd 491.52SmycroftSUBDIR+= lib include bin libexec sbin usr.bin usr.sbin share sys 501.105Sassar 511.105Sassarincludes-lib: includes-include includes-sys 521.36Sexplorer 531.36Sexplorer.if exists(games) 541.36SexplorerSUBDIR+= games 551.36Sexplorer.endif 561.36Sexplorer 571.8ScgdSUBDIR+= gnu 581.52Smycroft# This is needed for libstdc++ and gen-params. 591.52Smycroftincludes-gnu: includes-include includes-sys 601.21Scgd 611.13Sbrezak.if exists(regress) 621.9Scgd.ifmake !(install) 631.9ScgdSUBDIR+= regress 641.9Scgd.endif 651.9Scgd 661.10Scgdregression-tests: 671.10Scgd @echo Running regression tests... 681.22Scgd @(cd ${.CURDIR}/regress && ${MAKE} regress) 691.13Sbrezak.endif 701.20Scgd 711.26Stlsbeforeinstall: 721.45Sperry.ifmake build 731.45Sperry @echo -n "Build started at: " 741.45Sperry @date 751.45Sperry.endif 761.26Stls.ifndef DESTDIR 771.26Stls (cd ${.CURDIR}/etc && ${MAKE} DESTDIR=/ distrib-dirs) 781.31Stls.else 791.31Stls (cd ${.CURDIR}/etc && ${MAKE} distrib-dirs) 801.26Stls.endif 811.15Scgd 821.15Scgdafterinstall: 831.86Slukem.if ${MKMAN} != "no" && !defined(_BUILD) 841.81Sscottr ${MAKE} whatis.db 851.81Sscottr.endif 861.81Sscottr 871.81Sscottrwhatis.db: 881.22Scgd (cd ${.CURDIR}/share/man && ${MAKE} makedb) 891.15Scgd 901.84Stv# wrt info/dir below: It's safe to move this over top of /usr/share/info/dir, 911.84Stv# as the build will automatically remove/replace the non-pkg entries there. 921.84Stv 931.43Sthorpejbuild: beforeinstall 941.96Sscottr.if defined(FORCE_DOMESTIC) 951.96Sscottr @echo '*** CAPUTE!' 961.96Sscottr @echo ' The FORCE_DOMESTIC flag is not compatible with "make build".' 971.96Sscottr @echo ' Please correct the problem and try again.' 981.96Sscottr @false 991.96Sscottr.endif 1001.86Slukem.if ${MKSHARE} != "no" 1011.32Scgd (cd ${.CURDIR}/share/mk && ${MAKE} install) 1021.68Slukem.endif 1031.39Schristos.if !defined(UPDATE) 1041.17Scgd ${MAKE} cleandir 1051.39Schristos.endif 1061.103Ssimonb.if ${MKOBJDIRS} != "no" 1071.103Ssimonb ${MAKE} obj 1081.104Ssimonb (cd ${.CURDIR}/distrib && ${MAKE} obj) 1091.103Ssimonb.endif 1101.75Stv.if empty(HAVE_GCC28) 1111.71Smycroft.if defined(DESTDIR) 1121.71Smycroft @echo "*** CAPUTE!" 1131.84Stv @echo " You attempted to compile the world without egcs. You must" 1141.71Smycroft @echo " first install a native egcs compiler." 1151.84Stv @false 1161.71Smycroft.else 1171.71Smycroft (cd ${.CURDIR}/gnu/usr.bin/egcs && \ 1181.99Sperry ${MAKE} ${_J} dependall MKMAN=no && \ 1191.86Slukem ${MAKE} MKMAN=no install && ${MAKE} cleandir) 1201.71Smycroft.endif 1211.71Smycroft.endif 1221.93Sscottr ${MAKE} includes 1231.61Smycroft (cd ${.CURDIR}/lib/csu && \ 1241.99Sperry ${MAKE} ${_J} dependall MKMAN=no && \ 1251.86Slukem ${MAKE} MKMAN=no install) 1261.61Smycroft (cd ${.CURDIR}/lib && \ 1271.99Sperry ${MAKE} ${_J} dependall MKMAN=no && \ 1281.86Slukem ${MAKE} MKMAN=no install) 1291.61Smycroft (cd ${.CURDIR}/gnu/lib && \ 1301.99Sperry ${MAKE} ${_J} dependall MKMAN=no MKINFO=no && \ 1311.89Smellon ${MAKE} MKMAN=no MKINFO=no install) 1321.103Ssimonb.if ${MKSHARE} != "no" 1331.103Ssimonb (cd ${.CURDIR}/share/tmac && ${MAKE} && ${MAKE} install) 1341.103Ssimonb.endif 1351.99Sperry ${MAKE} ${_J} dependall && ${MAKE} _BUILD= install 1361.97Schristos.if defined(DOMESTIC) && !defined(EXPORTABLE_SYSTEM) 1371.97Schristos (cd ${.CURDIR}/${DOMESTIC} && ${MAKE} ${_J} _SLAVE_BUILD= build) 1381.49Slukem.endif 1391.81Sscottr ${MAKE} whatis.db 1401.50Smellon @echo -n "Build finished at: " 1411.50Smellon @date 1421.87Scjs 1431.87Scjsrelease snapshot: build 1441.91Sscottr (cd ${.CURDIR}/etc && ${MAKE} INSTALL_DONE=1 release) 1451.1Scgd 1461.1Scgd.include <bsd.subdir.mk> 147