Makefile revision 1.81
11.81Sscottr#	$NetBSD: Makefile,v 1.81 1999/01/28 15:36:48 scottr Exp $
21.32Scgd
31.32Scgd.include <bsd.own.mk>			# for configuration variables.
41.4Scgd
51.76Sbouyer# Configurations variables (can be set either in /etc/mk.conf or
61.76Sbouyer# as environement variable
71.76Sbouyer# NBUILDJOBS: the number of jobs to start in parallel in a 'make build'.
81.76Sbouyer#             defaults to 1
91.76Sbouyer# NOMAN: if set to 1, don't build and install man pages
101.76Sbouyer# NOSHARE: if set to 1, don't build or install /usr/share stuffs
111.76Sbouyer# UPDATE: if set to 1, don't do a 'make cleandir' before compile
121.76Sbouyer# DESTDIR: The target directory for installation (default to '/',
131.76Sbouyer#          which mean the current system is updated).
141.76Sbouyer
151.58StvHAVE_GCC28!=	${CXX} --version | egrep "^(2\.8|egcs)" ; echo
161.58Stv
171.76Sbouyer.if defined(NBUILDJOBS)
181.76Sbouyer_J= -j${NBUILDJOBS}
191.76Sbouyer.endif
201.76Sbouyer
211.4Scgd# NOTE THAT etc *DOES NOT* BELONG IN THE LIST BELOW
221.2Scgd
231.52SmycroftSUBDIR+= lib include bin libexec sbin usr.bin usr.sbin share sys
241.36Sexplorer
251.36Sexplorer.if exists(games)
261.36SexplorerSUBDIR+= games
271.36Sexplorer.endif
281.36Sexplorer
291.8ScgdSUBDIR+= gnu
301.52Smycroft# This is needed for libstdc++ and gen-params.
311.52Smycroftincludes-gnu: includes-include includes-sys
321.9Scgd
331.79Sscottr# This little mess makes the includes and install targets
341.79Sscottr# do the expected thing.
351.79Sscottr.if exists(domestic) && \
361.79Sscottr    (make(clean) || make(cleandir) || make(obj) || \
371.80Sscottr    (!defined(_BUILD) && (make(includes) || make(install))))
381.21ScgdSUBDIR+= domestic
391.21Scgd.endif
401.21Scgd
411.13Sbrezak.if exists(regress)
421.9Scgd.ifmake !(install)
431.9ScgdSUBDIR+= regress
441.9Scgd.endif
451.9Scgd
461.10Scgdregression-tests:
471.10Scgd	@echo Running regression tests...
481.22Scgd	@(cd ${.CURDIR}/regress && ${MAKE} regress)
491.13Sbrezak.endif
501.20Scgd
511.26Stlsbeforeinstall:
521.45Sperry.ifmake build
531.45Sperry	@echo -n "Build started at: "
541.45Sperry	@date
551.45Sperry.endif
561.26Stls.ifndef DESTDIR
571.26Stls	(cd ${.CURDIR}/etc && ${MAKE} DESTDIR=/ distrib-dirs)
581.31Stls.else
591.31Stls	(cd ${.CURDIR}/etc && ${MAKE} distrib-dirs)
601.26Stls.endif
611.15Scgd
621.15Scgdafterinstall:
631.81Sscottr.if !defined(NOMAN) && !defined(NOSHARE) && !defined(_BUILD)
641.81Sscottr	${MAKE} whatis.db
651.81Sscottr.endif
661.81Sscottr
671.81Sscottrwhatis.db:
681.22Scgd	(cd ${.CURDIR}/share/man && ${MAKE} makedb)
691.15Scgd
701.43Sthorpejbuild: beforeinstall
711.68Slukem.if !defined(NOSHARE)
721.32Scgd	(cd ${.CURDIR}/share/mk && ${MAKE} install)
731.47Sthorpej	(cd ${.CURDIR}/share/tmac && ${MAKE} && ${MAKE} install)
741.68Slukem.endif
751.39Schristos.if !defined(UPDATE)
761.17Scgd	${MAKE} cleandir
771.39Schristos.endif
781.75Stv.if empty(HAVE_GCC28)
791.71Smycroft.if defined(DESTDIR)
801.71Smycroft	@echo "*** CAPUTE!"
811.71Smycroft	@echo "    You attempted to compile the world with egcs.  You must"
821.71Smycroft	@echo "    first install a native egcs compiler."
831.71Smycroft	false
841.71Smycroft.else
851.71Smycroft	(cd ${.CURDIR}/gnu/usr.bin/egcs && \
861.76Sbouyer	    ${MAKE} depend && ${MAKE} ${_J} NOMAN= && \
871.76Sbouyer	    ${MAKE} NOMAN= install && ${MAKE} cleandir)
881.71Smycroft.endif
891.71Smycroft.endif
901.80Sscottr	${MAKE} _BUILD= includes
911.61Smycroft	(cd ${.CURDIR}/lib/csu && \
921.76Sbouyer	    ${MAKE} depend && ${MAKE} ${_J} NOMAN= && ${MAKE} NOMAN= install)
931.61Smycroft	(cd ${.CURDIR}/lib && \
941.76Sbouyer	    ${MAKE} depend && ${MAKE} ${_J} NOMAN= && ${MAKE} NOMAN= install)
951.61Smycroft	(cd ${.CURDIR}/gnu/lib && \
961.76Sbouyer	    ${MAKE} depend && ${MAKE} ${_J} NOMAN= && ${MAKE} NOMAN= install)
971.80Sscottr	${MAKE} depend && ${MAKE} ${_J} && ${MAKE} _BUILD= install
981.32Scgd.if exists(domestic) && !defined(EXPORTABLE_SYSTEM)
991.78Sscottr	(cd ${.CURDIR}/domestic && ${MAKE} ${_J} _SLAVE_BUILD= build)
1001.49Slukem.endif
1011.81Sscottr	${MAKE} whatis.db
1021.50Smellon	@echo -n "Build finished at: "
1031.50Smellon	@date
1041.1Scgd
1051.1Scgd.include <bsd.subdir.mk>
106