[BACK]Return to Makefile CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / src

Annotation of src/Makefile, Revision 1.125

1.125   ! mrg         1: #      $NetBSD: Makefile,v 1.124 2001/06/10 13:12:32 mrg Exp $
1.95      cjs         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:
1.101     sommerfe   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.
1.95      cjs        21: #   MKMAN, if set to `no', will prevent building of manual pages.
1.101     sommerfe   22: #   MKOBJDIRS, if not set to `no', will build object directories at
                     23: #      an appropriate point in a build.
1.95      cjs        24: #   MKSHARE, if set to `no', will prevent building and installing
                     25: #      anything in /usr/share.
1.101     sommerfe   26: #   NBUILDJOBS is the number of jobs to start in parallel during a
                     27: #      'make build'. It defaults to 1.
1.125   ! mrg        28: #   UPDATE, if defined, will avoid a `make cleandir' at the start of
        !            29: #     `make build', as well as having the effects listed in
        !            30: #     /usr/share/mk/bsd.README.
        !            31: #   NOCLEANDIR, if defined, will avoid a `make cleandir' at the start
        !            32: #     of the `make build'.
1.119     toddpw     33: #   NOINCLUDES will avoid the `make includes' usually done by `make build'.
1.125   ! mrg        34:
1.95      cjs        35: #
                     36: # Targets:
1.110     jlam       37: #   build: builds a full release of netbsd in DESTDIR. If BUILD_DONE is
                     38: #      set, this is an empty target.
1.95      cjs        39: #   release: does a `make build,' and then tars up the DESTDIR files
                     40: #      into RELEASEDIR, in release(7) format. (See etc/Makefile for
                     41: #      more information on this.)
                     42: #   snapshot: a synonym for release.
1.123     mrg        43: #
                     44: # Sub targets of `make build,' in order:
                     45: #   buildstartmsg: displays the start time of the build.
                     46: #   beforeinstall: creates the distribution directories.
                     47: #   do-force-domestic: check's that FORCE_DOMESTIC isn't set (deprecated.)
                     48: #   do-share-mk: installs /usr/share/mk files.
                     49: #   do-cleandir: clean's the tree.
                     50: #   do-make-obj: create's object directories if required.
                     51: #   do-check-egcs: check's that we have a modern enough compiler (deprecated.)
                     52: #   do-make-includes: install include files.
                     53: #   do-lib-csu: build & install startup object files.
                     54: #   do-lib: build & install system libraries.
                     55: #   do-gnu-lib: build & install gnu system libraries.
                     56: #   do-dependall: builds & install the entire system.
                     57: #   do-domestic: build & install the domestic tree (deprecated.)
                     58: #   do-whatisdb: build & install the `whatis.db' man database.
                     59: #   buildendmsg: displays the end time of the build.
1.32      cgd        60:
1.118     thorpej    61: .include <bsd.own.mk>
1.4       cgd        62:
1.100     sommerfe   63: MKOBJDIRS ?= no
1.115     thorpej    64: HAVE_EGCS!=    ${CXX} --version | egrep "^(2\.[89]|egcs)" ; echo
1.58      tv         65:
1.76      bouyer     66: .if defined(NBUILDJOBS)
                     67: _J= -j${NBUILDJOBS}
                     68: .endif
                     69:
1.112     mrg        70: .if defined(DESTDIR)
                     71: _M=-m ${DESTDIR}/usr/share/mk
                     72: .endif
                     73:
1.4       cgd        74: # NOTE THAT etc *DOES NOT* BELONG IN THE LIST BELOW
1.2       cgd        75:
1.52      mycroft    76: SUBDIR+= lib include bin libexec sbin usr.bin usr.sbin share sys
1.120     fredb      77: .if make(cleandir) || make(obj)
1.109     cjs        78: SUBDIR+= distrib
1.114     sjg        79: .ifdef MAKEOBJDIRPREFIX
                     80: SUBDIR+= etc
                     81: .endif
1.109     cjs        82: .endif
1.105     assar      83:
                     84: includes-lib: includes-include includes-sys
1.36      explorer   85:
                     86: .if exists(games)
                     87: SUBDIR+= games
                     88: .endif
                     89:
1.8       cgd        90: SUBDIR+= gnu
1.52      mycroft    91: # This is needed for libstdc++ and gen-params.
                     92: includes-gnu: includes-include includes-sys
1.21      cgd        93:
1.13      brezak     94: .if exists(regress)
1.9       cgd        95: .ifmake !(install)
                     96: SUBDIR+= regress
                     97: .endif
                     98:
1.10      cgd        99: regression-tests:
                    100:        @echo Running regression tests...
1.112     mrg       101:        @(cd ${.CURDIR}/regress && ${MAKE} ${_M} regress)
1.13      brezak    102: .endif
1.20      cgd       103:
1.123     mrg       104: buildstartmsg:
1.45      perry     105:        @echo -n "Build started at: "
                    106:        @date
1.108     erh       107:
1.123     mrg       108: buildendmsg:
                    109:        @echo -n "Build finished at: "
                    110:        @date
                    111:
1.121     deberg    112: # If sharesrc is around, use its share/mk files to bootstrap until the
                    113: # mk files are installed (first step of make build).  If installing to
                    114: # DESTDIR, don't bother, since the build will fail later on anyway.
                    115:
1.108     erh       116: beforeinstall:
1.112     mrg       117: .ifndef NODISTRIBDIRS
1.26      tls       118: .ifndef DESTDIR
1.121     deberg    119: .if exists(share/mk)
                    120:        (cd ${.CURDIR}/etc && ${MAKE} -m ${.CURDIR}/share/mk DESTDIR=/ distrib-dirs)
                    121: .else
1.26      tls       122:        (cd ${.CURDIR}/etc && ${MAKE} DESTDIR=/ distrib-dirs)
1.121     deberg    123: .endif
1.31      tls       124: .else
1.117     mrg       125:        (cd ${.CURDIR}/etc && ${MAKE} distrib-dirs)
1.26      tls       126: .endif
1.112     mrg       127: .endif
1.15      cgd       128:
                    129: afterinstall:
1.86      lukem     130: .if ${MKMAN} != "no" && !defined(_BUILD)
1.112     mrg       131:        ${MAKE} ${_M} whatis.db
1.81      scottr    132: .endif
                    133:
                    134: whatis.db:
1.112     mrg       135:        (cd ${.CURDIR}/share/man && ${MAKE} ${_M} makedb)
1.15      cgd       136:
1.84      tv        137: # wrt info/dir below:  It's safe to move this over top of /usr/share/info/dir,
                    138: # as the build will automatically remove/replace the non-pkg entries there.
                    139:
1.110     jlam      140: .if defined(BUILD_DONE)
                    141: build:
                    142:        @echo "Build installed into ${DESTDIR}"
                    143: .else
1.124     mrg       144: build:
                    145:        @${MAKE} ${_M} buildstartmsg
                    146:        @${MAKE} ${_M} beforeinstall
                    147:        @${MAKE} ${_M} do-force-domestic
                    148:        @${MAKE} ${_M} do-share-mk
                    149:        @${MAKE} ${_M} do-cleandir
                    150:        @${MAKE} ${_M} do-make-obj
                    151:        @${MAKE} ${_M} do-check-egcs
                    152:        @${MAKE} ${_M} do-make-includes
                    153:        @${MAKE} ${_M} do-lib-csu
                    154:        @${MAKE} ${_M} do-lib
                    155:        @${MAKE} ${_M} do-gnu-lib
                    156:        @${MAKE} ${_M} do-dependall
                    157:        @${MAKE} ${_M} do-domestic
                    158:        @${MAKE} ${_M} do-whatisdb
                    159:        @${MAKE} ${_M} buildendmsg
1.123     mrg       160: .endif
                    161:
                    162: do-force-domestic:
1.96      scottr    163: .if defined(FORCE_DOMESTIC)
                    164:        @echo '*** CAPUTE!'
                    165:        @echo '    The FORCE_DOMESTIC flag is not compatible with "make build".'
                    166:        @echo '    Please correct the problem and try again.'
                    167:        @false
                    168: .endif
1.123     mrg       169:
                    170: do-share-mk:
1.86      lukem     171: .if ${MKSHARE} != "no"
1.117     mrg       172:        (cd ${.CURDIR}/share/mk && ${MAKE} install)
1.68      lukem     173: .endif
1.123     mrg       174:
                    175: do-cleandir:
1.112     mrg       176: .if !defined(UPDATE) && !defined(NOCLEANDIR)
1.117     mrg       177:        ${MAKE} ${_J} ${_M} cleandir
1.39      christos  178: .endif
1.123     mrg       179:
                    180: do-make-obj:
1.103     simonb    181: .if ${MKOBJDIRS} != "no"
1.122     sommerfe  182:        ${MAKE} ${_J} ${_M} obj
1.103     simonb    183: .endif
1.123     mrg       184:
                    185: do-check-egcs:
1.115     thorpej   186: .if empty(HAVE_EGCS)
1.71      mycroft   187: .if defined(DESTDIR)
                    188:        @echo "*** CAPUTE!"
1.84      tv        189:        @echo "    You attempted to compile the world without egcs.  You must"
1.71      mycroft   190:        @echo "    first install a native egcs compiler."
1.84      tv        191:        @false
1.71      mycroft   192: .else
                    193:        (cd ${.CURDIR}/gnu/usr.bin/egcs && \
1.112     mrg       194:            ${MAKE} ${_M} ${_J} dependall MKMAN=no && \
                    195:            ${MAKE} ${_M} MKMAN=no install && ${MAKE} ${_M} cleandir)
                    196: .endif
1.71      mycroft   197: .endif
1.123     mrg       198:
                    199: do-make-includes:
1.112     mrg       200: .if !defined(NOINCLUDES)
                    201:        ${MAKE} ${_M} includes
1.71      mycroft   202: .endif
1.123     mrg       203:
                    204: do-lib-csu:
1.61      mycroft   205:        (cd ${.CURDIR}/lib/csu && \
1.113     mrg       206:            ${MAKE} ${_M} ${_J} MKSHARE=no dependall && \
                    207:            ${MAKE} ${_M} MKSHARE=no install)
1.123     mrg       208:
                    209: do-lib:
1.61      mycroft   210:        (cd ${.CURDIR}/lib && \
1.113     mrg       211:            ${MAKE} ${_M} ${_J} MKSHARE=no dependall && \
                    212:            ${MAKE} ${_M} MKSHARE=no install)
1.123     mrg       213:
                    214: do-gnu-lib:
1.61      mycroft   215:        (cd ${.CURDIR}/gnu/lib && \
1.113     mrg       216:            ${MAKE} ${_M} ${_J} MKSHARE=no dependall && \
                    217:            ${MAKE} ${_M} MKSHARE=no install)
1.123     mrg       218:
                    219: do-dependall:
1.112     mrg       220:        ${MAKE} ${_M} ${_J} dependall && ${MAKE} ${_M} _BUILD= install
1.123     mrg       221:
                    222: do-domestic:
1.97      christos  223: .if defined(DOMESTIC) && !defined(EXPORTABLE_SYSTEM)
1.112     mrg       224:        (cd ${.CURDIR}/${DOMESTIC} && ${MAKE} ${_M} ${_J} _SLAVE_BUILD= build)
1.49      lukem     225: .endif
1.123     mrg       226:
                    227: do-whatisdb:
1.112     mrg       228:        ${MAKE} ${_M} whatis.db
1.87      cjs       229:
                    230: release snapshot: build
1.112     mrg       231:        (cd ${.CURDIR}/etc && ${MAKE} ${_M} INSTALL_DONE=1 release)
1.1       cgd       232:
                    233: .include <bsd.subdir.mk>

CVSweb <webmaster@jp.NetBSD.org>