Makefile revision 1.108
11.108Serh#	$NetBSD: Makefile,v 1.108 2000/02/29 21:54:03 erh 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.106SaidanSRCTOP=.
391.106Saidan.include <bsd.crypto.mk>		# for configuration variables.
401.106Saidan
411.106Saidan.if defined(CRYPTOPATH)
421.106Saidan.sinclude "${CRYPTOPATH}/Makefile.frag"
431.106Saidan.endif
441.4Scgd
451.100SsommerfeMKOBJDIRS ?= no
461.58StvHAVE_GCC28!=	${CXX} --version | egrep "^(2\.8|egcs)" ; echo
471.58Stv
481.76Sbouyer.if defined(NBUILDJOBS)
491.76Sbouyer_J= -j${NBUILDJOBS}
501.76Sbouyer.endif
511.76Sbouyer
521.4Scgd# NOTE THAT etc *DOES NOT* BELONG IN THE LIST BELOW
531.2Scgd
541.52SmycroftSUBDIR+= lib include bin libexec sbin usr.bin usr.sbin share sys
551.105Sassar
561.105Sassarincludes-lib: includes-include includes-sys
571.36Sexplorer
581.36Sexplorer.if exists(games)
591.36SexplorerSUBDIR+= games
601.36Sexplorer.endif
611.36Sexplorer
621.8ScgdSUBDIR+= gnu
631.52Smycroft# This is needed for libstdc++ and gen-params.
641.52Smycroftincludes-gnu: includes-include includes-sys
651.21Scgd
661.13Sbrezak.if exists(regress)
671.9Scgd.ifmake !(install)
681.9ScgdSUBDIR+= regress
691.9Scgd.endif
701.9Scgd
711.10Scgdregression-tests:
721.10Scgd	@echo Running regression tests...
731.22Scgd	@(cd ${.CURDIR}/regress && ${MAKE} regress)
741.13Sbrezak.endif
751.20Scgd
761.108Serhbuildmsg:
771.45Sperry	@echo -n "Build started at: "
781.45Sperry	@date
791.108Serh
801.108Serhbeforeinstall:
811.26Stls.ifndef DESTDIR
821.26Stls	(cd ${.CURDIR}/etc && ${MAKE} DESTDIR=/ distrib-dirs)
831.31Stls.else
841.31Stls	(cd ${.CURDIR}/etc && ${MAKE} distrib-dirs)
851.26Stls.endif
861.15Scgd
871.15Scgdafterinstall:
881.86Slukem.if ${MKMAN} != "no" && !defined(_BUILD)
891.81Sscottr	${MAKE} whatis.db
901.81Sscottr.endif
911.81Sscottr
921.81Sscottrwhatis.db:
931.22Scgd	(cd ${.CURDIR}/share/man && ${MAKE} makedb)
941.15Scgd
951.84Stv# wrt info/dir below:  It's safe to move this over top of /usr/share/info/dir,
961.84Stv# as the build will automatically remove/replace the non-pkg entries there.
971.84Stv
981.108Serhbuild: buildmsg beforeinstall
991.96Sscottr.if defined(FORCE_DOMESTIC)
1001.96Sscottr	@echo '*** CAPUTE!'
1011.96Sscottr	@echo '    The FORCE_DOMESTIC flag is not compatible with "make build".'
1021.96Sscottr	@echo '    Please correct the problem and try again.'
1031.96Sscottr	@false
1041.96Sscottr.endif
1051.86Slukem.if ${MKSHARE} != "no"
1061.32Scgd	(cd ${.CURDIR}/share/mk && ${MAKE} install)
1071.68Slukem.endif
1081.39Schristos.if !defined(UPDATE)
1091.17Scgd	${MAKE} cleandir
1101.39Schristos.endif
1111.103Ssimonb.if ${MKOBJDIRS} != "no"
1121.103Ssimonb	${MAKE} obj
1131.104Ssimonb	(cd ${.CURDIR}/distrib && ${MAKE} obj)
1141.103Ssimonb.endif
1151.75Stv.if empty(HAVE_GCC28)
1161.71Smycroft.if defined(DESTDIR)
1171.71Smycroft	@echo "*** CAPUTE!"
1181.84Stv	@echo "    You attempted to compile the world without egcs.  You must"
1191.71Smycroft	@echo "    first install a native egcs compiler."
1201.84Stv	@false
1211.71Smycroft.else
1221.71Smycroft	(cd ${.CURDIR}/gnu/usr.bin/egcs && \
1231.99Sperry	    ${MAKE} ${_J} dependall MKMAN=no && \
1241.86Slukem	    ${MAKE} MKMAN=no install && ${MAKE} cleandir)
1251.71Smycroft.endif
1261.71Smycroft.endif
1271.93Sscottr	${MAKE} includes
1281.61Smycroft	(cd ${.CURDIR}/lib/csu && \
1291.107Smycroft	    ${MAKE} ${_J} MKMAN=no dependall && \
1301.86Slukem	    ${MAKE} MKMAN=no install)
1311.61Smycroft	(cd ${.CURDIR}/lib && \
1321.107Smycroft	    ${MAKE} ${_J} MKMAN=no dependall && \
1331.86Slukem	    ${MAKE} MKMAN=no install)
1341.61Smycroft	(cd ${.CURDIR}/gnu/lib && \
1351.107Smycroft	    ${MAKE} ${_J} MKMAN=no MKINFO=no dependall && \
1361.89Smellon	    ${MAKE} MKMAN=no MKINFO=no install)
1371.106Saidan.if target(cryptobuild)
1381.106Saidan	${MAKE} ${_J} cryptobuild
1391.103Ssimonb.endif
1401.99Sperry	${MAKE} ${_J} dependall && ${MAKE} _BUILD= install
1411.97Schristos.if defined(DOMESTIC) && !defined(EXPORTABLE_SYSTEM)
1421.97Schristos	(cd ${.CURDIR}/${DOMESTIC} && ${MAKE} ${_J} _SLAVE_BUILD= build)
1431.49Slukem.endif
1441.81Sscottr	${MAKE} whatis.db
1451.50Smellon	@echo -n "Build finished at: "
1461.50Smellon	@date
1471.87Scjs
1481.87Scjsrelease snapshot: build
1491.91Sscottr	(cd ${.CURDIR}/etc && ${MAKE} INSTALL_DONE=1 release)
1501.1Scgd
1511.1Scgd.include <bsd.subdir.mk>
152