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

Annotation of src/Makefile, Revision 1.328

1.328   ! kamil       1: #      $NetBSD: Makefile,v 1.327 2019/06/14 09:12:42 martin 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.325     maya      139: _SUBDIR=       tools .WAIT lib include external crypto/external bin
                    140: _SUBDIR+=      games libexec sbin usr.bin
1.303     joerg     141: _SUBDIR+=      usr.sbin share sys etc tests compat
                    142: _SUBDIR+=      .WAIT rescue .WAIT distrib regress
1.105     assar     143:
1.137     tv        144: .for dir in ${_SUBDIR}
1.261     apb       145: .if "${dir}" == ".WAIT" \
                    146:        || (${BUILD_${dir}:Uyes} != "no" && exists(${dir}/Makefile))
1.137     tv        147: SUBDIR+=       ${dir}
1.36      explorer  148: .endif
1.137     tv        149: .endfor
1.21      cgd       150:
1.13      brezak    151: .if exists(regress)
1.242     dsl       152: regression-tests: .PHONY .MAKE
1.10      cgd       153:        @echo Running regression tests...
1.232     lukem     154:        ${MAKEDIRTARGET} regress regress
1.13      brezak    155: .endif
1.20      cgd       156:
1.214     lukem     157: .if ${MKUNPRIVED} != "no"
1.179     thorpej   158: NOPOSTINSTALL= # defined
                    159: .endif
                    160:
1.242     dsl       161: afterinstall: .PHONY .MAKE
1.137     tv        162: .if ${MKMAN} != "no"
1.232     lukem     163:        ${MAKEDIRTARGET} share/man makedb
1.137     tv        164: .endif
1.214     lukem     165: .if (${MKUNPRIVED} != "no" && ${MKINFO} != "no")
1.317     christos  166:        ${MAKEDIRTARGET} external/gpl2/texinfo/bin/install-info infodir-meta
1.176     lukem     167: .endif
1.179     thorpej   168: .if !defined(NOPOSTINSTALL)
1.232     lukem     169:        ${MAKEDIRTARGET} . postinstall-check
1.159     perry     170: .endif
1.170     lukem     171:
1.327     martin    172: _POSTINSTALL=  ${:!cd ${.CURDIR}/usr.sbin/postinstall && \
                    173:                        ${MAKE} print-objdir!}/postinstall  \
1.308     apb       174:                -m ${MACHINE} -a ${MACHINE_ARCH}
1.295     apb       175: _POSTINSTALL_ENV= \
                    176:        AWK=${TOOL_AWK:Q}               \
                    177:        DB=${TOOL_DB:Q}                 \
1.298     apb       178:        HOST_SH=${HOST_SH:Q}            \
1.295     apb       179:        MAKE=${MAKE:Q}                  \
1.297     apb       180:        PWD_MKDB=${TOOL_PWD_MKDB:Q}     \
1.307     apb       181:        SED=${TOOL_SED:Q}               \
1.297     apb       182:        STAT=${TOOL_STAT:Q}
1.239     lukem     183:
1.313     martin    184: .if ${MKX11} != "no"
                    185: _POSTINSTALL_X11=-x ${X11SRCDIR:Q}
                    186: .endif
                    187:
1.228     lukem     188: postinstall-check: .PHONY
1.169     lukem     189:        @echo "   === Post installation checks ==="
1.313     martin    190:        ${_POSTINSTALL_ENV} ${HOST_SH} ${_POSTINSTALL} -s ${.CURDIR} ${_POSTINSTALL_X11} -d ${DESTDIR}/ check; if [ $$? -gt 1 ]; then exit 1; fi
1.171     lukem     191:        @echo "   ================================"
                    192:
1.228     lukem     193: postinstall-fix: .NOTMAIN .PHONY
1.171     lukem     194:        @echo "   === Post installation fixes ==="
1.313     martin    195:        ${_POSTINSTALL_ENV} ${HOST_SH} ${_POSTINSTALL} -s ${.CURDIR} ${_POSTINSTALL_X11} -d ${DESTDIR}/ fix
1.212     lukem     196:        @echo "   ==============================="
                    197:
1.228     lukem     198: postinstall-fix-obsolete: .NOTMAIN .PHONY
1.212     lukem     199:        @echo "   === Removing obsolete files ==="
1.313     martin    200:        ${_POSTINSTALL_ENV} ${HOST_SH} ${_POSTINSTALL} -s ${.CURDIR} ${_POSTINSTALL_X11} -d ${DESTDIR}/ fix obsolete
1.212     lukem     201:        @echo "   ==============================="
1.169     lukem     202:
1.309     apb       203: postinstall-fix-obsolete_stand: .NOTMAIN .PHONY
                    204:        @echo "   === Removing obsolete files ==="
1.313     martin    205:        ${_POSTINSTALL_ENV} ${HOST_SH} ${_POSTINSTALL} -s ${.CURDIR} ${_POSTINSTALL_X11} -d ${DESTDIR}/ fix obsolete_stand
1.309     apb       206:        @echo "   ==============================="
                    207:
1.108     erh       208:
1.193     lukem     209: #
1.137     tv        210: # Targets (in order!) called by "make build".
1.193     lukem     211: #
1.156     tv        212: BUILDTARGETS+= check-tools
1.214     lukem     213: .if ${MKUPDATE} == "no" && !defined(NOCLEANDIR)
1.155     tv        214: BUILDTARGETS+= cleandir
                    215: .endif
1.261     apb       216: .if ${MKOBJDIRS} != "no"
                    217: BUILDTARGETS+= do-top-obj
                    218: .endif
                    219: .if ${USETOOLS} == "yes"       # {
1.149     tv        220: .if ${MKOBJDIRS} != "no"
1.260     apb       221: BUILDTARGETS+= do-tools-obj
1.123     mrg       222: .endif
1.152     tv        223: BUILDTARGETS+= do-tools
1.261     apb       224: .endif # USETOOLS              # }
1.300     apb       225: BUILDTARGETS+= params
1.260     apb       226: .if ${MKOBJDIRS} != "no"
                    227: BUILDTARGETS+= obj
                    228: .endif
1.270     apb       229: BUILDTARGETS+= clean_METALOG
1.137     tv        230: .if !defined(NODISTRIBDIRS)
                    231: BUILDTARGETS+= do-distrib-dirs
1.131     tv        232: .endif
1.137     tv        233: .if !defined(NOINCLUDES)
                    234: BUILDTARGETS+= includes
1.131     tv        235: .endif
1.281     plunky    236: BUILDTARGETS+= do-lib
1.299     joerg     237: BUILDTARGETS+= do-compat-lib
1.328   ! kamil     238: .if ${MKLLVM} != "no"
        !           239: BUILDTARGETS+= do-sanitizer-includes
        !           240: BUILDTARGETS+= do-sanitizer-lib
        !           241: .if ${MKSANITIZER:Uno} == "yes"
        !           242: BUILDTARGETS+= do-sanitizer-tools
        !           243: .endif
        !           244: .endif
1.263     mrg       245: .if ${MKX11} != "no"
1.227     lukem     246: BUILDTARGETS+= do-x11
                    247: .endif
1.321     uwe       248: .if !defined(NOBINARIES)
1.312     joerg     249: BUILDTARGETS+= do-build
1.275     uebayasi  250: .if ${MKEXTSRC} != "no"
                    251: BUILDTARGETS+= do-extsrc
                    252: .endif
1.200     lukem     253: BUILDTARGETS+= do-obsolete
1.319     christos  254: .endif
1.131     tv        255:
1.193     lukem     256: #
1.137     tv        257: # Enforce proper ordering of some rules.
1.193     lukem     258: #
1.123     mrg       259:
1.137     tv        260: .ORDER:                ${BUILDTARGETS}
1.228     lukem     261: includes-lib:  .PHONY includes-include includes-sys
1.123     mrg       262:
1.193     lukem     263: #
1.300     apb       264: # Record the values of variables that might affect the build.
                    265: # If no values have changed, avoid updating the timestamp
                    266: # of the params file.
                    267: #
                    268: # This is referenced by _NETBSD_VERSION_DEPENDS in <bsd.own.mk>.
                    269: #
1.302     apb       270: .include "${NETBSDSRCDIR}/etc/Makefile.params"
1.300     apb       271: CLEANDIRFILES+= params
                    272: params: .EXEC
                    273:        ${_MKMSG_CREATE} params
1.302     apb       274:        @${PRINT_PARAMS} >${.TARGET}.new
1.300     apb       275:        @if cmp -s ${.TARGET}.new ${.TARGET} > /dev/null 2>&1; then \
                    276:                : "params is unchanged" ; \
                    277:                rm ${.TARGET}.new ; \
                    278:        else \
                    279:                : "params has changed or is new" ; \
                    280:                mv ${.TARGET}.new ${.TARGET} ; \
                    281:        fi
                    282:
                    283: #
1.302     apb       284: # Display current make(1) parameters
                    285: #
                    286: show-params: .PHONY .MAKE
                    287:        @${PRINT_PARAMS}
                    288:
                    289: #
1.137     tv        290: # Build the system and install into DESTDIR.
1.193     lukem     291: #
1.123     mrg       292:
1.191     lukem     293: START_TIME!=   date
                    294:
1.242     dsl       295: build: .PHONY .MAKE
1.137     tv        296: .if defined(BUILD_DONE)
                    297:        @echo "Build already installed into ${DESTDIR}"
                    298: .else
1.191     lukem     299:        @echo "Build started at: ${START_TIME}"
1.145     tv        300: .for tgt in ${BUILDTARGETS}
1.232     lukem     301:        ${MAKEDIRTARGET} . ${tgt}
1.145     tv        302: .endfor
1.232     lukem     303:        ${MAKEDIRTARGET} etc install-etc-release
1.191     lukem     304:        @echo   "Build started at:  ${START_TIME}"
1.172     bjh21     305:        @printf "Build finished at: " && date
1.71      mycroft   306: .endif
1.160     thorpej   307:
1.193     lukem     308: #
1.160     thorpej   309: # Build a full distribution, but not a release (i.e. no sets into
1.193     lukem     310: # ${RELEASEDIR}).  "buildworld" enforces a build to ${DESTDIR} != /
                    311: #
1.160     thorpej   312:
1.242     dsl       313: distribution buildworld: .PHONY .MAKE
1.194     lukem     314: .if make(buildworld) && \
                    315:     (!defined(DESTDIR) || ${DESTDIR} == "" || ${DESTDIR} == "/")
1.193     lukem     316:        @echo "Won't make ${.TARGET} with DESTDIR=/"
                    317:        @false
                    318: .endif
1.232     lukem     319:        ${MAKEDIRTARGET} . build NOPOSTINSTALL=1
                    320:        ${MAKEDIRTARGET} etc distribution INSTALL_DONE=1
1.181     thorpej   321: .if defined(DESTDIR) && ${DESTDIR} != "" && ${DESTDIR} != "/"
1.232     lukem     322:        ${MAKEDIRTARGET} . postinstall-fix-obsolete
1.309     apb       323:        ${MAKEDIRTARGET} . postinstall-fix-obsolete_stand
1.232     lukem     324:        ${MAKEDIRTARGET} distrib/sets checkflist
1.181     thorpej   325: .endif
1.192     lukem     326:        @echo   "make ${.TARGET} started at:  ${START_TIME}"
1.185     lukem     327:        @printf "make ${.TARGET} finished at: " && date
1.123     mrg       328:
1.193     lukem     329: #
                    330: # Install the distribution from $DESTDIR to $INSTALLWORLDDIR (defaults to `/')
                    331: # If installing to /, ensures that the host's operating system is NetBSD and
                    332: # the host's `uname -m` == ${MACHINE}.
                    333: #
                    334:
                    335: HOST_UNAME_S!= uname -s
                    336: HOST_UNAME_M!= uname -m
                    337:
1.242     dsl       338: installworld: .PHONY .MAKE
1.194     lukem     339: .if (!defined(DESTDIR) || ${DESTDIR} == "" || ${DESTDIR} == "/")
1.193     lukem     340:        @echo "Can't make ${.TARGET} to DESTDIR=/"
                    341:        @false
                    342: .endif
                    343: .if !defined(INSTALLWORLDDIR) || \
                    344:     ${INSTALLWORLDDIR} == "" || ${INSTALLWORLDDIR} == "/"
                    345: .if (${HOST_UNAME_S} != "NetBSD")
                    346:        @echo "Won't cross-make ${.TARGET} from ${HOST_UNAME_S} to NetBSD with INSTALLWORLDDIR=/"
                    347:        @false
                    348: .endif
                    349: .if (${HOST_UNAME_M} != ${MACHINE})
                    350:        @echo "Won't cross-make ${.TARGET} from ${HOST_UNAME_M} to ${MACHINE} with INSTALLWORLDDIR=/"
                    351:        @false
                    352: .endif
                    353: .endif
1.232     lukem     354:        ${MAKEDIRTARGET} distrib/sets installsets \
1.282     jym       355:                INSTALLDIR=${INSTALLWORLDDIR:U/} INSTALLSETS=${INSTALLSETS:Q}
1.232     lukem     356:        ${MAKEDIRTARGET} . postinstall-check DESTDIR=${INSTALLWORLDDIR}
1.193     lukem     357:        @echo   "make ${.TARGET} started at:  ${START_TIME}"
                    358:        @printf "make ${.TARGET} finished at: " && date
1.199     lukem     359:
                    360: #
1.287     jmcneill  361: # Install modules from $DESTDIR to $INSTALLMODULESDIR
                    362: #
                    363: installmodules: .PHONY .MAKE
                    364: .if (!defined(DESTDIR) || ${DESTDIR} == "" || ${DESTDIR} == "/")
                    365:        @echo "Can't make ${.TARGET} to DESTDIR=/"
                    366:        @false
                    367: .endif
                    368: .if !defined(INSTALLMODULESDIR) || \
                    369:     ${INSTALLMODULESDIR} == "" || ${INSTALLMODULESDIR} == "/"
                    370: .if (${HOST_UNAME_S} != "NetBSD")
                    371:        @echo "Won't cross-make ${.TARGET} from ${HOST_UNAME_S} to NetBSD with INSTALLMODULESDIR=/"
                    372:        @false
                    373: .endif
                    374: .if (${HOST_UNAME_M} != ${MACHINE})
                    375:        @echo "Won't cross-make ${.TARGET} from ${HOST_UNAME_M} to ${MACHINE} with INSTALLMODULESDIR=/"
                    376:        @false
                    377: .endif
                    378: .endif
1.288     jmcneill  379:        ${MAKEDIRTARGET} sys/modules install DESTDIR=${INSTALLMODULESDIR:U/}
1.287     jmcneill  380:        @echo   "make ${.TARGET} started at:  ${START_TIME}"
                    381:        @printf "make ${.TARGET} finished at: " && date
                    382:
                    383: #
1.206     lukem     384: # Create sets from $DESTDIR or $NETBSDSRCDIR into $RELEASEDIR
1.199     lukem     385: #
                    386:
1.241     apb       387: .for tgt in sets sourcesets syspkgs
1.242     dsl       388: ${tgt}: .PHONY .MAKE
1.232     lukem     389:        ${MAKEDIRTARGET} distrib/sets ${tgt}
1.206     lukem     390: .endfor
1.193     lukem     391:
                    392: #
1.240     lukem     393: # Build a release or snapshot (implies "make distribution").  Note that
1.181     thorpej   394: # in this case, the set lists will be checked before the tar files
                    395: # are made.
1.193     lukem     396: #
1.123     mrg       397:
1.242     dsl       398: release snapshot: .PHONY .MAKE
1.240     lukem     399:        ${MAKEDIRTARGET} . distribution
                    400:        ${MAKEDIRTARGET} etc release DISTRIBUTION_DONE=1
1.192     lukem     401:        @echo   "make ${.TARGET} started at:  ${START_TIME}"
1.185     lukem     402:        @printf "make ${.TARGET} finished at: " && date
1.123     mrg       403:
1.193     lukem     404: #
1.243     apb       405: # Create a CD-ROM image.
                    406: #
                    407:
                    408: iso-image: .PHONY
1.247     bouyer    409:        ${MAKEDIRTARGET} distrib iso_image
1.243     apb       410:        ${MAKEDIRTARGET} etc iso-image
                    411:        @echo   "make ${.TARGET} started at:  ${START_TIME}"
                    412:        @printf "make ${.TARGET} finished at: " && date
                    413:
1.248     jnemeth   414: iso-image-source: .PHONY
                    415:        ${MAKEDIRTARGET} distrib iso_image CDSOURCE=true
                    416:        ${MAKEDIRTARGET} etc iso-image
                    417:        @echo   "make ${.TARGET} started at:  ${START_TIME}"
                    418:        @printf "make ${.TARGET} finished at: " && date
                    419:
1.243     apb       420: #
1.290     tsutsui   421: # Create bootable live images.
                    422: #
                    423:
                    424: live-image: .PHONY
                    425:        ${MAKEDIRTARGET} etc live-image
                    426:        @echo   "make ${.TARGET} started at:  ${START_TIME}"
                    427:        @printf "make ${.TARGET} finished at: " && date
                    428:
                    429: #
                    430: # Create bootable installation images.
                    431: #
                    432:
                    433: install-image: .PHONY
                    434:        ${MAKEDIRTARGET} etc install-image
                    435:        @echo   "make ${.TARGET} started at:  ${START_TIME}"
                    436:        @printf "make ${.TARGET} finished at: " && date
                    437:
                    438: #
1.137     tv        439: # Special components of the "make build" process.
1.193     lukem     440: #
1.156     tv        441:
1.228     lukem     442: check-tools: .PHONY
1.223     lukem     443: .if ${TOOLCHAIN_MISSING} != "no" && !defined(EXTERNAL_TOOLCHAIN)
1.187     thorpej   444:        @echo '*** WARNING:  Building on MACHINE=${MACHINE} with missing toolchain.'
                    445:        @echo '*** May result in a failed build or corrupt binaries!'
                    446: .elif defined(EXTERNAL_TOOLCHAIN)
                    447:        @echo '*** Using external toolchain rooted at ${EXTERNAL_TOOLCHAIN}.'
1.156     tv        448: .endif
1.173     sommerfe  449: .if defined(NBUILDJOBS)
                    450:        @echo '*** WARNING: NBUILDJOBS is obsolete; use -j directly instead!'
                    451: .endif
1.123     mrg       452:
1.270     apb       453: # Delete or sanitise a leftover METALOG from a previous build.
                    454: clean_METALOG: .PHONY .MAKE
                    455: .if ${MKUPDATE} != "no"
                    456:        ${MAKEDIRTARGET} distrib/sets clean_METALOG
                    457: .endif
                    458:
1.242     dsl       459: do-distrib-dirs: .PHONY .MAKE
1.147     jmc       460: .if !defined(DESTDIR) || ${DESTDIR} == ""
1.232     lukem     461:        ${MAKEDIRTARGET} etc distrib-dirs DESTDIR=/
1.147     jmc       462: .else
1.232     lukem     463:        ${MAKEDIRTARGET} etc distrib-dirs DESTDIR=${DESTDIR}
1.147     jmc       464: .endif
1.190     lukem     465:
                    466: .for targ in cleandir obj includes
1.228     lukem     467: do-${targ}: .PHONY ${targ}
1.190     lukem     468:        @true
                    469: .endfor
1.123     mrg       470:
1.301     joerg     471: do-tools: .PHONY .MAKE
                    472:        ${MAKEDIRTARGET} tools build_install
1.184     lukem     473:
1.299     joerg     474: do-lib: .PHONY .MAKE
                    475:        ${MAKEDIRTARGET} lib build_install
                    476:
                    477: do-compat-lib: .PHONY .MAKE
                    478:        ${MAKEDIRTARGET} compat build_install BOOTSTRAP_SUBDIRS="../../../lib"
1.276     mrg       479:
1.328   ! kamil     480: do-sanitizer-includes: .PHONY .MAKE
        !           481:        ${MAKEDIRTARGET} external/bsd/compiler_rt/lib/clang/include includes
        !           482:        ${MAKEDIRTARGET} external/bsd/compiler_rt/lib/clang/share includes
        !           483:
        !           484: do-sanitizer-lib: .PHONY .MAKE
        !           485:        ${MAKEDIRTARGET} external/bsd/compiler_rt/lib/clang/lib build_install
        !           486:
        !           487: do-sanitizer-tools: .PHONY .MAKE
        !           488: .if !exists(${TOOLDIR}/lib/clang)
        !           489:        mkdir -p ${TOOLDIR}/lib/clang
        !           490:        cd ${DESTDIR}/usr/lib/clang && \
        !           491:                ${TOOL_PAX} -rw . ${TOOLDIR}/lib/clang
        !           492: .endif
        !           493:
1.261     apb       494: do-top-obj: .PHONY .MAKE
                    495:        ${MAKEDIRTARGET} . obj NOSUBDIR=
                    496:
1.260     apb       497: do-tools-obj: .PHONY .MAKE
                    498:        ${MAKEDIRTARGET} tools obj
                    499:
1.242     dsl       500: do-build: .PHONY .MAKE
1.154     tv        501: .for targ in dependall install
1.232     lukem     502:        ${MAKEDIRTARGET} . ${targ} BUILD_tools=no BUILD_lib=no
1.154     tv        503: .endfor
1.200     lukem     504:
1.242     dsl       505: do-x11: .PHONY .MAKE
1.263     mrg       506: .if ${MKX11} != "no"
1.312     joerg     507:        ${MAKEDIRTARGET} external/mit/xorg/tools all
                    508:        ${MAKEDIRTARGET} external/mit/xorg/lib build_install
1.315     matt      509: .if ${MKCOMPATX11} != "no"
1.314     matt      510:        ${MAKEDIRTARGET} compat build_install BOOTSTRAP_SUBDIRS="../../../external/mit/xorg/lib"
                    511: .endif
1.263     mrg       512: .else
                    513:        @echo "MKX11 is not enabled"
1.257     lukem     514:        @false
1.254     mrg       515: .endif
1.227     lukem     516:
1.275     uebayasi  517: do-extsrc: .PHONY .MAKE
                    518: .if ${MKEXTSRC} != "no"
                    519:        ${MAKEDIRTARGET} extsrc build
                    520: .else
                    521:        @echo "MKEXTSRC is not enabled"
                    522:        @false
                    523: .endif
                    524:
1.242     dsl       525: do-obsolete: .PHONY .MAKE
1.232     lukem     526:        ${MAKEDIRTARGET} etc install-obsolete-lists
1.87      cjs       527:
1.193     lukem     528: #
1.137     tv        529: # Speedup stubs for some subtrees that don't need to run these rules.
                    530: # (Tells <bsd.subdir.mk> not to recurse for them.)
1.193     lukem     531: #
1.129     tv        532:
1.292     veego     533: .for dir in bin etc distrib games libexec regress sbin usr.bin usr.sbin tools
1.228     lukem     534: includes-${dir}: .PHONY
1.152     tv        535:        @true
                    536: .endfor
                    537: .for dir in etc distrib regress
1.228     lukem     538: install-${dir}: .PHONY
1.152     tv        539:        @true
                    540: .endfor
                    541:
1.193     lukem     542: #
1.152     tv        543: # XXX this needs to change when distrib Makefiles are recursion compliant
1.193     lukem     544: # XXX many distrib subdirs need "cd etc && make snap_pre snap_kern" first...
                    545: #
1.228     lukem     546: dependall-distrib depend-distrib all-distrib: .PHONY
1.136     nathanw   547:        @true
1.130     tv        548:
1.151     tv        549: .include <bsd.obj.mk>
1.209     lukem     550: .include <bsd.kernobj.mk>
1.146     tv        551: .include <bsd.subdir.mk>
1.322     mrg       552: .include <bsd.clean.mk>

CVSweb <webmaster@jp.NetBSD.org>