Home | History | Annotate | Line # | Download | only in src
Makefile revision 1.122
      1  1.122  sommerfe #	$NetBSD: Makefile,v 1.122 2001/05/08 02:04:08 sommerfeld Exp $
      2   1.95       cjs 
      3   1.95       cjs # This is the top-level makefile for building NetBSD. For an outline of
      4   1.95       cjs # how to build a snapshot or release, as well as other release engineering
      5   1.95       cjs # information, see http://www.netbsd.org/developers/releng/index.html
      6   1.95       cjs #
      7   1.95       cjs # Not everything you can set or do is documented in this makefile. In
      8   1.95       cjs # particular, you should review the files in /usr/share/mk (especially
      9   1.95       cjs # bsd.README) for general information on building programs and writing
     10   1.95       cjs # Makefiles within this structure, and see the comments in src/etc/Makefile
     11   1.95       cjs # for further information on installation and release set options.
     12   1.95       cjs #
     13   1.95       cjs # Variables listed below can be set on the make command line (highest
     14   1.95       cjs # priority), in /etc/mk.conf (middle priority), or in the environment
     15   1.95       cjs # (lowest priority).
     16   1.95       cjs #
     17   1.95       cjs # Variables:
     18  1.101  sommerfe #   DESTDIR is the target directory for installation of the compiled
     19  1.101  sommerfe #	software. It defaults to /. Note that programs are built against
     20  1.101  sommerfe #	libraries installed in DESTDIR.
     21   1.95       cjs #   MKMAN, if set to `no', will prevent building of manual pages.
     22  1.101  sommerfe #   MKOBJDIRS, if not set to `no', will build object directories at 
     23  1.101  sommerfe #	an appropriate point in a build.
     24   1.95       cjs #   MKSHARE, if set to `no', will prevent building and installing
     25   1.95       cjs #	anything in /usr/share.
     26  1.101  sommerfe #   NBUILDJOBS is the number of jobs to start in parallel during a
     27  1.101  sommerfe #	'make build'. It defaults to 1.
     28   1.95       cjs #   UPDATE will avoid a `make cleandir' at the start of `make build',
     29   1.95       cjs #	as well as having the effects listed in /usr/share/mk/bsd.README.
     30  1.119    toddpw #   NOCLEANDIR will avoid a `make cleandir' at the start of `make build',
     31  1.119    toddpw #	but without having the effects listed in /usr/share/mk/bsd.README.
     32  1.119    toddpw #   NOINCLUDES will avoid the `make includes' usually done by `make build'.
     33   1.95       cjs #
     34   1.95       cjs # Targets:
     35  1.110      jlam #   build: builds a full release of netbsd in DESTDIR. If BUILD_DONE is
     36  1.110      jlam #	set, this is an empty target.
     37   1.95       cjs #   release: does a `make build,' and then tars up the DESTDIR files
     38   1.95       cjs #	into RELEASEDIR, in release(7) format. (See etc/Makefile for
     39   1.95       cjs #	more information on this.)
     40   1.95       cjs #   snapshot: a synonym for release.
     41   1.32       cgd 
     42  1.118   thorpej .include <bsd.own.mk>
     43    1.4       cgd 
     44  1.100  sommerfe MKOBJDIRS ?= no
     45  1.115   thorpej HAVE_EGCS!=	${CXX} --version | egrep "^(2\.[89]|egcs)" ; echo
     46   1.58        tv 
     47   1.76    bouyer .if defined(NBUILDJOBS)
     48   1.76    bouyer _J= -j${NBUILDJOBS}
     49   1.76    bouyer .endif
     50   1.76    bouyer 
     51  1.112       mrg .if defined(DESTDIR)
     52  1.112       mrg _M=-m ${DESTDIR}/usr/share/mk
     53  1.112       mrg .endif
     54  1.112       mrg 
     55    1.4       cgd # NOTE THAT etc *DOES NOT* BELONG IN THE LIST BELOW
     56    1.2       cgd 
     57   1.52   mycroft SUBDIR+= lib include bin libexec sbin usr.bin usr.sbin share sys
     58  1.120     fredb .if make(cleandir) || make(obj)
     59  1.109       cjs SUBDIR+= distrib
     60  1.114       sjg .ifdef MAKEOBJDIRPREFIX
     61  1.114       sjg SUBDIR+= etc
     62  1.114       sjg .endif
     63  1.109       cjs .endif
     64  1.105     assar 
     65  1.105     assar includes-lib: includes-include includes-sys
     66   1.36  explorer 
     67   1.36  explorer .if exists(games)
     68   1.36  explorer SUBDIR+= games
     69   1.36  explorer .endif
     70   1.36  explorer 
     71    1.8       cgd SUBDIR+= gnu
     72   1.52   mycroft # This is needed for libstdc++ and gen-params.
     73   1.52   mycroft includes-gnu: includes-include includes-sys
     74   1.21       cgd 
     75   1.13    brezak .if exists(regress)
     76    1.9       cgd .ifmake !(install)
     77    1.9       cgd SUBDIR+= regress
     78    1.9       cgd .endif
     79    1.9       cgd 
     80   1.10       cgd regression-tests:
     81   1.10       cgd 	@echo Running regression tests...
     82  1.112       mrg 	@(cd ${.CURDIR}/regress && ${MAKE} ${_M} regress)
     83   1.13    brezak .endif
     84   1.20       cgd 
     85  1.108       erh buildmsg:
     86   1.45     perry 	@echo -n "Build started at: "
     87   1.45     perry 	@date
     88  1.108       erh 
     89  1.121    deberg # If sharesrc is around, use its share/mk files to bootstrap until the
     90  1.121    deberg # mk files are installed (first step of make build).  If installing to
     91  1.121    deberg # DESTDIR, don't bother, since the build will fail later on anyway.
     92  1.121    deberg 
     93  1.108       erh beforeinstall:
     94  1.112       mrg .ifndef NODISTRIBDIRS
     95   1.26       tls .ifndef DESTDIR
     96  1.121    deberg .if exists(share/mk)
     97  1.121    deberg 	(cd ${.CURDIR}/etc && ${MAKE} -m ${.CURDIR}/share/mk DESTDIR=/ distrib-dirs)
     98  1.121    deberg .else
     99   1.26       tls 	(cd ${.CURDIR}/etc && ${MAKE} DESTDIR=/ distrib-dirs)
    100  1.121    deberg .endif
    101   1.31       tls .else
    102  1.117       mrg 	(cd ${.CURDIR}/etc && ${MAKE} distrib-dirs)
    103   1.26       tls .endif
    104  1.112       mrg .endif
    105   1.15       cgd 
    106   1.15       cgd afterinstall:
    107   1.86     lukem .if ${MKMAN} != "no" && !defined(_BUILD)
    108  1.112       mrg 	${MAKE} ${_M} whatis.db
    109   1.81    scottr .endif
    110   1.81    scottr 
    111   1.81    scottr whatis.db:
    112  1.112       mrg 	(cd ${.CURDIR}/share/man && ${MAKE} ${_M} makedb)
    113   1.15       cgd 
    114   1.84        tv # wrt info/dir below:  It's safe to move this over top of /usr/share/info/dir,
    115   1.84        tv # as the build will automatically remove/replace the non-pkg entries there.
    116   1.84        tv 
    117  1.110      jlam .if defined(BUILD_DONE)
    118  1.110      jlam build:
    119  1.110      jlam 	@echo "Build installed into ${DESTDIR}"
    120  1.110      jlam .else
    121  1.108       erh build: buildmsg beforeinstall
    122   1.96    scottr .if defined(FORCE_DOMESTIC)
    123   1.96    scottr 	@echo '*** CAPUTE!'
    124   1.96    scottr 	@echo '    The FORCE_DOMESTIC flag is not compatible with "make build".'
    125   1.96    scottr 	@echo '    Please correct the problem and try again.'
    126   1.96    scottr 	@false
    127   1.96    scottr .endif
    128   1.86     lukem .if ${MKSHARE} != "no"
    129  1.117       mrg 	(cd ${.CURDIR}/share/mk && ${MAKE} install)
    130   1.68     lukem .endif
    131  1.112       mrg .if !defined(UPDATE) && !defined(NOCLEANDIR)
    132  1.117       mrg 	${MAKE} ${_J} ${_M} cleandir
    133   1.39  christos .endif
    134  1.103    simonb .if ${MKOBJDIRS} != "no"
    135  1.122  sommerfe 	${MAKE} ${_J} ${_M} obj
    136  1.103    simonb .endif
    137  1.115   thorpej .if empty(HAVE_EGCS)
    138   1.71   mycroft .if defined(DESTDIR)
    139   1.71   mycroft 	@echo "*** CAPUTE!"
    140   1.84        tv 	@echo "    You attempted to compile the world without egcs.  You must"
    141   1.71   mycroft 	@echo "    first install a native egcs compiler."
    142   1.84        tv 	@false
    143   1.71   mycroft .else
    144   1.71   mycroft 	(cd ${.CURDIR}/gnu/usr.bin/egcs && \
    145  1.112       mrg 	    ${MAKE} ${_M} ${_J} dependall MKMAN=no && \
    146  1.112       mrg 	    ${MAKE} ${_M} MKMAN=no install && ${MAKE} ${_M} cleandir)
    147  1.112       mrg .endif
    148   1.71   mycroft .endif
    149  1.112       mrg .if !defined(NOINCLUDES)
    150  1.112       mrg 	${MAKE} ${_M} includes
    151   1.71   mycroft .endif
    152   1.61   mycroft 	(cd ${.CURDIR}/lib/csu && \
    153  1.113       mrg 	    ${MAKE} ${_M} ${_J} MKSHARE=no dependall && \
    154  1.113       mrg 	    ${MAKE} ${_M} MKSHARE=no install)
    155   1.61   mycroft 	(cd ${.CURDIR}/lib && \
    156  1.113       mrg 	    ${MAKE} ${_M} ${_J} MKSHARE=no dependall && \
    157  1.113       mrg 	    ${MAKE} ${_M} MKSHARE=no install)
    158   1.61   mycroft 	(cd ${.CURDIR}/gnu/lib && \
    159  1.113       mrg 	    ${MAKE} ${_M} ${_J} MKSHARE=no dependall && \
    160  1.113       mrg 	    ${MAKE} ${_M} MKSHARE=no install)
    161  1.112       mrg 	${MAKE} ${_M} ${_J} dependall && ${MAKE} ${_M} _BUILD= install
    162   1.97  christos .if defined(DOMESTIC) && !defined(EXPORTABLE_SYSTEM)
    163  1.112       mrg 	(cd ${.CURDIR}/${DOMESTIC} && ${MAKE} ${_M} ${_J} _SLAVE_BUILD= build)
    164   1.49     lukem .endif
    165  1.112       mrg 	${MAKE} ${_M} whatis.db
    166   1.50    mellon 	@echo -n "Build finished at: "
    167   1.50    mellon 	@date
    168  1.110      jlam .endif
    169   1.87       cjs 
    170   1.87       cjs release snapshot: build
    171  1.112       mrg 	(cd ${.CURDIR}/etc && ${MAKE} ${_M} INSTALL_DONE=1 release)
    172    1.1       cgd 
    173    1.1       cgd .include <bsd.subdir.mk>
    174