Home | History | Annotate | Line # | Download | only in src
Makefile revision 1.86
      1 #	$NetBSD: Makefile,v 1.86 1999/02/13 02:54:17 lukem 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 # MKMAN:	if set to no, don't build and install man pages
     10 # MKSHARE:	if set to no, 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 # Descend into the domestic tree if it exists AND
     34 #  1) the target is clean, cleandir, or obj, OR
     35 #  2) the the target is install or includes AND NOT
     36 #    a) compiling only "exportable" code OR
     37 #    b) doing it as part of build.
     38 
     39 .if exists(domestic) && \
     40     (make(clean) || make(cleandir) || make(obj) || \
     41     ((make(includes) || make(install)) && \
     42     !(defined(EXPORTABLE_SYSTEM) || defined(_BUILD))))
     43 SUBDIR+= domestic
     44 .endif
     45 
     46 .if exists(regress)
     47 .ifmake !(install)
     48 SUBDIR+= regress
     49 .endif
     50 
     51 regression-tests:
     52 	@echo Running regression tests...
     53 	@(cd ${.CURDIR}/regress && ${MAKE} regress)
     54 .endif
     55 
     56 beforeinstall:
     57 .ifmake build
     58 	@echo -n "Build started at: "
     59 	@date
     60 .endif
     61 .ifndef DESTDIR
     62 	(cd ${.CURDIR}/etc && ${MAKE} DESTDIR=/ distrib-dirs)
     63 .else
     64 	(cd ${.CURDIR}/etc && ${MAKE} distrib-dirs)
     65 .endif
     66 
     67 afterinstall:
     68 .if ${MKMAN} != "no" && !defined(_BUILD)
     69 	${MAKE} whatis.db
     70 .endif
     71 
     72 whatis.db:
     73 	(cd ${.CURDIR}/share/man && ${MAKE} makedb)
     74 
     75 # wrt info/dir below:  It's safe to move this over top of /usr/share/info/dir,
     76 # as the build will automatically remove/replace the non-pkg entries there.
     77 
     78 build: beforeinstall
     79 .if ${MKSHARE} != "no"
     80 	(cd ${.CURDIR}/share/mk && ${MAKE} install)
     81 	(cd ${.CURDIR}/share/tmac && ${MAKE} && ${MAKE} install)
     82 .endif
     83 .if !defined(UPDATE)
     84 	${MAKE} cleandir
     85 .endif
     86 .if empty(HAVE_GCC28)
     87 .if defined(DESTDIR)
     88 	@echo "*** CAPUTE!"
     89 	@echo "    You attempted to compile the world without egcs.  You must"
     90 	@echo "    first install a native egcs compiler."
     91 	@false
     92 .else
     93 	(cd ${.CURDIR}/gnu/usr.bin/egcs && \
     94 	    ${MAKE} depend && ${MAKE} ${_J} MKMAN=no && \
     95 	    ${MAKE} MKMAN=no install && ${MAKE} cleandir)
     96 .endif
     97 .endif
     98 	${MAKE} _BUILD= includes
     99 	(cd ${.CURDIR}/lib/csu && \
    100 	    ${MAKE} depend && ${MAKE} ${_J} MKMAN=no && \
    101 	    ${MAKE} MKMAN=no install)
    102 	(cd ${.CURDIR}/lib && \
    103 	    ${MAKE} depend && ${MAKE} ${_J} MKMAN=no && \
    104 	    ${MAKE} MKMAN=no install)
    105 	(cd ${.CURDIR}/gnu/lib && \
    106 	    ${MAKE} depend && ${MAKE} ${_J} MKMAN=no && \
    107 	    ${MAKE} MKMAN=no install)
    108 .if exists(domestic) && !defined(EXPORTABLE_SYSTEM)
    109 	(cd ${.CURDIR}/domestic/lib && \
    110 	    ${MAKE} depend && ${MAKE} ${_J} MKMAN=no && \
    111 	    ${MAKE} MKMAN=no install)
    112 .endif
    113 	${MAKE} depend && ${MAKE} ${_J} && ${MAKE} _BUILD= install
    114 .if exists(domestic) && !defined(EXPORTABLE_SYSTEM)
    115 	(cd ${.CURDIR}/domestic && ${MAKE} ${_J} _SLAVE_BUILD= build)
    116 .endif
    117 	${MAKE} whatis.db
    118 	@echo -n "Build finished at: "
    119 	@date
    120 
    121 .include <bsd.subdir.mk>
    122