Annotation of src/Makefile, Revision 1.296
1.296 ! apb 1: # $NetBSD: Makefile,v 1.295 2012/08/14 12:37:41 apb 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.95 cjs 33: #
1.214 lukem 34: # See mk.conf(5) for more details.
35: #
36: #
1.95 cjs 37: # Targets:
1.137 tv 38: # build:
1.196 lukem 39: # Builds a full release of NetBSD in DESTDIR, except for the
40: # /etc configuration files.
41: # If BUILD_DONE is set, this is an empty target.
42: # distribution:
43: # Builds a full release of NetBSD in DESTDIR, including the /etc
44: # configuration files.
45: # buildworld:
46: # As per `make distribution', except that it ensures that DESTDIR
47: # is not the root directory.
48: # installworld:
49: # Install the distribution from DESTDIR to INSTALLWORLDDIR (which
50: # defaults to the root directory). Ensures that INSTALLWORLDDIR
1.291 abs 51: # is not the root directory if cross compiling.
1.137 tv 52: # release:
1.240 lukem 53: # Does a `make distribution', and then tars up the DESTDIR files
1.252 lukem 54: # into ${RELEASEDIR}/${RELEASEMACHINEDIR}, in release(7) format.
1.196 lukem 55: # (See etc/Makefile for more information on this.)
1.137 tv 56: # regression-tests:
57: # Runs the regression tests in "regress" on this host.
1.206 lukem 58: # sets:
1.252 lukem 59: # Populate ${RELEASEDIR}/${RELEASEMACHINEDIR}/binary/sets
60: # from ${DESTDIR}
1.206 lukem 61: # sourcesets:
62: # Populate ${RELEASEDIR}/source/sets from ${NETBSDSRCDIR}
1.241 apb 63: # syspkgs:
1.252 lukem 64: # Populate ${RELEASEDIR}/${RELEASEMACHINEDIR}/binary/syspkgs
65: # from ${DESTDIR}
1.243 apb 66: # iso-image:
1.248 jnemeth 67: # Create CD-ROM image in RELEASEDIR/iso.
1.243 apb 68: # RELEASEDIR must already have been populated by `make release'
69: # or equivalent.
1.248 jnemeth 70: # iso-image-source:
71: # Create CD-ROM image with source in RELEASEDIR/iso.
72: # RELEASEDIR must already have been populated by
73: # `make release sourcesets' or equivalent.
1.290 tsutsui 74: # live-image:
75: # Create bootable live image for emulators or USB stick etc.
76: # in RELEASEDIR/liveimage.
77: # RELEASEDIR must already have been populated by `make release'
78: # or equivalent.
79: # install-image:
80: # Create bootable installation image for USB stick etc.
81: # in RELEASEDIR/installimage.
82: # RELEASEDIR must already have been populated by `make release'
83: # or equivalent.
1.123 mrg 84: #
1.137 tv 85: # Targets invoked by `make build,' in order:
1.155 tv 86: # cleandir: cleans the tree.
1.261 apb 87: # do-top-obj: creates the top level object directory.
1.260 apb 88: # do-tools-obj: creates object directories for the host toolchain.
89: # do-tools: builds host toolchain.
1.137 tv 90: # obj: creates object directories.
1.208 lukem 91: # do-distrib-dirs: creates the distribution directories.
92: # includes: installs include files.
1.202 thorpej 93: # do-tools-compat: builds the "libnbcompat" library; needed for some
94: # random host tool programs in the source tree.
1.238 lukem 95: # do-lib-csu: builds and installs prerequisites from lib/csu.
1.249 lukem 96: # do-libgcc: builds and installs prerequisites from
97: # gnu/lib/crtstuff${LIBGCC_EXT} (if necessary) and
98: # gnu/lib/libgcc${LIBGCC_EXT}.
1.256 gmcgarry 99: # do-libpcc: builds and install prerequisites from
1.280 skrll 100: # external/bsd/pcc/crtstuff (if necessary) and
101: # external/bsd/pcc/libpcc.
1.186 thorpej 102: # do-lib-libc: builds and installs prerequisites from lib/libc.
1.143 tv 103: # do-lib: builds and installs prerequisites from lib.
1.274 pooka 104: # do-sys-rump-dev-lib: builds and installs prerequisites from sys/rump/dev/lib
1.259 pooka 105: # do-sys-rump-fs-lib: builds and installs prerequisites from sys/rump/fs/lib
1.277 pooka 106: # do-sys-rump-kern-lib: builds and installs prereq. from sys/rump/kern/lib
1.259 pooka 107: # do-sys-rump-net-lib: builds and installs prerequisites from sys/rump/net/lib
1.265 pooka 108: # do-sys-modules: builds and installs kernel modules (used by rump binaries)
1.189 itohy 109: # do-ld.so: builds and installs prerequisites from libexec/ld.*_so.
1.262 mrg 110: # do-compat-lib-csu: builds and installs prerequisites from compat/lib/csu
111: # if ${MKCOMPAT} != "no".
112: # do-compat-libgcc: builds and installs prerequisites from
113: # compat/gnu/lib/crtstuff${LIBGCC_EXT} (if necessary) and
114: # compat/gnu/lib/libgcc${LIBGCC_EXT} if ${MKCOMPAT} != "no".
115: # do-compat-lib-libc: builds and installs prerequisites from compat/lib/libc
116: # if ${MKCOMPAT} != "no".
1.137 tv 117: # do-build: builds and installs the entire system.
1.263 mrg 118: # do-x11: builds and installs X11 if ${MKX11} != "no"; either
119: # X11R7 from src/external/mit/xorg if ${X11FLAVOUR} == "Xorg"
120: # or X11R6 from src/x11
1.275 uebayasi 121: # do-extsrc: builds and installs extsrc if ${MKEXTSRC} != "no".
1.222 lukem 122: # do-obsolete: installs the obsolete sets (for the postinstall-* targets).
1.193 lukem 123: #
1.32 cgd 124:
1.146 tv 125: .if ${.MAKEFLAGS:M${.CURDIR}/share/mk} == ""
126: .MAKEFLAGS: -m ${.CURDIR}/share/mk
127: .endif
1.163 tv 128:
1.193 lukem 129: #
1.163 tv 130: # If _SRC_TOP_OBJ_ gets set here, we will end up with a directory that may
131: # not be the top level objdir, because "make obj" can happen in the *middle*
132: # of "make build" (long after <bsd.own.mk> is calculated it). So, pre-set
133: # _SRC_TOP_OBJ_ here so it will not be added to ${.MAKEOVERRIDES}.
1.193 lukem 134: #
1.163 tv 135: _SRC_TOP_OBJ_=
1.148 jmc 136:
1.146 tv 137: .include <bsd.own.mk>
1.4 cgd 138:
1.193 lukem 139: #
1.137 tv 140: # Sanity check: make sure that "make build" is not invoked simultaneously
141: # with a standard recursive target.
1.193 lukem 142: #
1.137 tv 143:
144: .if make(build) || make(release) || make(snapshot)
145: .for targ in ${TARGETS:Nobj:Ncleandir}
146: .if make(${targ}) && !target(.BEGIN)
147: .BEGIN:
148: @echo 'BUILD ABORTED: "make build" and "make ${targ}" are mutually exclusive.'
149: @false
150: .endif
151: .endfor
152: .endif
1.58 tv 153:
1.261 apb 154: #
155: # _SUBDIR is used to set SUBDIR, after removing directories that have
156: # BUILD_${dir}=no, or that have no ${dir}/Makefile.
157: #
1.271 christos 158: _SUBDIR= tools lib include gnu external crypto/external bin games
159: _SUBDIR+= libexec sbin usr.bin
1.262 mrg 160: _SUBDIR+= usr.sbin share rescue sys etc tests compat .WAIT distrib regress
1.105 assar 161:
1.137 tv 162: .for dir in ${_SUBDIR}
1.261 apb 163: .if "${dir}" == ".WAIT" \
164: || (${BUILD_${dir}:Uyes} != "no" && exists(${dir}/Makefile))
1.137 tv 165: SUBDIR+= ${dir}
1.36 explorer 166: .endif
1.137 tv 167: .endfor
1.21 cgd 168:
1.13 brezak 169: .if exists(regress)
1.242 dsl 170: regression-tests: .PHONY .MAKE
1.10 cgd 171: @echo Running regression tests...
1.232 lukem 172: ${MAKEDIRTARGET} regress regress
1.13 brezak 173: .endif
1.20 cgd 174:
1.214 lukem 175: .if ${MKUNPRIVED} != "no"
1.179 thorpej 176: NOPOSTINSTALL= # defined
177: .endif
178:
1.242 dsl 179: afterinstall: .PHONY .MAKE
1.137 tv 180: .if ${MKMAN} != "no"
1.232 lukem 181: ${MAKEDIRTARGET} share/man makedb
1.137 tv 182: .endif
1.214 lukem 183: .if (${MKUNPRIVED} != "no" && ${MKINFO} != "no")
1.232 lukem 184: ${MAKEDIRTARGET} gnu/usr.bin/texinfo/install-info infodir-meta
1.176 lukem 185: .endif
1.179 thorpej 186: .if !defined(NOPOSTINSTALL)
1.232 lukem 187: ${MAKEDIRTARGET} . postinstall-check
1.159 perry 188: .endif
1.170 lukem 189:
1.239 lukem 190: _POSTINSTALL= ${.CURDIR}/usr.sbin/postinstall/postinstall
1.295 apb 191: _POSTINSTALL_ENV= \
192: AWK=${TOOL_AWK:Q} \
193: DB=${TOOL_DB:Q} \
194: MAKE=${MAKE:Q} \
195: PWD_MKDB=${TOOL_PWD_MKDB:Q}
1.239 lukem 196:
1.228 lukem 197: postinstall-check: .PHONY
1.169 lukem 198: @echo " === Post installation checks ==="
1.295 apb 199: ${_POSTINSTALL_ENV} ${HOST_SH} ${_POSTINSTALL} -s ${.CURDIR} -d ${DESTDIR}/ check; if [ $$? -gt 1 ]; then exit 1; fi
1.171 lukem 200: @echo " ================================"
201:
1.228 lukem 202: postinstall-fix: .NOTMAIN .PHONY
1.171 lukem 203: @echo " === Post installation fixes ==="
1.295 apb 204: ${_POSTINSTALL_ENV} ${HOST_SH} ${_POSTINSTALL} -s ${.CURDIR} -d ${DESTDIR}/ fix
1.212 lukem 205: @echo " ==============================="
206:
1.228 lukem 207: postinstall-fix-obsolete: .NOTMAIN .PHONY
1.212 lukem 208: @echo " === Removing obsolete files ==="
1.295 apb 209: ${_POSTINSTALL_ENV} ${HOST_SH} ${_POSTINSTALL} -s ${.CURDIR} -d ${DESTDIR}/ fix obsolete
1.212 lukem 210: @echo " ==============================="
1.169 lukem 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.256 gmcgarry 216: .if defined(HAVE_GCC)
1.284 mrg 217: .if ${HAVE_GCC} == "4"
218: LIBGCC_EXT=4
1.285 mrg 219: BUILD_CC_LIB_BASEDIR= gnu/lib
220: BUILD_CC_LIB_BASETARGET= gnu-lib
1.245 mrg 221: .else
1.285 mrg 222: LIBGCC_EXT=
223: BUILD_CC_LIB_BASEDIR= external/gpl3/gcc/lib
224: BUILD_CC_LIB_BASETARGET= external-gpl3-gcc-lib
1.220 mrg 225: .endif
1.256 gmcgarry 226: .endif
1.123 mrg 227:
1.156 tv 228: BUILDTARGETS+= check-tools
1.214 lukem 229: .if ${MKUPDATE} == "no" && !defined(NOCLEANDIR)
1.155 tv 230: BUILDTARGETS+= cleandir
231: .endif
1.261 apb 232: .if ${MKOBJDIRS} != "no"
233: BUILDTARGETS+= do-top-obj
234: .endif
235: .if ${USETOOLS} == "yes" # {
1.149 tv 236: .if ${MKOBJDIRS} != "no"
1.260 apb 237: BUILDTARGETS+= do-tools-obj
1.123 mrg 238: .endif
1.152 tv 239: BUILDTARGETS+= do-tools
1.261 apb 240: .endif # USETOOLS # }
1.260 apb 241: .if ${MKOBJDIRS} != "no"
242: BUILDTARGETS+= obj
243: .endif
1.270 apb 244: BUILDTARGETS+= clean_METALOG
1.137 tv 245: .if !defined(NODISTRIBDIRS)
246: BUILDTARGETS+= do-distrib-dirs
1.131 tv 247: .endif
1.137 tv 248: .if !defined(NOINCLUDES)
249: BUILDTARGETS+= includes
1.131 tv 250: .endif
1.202 thorpej 251: BUILDTARGETS+= do-tools-compat
1.231 skrll 252: BUILDTARGETS+= do-lib-csu
1.207 drochner 253: .if ${MKGCC} != "no"
1.249 lukem 254: BUILDTARGETS+= do-libgcc
1.207 drochner 255: .endif
1.256 gmcgarry 256: .if ${MKPCC} != "no"
257: BUILDTARGET+= do-libpcc
258: .endif
1.231 skrll 259: BUILDTARGETS+= do-lib-libc
1.281 plunky 260: BUILDTARGETS+= do-lib
1.283 mrg 261: .if ${MKKMOD} != "no"
1.265 pooka 262: BUILDTARGETS+= do-sys-modules
263: .endif
1.294 apb 264: .if ${MKRUMP} != "no"
1.277 pooka 265: BUILDTARGETS+= do-sys-rump-dev-lib do-sys-rump-fs-lib
266: BUILDTARGETS+= do-sys-rump-kern-lib do-sys-rump-net-lib
1.293 christos 267: .endif
1.262 mrg 268: .if ${MKCOMPAT} != "no"
269: BUILDTARGETS+= do-compat-lib-csu
270: BUILDTARGETS+= do-compat-libgcc
271: BUILDTARGETS+= do-compat-lib-libc
272: .endif
1.224 lukem 273: BUILDTARGETS+= do-ld.so
274: BUILDTARGETS+= do-build
1.263 mrg 275: .if ${MKX11} != "no"
1.227 lukem 276: BUILDTARGETS+= do-x11
277: .endif
1.275 uebayasi 278: .if ${MKEXTSRC} != "no"
279: BUILDTARGETS+= do-extsrc
280: .endif
1.200 lukem 281: BUILDTARGETS+= do-obsolete
1.131 tv 282:
1.193 lukem 283: #
1.137 tv 284: # Enforce proper ordering of some rules.
1.193 lukem 285: #
1.123 mrg 286:
1.137 tv 287: .ORDER: ${BUILDTARGETS}
1.228 lukem 288: includes-lib: .PHONY includes-include includes-sys
289: includes-gnu: .PHONY includes-lib
1.123 mrg 290:
1.193 lukem 291: #
1.137 tv 292: # Build the system and install into DESTDIR.
1.193 lukem 293: #
1.123 mrg 294:
1.191 lukem 295: START_TIME!= date
296:
1.242 dsl 297: build: .PHONY .MAKE
1.137 tv 298: .if defined(BUILD_DONE)
299: @echo "Build already installed into ${DESTDIR}"
300: .else
1.191 lukem 301: @echo "Build started at: ${START_TIME}"
1.145 tv 302: .for tgt in ${BUILDTARGETS}
1.232 lukem 303: ${MAKEDIRTARGET} . ${tgt}
1.145 tv 304: .endfor
1.232 lukem 305: ${MAKEDIRTARGET} etc install-etc-release
1.191 lukem 306: @echo "Build started at: ${START_TIME}"
1.172 bjh21 307: @printf "Build finished at: " && date
1.71 mycroft 308: .endif
1.160 thorpej 309:
1.193 lukem 310: #
1.160 thorpej 311: # Build a full distribution, but not a release (i.e. no sets into
1.193 lukem 312: # ${RELEASEDIR}). "buildworld" enforces a build to ${DESTDIR} != /
313: #
1.160 thorpej 314:
1.242 dsl 315: distribution buildworld: .PHONY .MAKE
1.194 lukem 316: .if make(buildworld) && \
317: (!defined(DESTDIR) || ${DESTDIR} == "" || ${DESTDIR} == "/")
1.193 lukem 318: @echo "Won't make ${.TARGET} with DESTDIR=/"
319: @false
320: .endif
1.232 lukem 321: ${MAKEDIRTARGET} . build NOPOSTINSTALL=1
322: ${MAKEDIRTARGET} etc distribution INSTALL_DONE=1
1.181 thorpej 323: .if defined(DESTDIR) && ${DESTDIR} != "" && ${DESTDIR} != "/"
1.232 lukem 324: ${MAKEDIRTARGET} . postinstall-fix-obsolete
325: ${MAKEDIRTARGET} distrib/sets checkflist
1.181 thorpej 326: .endif
1.192 lukem 327: @echo "make ${.TARGET} started at: ${START_TIME}"
1.185 lukem 328: @printf "make ${.TARGET} finished at: " && date
1.123 mrg 329:
1.193 lukem 330: #
331: # Install the distribution from $DESTDIR to $INSTALLWORLDDIR (defaults to `/')
332: # If installing to /, ensures that the host's operating system is NetBSD and
333: # the host's `uname -m` == ${MACHINE}.
334: #
335:
336: HOST_UNAME_S!= uname -s
337: HOST_UNAME_M!= uname -m
338:
1.242 dsl 339: installworld: .PHONY .MAKE
1.194 lukem 340: .if (!defined(DESTDIR) || ${DESTDIR} == "" || ${DESTDIR} == "/")
1.193 lukem 341: @echo "Can't make ${.TARGET} to DESTDIR=/"
342: @false
343: .endif
344: .if !defined(INSTALLWORLDDIR) || \
345: ${INSTALLWORLDDIR} == "" || ${INSTALLWORLDDIR} == "/"
346: .if (${HOST_UNAME_S} != "NetBSD")
347: @echo "Won't cross-make ${.TARGET} from ${HOST_UNAME_S} to NetBSD with INSTALLWORLDDIR=/"
348: @false
349: .endif
350: .if (${HOST_UNAME_M} != ${MACHINE})
351: @echo "Won't cross-make ${.TARGET} from ${HOST_UNAME_M} to ${MACHINE} with INSTALLWORLDDIR=/"
352: @false
353: .endif
354: .endif
1.232 lukem 355: ${MAKEDIRTARGET} distrib/sets installsets \
1.282 jym 356: INSTALLDIR=${INSTALLWORLDDIR:U/} INSTALLSETS=${INSTALLSETS:Q}
1.232 lukem 357: ${MAKEDIRTARGET} . postinstall-check DESTDIR=${INSTALLWORLDDIR}
1.193 lukem 358: @echo "make ${.TARGET} started at: ${START_TIME}"
359: @printf "make ${.TARGET} finished at: " && date
1.199 lukem 360:
361: #
1.287 jmcneill 362: # Install modules from $DESTDIR to $INSTALLMODULESDIR
363: #
364: installmodules: .PHONY .MAKE
365: .if (!defined(DESTDIR) || ${DESTDIR} == "" || ${DESTDIR} == "/")
366: @echo "Can't make ${.TARGET} to DESTDIR=/"
367: @false
368: .endif
369: .if !defined(INSTALLMODULESDIR) || \
370: ${INSTALLMODULESDIR} == "" || ${INSTALLMODULESDIR} == "/"
371: .if (${HOST_UNAME_S} != "NetBSD")
372: @echo "Won't cross-make ${.TARGET} from ${HOST_UNAME_S} to NetBSD with INSTALLMODULESDIR=/"
373: @false
374: .endif
375: .if (${HOST_UNAME_M} != ${MACHINE})
376: @echo "Won't cross-make ${.TARGET} from ${HOST_UNAME_M} to ${MACHINE} with INSTALLMODULESDIR=/"
377: @false
378: .endif
379: .endif
1.288 jmcneill 380: ${MAKEDIRTARGET} sys/modules install DESTDIR=${INSTALLMODULESDIR:U/}
1.287 jmcneill 381: @echo "make ${.TARGET} started at: ${START_TIME}"
382: @printf "make ${.TARGET} finished at: " && date
383:
384: #
1.206 lukem 385: # Create sets from $DESTDIR or $NETBSDSRCDIR into $RELEASEDIR
1.199 lukem 386: #
387:
1.241 apb 388: .for tgt in sets sourcesets syspkgs
1.242 dsl 389: ${tgt}: .PHONY .MAKE
1.232 lukem 390: ${MAKEDIRTARGET} distrib/sets ${tgt}
1.206 lukem 391: .endfor
1.193 lukem 392:
393: #
1.240 lukem 394: # Build a release or snapshot (implies "make distribution"). Note that
1.181 thorpej 395: # in this case, the set lists will be checked before the tar files
396: # are made.
1.193 lukem 397: #
1.123 mrg 398:
1.242 dsl 399: release snapshot: .PHONY .MAKE
1.240 lukem 400: ${MAKEDIRTARGET} . distribution
401: ${MAKEDIRTARGET} etc release DISTRIBUTION_DONE=1
1.192 lukem 402: @echo "make ${.TARGET} started at: ${START_TIME}"
1.185 lukem 403: @printf "make ${.TARGET} finished at: " && date
1.123 mrg 404:
1.193 lukem 405: #
1.243 apb 406: # Create a CD-ROM image.
407: #
408:
409: iso-image: .PHONY
1.247 bouyer 410: ${MAKEDIRTARGET} distrib iso_image
1.243 apb 411: ${MAKEDIRTARGET} etc iso-image
412: @echo "make ${.TARGET} started at: ${START_TIME}"
413: @printf "make ${.TARGET} finished at: " && date
414:
1.248 jnemeth 415: iso-image-source: .PHONY
416: ${MAKEDIRTARGET} distrib iso_image CDSOURCE=true
417: ${MAKEDIRTARGET} etc iso-image
418: @echo "make ${.TARGET} started at: ${START_TIME}"
419: @printf "make ${.TARGET} finished at: " && date
420:
1.243 apb 421: #
1.290 tsutsui 422: # Create bootable live images.
423: #
424:
425: live-image: .PHONY
426: ${MAKEDIRTARGET} etc live-image
427: @echo "make ${.TARGET} started at: ${START_TIME}"
428: @printf "make ${.TARGET} finished at: " && date
429:
430: #
431: # Create bootable installation images.
432: #
433:
434: install-image: .PHONY
435: ${MAKEDIRTARGET} etc install-image
436: @echo "make ${.TARGET} started at: ${START_TIME}"
437: @printf "make ${.TARGET} finished at: " && date
438:
439: #
1.137 tv 440: # Special components of the "make build" process.
1.193 lukem 441: #
1.156 tv 442:
1.228 lukem 443: check-tools: .PHONY
1.223 lukem 444: .if ${TOOLCHAIN_MISSING} != "no" && !defined(EXTERNAL_TOOLCHAIN)
1.187 thorpej 445: @echo '*** WARNING: Building on MACHINE=${MACHINE} with missing toolchain.'
446: @echo '*** May result in a failed build or corrupt binaries!'
447: .elif defined(EXTERNAL_TOOLCHAIN)
448: @echo '*** Using external toolchain rooted at ${EXTERNAL_TOOLCHAIN}.'
1.156 tv 449: .endif
1.173 sommerfe 450: .if defined(NBUILDJOBS)
451: @echo '*** WARNING: NBUILDJOBS is obsolete; use -j directly instead!'
452: .endif
1.123 mrg 453:
1.270 apb 454: # Delete or sanitise a leftover METALOG from a previous build.
455: clean_METALOG: .PHONY .MAKE
456: .if ${MKUPDATE} != "no"
457: ${MAKEDIRTARGET} distrib/sets clean_METALOG
458: .endif
459:
1.242 dsl 460: do-distrib-dirs: .PHONY .MAKE
1.147 jmc 461: .if !defined(DESTDIR) || ${DESTDIR} == ""
1.232 lukem 462: ${MAKEDIRTARGET} etc distrib-dirs DESTDIR=/
1.147 jmc 463: .else
1.232 lukem 464: ${MAKEDIRTARGET} etc distrib-dirs DESTDIR=${DESTDIR}
1.147 jmc 465: .endif
1.190 lukem 466:
467: .for targ in cleandir obj includes
1.228 lukem 468: do-${targ}: .PHONY ${targ}
1.190 lukem 469: @true
470: .endfor
1.123 mrg 471:
1.256 gmcgarry 472: .if defined(HAVE_GCC)
1.280 skrll 473: .if ${USE_COMPILERCRTSTUFF} == "yes"
1.285 mrg 474: BUILD_CC_LIB= ${BUILD_CC_LIB_BASEDIR}/crtstuff${LIBGCC_EXT}
1.280 skrll 475: .endif
1.285 mrg 476: BUILD_CC_LIB+= ${BUILD_CC_LIB_BASEDIR}/libgcc${LIBGCC_EXT}
1.256 gmcgarry 477: .elif defined(HAVE_PCC)
478: BUILD_CC_LIB+= external/bsd/pcc/crtstuff
479: BUILD_CC_LIB+= external/bsd/pcc/libpcc
480: .endif
481:
1.281 plunky 482: .for dir in tools tools/compat lib/csu ${BUILD_CC_LIB} lib/libc lib sys/rump/dev/lib sys/rump/fs/lib sys/rump/kern/lib sys/rump/net/lib sys/modules
1.242 dsl 483: do-${dir:S/\//-/g}: .PHONY .MAKE
1.137 tv 484: .for targ in dependall install
1.232 lukem 485: ${MAKEDIRTARGET} ${dir} ${targ}
1.137 tv 486: .endfor
1.184 lukem 487: .endfor
488:
1.276 mrg 489: .if ${MKCOMPAT} != "no"
490: COMPAT_SUBDIR_LIST=lib/csu ${BUILD_CC_LIB} lib/libc
491: .for dir in ${COMPAT_SUBDIR_LIST}
492: do-compat-${dir:S/\//-/g}: .PHONY .MAKE
1.281 plunky 493: .for targ in dependall install
1.276 mrg 494: ${MAKEDIRTARGET} compat ${targ} BOOTSTRAP_SUBDIRS="../../../${dir}"
495: .endfor
496: .endfor
497: .endif
498:
1.261 apb 499: do-top-obj: .PHONY .MAKE
500: ${MAKEDIRTARGET} . obj NOSUBDIR=
501:
1.260 apb 502: do-tools-obj: .PHONY .MAKE
503: ${MAKEDIRTARGET} tools obj
504:
1.249 lukem 505: do-libgcc: .PHONY .MAKE
1.256 gmcgarry 506: .if defined(HAVE_GCC)
1.249 lukem 507: .if ${MKGCC} != "no"
1.280 skrll 508: .if ${USE_COMPILERCRTSTUFF} == "yes"
1.285 mrg 509: ${MAKEDIRTARGET} . do-${BUILD_CC_LIB_BASETARGET}-crtstuff${LIBGCC_EXT}
1.249 lukem 510: .endif
1.285 mrg 511: ${MAKEDIRTARGET} . do-${BUILD_CC_LIB_BASETARGET}-libgcc${LIBGCC_EXT}
1.249 lukem 512: .endif
1.256 gmcgarry 513: .endif
514:
1.262 mrg 515: do-compat-libgcc: .PHONY .MAKE
516: .if defined(HAVE_GCC)
517: .if ${MKGCC} != "no"
1.280 skrll 518: .if ${USE_COMPILERCRTSTUFF} == "yes"
1.285 mrg 519: ${MAKEDIRTARGET} . do-compat-${BUILD_CC_LIB_BASETARGET}-crtstuff${LIBGCC_EXT}
1.280 skrll 520: .endif
1.285 mrg 521: ${MAKEDIRTARGET} . do-compat-${BUILD_CC_LIB_BASETARGET}-libgcc${LIBGCC_EXT}
1.262 mrg 522: .endif
523: .endif
524:
1.256 gmcgarry 525: do-libpcc: .PHONY .MAKE
526: .if defined(HAVE_PCC)
527: .if ${MKPCC} != "no"
1.280 skrll 528: .if ${USE_COMPILERCRTSTUFF} == "yes"
1.256 gmcgarry 529: ${MAKEDIRTARGET} . do-pcc-lib-crtstuff
1.280 skrll 530: .endif
1.256 gmcgarry 531: ${MAKEDIRTARGET} . do-pcc-lib-libpcc
532: .endif
533: .endif
1.249 lukem 534:
1.242 dsl 535: do-ld.so: .PHONY .MAKE
1.184 lukem 536: .for targ in dependall install
1.232 lukem 537: ${MAKEDIRTARGET} libexec/ld.elf_so ${targ}
1.137 tv 538: .endfor
1.143 tv 539:
1.242 dsl 540: do-build: .PHONY .MAKE
1.154 tv 541: .for targ in dependall install
1.232 lukem 542: ${MAKEDIRTARGET} . ${targ} BUILD_tools=no BUILD_lib=no
1.154 tv 543: .endfor
1.200 lukem 544:
1.242 dsl 545: do-x11: .PHONY .MAKE
1.263 mrg 546: .if ${MKX11} != "no"
547: .if ${X11FLAVOUR} == "Xorg"
1.254 mrg 548: ${MAKEDIRTARGET} external/mit/xorg build
1.263 mrg 549: .else
1.257 lukem 550: ${MAKEDIRTARGET} x11 build
1.263 mrg 551: .endif
1.254 mrg 552: .else
1.263 mrg 553: @echo "MKX11 is not enabled"
1.257 lukem 554: @false
1.254 mrg 555: .endif
1.227 lukem 556:
1.275 uebayasi 557: do-extsrc: .PHONY .MAKE
558: .if ${MKEXTSRC} != "no"
559: ${MAKEDIRTARGET} extsrc build
560: .else
561: @echo "MKEXTSRC is not enabled"
562: @false
563: .endif
564:
1.242 dsl 565: do-obsolete: .PHONY .MAKE
1.232 lukem 566: ${MAKEDIRTARGET} etc install-obsolete-lists
1.87 cjs 567:
1.193 lukem 568: #
1.137 tv 569: # Speedup stubs for some subtrees that don't need to run these rules.
570: # (Tells <bsd.subdir.mk> not to recurse for them.)
1.193 lukem 571: #
1.129 tv 572:
1.292 veego 573: .for dir in bin etc distrib games libexec regress sbin usr.bin usr.sbin tools
1.228 lukem 574: includes-${dir}: .PHONY
1.152 tv 575: @true
576: .endfor
577: .for dir in etc distrib regress
1.228 lukem 578: install-${dir}: .PHONY
1.152 tv 579: @true
580: .endfor
581:
1.193 lukem 582: #
1.152 tv 583: # XXX this needs to change when distrib Makefiles are recursion compliant
1.193 lukem 584: # XXX many distrib subdirs need "cd etc && make snap_pre snap_kern" first...
585: #
1.228 lukem 586: dependall-distrib depend-distrib all-distrib: .PHONY
1.136 nathanw 587: @true
1.130 tv 588:
1.211 lukem 589: .include <bsd.sys.mk>
1.151 tv 590: .include <bsd.obj.mk>
1.209 lukem 591: .include <bsd.kernobj.mk>
1.146 tv 592: .include <bsd.subdir.mk>
1.144 tv 593:
1.209 lukem 594: #
595: # Display current make(1) parameters
596: #
1.242 dsl 597: params: .PHONY .MAKE
1.232 lukem 598: ${MAKEDIRTARGET} etc params
CVSweb <webmaster@jp.NetBSD.org>