1 # $NetBSD: Makefile,v 1.77 1999/01/03 22:17:19 cjs 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 15 HAVE_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 23 SUBDIR+= lib include bin libexec sbin usr.bin usr.sbin share sys 24 25 .if exists(games) 26 SUBDIR+= games 27 .endif 28 29 SUBDIR+= gnu 30 # This is needed for libstdc++ and gen-params. 31 includes-gnu: includes-include includes-sys 32 33 .if exists(domestic) && (!defined(EXPORTABLE_SYSTEM) ||\ 34 make(obj) || make(clean) || make(cleandir) || make(distclean)) 35 SUBDIR+= domestic 36 .endif 37 38 .if exists(regress) 39 .ifmake !(install) 40 SUBDIR+= regress 41 .endif 42 43 regression-tests: 44 @echo Running regression tests... 45 @(cd ${.CURDIR}/regress && ${MAKE} regress) 46 .endif 47 48 beforeinstall: 49 .ifmake build 50 @echo -n "Build started at: " 51 @date 52 .endif 53 .ifndef DESTDIR 54 (cd ${.CURDIR}/etc && ${MAKE} DESTDIR=/ distrib-dirs) 55 .else 56 (cd ${.CURDIR}/etc && ${MAKE} distrib-dirs) 57 .endif 58 59 afterinstall: 60 .if !defined(NOMAN) && !defined(NOSHARE) 61 (cd ${.CURDIR}/share/man && ${MAKE} makedb) 62 .endif 63 64 build: beforeinstall 65 .if !defined(NOSHARE) 66 (cd ${.CURDIR}/share/mk && ${MAKE} install) 67 (cd ${.CURDIR}/share/tmac && ${MAKE} && ${MAKE} install) 68 .endif 69 .if !defined(UPDATE) 70 ${MAKE} cleandir 71 .endif 72 .if empty(HAVE_GCC28) 73 .if defined(DESTDIR) 74 @echo "*** CAPUTE!" 75 @echo " You attempted to compile the world with egcs. You must" 76 @echo " first install a native egcs compiler." 77 false 78 .else 79 (cd ${.CURDIR}/gnu/usr.bin/egcs && \ 80 ${MAKE} depend && ${MAKE} ${_J} NOMAN= && \ 81 ${MAKE} NOMAN= install && ${MAKE} cleandir) 82 .endif 83 .endif 84 ${MAKE} includes 85 (cd ${.CURDIR}/lib/csu && \ 86 ${MAKE} depend && ${MAKE} ${_J} NOMAN= && ${MAKE} NOMAN= install) 87 (cd ${.CURDIR}/lib && \ 88 ${MAKE} depend && ${MAKE} ${_J} NOMAN= && ${MAKE} NOMAN= install) 89 (cd ${.CURDIR}/gnu/lib && \ 90 ${MAKE} depend && ${MAKE} ${_J} NOMAN= && ${MAKE} NOMAN= install) 91 .if exists(domestic) && !defined(EXPORTABLE_SYSTEM) 92 # libtelnet depends on libdes and libkrb. libkrb depends on 93 # libcom_err. 94 .if exists(domestic/lib/libdes) 95 (cd ${.CURDIR}/domestic/lib/libdes && \ 96 ${MAKE} depend && ${MAKE} ${_J} NOMAN= && ${MAKE} NOMAN= install) 97 .endif 98 .if exists(domestic/lib/libcom_err) 99 (cd ${.CURDIR}/domestic/lib/libcom_err && \ 100 ${MAKE} depend && ${MAKE} ${_J} NOMAN= && ${MAKE} NOMAN= install) 101 .endif 102 .if exists(domestic/lib/libkrb) 103 (cd ${.CURDIR}/domestic/lib/libkrb && \ 104 ${MAKE} depend && ${MAKE} ${_J} NOMAN= && ${MAKE} NOMAN= install) 105 .endif 106 (cd ${.CURDIR}/domestic/lib && \ 107 ${MAKE} depend && ${MAKE} ${_J} NOMAN= && ${MAKE} NOMAN= install) 108 .endif 109 ${MAKE} depend && ${MAKE} ${_J} && ${MAKE} install 110 @echo -n "Build finished at: " 111 @date 112 113 .include <bsd.subdir.mk> 114