Makefile revision 1.84
11.84Stv#	$NetBSD: Makefile,v 1.84 1999/02/11 14:49:49 tv 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.82Sscottr# Descend into the domestic tree if it exists AND
341.82Sscottr#  1) the target is clean, cleandir, or obj, OR
351.82Sscottr#  2) the the target is install or includes AND NOT
361.82Sscottr#    a) compiling only "exportable" code OR
371.82Sscottr#    b) doing it as part of build.
381.82Sscottr
391.79Sscottr.if exists(domestic) && \
401.79Sscottr    (make(clean) || make(cleandir) || make(obj) || \
411.82Sscottr    ((make(includes) || make(install)) && \
421.82Sscottr    !(defined(EXPORTABLE_SYSTEM) || defined(_BUILD))))
431.21ScgdSUBDIR+= domestic
441.21Scgd.endif
451.21Scgd
461.13Sbrezak.if exists(regress)
471.9Scgd.ifmake !(install)
481.9ScgdSUBDIR+= regress
491.9Scgd.endif
501.9Scgd
511.10Scgdregression-tests:
521.10Scgd	@echo Running regression tests...
531.22Scgd	@(cd ${.CURDIR}/regress && ${MAKE} regress)
541.13Sbrezak.endif
551.20Scgd
561.26Stlsbeforeinstall:
571.45Sperry.ifmake build
581.45Sperry	@echo -n "Build started at: "
591.45Sperry	@date
601.45Sperry.endif
611.26Stls.ifndef DESTDIR
621.26Stls	(cd ${.CURDIR}/etc && ${MAKE} DESTDIR=/ distrib-dirs)
631.31Stls.else
641.31Stls	(cd ${.CURDIR}/etc && ${MAKE} distrib-dirs)
651.26Stls.endif
661.15Scgd
671.15Scgdafterinstall:
681.81Sscottr.if !defined(NOMAN) && !defined(NOSHARE) && !defined(_BUILD)
691.81Sscottr	${MAKE} whatis.db
701.81Sscottr.endif
711.81Sscottr
721.81Sscottrwhatis.db:
731.22Scgd	(cd ${.CURDIR}/share/man && ${MAKE} makedb)
741.15Scgd
751.84Stv# wrt info/dir below:  It's safe to move this over top of /usr/share/info/dir,
761.84Stv# as the build will automatically remove/replace the non-pkg entries there.
771.84Stv
781.43Sthorpejbuild: beforeinstall
791.68Slukem.if !defined(NOSHARE)
801.32Scgd	(cd ${.CURDIR}/share/mk && ${MAKE} install)
811.47Sthorpej	(cd ${.CURDIR}/share/tmac && ${MAKE} && ${MAKE} install)
821.84Stv	if [ -f ${DESTDIR}/usr/pkg/info/dir ]; then \
831.84Stv		${INSTALL} -c -m 644 -o ${BINOWN} -g ${BINGRP} \
841.84Stv			${DESTDIR}/usr/pkg/info/dir ${DESTDIR}/usr/share/info/dir; \
851.84Stv		rm -f ${DESTDIR}/usr/pkg/info/dir; \
861.84Stv		ln -s /usr/share/info/dir ${DESTDIR}/usr/pkg/info/dir; \
871.84Stv	fi
881.68Slukem.endif
891.39Schristos.if !defined(UPDATE)
901.17Scgd	${MAKE} cleandir
911.39Schristos.endif
921.75Stv.if empty(HAVE_GCC28)
931.71Smycroft.if defined(DESTDIR)
941.71Smycroft	@echo "*** CAPUTE!"
951.84Stv	@echo "    You attempted to compile the world without egcs.  You must"
961.71Smycroft	@echo "    first install a native egcs compiler."
971.84Stv	@false
981.71Smycroft.else
991.71Smycroft	(cd ${.CURDIR}/gnu/usr.bin/egcs && \
1001.76Sbouyer	    ${MAKE} depend && ${MAKE} ${_J} NOMAN= && \
1011.76Sbouyer	    ${MAKE} NOMAN= install && ${MAKE} cleandir)
1021.71Smycroft.endif
1031.71Smycroft.endif
1041.80Sscottr	${MAKE} _BUILD= includes
1051.61Smycroft	(cd ${.CURDIR}/lib/csu && \
1061.76Sbouyer	    ${MAKE} depend && ${MAKE} ${_J} NOMAN= && ${MAKE} NOMAN= install)
1071.61Smycroft	(cd ${.CURDIR}/lib && \
1081.76Sbouyer	    ${MAKE} depend && ${MAKE} ${_J} NOMAN= && ${MAKE} NOMAN= install)
1091.61Smycroft	(cd ${.CURDIR}/gnu/lib && \
1101.76Sbouyer	    ${MAKE} depend && ${MAKE} ${_J} NOMAN= && ${MAKE} NOMAN= install)
1111.83Schristos.if exists(domestic) && !defined(EXPORTABLE_SYSTEM)
1121.83Schristos	(cd ${.CURDIR}/domestic/lib && \
1131.83Schristos	    ${MAKE} depend && ${MAKE} ${_J} NOMAN= && ${MAKE} NOMAN= install)
1141.83Schristos.endif
1151.80Sscottr	${MAKE} depend && ${MAKE} ${_J} && ${MAKE} _BUILD= install
1161.32Scgd.if exists(domestic) && !defined(EXPORTABLE_SYSTEM)
1171.78Sscottr	(cd ${.CURDIR}/domestic && ${MAKE} ${_J} _SLAVE_BUILD= build)
1181.49Slukem.endif
1191.81Sscottr	${MAKE} whatis.db
1201.50Smellon	@echo -n "Build finished at: "
1211.50Smellon	@date
1221.1Scgd
1231.1Scgd.include <bsd.subdir.mk>
124