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

Annotation of src/Makefile, Revision 1.136

1.136   ! nathanw     1: #      $NetBSD: Makefile,v 1.135 2001/10/10 17:20:15 jwise 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
1.127     tv         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.
1.131     tv         46: #   do-make-tools: builds host toolchain.
                     47: #   do-distrib-dirs: creates the distribution directories.
1.123     mrg        48: #   do-force-domestic: check's that FORCE_DOMESTIC isn't set (deprecated.)
1.127     tv         49: #   do-cleandir: cleans the tree.
                     50: #   do-make-obj: creates object directories if required.
1.123     mrg        51: #   do-make-includes: install include files.
                     52: #   do-lib-csu: build & install startup object files.
                     53: #   do-lib: build & install system libraries.
                     54: #   do-gnu-lib: build & install gnu system libraries.
                     55: #   do-dependall: builds & install the entire system.
                     56: #   do-domestic: build & install the domestic tree (deprecated.)
                     57: #   do-whatisdb: build & install the `whatis.db' man database.
                     58: #   buildendmsg: displays the end time of the build.
1.32      cgd        59:
1.133     tv         60: .include "${.CURDIR}/share/mk/bsd.own.mk"
1.4       cgd        61:
1.100     sommerfe   62: MKOBJDIRS ?= no
1.58      tv         63:
1.76      bouyer     64: .if defined(NBUILDJOBS)
                     65: _J= -j${NBUILDJOBS}
                     66: .endif
                     67:
1.4       cgd        68: # NOTE THAT etc *DOES NOT* BELONG IN THE LIST BELOW
1.2       cgd        69:
1.52      mycroft    70: SUBDIR+= lib include bin libexec sbin usr.bin usr.sbin share sys
1.120     fredb      71: .if make(cleandir) || make(obj)
1.135     jwise      72: SUBDIR+= distrib
                     73: .if ${USETOOLS} != "no"
                     74: SUBDIR+= tools
                     75: .endif
1.114     sjg        76: .ifdef MAKEOBJDIRPREFIX
                     77: SUBDIR+= etc
                     78: .endif
1.109     cjs        79: .endif
1.105     assar      80:
                     81: includes-lib: includes-include includes-sys
1.36      explorer   82:
                     83: .if exists(games)
                     84: SUBDIR+= games
                     85: .endif
                     86:
1.8       cgd        87: SUBDIR+= gnu
1.52      mycroft    88: # This is needed for libstdc++ and gen-params.
                     89: includes-gnu: includes-include includes-sys
1.21      cgd        90:
1.13      brezak     91: .if exists(regress)
1.9       cgd        92: .ifmake !(install)
                     93: SUBDIR+= regress
                     94: .endif
                     95:
1.10      cgd        96: regression-tests:
                     97:        @echo Running regression tests...
1.112     mrg        98:        @(cd ${.CURDIR}/regress && ${MAKE} ${_M} regress)
1.13      brezak     99: .endif
1.20      cgd       100:
1.123     mrg       101: buildstartmsg:
1.45      perry     102:        @echo -n "Build started at: "
                    103:        @date
1.108     erh       104:
1.123     mrg       105: buildendmsg:
                    106:        @echo -n "Build finished at: "
                    107:        @date
                    108:
1.15      cgd       109: afterinstall:
1.86      lukem     110: .if ${MKMAN} != "no" && !defined(_BUILD)
1.112     mrg       111:        ${MAKE} ${_M} whatis.db
1.81      scottr    112: .endif
                    113:
                    114: whatis.db:
1.112     mrg       115:        (cd ${.CURDIR}/share/man && ${MAKE} ${_M} makedb)
1.15      cgd       116:
1.84      tv        117: # wrt info/dir below:  It's safe to move this over top of /usr/share/info/dir,
                    118: # as the build will automatically remove/replace the non-pkg entries there.
                    119:
1.110     jlam      120: .if defined(BUILD_DONE)
                    121: build:
                    122:        @echo "Build installed into ${DESTDIR}"
                    123: .else
1.124     mrg       124: build:
                    125:        @${MAKE} ${_M} buildstartmsg
1.131     tv        126:        @${MAKE} ${_M} do-make-tools
                    127:        @${MAKE} ${_M} do-distrib-dirs
1.124     mrg       128:        @${MAKE} ${_M} do-force-domestic
                    129:        @${MAKE} ${_M} do-cleandir
                    130:        @${MAKE} ${_M} do-make-obj
                    131:        @${MAKE} ${_M} do-make-includes
                    132:        @${MAKE} ${_M} do-lib-csu
                    133:        @${MAKE} ${_M} do-lib
                    134:        @${MAKE} ${_M} do-gnu-lib
                    135:        @${MAKE} ${_M} do-dependall
                    136:        @${MAKE} ${_M} do-domestic
                    137:        @${MAKE} ${_M} do-whatisdb
                    138:        @${MAKE} ${_M} buildendmsg
1.123     mrg       139: .endif
                    140:
1.131     tv        141: do-make-tools:
1.132     mason     142: .if ${USETOOLS} != "no"
1.131     tv        143: .if ${MKOBJDIRS} != "no"
                    144:        cd ${.CURDIR}/tools && ${MAKE} ${_M} obj
                    145: .endif
                    146:        cd ${.CURDIR}/tools && ${MAKE} ${_M} build
1.132     mason     147: .endif
1.131     tv        148:
                    149: do-distrib-dirs:
                    150: .ifndef NODISTRIBDIRS
                    151: .ifndef DESTDIR
                    152:        (cd ${.CURDIR}/etc && ${MAKE} ${_M} DESTDIR=/ distrib-dirs)
                    153: .else
                    154:        (cd ${.CURDIR}/etc && ${MAKE} ${_M} DESTDIR=${DESTDIR} distrib-dirs)
                    155: .endif
                    156: .endif
                    157:
1.123     mrg       158: do-force-domestic:
1.96      scottr    159: .if defined(FORCE_DOMESTIC)
                    160:        @echo '*** CAPUTE!'
                    161:        @echo '    The FORCE_DOMESTIC flag is not compatible with "make build".'
                    162:        @echo '    Please correct the problem and try again.'
                    163:        @false
                    164: .endif
1.123     mrg       165:
                    166: do-cleandir:
1.112     mrg       167: .if !defined(UPDATE) && !defined(NOCLEANDIR)
1.117     mrg       168:        ${MAKE} ${_J} ${_M} cleandir
1.39      christos  169: .endif
1.123     mrg       170:
                    171: do-make-obj:
1.103     simonb    172: .if ${MKOBJDIRS} != "no"
1.122     sommerfe  173:        ${MAKE} ${_J} ${_M} obj
1.127     tv        174: .endif
1.123     mrg       175:
                    176: do-make-includes:
1.112     mrg       177: .if !defined(NOINCLUDES)
                    178:        ${MAKE} ${_M} includes
1.71      mycroft   179: .endif
1.123     mrg       180:
                    181: do-lib-csu:
1.61      mycroft   182:        (cd ${.CURDIR}/lib/csu && \
1.113     mrg       183:            ${MAKE} ${_M} ${_J} MKSHARE=no dependall && \
                    184:            ${MAKE} ${_M} MKSHARE=no install)
1.123     mrg       185:
                    186: do-lib:
1.61      mycroft   187:        (cd ${.CURDIR}/lib && \
1.113     mrg       188:            ${MAKE} ${_M} ${_J} MKSHARE=no dependall && \
                    189:            ${MAKE} ${_M} MKSHARE=no install)
1.123     mrg       190:
                    191: do-gnu-lib:
1.61      mycroft   192:        (cd ${.CURDIR}/gnu/lib && \
1.113     mrg       193:            ${MAKE} ${_M} ${_J} MKSHARE=no dependall && \
                    194:            ${MAKE} ${_M} MKSHARE=no install)
1.123     mrg       195:
                    196: do-dependall:
1.112     mrg       197:        ${MAKE} ${_M} ${_J} dependall && ${MAKE} ${_M} _BUILD= install
1.123     mrg       198:
                    199: do-domestic:
1.97      christos  200: .if defined(DOMESTIC) && !defined(EXPORTABLE_SYSTEM)
1.112     mrg       201:        (cd ${.CURDIR}/${DOMESTIC} && ${MAKE} ${_M} ${_J} _SLAVE_BUILD= build)
1.49      lukem     202: .endif
1.123     mrg       203:
                    204: do-whatisdb:
1.112     mrg       205:        ${MAKE} ${_M} whatis.db
1.87      cjs       206:
                    207: release snapshot: build
1.112     mrg       208:        (cd ${.CURDIR}/etc && ${MAKE} ${_M} INSTALL_DONE=1 release)
1.129     tv        209:
                    210: # Speedup stubs for some subtrees that don't need to run these rules
                    211: includes-bin includes-games includes-libexec includes-regress \
                    212: includes-sbin includes-usr.sbin:
1.136   ! nathanw   213:        @true
1.1       cgd       214:
1.130     tv        215: .if !exists(${.CURDIR}/share/mk)
                    216: .BEGIN:
                    217:        @echo 'BUILD ABORTED: share/mk does not exist, cannot run make.'
                    218:        @false
                    219: .endif
                    220:
1.133     tv        221: .include "${.CURDIR}/share/mk/bsd.subdir.mk"
1.130     tv        222:
                    223: _M:=   -m ${.CURDIR}/share/mk

CVSweb <webmaster@jp.NetBSD.org>