Makefile revision 1.100
11.100Ssommerfe# $NetBSD: Makefile,v 1.100 1999/11/30 16:16:41 sommerfeld 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.95Scjs# NBUILDJOBS is the number of jobs to start in parallel during a 191.95Scjs# 'make build'. It defaults to 1. 201.95Scjs# MKMAN, if set to `no', will prevent building of manual pages. 211.95Scjs# MKSHARE, if set to `no', will prevent building and installing 221.95Scjs# anything in /usr/share. 231.95Scjs# UPDATE will avoid a `make cleandir' at the start of `make build', 241.95Scjs# as well as having the effects listed in /usr/share/mk/bsd.README. 251.95Scjs# DESTDIR is the target directory for installation of the compiled 261.95Scjs# software. It defaults to /. Note that programs are built against 271.95Scjs# libraries installed in DESTDIR. 281.95Scjs# 291.95Scjs# Targets: 301.95Scjs# build: builds a full release of netbsd in DESTDIR. 311.95Scjs# release: does a `make build,' and then tars up the DESTDIR files 321.95Scjs# into RELEASEDIR, in release(7) format. (See etc/Makefile for 331.95Scjs# more information on this.) 341.95Scjs# snapshot: a synonym for release. 351.32Scgd 361.32Scgd.include <bsd.own.mk> # for configuration variables. 371.4Scgd 381.100SsommerfeMKOBJDIRS ?= no 391.58StvHAVE_GCC28!= ${CXX} --version | egrep "^(2\.8|egcs)" ; echo 401.58Stv 411.76Sbouyer.if defined(NBUILDJOBS) 421.76Sbouyer_J= -j${NBUILDJOBS} 431.76Sbouyer.endif 441.76Sbouyer 451.4Scgd# NOTE THAT etc *DOES NOT* BELONG IN THE LIST BELOW 461.2Scgd 471.52SmycroftSUBDIR+= lib include bin libexec sbin usr.bin usr.sbin share sys 481.36Sexplorer 491.36Sexplorer.if exists(games) 501.36SexplorerSUBDIR+= games 511.36Sexplorer.endif 521.36Sexplorer 531.8ScgdSUBDIR+= gnu 541.52Smycroft# This is needed for libstdc++ and gen-params. 551.52Smycroftincludes-gnu: includes-include includes-sys 561.21Scgd 571.13Sbrezak.if exists(regress) 581.9Scgd.ifmake !(install) 591.9ScgdSUBDIR+= regress 601.9Scgd.endif 611.9Scgd 621.10Scgdregression-tests: 631.10Scgd @echo Running regression tests... 641.22Scgd @(cd ${.CURDIR}/regress && ${MAKE} regress) 651.13Sbrezak.endif 661.20Scgd 671.26Stlsbeforeinstall: 681.45Sperry.ifmake build 691.45Sperry @echo -n "Build started at: " 701.45Sperry @date 711.45Sperry.endif 721.26Stls.ifndef DESTDIR 731.26Stls (cd ${.CURDIR}/etc && ${MAKE} DESTDIR=/ distrib-dirs) 741.31Stls.else 751.31Stls (cd ${.CURDIR}/etc && ${MAKE} distrib-dirs) 761.26Stls.endif 771.15Scgd 781.15Scgdafterinstall: 791.86Slukem.if ${MKMAN} != "no" && !defined(_BUILD) 801.81Sscottr ${MAKE} whatis.db 811.81Sscottr.endif 821.81Sscottr 831.81Sscottrwhatis.db: 841.22Scgd (cd ${.CURDIR}/share/man && ${MAKE} makedb) 851.15Scgd 861.84Stv# wrt info/dir below: It's safe to move this over top of /usr/share/info/dir, 871.84Stv# as the build will automatically remove/replace the non-pkg entries there. 881.84Stv 891.43Sthorpejbuild: beforeinstall 901.96Sscottr.if defined(FORCE_DOMESTIC) 911.96Sscottr @echo '*** CAPUTE!' 921.96Sscottr @echo ' The FORCE_DOMESTIC flag is not compatible with "make build".' 931.96Sscottr @echo ' Please correct the problem and try again.' 941.96Sscottr @false 951.96Sscottr.endif 961.86Slukem.if ${MKSHARE} != "no" 971.32Scgd (cd ${.CURDIR}/share/mk && ${MAKE} install) 981.47Sthorpej (cd ${.CURDIR}/share/tmac && ${MAKE} && ${MAKE} install) 991.68Slukem.endif 1001.39Schristos.if !defined(UPDATE) 1011.17Scgd ${MAKE} cleandir 1021.100Ssommerfe.endif 1031.100Ssommerfe.if ${MKOBJDIRS} != "no" 1041.100Ssommerfe ${MAKE} obj 1051.39Schristos.endif 1061.75Stv.if empty(HAVE_GCC28) 1071.71Smycroft.if defined(DESTDIR) 1081.71Smycroft @echo "*** CAPUTE!" 1091.84Stv @echo " You attempted to compile the world without egcs. You must" 1101.71Smycroft @echo " first install a native egcs compiler." 1111.84Stv @false 1121.71Smycroft.else 1131.71Smycroft (cd ${.CURDIR}/gnu/usr.bin/egcs && \ 1141.99Sperry ${MAKE} ${_J} dependall MKMAN=no && \ 1151.86Slukem ${MAKE} MKMAN=no install && ${MAKE} cleandir) 1161.71Smycroft.endif 1171.71Smycroft.endif 1181.93Sscottr ${MAKE} includes 1191.61Smycroft (cd ${.CURDIR}/lib/csu && \ 1201.99Sperry ${MAKE} ${_J} dependall MKMAN=no && \ 1211.86Slukem ${MAKE} MKMAN=no install) 1221.61Smycroft (cd ${.CURDIR}/lib && \ 1231.99Sperry ${MAKE} ${_J} dependall MKMAN=no && \ 1241.86Slukem ${MAKE} MKMAN=no install) 1251.61Smycroft (cd ${.CURDIR}/gnu/lib && \ 1261.99Sperry ${MAKE} ${_J} dependall MKMAN=no MKINFO=no && \ 1271.89Smellon ${MAKE} MKMAN=no MKINFO=no install) 1281.99Sperry ${MAKE} ${_J} dependall && ${MAKE} _BUILD= install 1291.97Schristos.if defined(DOMESTIC) && !defined(EXPORTABLE_SYSTEM) 1301.97Schristos (cd ${.CURDIR}/${DOMESTIC} && ${MAKE} ${_J} _SLAVE_BUILD= build) 1311.49Slukem.endif 1321.81Sscottr ${MAKE} whatis.db 1331.50Smellon @echo -n "Build finished at: " 1341.50Smellon @date 1351.87Scjs 1361.87Scjsrelease snapshot: build 1371.91Sscottr (cd ${.CURDIR}/etc && ${MAKE} INSTALL_DONE=1 release) 1381.1Scgd 1391.1Scgd.include <bsd.subdir.mk> 140