Makefile revision 1.80
1# $NetBSD: Makefile,v 1.80 1999/01/24 19:18:54 scottr Exp $ 2 3.include <bsd.own.mk> # for configuration variables. 4 5# Configurations variables (can be set either in /etc/mk.conf or 6# as environement variable 7# NBUILDJOBS: the number of jobs to start in parallel in a 'make build'. 8# defaults to 1 9# NOMAN: if set to 1, don't build and install man pages 10# NOSHARE: if set to 1, don't build or install /usr/share stuffs 11# UPDATE: if set to 1, don't do a 'make cleandir' before compile 12# DESTDIR: The target directory for installation (default to '/', 13# which mean the current system is updated). 14 15HAVE_GCC28!= ${CXX} --version | egrep "^(2\.8|egcs)" ; echo 16 17.if defined(NBUILDJOBS) 18_J= -j${NBUILDJOBS} 19.endif 20 21# NOTE THAT etc *DOES NOT* BELONG IN THE LIST BELOW 22 23SUBDIR+= lib include bin libexec sbin usr.bin usr.sbin share sys 24 25.if exists(games) 26SUBDIR+= games 27.endif 28 29SUBDIR+= gnu 30# This is needed for libstdc++ and gen-params. 31includes-gnu: includes-include includes-sys 32 33# This little mess makes the includes and install targets 34# do the expected thing. 35.if exists(domestic) && \ 36 (make(clean) || make(cleandir) || make(obj) || \ 37 (!defined(_BUILD) && (make(includes) || make(install)))) 38SUBDIR+= domestic 39.endif 40 41.if exists(regress) 42.ifmake !(install) 43SUBDIR+= regress 44.endif 45 46regression-tests: 47 @echo Running regression tests... 48 @(cd ${.CURDIR}/regress && ${MAKE} regress) 49.endif 50 51beforeinstall: 52.ifmake build 53 @echo -n "Build started at: " 54 @date 55.endif 56.ifndef DESTDIR 57 (cd ${.CURDIR}/etc && ${MAKE} DESTDIR=/ distrib-dirs) 58.else 59 (cd ${.CURDIR}/etc && ${MAKE} distrib-dirs) 60.endif 61 62afterinstall: 63.if !defined(NOMAN) && !defined(NOSHARE) 64 (cd ${.CURDIR}/share/man && ${MAKE} makedb) 65.endif 66 67build: beforeinstall 68.if !defined(NOSHARE) 69 (cd ${.CURDIR}/share/mk && ${MAKE} install) 70 (cd ${.CURDIR}/share/tmac && ${MAKE} && ${MAKE} install) 71.endif 72.if !defined(UPDATE) 73 ${MAKE} cleandir 74.endif 75.if empty(HAVE_GCC28) 76.if defined(DESTDIR) 77 @echo "*** CAPUTE!" 78 @echo " You attempted to compile the world with egcs. You must" 79 @echo " first install a native egcs compiler." 80 false 81.else 82 (cd ${.CURDIR}/gnu/usr.bin/egcs && \ 83 ${MAKE} depend && ${MAKE} ${_J} NOMAN= && \ 84 ${MAKE} NOMAN= install && ${MAKE} cleandir) 85.endif 86.endif 87 ${MAKE} _BUILD= includes 88 (cd ${.CURDIR}/lib/csu && \ 89 ${MAKE} depend && ${MAKE} ${_J} NOMAN= && ${MAKE} NOMAN= install) 90 (cd ${.CURDIR}/lib && \ 91 ${MAKE} depend && ${MAKE} ${_J} NOMAN= && ${MAKE} NOMAN= install) 92 (cd ${.CURDIR}/gnu/lib && \ 93 ${MAKE} depend && ${MAKE} ${_J} NOMAN= && ${MAKE} NOMAN= install) 94 ${MAKE} depend && ${MAKE} ${_J} && ${MAKE} _BUILD= install 95.if exists(domestic) && !defined(EXPORTABLE_SYSTEM) 96 (cd ${.CURDIR}/domestic && ${MAKE} ${_J} _SLAVE_BUILD= build) 97.endif 98 @echo -n "Build finished at: " 99 @date 100 101.include <bsd.subdir.mk> 102