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

Annotation of src/Makefile, Revision 1.330

1.330   ! kamil       1: #      $NetBSD: Makefile,v 1.329 2019/08/25 06:06:48 kamil Exp $
1.95      cjs         2:
1.193     lukem       3: #
1.95      cjs         4: # This is the top-level makefile for building NetBSD. For an outline of
                      5: # how to build a snapshot or release, as well as other release engineering
1.221     salo        6: # information, see http://www.NetBSD.org/developers/releng/index.html
1.95      cjs         7: #
                      8: # Not everything you can set or do is documented in this makefile. In
                      9: # particular, you should review the files in /usr/share/mk (especially
                     10: # bsd.README) for general information on building programs and writing
                     11: # Makefiles within this structure, and see the comments in src/etc/Makefile
                     12: # for further information on installation and release set options.
                     13: #
                     14: # Variables listed below can be set on the make command line (highest
                     15: # priority), in /etc/mk.conf (middle priority), or in the environment
                     16: # (lowest priority).
                     17: #
                     18: # Variables:
1.101     sommerfe   19: #   DESTDIR is the target directory for installation of the compiled
                     20: #      software. It defaults to /. Note that programs are built against
                     21: #      libraries installed in DESTDIR.
1.214     lukem      22: #   MKMAN, if `no', will prevent building of manual pages.
                     23: #   MKOBJDIRS, if not `no', will build object directories at
1.101     sommerfe   24: #      an appropriate point in a build.
1.214     lukem      25: #   MKSHARE, if `no', will prevent building and installing
1.95      cjs        26: #      anything in /usr/share.
1.214     lukem      27: #   MKUPDATE, if not `no', will avoid a `make cleandir' at the start of
1.178     enami      28: #      `make build', as well as having the effects listed in
                     29: #      /usr/share/mk/bsd.README.
1.125     mrg        30: #   NOCLEANDIR, if defined, will avoid a `make cleandir' at the start
1.178     enami      31: #      of the `make build'.
1.119     toddpw     32: #   NOINCLUDES will avoid the `make includes' usually done by `make build'.
1.319     christos   33: #   NOBINARIES will not build binaries, only includes and libraries
1.95      cjs        34: #
1.214     lukem      35: #   See mk.conf(5) for more details.
                     36: #
                     37: #
1.95      cjs        38: # Targets:
1.137     tv         39: #   build:
1.196     lukem      40: #      Builds a full release of NetBSD in DESTDIR, except for the
                     41: #      /etc configuration files.
                     42: #      If BUILD_DONE is set, this is an empty target.
                     43: #   distribution:
                     44: #      Builds a full release of NetBSD in DESTDIR, including the /etc
                     45: #      configuration files.
                     46: #   buildworld:
                     47: #      As per `make distribution', except that it ensures that DESTDIR
                     48: #      is not the root directory.
                     49: #   installworld:
                     50: #      Install the distribution from DESTDIR to INSTALLWORLDDIR (which
                     51: #      defaults to the root directory).  Ensures that INSTALLWORLDDIR
1.291     abs        52: #      is not the root directory if cross compiling.
1.137     tv         53: #   release:
1.240     lukem      54: #      Does a `make distribution', and then tars up the DESTDIR files
1.252     lukem      55: #      into ${RELEASEDIR}/${RELEASEMACHINEDIR}, in release(7) format.
1.196     lukem      56: #      (See etc/Makefile for more information on this.)
1.137     tv         57: #   regression-tests:
                     58: #      Runs the regression tests in "regress" on this host.
1.206     lukem      59: #   sets:
1.252     lukem      60: #      Populate ${RELEASEDIR}/${RELEASEMACHINEDIR}/binary/sets
                     61: #      from ${DESTDIR}
1.206     lukem      62: #   sourcesets:
                     63: #      Populate ${RELEASEDIR}/source/sets from ${NETBSDSRCDIR}
1.241     apb        64: #   syspkgs:
1.252     lukem      65: #      Populate ${RELEASEDIR}/${RELEASEMACHINEDIR}/binary/syspkgs
                     66: #      from ${DESTDIR}
1.243     apb        67: #   iso-image:
1.311     snj        68: #      Create CD-ROM image in RELEASEDIR/images.
1.243     apb        69: #      RELEASEDIR must already have been populated by `make release'
                     70: #      or equivalent.
1.248     jnemeth    71: #   iso-image-source:
1.311     snj        72: #      Create CD-ROM image with source in RELEASEDIR/images.
1.248     jnemeth    73: #      RELEASEDIR must already have been populated by
                     74: #      `make release sourcesets' or equivalent.
1.290     tsutsui    75: #   live-image:
                     76: #      Create bootable live image for emulators or USB stick etc.
                     77: #      in RELEASEDIR/liveimage.
                     78: #      RELEASEDIR must already have been populated by `make release'
                     79: #      or equivalent.
                     80: #   install-image:
                     81: #      Create bootable installation image for USB stick etc.
                     82: #      in RELEASEDIR/installimage.
                     83: #      RELEASEDIR must already have been populated by `make release'
                     84: #      or equivalent.
1.123     mrg        85: #
1.137     tv         86: # Targets invoked by `make build,' in order:
1.155     tv         87: #   cleandir:        cleans the tree.
1.261     apb        88: #   do-top-obj:      creates the top level object directory.
1.260     apb        89: #   do-tools-obj:    creates object directories for the host toolchain.
                     90: #   do-tools:        builds host toolchain.
1.300     apb        91: #   params:          record the values of variables that might affect the
                     92: #                    build.
1.137     tv         93: #   obj:             creates object directories.
1.208     lukem      94: #   do-distrib-dirs: creates the distribution directories.
                     95: #   includes:        installs include files.
1.326     martin     96: #   do-lib:          builds and installs prerequisites from lib.
1.299     joerg      97: #   do-compat-lib:   builds and installs prerequisites from compat/lib
1.262     mrg        98: #                    if ${MKCOMPAT} != "no".
1.320     uwe        99: #   do-x11:          builds and installs X11 tools and libraries
                    100: #                    from src/external/mit/xorg if ${MKX11} != "no".
1.137     tv        101: #   do-build:        builds and installs the entire system.
1.275     uebayasi  102: #   do-extsrc:       builds and installs extsrc if ${MKEXTSRC} != "no".
1.222     lukem     103: #   do-obsolete:     installs the obsolete sets (for the postinstall-* targets).
1.193     lukem     104: #
1.32      cgd       105:
1.146     tv        106: .if ${.MAKEFLAGS:M${.CURDIR}/share/mk} == ""
                    107: .MAKEFLAGS: -m ${.CURDIR}/share/mk
                    108: .endif
1.163     tv        109:
1.193     lukem     110: #
1.163     tv        111: # If _SRC_TOP_OBJ_ gets set here, we will end up with a directory that may
                    112: # not be the top level objdir, because "make obj" can happen in the *middle*
                    113: # of "make build" (long after <bsd.own.mk> is calculated it).  So, pre-set
                    114: # _SRC_TOP_OBJ_ here so it will not be added to ${.MAKEOVERRIDES}.
1.193     lukem     115: #
1.163     tv        116: _SRC_TOP_OBJ_=
1.148     jmc       117:
1.146     tv        118: .include <bsd.own.mk>
1.4       cgd       119:
1.193     lukem     120: #
1.137     tv        121: # Sanity check: make sure that "make build" is not invoked simultaneously
                    122: # with a standard recursive target.
1.193     lukem     123: #
1.137     tv        124:
                    125: .if make(build) || make(release) || make(snapshot)
                    126: .for targ in ${TARGETS:Nobj:Ncleandir}
                    127: .if make(${targ}) && !target(.BEGIN)
                    128: .BEGIN:
                    129:        @echo 'BUILD ABORTED: "make build" and "make ${targ}" are mutually exclusive.'
                    130:        @false
                    131: .endif
                    132: .endfor
                    133: .endif
1.58      tv        134:
1.261     apb       135: #
                    136: # _SUBDIR is used to set SUBDIR, after removing directories that have
                    137: # BUILD_${dir}=no, or that have no ${dir}/Makefile.
                    138: #
1.329     kamil     139: _SUBDIR=       tools .WAIT lib
                    140: .if ${MKLLVM} != "no"
                    141: _SUBDIR+=      external/bsd/compiler_rt
                    142: .endif
                    143: _SUBDIR+=       include external crypto/external bin
1.325     maya      144: _SUBDIR+=      games libexec sbin usr.bin
1.303     joerg     145: _SUBDIR+=      usr.sbin share sys etc tests compat
                    146: _SUBDIR+=      .WAIT rescue .WAIT distrib regress
1.105     assar     147:
1.137     tv        148: .for dir in ${_SUBDIR}
1.261     apb       149: .if "${dir}" == ".WAIT" \
                    150:        || (${BUILD_${dir}:Uyes} != "no" && exists(${dir}/Makefile))
1.137     tv        151: SUBDIR+=       ${dir}
1.36      explorer  152: .endif
1.137     tv        153: .endfor
1.21      cgd       154:
1.13      brezak    155: .if exists(regress)
1.242     dsl       156: regression-tests: .PHONY .MAKE
1.10      cgd       157:        @echo Running regression tests...
1.232     lukem     158:        ${MAKEDIRTARGET} regress regress
1.13      brezak    159: .endif
1.20      cgd       160:
1.214     lukem     161: .if ${MKUNPRIVED} != "no"
1.179     thorpej   162: NOPOSTINSTALL= # defined
                    163: .endif
                    164:
1.242     dsl       165: afterinstall: .PHONY .MAKE
1.137     tv        166: .if ${MKMAN} != "no"
1.232     lukem     167:        ${MAKEDIRTARGET} share/man makedb
1.137     tv        168: .endif
1.214     lukem     169: .if (${MKUNPRIVED} != "no" && ${MKINFO} != "no")
1.317     christos  170:        ${MAKEDIRTARGET} external/gpl2/texinfo/bin/install-info infodir-meta
1.176     lukem     171: .endif
1.179     thorpej   172: .if !defined(NOPOSTINSTALL)
1.232     lukem     173:        ${MAKEDIRTARGET} . postinstall-check
1.159     perry     174: .endif
1.170     lukem     175:
1.327     martin    176: _POSTINSTALL=  ${:!cd ${.CURDIR}/usr.sbin/postinstall && \
                    177:                        ${MAKE} print-objdir!}/postinstall  \
1.308     apb       178:                -m ${MACHINE} -a ${MACHINE_ARCH}
1.295     apb       179: _POSTINSTALL_ENV= \
                    180:        AWK=${TOOL_AWK:Q}               \
                    181:        DB=${TOOL_DB:Q}                 \
1.298     apb       182:        HOST_SH=${HOST_SH:Q}            \
1.295     apb       183:        MAKE=${MAKE:Q}                  \
1.297     apb       184:        PWD_MKDB=${TOOL_PWD_MKDB:Q}     \
1.307     apb       185:        SED=${TOOL_SED:Q}               \
1.297     apb       186:        STAT=${TOOL_STAT:Q}
1.239     lukem     187:
1.313     martin    188: .if ${MKX11} != "no"
                    189: _POSTINSTALL_X11=-x ${X11SRCDIR:Q}
                    190: .endif
                    191:
1.228     lukem     192: postinstall-check: .PHONY
1.169     lukem     193:        @echo "   === Post installation checks ==="
1.313     martin    194:        ${_POSTINSTALL_ENV} ${HOST_SH} ${_POSTINSTALL} -s ${.CURDIR} ${_POSTINSTALL_X11} -d ${DESTDIR}/ check; if [ $$? -gt 1 ]; then exit 1; fi
1.171     lukem     195:        @echo "   ================================"
                    196:
1.228     lukem     197: postinstall-fix: .NOTMAIN .PHONY
1.171     lukem     198:        @echo "   === Post installation fixes ==="
1.313     martin    199:        ${_POSTINSTALL_ENV} ${HOST_SH} ${_POSTINSTALL} -s ${.CURDIR} ${_POSTINSTALL_X11} -d ${DESTDIR}/ fix
1.212     lukem     200:        @echo "   ==============================="
                    201:
1.228     lukem     202: postinstall-fix-obsolete: .NOTMAIN .PHONY
1.212     lukem     203:        @echo "   === Removing obsolete files ==="
1.313     martin    204:        ${_POSTINSTALL_ENV} ${HOST_SH} ${_POSTINSTALL} -s ${.CURDIR} ${_POSTINSTALL_X11} -d ${DESTDIR}/ fix obsolete
1.212     lukem     205:        @echo "   ==============================="
1.169     lukem     206:
1.309     apb       207: postinstall-fix-obsolete_stand: .NOTMAIN .PHONY
                    208:        @echo "   === Removing obsolete files ==="
1.313     martin    209:        ${_POSTINSTALL_ENV} ${HOST_SH} ${_POSTINSTALL} -s ${.CURDIR} ${_POSTINSTALL_X11} -d ${DESTDIR}/ fix obsolete_stand
1.309     apb       210:        @echo "   ==============================="
                    211:
1.108     erh       212:
1.193     lukem     213: #
1.137     tv        214: # Targets (in order!) called by "make build".
1.193     lukem     215: #
1.156     tv        216: BUILDTARGETS+= check-tools
1.214     lukem     217: .if ${MKUPDATE} == "no" && !defined(NOCLEANDIR)
1.155     tv        218: BUILDTARGETS+= cleandir
                    219: .endif
1.261     apb       220: .if ${MKOBJDIRS} != "no"
                    221: BUILDTARGETS+= do-top-obj
                    222: .endif
                    223: .if ${USETOOLS} == "yes"       # {
1.149     tv        224: .if ${MKOBJDIRS} != "no"
1.260     apb       225: BUILDTARGETS+= do-tools-obj
1.123     mrg       226: .endif
1.152     tv        227: BUILDTARGETS+= do-tools
1.261     apb       228: .endif # USETOOLS              # }
1.300     apb       229: BUILDTARGETS+= params
1.260     apb       230: .if ${MKOBJDIRS} != "no"
                    231: BUILDTARGETS+= obj
                    232: .endif
1.270     apb       233: BUILDTARGETS+= clean_METALOG
1.137     tv        234: .if !defined(NODISTRIBDIRS)
                    235: BUILDTARGETS+= do-distrib-dirs
1.131     tv        236: .endif
1.137     tv        237: .if !defined(NOINCLUDES)
                    238: BUILDTARGETS+= includes
1.131     tv        239: .endif
1.281     plunky    240: BUILDTARGETS+= do-lib
1.299     joerg     241: BUILDTARGETS+= do-compat-lib
1.328     kamil     242: .if ${MKLLVM} != "no"
1.329     kamil     243: BUILDTARGETS+= do-sanitizer
1.328     kamil     244: .if ${MKSANITIZER:Uno} == "yes"
                    245: BUILDTARGETS+= do-sanitizer-tools
                    246: .endif
                    247: .endif
1.263     mrg       248: .if ${MKX11} != "no"
1.227     lukem     249: BUILDTARGETS+= do-x11
                    250: .endif
1.321     uwe       251: .if !defined(NOBINARIES)
1.312     joerg     252: BUILDTARGETS+= do-build
1.275     uebayasi  253: .if ${MKEXTSRC} != "no"
                    254: BUILDTARGETS+= do-extsrc
                    255: .endif
1.200     lukem     256: BUILDTARGETS+= do-obsolete
1.319     christos  257: .endif
1.131     tv        258:
1.193     lukem     259: #
1.137     tv        260: # Enforce proper ordering of some rules.
1.193     lukem     261: #
1.123     mrg       262:
1.137     tv        263: .ORDER:                ${BUILDTARGETS}
1.228     lukem     264: includes-lib:  .PHONY includes-include includes-sys
1.123     mrg       265:
1.193     lukem     266: #
1.300     apb       267: # Record the values of variables that might affect the build.
                    268: # If no values have changed, avoid updating the timestamp
                    269: # of the params file.
                    270: #
                    271: # This is referenced by _NETBSD_VERSION_DEPENDS in <bsd.own.mk>.
                    272: #
1.302     apb       273: .include "${NETBSDSRCDIR}/etc/Makefile.params"
1.300     apb       274: CLEANDIRFILES+= params
                    275: params: .EXEC
                    276:        ${_MKMSG_CREATE} params
1.302     apb       277:        @${PRINT_PARAMS} >${.TARGET}.new
1.300     apb       278:        @if cmp -s ${.TARGET}.new ${.TARGET} > /dev/null 2>&1; then \
                    279:                : "params is unchanged" ; \
                    280:                rm ${.TARGET}.new ; \
                    281:        else \
                    282:                : "params has changed or is new" ; \
                    283:                mv ${.TARGET}.new ${.TARGET} ; \
                    284:        fi
                    285:
                    286: #
1.302     apb       287: # Display current make(1) parameters
                    288: #
                    289: show-params: .PHONY .MAKE
                    290:        @${PRINT_PARAMS}
                    291:
                    292: #
1.137     tv        293: # Build the system and install into DESTDIR.
1.193     lukem     294: #
1.123     mrg       295:
1.191     lukem     296: START_TIME!=   date
                    297:
1.242     dsl       298: build: .PHONY .MAKE
1.137     tv        299: .if defined(BUILD_DONE)
                    300:        @echo "Build already installed into ${DESTDIR}"
                    301: .else
1.191     lukem     302:        @echo "Build started at: ${START_TIME}"
1.145     tv        303: .for tgt in ${BUILDTARGETS}
1.232     lukem     304:        ${MAKEDIRTARGET} . ${tgt}
1.145     tv        305: .endfor
1.232     lukem     306:        ${MAKEDIRTARGET} etc install-etc-release
1.191     lukem     307:        @echo   "Build started at:  ${START_TIME}"
1.172     bjh21     308:        @printf "Build finished at: " && date
1.71      mycroft   309: .endif
1.160     thorpej   310:
1.193     lukem     311: #
1.160     thorpej   312: # Build a full distribution, but not a release (i.e. no sets into
1.193     lukem     313: # ${RELEASEDIR}).  "buildworld" enforces a build to ${DESTDIR} != /
                    314: #
1.160     thorpej   315:
1.242     dsl       316: distribution buildworld: .PHONY .MAKE
1.194     lukem     317: .if make(buildworld) && \
                    318:     (!defined(DESTDIR) || ${DESTDIR} == "" || ${DESTDIR} == "/")
1.193     lukem     319:        @echo "Won't make ${.TARGET} with DESTDIR=/"
                    320:        @false
                    321: .endif
1.232     lukem     322:        ${MAKEDIRTARGET} . build NOPOSTINSTALL=1
                    323:        ${MAKEDIRTARGET} etc distribution INSTALL_DONE=1
1.181     thorpej   324: .if defined(DESTDIR) && ${DESTDIR} != "" && ${DESTDIR} != "/"
1.232     lukem     325:        ${MAKEDIRTARGET} . postinstall-fix-obsolete
1.309     apb       326:        ${MAKEDIRTARGET} . postinstall-fix-obsolete_stand
1.232     lukem     327:        ${MAKEDIRTARGET} distrib/sets checkflist
1.181     thorpej   328: .endif
1.192     lukem     329:        @echo   "make ${.TARGET} started at:  ${START_TIME}"
1.185     lukem     330:        @printf "make ${.TARGET} finished at: " && date
1.123     mrg       331:
1.193     lukem     332: #
                    333: # Install the distribution from $DESTDIR to $INSTALLWORLDDIR (defaults to `/')
                    334: # If installing to /, ensures that the host's operating system is NetBSD and
                    335: # the host's `uname -m` == ${MACHINE}.
                    336: #
                    337:
                    338: HOST_UNAME_S!= uname -s
                    339: HOST_UNAME_M!= uname -m
                    340:
1.242     dsl       341: installworld: .PHONY .MAKE
1.194     lukem     342: .if (!defined(DESTDIR) || ${DESTDIR} == "" || ${DESTDIR} == "/")
1.193     lukem     343:        @echo "Can't make ${.TARGET} to DESTDIR=/"
                    344:        @false
                    345: .endif
                    346: .if !defined(INSTALLWORLDDIR) || \
                    347:     ${INSTALLWORLDDIR} == "" || ${INSTALLWORLDDIR} == "/"
                    348: .if (${HOST_UNAME_S} != "NetBSD")
                    349:        @echo "Won't cross-make ${.TARGET} from ${HOST_UNAME_S} to NetBSD with INSTALLWORLDDIR=/"
                    350:        @false
                    351: .endif
                    352: .if (${HOST_UNAME_M} != ${MACHINE})
                    353:        @echo "Won't cross-make ${.TARGET} from ${HOST_UNAME_M} to ${MACHINE} with INSTALLWORLDDIR=/"
                    354:        @false
                    355: .endif
                    356: .endif
1.232     lukem     357:        ${MAKEDIRTARGET} distrib/sets installsets \
1.282     jym       358:                INSTALLDIR=${INSTALLWORLDDIR:U/} INSTALLSETS=${INSTALLSETS:Q}
1.232     lukem     359:        ${MAKEDIRTARGET} . postinstall-check DESTDIR=${INSTALLWORLDDIR}
1.193     lukem     360:        @echo   "make ${.TARGET} started at:  ${START_TIME}"
                    361:        @printf "make ${.TARGET} finished at: " && date
1.199     lukem     362:
                    363: #
1.287     jmcneill  364: # Install modules from $DESTDIR to $INSTALLMODULESDIR
                    365: #
                    366: installmodules: .PHONY .MAKE
                    367: .if (!defined(DESTDIR) || ${DESTDIR} == "" || ${DESTDIR} == "/")
                    368:        @echo "Can't make ${.TARGET} to DESTDIR=/"
                    369:        @false
                    370: .endif
                    371: .if !defined(INSTALLMODULESDIR) || \
                    372:     ${INSTALLMODULESDIR} == "" || ${INSTALLMODULESDIR} == "/"
                    373: .if (${HOST_UNAME_S} != "NetBSD")
                    374:        @echo "Won't cross-make ${.TARGET} from ${HOST_UNAME_S} to NetBSD with INSTALLMODULESDIR=/"
                    375:        @false
                    376: .endif
                    377: .if (${HOST_UNAME_M} != ${MACHINE})
                    378:        @echo "Won't cross-make ${.TARGET} from ${HOST_UNAME_M} to ${MACHINE} with INSTALLMODULESDIR=/"
                    379:        @false
                    380: .endif
                    381: .endif
1.288     jmcneill  382:        ${MAKEDIRTARGET} sys/modules install DESTDIR=${INSTALLMODULESDIR:U/}
1.287     jmcneill  383:        @echo   "make ${.TARGET} started at:  ${START_TIME}"
                    384:        @printf "make ${.TARGET} finished at: " && date
                    385:
                    386: #
1.206     lukem     387: # Create sets from $DESTDIR or $NETBSDSRCDIR into $RELEASEDIR
1.199     lukem     388: #
                    389:
1.241     apb       390: .for tgt in sets sourcesets syspkgs
1.242     dsl       391: ${tgt}: .PHONY .MAKE
1.232     lukem     392:        ${MAKEDIRTARGET} distrib/sets ${tgt}
1.206     lukem     393: .endfor
1.193     lukem     394:
                    395: #
1.240     lukem     396: # Build a release or snapshot (implies "make distribution").  Note that
1.181     thorpej   397: # in this case, the set lists will be checked before the tar files
                    398: # are made.
1.193     lukem     399: #
1.123     mrg       400:
1.242     dsl       401: release snapshot: .PHONY .MAKE
1.240     lukem     402:        ${MAKEDIRTARGET} . distribution
                    403:        ${MAKEDIRTARGET} etc release DISTRIBUTION_DONE=1
1.192     lukem     404:        @echo   "make ${.TARGET} started at:  ${START_TIME}"
1.185     lukem     405:        @printf "make ${.TARGET} finished at: " && date
1.123     mrg       406:
1.193     lukem     407: #
1.243     apb       408: # Create a CD-ROM image.
                    409: #
                    410:
                    411: iso-image: .PHONY
1.247     bouyer    412:        ${MAKEDIRTARGET} distrib iso_image
1.243     apb       413:        ${MAKEDIRTARGET} etc iso-image
                    414:        @echo   "make ${.TARGET} started at:  ${START_TIME}"
                    415:        @printf "make ${.TARGET} finished at: " && date
                    416:
1.248     jnemeth   417: iso-image-source: .PHONY
                    418:        ${MAKEDIRTARGET} distrib iso_image CDSOURCE=true
                    419:        ${MAKEDIRTARGET} etc iso-image
                    420:        @echo   "make ${.TARGET} started at:  ${START_TIME}"
                    421:        @printf "make ${.TARGET} finished at: " && date
                    422:
1.243     apb       423: #
1.290     tsutsui   424: # Create bootable live images.
                    425: #
                    426:
                    427: live-image: .PHONY
                    428:        ${MAKEDIRTARGET} etc live-image
                    429:        @echo   "make ${.TARGET} started at:  ${START_TIME}"
                    430:        @printf "make ${.TARGET} finished at: " && date
                    431:
                    432: #
                    433: # Create bootable installation images.
                    434: #
                    435:
                    436: install-image: .PHONY
                    437:        ${MAKEDIRTARGET} etc install-image
                    438:        @echo   "make ${.TARGET} started at:  ${START_TIME}"
                    439:        @printf "make ${.TARGET} finished at: " && date
                    440:
                    441: #
1.137     tv        442: # Special components of the "make build" process.
1.193     lukem     443: #
1.156     tv        444:
1.228     lukem     445: check-tools: .PHONY
1.223     lukem     446: .if ${TOOLCHAIN_MISSING} != "no" && !defined(EXTERNAL_TOOLCHAIN)
1.187     thorpej   447:        @echo '*** WARNING:  Building on MACHINE=${MACHINE} with missing toolchain.'
                    448:        @echo '*** May result in a failed build or corrupt binaries!'
                    449: .elif defined(EXTERNAL_TOOLCHAIN)
                    450:        @echo '*** Using external toolchain rooted at ${EXTERNAL_TOOLCHAIN}.'
1.156     tv        451: .endif
1.173     sommerfe  452: .if defined(NBUILDJOBS)
                    453:        @echo '*** WARNING: NBUILDJOBS is obsolete; use -j directly instead!'
                    454: .endif
1.123     mrg       455:
1.270     apb       456: # Delete or sanitise a leftover METALOG from a previous build.
                    457: clean_METALOG: .PHONY .MAKE
                    458: .if ${MKUPDATE} != "no"
                    459:        ${MAKEDIRTARGET} distrib/sets clean_METALOG
                    460: .endif
                    461:
1.242     dsl       462: do-distrib-dirs: .PHONY .MAKE
1.147     jmc       463: .if !defined(DESTDIR) || ${DESTDIR} == ""
1.232     lukem     464:        ${MAKEDIRTARGET} etc distrib-dirs DESTDIR=/
1.147     jmc       465: .else
1.232     lukem     466:        ${MAKEDIRTARGET} etc distrib-dirs DESTDIR=${DESTDIR}
1.147     jmc       467: .endif
1.190     lukem     468:
                    469: .for targ in cleandir obj includes
1.228     lukem     470: do-${targ}: .PHONY ${targ}
1.190     lukem     471:        @true
                    472: .endfor
1.123     mrg       473:
1.301     joerg     474: do-tools: .PHONY .MAKE
                    475:        ${MAKEDIRTARGET} tools build_install
1.184     lukem     476:
1.299     joerg     477: do-lib: .PHONY .MAKE
                    478:        ${MAKEDIRTARGET} lib build_install
                    479:
                    480: do-compat-lib: .PHONY .MAKE
                    481:        ${MAKEDIRTARGET} compat build_install BOOTSTRAP_SUBDIRS="../../../lib"
1.276     mrg       482:
1.329     kamil     483: do-sanitizer: .PHONY .MAKE
1.330   ! kamil     484:        ${MAKEDIRTARGET} external/bsd/compiler_rt all
1.328     kamil     485:
                    486: do-sanitizer-tools: .PHONY .MAKE
1.329     kamil     487: .if !exists(${TOOLDIR}/lib/clang) && ${HAVE_LLVM:Uno} == "yes"
1.328     kamil     488:        mkdir -p ${TOOLDIR}/lib/clang
                    489:        cd ${DESTDIR}/usr/lib/clang && \
                    490:                ${TOOL_PAX} -rw . ${TOOLDIR}/lib/clang
                    491: .endif
                    492:
1.261     apb       493: do-top-obj: .PHONY .MAKE
                    494:        ${MAKEDIRTARGET} . obj NOSUBDIR=
                    495:
1.260     apb       496: do-tools-obj: .PHONY .MAKE
                    497:        ${MAKEDIRTARGET} tools obj
                    498:
1.242     dsl       499: do-build: .PHONY .MAKE
1.154     tv        500: .for targ in dependall install
1.232     lukem     501:        ${MAKEDIRTARGET} . ${targ} BUILD_tools=no BUILD_lib=no
1.154     tv        502: .endfor
1.200     lukem     503:
1.242     dsl       504: do-x11: .PHONY .MAKE
1.263     mrg       505: .if ${MKX11} != "no"
1.312     joerg     506:        ${MAKEDIRTARGET} external/mit/xorg/tools all
                    507:        ${MAKEDIRTARGET} external/mit/xorg/lib build_install
1.315     matt      508: .if ${MKCOMPATX11} != "no"
1.314     matt      509:        ${MAKEDIRTARGET} compat build_install BOOTSTRAP_SUBDIRS="../../../external/mit/xorg/lib"
                    510: .endif
1.263     mrg       511: .else
                    512:        @echo "MKX11 is not enabled"
1.257     lukem     513:        @false
1.254     mrg       514: .endif
1.227     lukem     515:
1.275     uebayasi  516: do-extsrc: .PHONY .MAKE
                    517: .if ${MKEXTSRC} != "no"
                    518:        ${MAKEDIRTARGET} extsrc build
                    519: .else
                    520:        @echo "MKEXTSRC is not enabled"
                    521:        @false
                    522: .endif
                    523:
1.242     dsl       524: do-obsolete: .PHONY .MAKE
1.232     lukem     525:        ${MAKEDIRTARGET} etc install-obsolete-lists
1.87      cjs       526:
1.193     lukem     527: #
1.137     tv        528: # Speedup stubs for some subtrees that don't need to run these rules.
                    529: # (Tells <bsd.subdir.mk> not to recurse for them.)
1.193     lukem     530: #
1.129     tv        531:
1.292     veego     532: .for dir in bin etc distrib games libexec regress sbin usr.bin usr.sbin tools
1.228     lukem     533: includes-${dir}: .PHONY
1.152     tv        534:        @true
                    535: .endfor
                    536: .for dir in etc distrib regress
1.228     lukem     537: install-${dir}: .PHONY
1.152     tv        538:        @true
                    539: .endfor
                    540:
1.193     lukem     541: #
1.152     tv        542: # XXX this needs to change when distrib Makefiles are recursion compliant
1.193     lukem     543: # XXX many distrib subdirs need "cd etc && make snap_pre snap_kern" first...
                    544: #
1.228     lukem     545: dependall-distrib depend-distrib all-distrib: .PHONY
1.136     nathanw   546:        @true
1.130     tv        547:
1.151     tv        548: .include <bsd.obj.mk>
1.209     lukem     549: .include <bsd.kernobj.mk>
1.146     tv        550: .include <bsd.subdir.mk>
1.322     mrg       551: .include <bsd.clean.mk>

CVSweb <webmaster@jp.NetBSD.org>