Home | History | Annotate | Line # | Download | only in src
Makefile revision 1.103
      1 #	$NetBSD: Makefile,v 1.103 1999/12/04 03:52:28 simonb Exp $
      2 
      3 # This is the top-level makefile for building NetBSD. For an outline of
      4 # how to build a snapshot or release, as well as other release engineering
      5 # information, see http://www.netbsd.org/developers/releng/index.html
      6 #
      7 # Not everything you can set or do is documented in this makefile. In
      8 # particular, you should review the files in /usr/share/mk (especially
      9 # bsd.README) for general information on building programs and writing
     10 # Makefiles within this structure, and see the comments in src/etc/Makefile
     11 # for further information on installation and release set options.
     12 #
     13 # Variables listed below can be set on the make command line (highest
     14 # priority), in /etc/mk.conf (middle priority), or in the environment
     15 # (lowest priority).
     16 #
     17 # Variables:
     18 #   DESTDIR is the target directory for installation of the compiled
     19 #	software. It defaults to /. Note that programs are built against
     20 #	libraries installed in DESTDIR.
     21 #   MKMAN, if set to `no', will prevent building of manual pages.
     22 #   MKOBJDIRS, if not set to `no', will build object directories at 
     23 #	an appropriate point in a build.
     24 #   MKSHARE, if set to `no', will prevent building and installing
     25 #	anything in /usr/share.
     26 #   NBUILDJOBS is the number of jobs to start in parallel during a
     27 #	'make build'. It defaults to 1.
     28 #   UPDATE will avoid a `make cleandir' at the start of `make build',
     29 #	as well as having the effects listed in /usr/share/mk/bsd.README.
     30 #
     31 # Targets:
     32 #   build: builds a full release of netbsd in DESTDIR.
     33 #   release: does a `make build,' and then tars up the DESTDIR files
     34 #	into RELEASEDIR, in release(7) format. (See etc/Makefile for
     35 #	more information on this.)
     36 #   snapshot: a synonym for release.
     37 
     38 .include <bsd.own.mk>			# for configuration variables.
     39 
     40 MKOBJDIRS ?= no
     41 HAVE_GCC28!=	${CXX} --version | egrep "^(2\.8|egcs)" ; echo
     42 
     43 .if defined(NBUILDJOBS)
     44 _J= -j${NBUILDJOBS}
     45 .endif
     46 
     47 # NOTE THAT etc *DOES NOT* BELONG IN THE LIST BELOW
     48 
     49 SUBDIR+= lib include bin libexec sbin usr.bin usr.sbin share sys
     50 
     51 .if exists(games)
     52 SUBDIR+= games
     53 .endif
     54 
     55 SUBDIR+= gnu
     56 # This is needed for libstdc++ and gen-params.
     57 includes-gnu: includes-include includes-sys
     58 
     59 .if exists(regress)
     60 .ifmake !(install)
     61 SUBDIR+= regress
     62 .endif
     63 
     64 regression-tests:
     65 	@echo Running regression tests...
     66 	@(cd ${.CURDIR}/regress && ${MAKE} regress)
     67 .endif
     68 
     69 beforeinstall:
     70 .ifmake build
     71 	@echo -n "Build started at: "
     72 	@date
     73 .endif
     74 .ifndef DESTDIR
     75 	(cd ${.CURDIR}/etc && ${MAKE} DESTDIR=/ distrib-dirs)
     76 .else
     77 	(cd ${.CURDIR}/etc && ${MAKE} distrib-dirs)
     78 .endif
     79 
     80 afterinstall:
     81 .if ${MKMAN} != "no" && !defined(_BUILD)
     82 	${MAKE} whatis.db
     83 .endif
     84 
     85 whatis.db:
     86 	(cd ${.CURDIR}/share/man && ${MAKE} makedb)
     87 
     88 # wrt info/dir below:  It's safe to move this over top of /usr/share/info/dir,
     89 # as the build will automatically remove/replace the non-pkg entries there.
     90 
     91 build: beforeinstall
     92 .if defined(FORCE_DOMESTIC)
     93 	@echo '*** CAPUTE!'
     94 	@echo '    The FORCE_DOMESTIC flag is not compatible with "make build".'
     95 	@echo '    Please correct the problem and try again.'
     96 	@false
     97 .endif
     98 .if ${MKSHARE} != "no"
     99 	(cd ${.CURDIR}/share/mk && ${MAKE} install)
    100 .endif
    101 .if !defined(UPDATE)
    102 	${MAKE} cleandir
    103 .endif
    104 .if ${MKOBJDIRS} != "no"
    105 	${MAKE} obj
    106 .endif
    107 .if empty(HAVE_GCC28)
    108 .if defined(DESTDIR)
    109 	@echo "*** CAPUTE!"
    110 	@echo "    You attempted to compile the world without egcs.  You must"
    111 	@echo "    first install a native egcs compiler."
    112 	@false
    113 .else
    114 	(cd ${.CURDIR}/gnu/usr.bin/egcs && \
    115 	    ${MAKE} ${_J} dependall MKMAN=no && \
    116 	    ${MAKE} MKMAN=no install && ${MAKE} cleandir)
    117 .endif
    118 .endif
    119 	${MAKE} includes
    120 	(cd ${.CURDIR}/lib/csu && \
    121 	    ${MAKE} ${_J} dependall MKMAN=no && \
    122 	    ${MAKE} MKMAN=no install)
    123 	(cd ${.CURDIR}/lib && \
    124 	    ${MAKE} ${_J} dependall MKMAN=no && \
    125 	    ${MAKE} MKMAN=no install)
    126 	(cd ${.CURDIR}/gnu/lib && \
    127 	    ${MAKE} ${_J} dependall MKMAN=no MKINFO=no && \
    128 	    ${MAKE} MKMAN=no MKINFO=no install)
    129 .if ${MKSHARE} != "no"
    130 	(cd ${.CURDIR}/share/tmac && ${MAKE} && ${MAKE} install)
    131 .endif
    132 	${MAKE} ${_J} dependall && ${MAKE} _BUILD= install
    133 .if defined(DOMESTIC) && !defined(EXPORTABLE_SYSTEM)
    134 	(cd ${.CURDIR}/${DOMESTIC} && ${MAKE} ${_J} _SLAVE_BUILD= build)
    135 .endif
    136 	${MAKE} whatis.db
    137 	@echo -n "Build finished at: "
    138 	@date
    139 
    140 release snapshot: build
    141 	(cd ${.CURDIR}/etc && ${MAKE} INSTALL_DONE=1 release)
    142 
    143 .include <bsd.subdir.mk>
    144