Makefile revision 1.110
11.110Sjlam#	$NetBSD: Makefile,v 1.110 2000/03/11 00:10:20 jlam 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.110Sjlam#   build: builds a full release of netbsd in DESTDIR. If BUILD_DONE is
331.110Sjlam#	set, this is an empty target.
341.95Scjs#   release: does a `make build,' and then tars up the DESTDIR files
351.95Scjs#	into RELEASEDIR, in release(7) format. (See etc/Makefile for
361.95Scjs#	more information on this.)
371.95Scjs#   snapshot: a synonym for release.
381.32Scgd
391.106SaidanSRCTOP=.
401.106Saidan.include <bsd.crypto.mk>		# for configuration variables.
411.106Saidan
421.106Saidan.if defined(CRYPTOPATH)
431.106Saidan.sinclude "${CRYPTOPATH}/Makefile.frag"
441.106Saidan.endif
451.4Scgd
461.100SsommerfeMKOBJDIRS ?= no
471.58StvHAVE_GCC28!=	${CXX} --version | egrep "^(2\.8|egcs)" ; echo
481.58Stv
491.76Sbouyer.if defined(NBUILDJOBS)
501.76Sbouyer_J= -j${NBUILDJOBS}
511.76Sbouyer.endif
521.76Sbouyer
531.4Scgd# NOTE THAT etc *DOES NOT* BELONG IN THE LIST BELOW
541.2Scgd
551.52SmycroftSUBDIR+= lib include bin libexec sbin usr.bin usr.sbin share sys
561.109Scjs.if make(obj)
571.109ScjsSUBDIR+= distrib
581.109Scjs.endif
591.105Sassar
601.105Sassarincludes-lib: includes-include includes-sys
611.36Sexplorer
621.36Sexplorer.if exists(games)
631.36SexplorerSUBDIR+= games
641.36Sexplorer.endif
651.36Sexplorer
661.8ScgdSUBDIR+= gnu
671.52Smycroft# This is needed for libstdc++ and gen-params.
681.52Smycroftincludes-gnu: includes-include includes-sys
691.21Scgd
701.13Sbrezak.if exists(regress)
711.9Scgd.ifmake !(install)
721.9ScgdSUBDIR+= regress
731.9Scgd.endif
741.9Scgd
751.10Scgdregression-tests:
761.10Scgd	@echo Running regression tests...
771.22Scgd	@(cd ${.CURDIR}/regress && ${MAKE} regress)
781.13Sbrezak.endif
791.20Scgd
801.108Serhbuildmsg:
811.45Sperry	@echo -n "Build started at: "
821.45Sperry	@date
831.108Serh
841.108Serhbeforeinstall:
851.26Stls.ifndef DESTDIR
861.26Stls	(cd ${.CURDIR}/etc && ${MAKE} DESTDIR=/ distrib-dirs)
871.31Stls.else
881.31Stls	(cd ${.CURDIR}/etc && ${MAKE} distrib-dirs)
891.26Stls.endif
901.15Scgd
911.15Scgdafterinstall:
921.86Slukem.if ${MKMAN} != "no" && !defined(_BUILD)
931.81Sscottr	${MAKE} whatis.db
941.81Sscottr.endif
951.81Sscottr
961.81Sscottrwhatis.db:
971.22Scgd	(cd ${.CURDIR}/share/man && ${MAKE} makedb)
981.15Scgd
991.84Stv# wrt info/dir below:  It's safe to move this over top of /usr/share/info/dir,
1001.84Stv# as the build will automatically remove/replace the non-pkg entries there.
1011.84Stv
1021.110Sjlam.if defined(BUILD_DONE)
1031.110Sjlambuild:
1041.110Sjlam	@echo "Build installed into ${DESTDIR}"
1051.110Sjlam.else
1061.108Serhbuild: buildmsg beforeinstall
1071.96Sscottr.if defined(FORCE_DOMESTIC)
1081.96Sscottr	@echo '*** CAPUTE!'
1091.96Sscottr	@echo '    The FORCE_DOMESTIC flag is not compatible with "make build".'
1101.96Sscottr	@echo '    Please correct the problem and try again.'
1111.96Sscottr	@false
1121.96Sscottr.endif
1131.86Slukem.if ${MKSHARE} != "no"
1141.32Scgd	(cd ${.CURDIR}/share/mk && ${MAKE} install)
1151.68Slukem.endif
1161.39Schristos.if !defined(UPDATE)
1171.17Scgd	${MAKE} cleandir
1181.39Schristos.endif
1191.103Ssimonb.if ${MKOBJDIRS} != "no"
1201.103Ssimonb	${MAKE} obj
1211.103Ssimonb.endif
1221.75Stv.if empty(HAVE_GCC28)
1231.71Smycroft.if defined(DESTDIR)
1241.71Smycroft	@echo "*** CAPUTE!"
1251.84Stv	@echo "    You attempted to compile the world without egcs.  You must"
1261.71Smycroft	@echo "    first install a native egcs compiler."
1271.84Stv	@false
1281.71Smycroft.else
1291.71Smycroft	(cd ${.CURDIR}/gnu/usr.bin/egcs && \
1301.99Sperry	    ${MAKE} ${_J} dependall MKMAN=no && \
1311.86Slukem	    ${MAKE} MKMAN=no install && ${MAKE} cleandir)
1321.71Smycroft.endif
1331.71Smycroft.endif
1341.93Sscottr	${MAKE} includes
1351.61Smycroft	(cd ${.CURDIR}/lib/csu && \
1361.107Smycroft	    ${MAKE} ${_J} MKMAN=no dependall && \
1371.86Slukem	    ${MAKE} MKMAN=no install)
1381.61Smycroft	(cd ${.CURDIR}/lib && \
1391.107Smycroft	    ${MAKE} ${_J} MKMAN=no dependall && \
1401.86Slukem	    ${MAKE} MKMAN=no install)
1411.61Smycroft	(cd ${.CURDIR}/gnu/lib && \
1421.107Smycroft	    ${MAKE} ${_J} MKMAN=no MKINFO=no dependall && \
1431.89Smellon	    ${MAKE} MKMAN=no MKINFO=no install)
1441.106Saidan.if target(cryptobuild)
1451.106Saidan	${MAKE} ${_J} cryptobuild
1461.103Ssimonb.endif
1471.99Sperry	${MAKE} ${_J} dependall && ${MAKE} _BUILD= install
1481.97Schristos.if defined(DOMESTIC) && !defined(EXPORTABLE_SYSTEM)
1491.97Schristos	(cd ${.CURDIR}/${DOMESTIC} && ${MAKE} ${_J} _SLAVE_BUILD= build)
1501.49Slukem.endif
1511.81Sscottr	${MAKE} whatis.db
1521.50Smellon	@echo -n "Build finished at: "
1531.50Smellon	@date
1541.110Sjlam.endif
1551.87Scjs
1561.87Scjsrelease snapshot: build
1571.91Sscottr	(cd ${.CURDIR}/etc && ${MAKE} INSTALL_DONE=1 release)
1581.1Scgd
1591.1Scgd.include <bsd.subdir.mk>
160