Home | History | Annotate | Line # | Download | only in src
Makefile revision 1.292
      1 #	$NetBSD: Makefile,v 1.292 2012/04/21 08:28:00 veego Exp $
      2 
      3 #
      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
      6 # information, see http://www.NetBSD.org/developers/releng/index.html
      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:
     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.
     22 #   MKMAN, if `no', will prevent building of manual pages.
     23 #   MKOBJDIRS, if not `no', will build object directories at
     24 #	an appropriate point in a build.
     25 #   MKSHARE, if `no', will prevent building and installing
     26 #	anything in /usr/share.
     27 #   MKUPDATE, if not `no', will avoid a `make cleandir' at the start of
     28 #	`make build', as well as having the effects listed in
     29 #	/usr/share/mk/bsd.README.
     30 #   NOCLEANDIR, if defined, will avoid a `make cleandir' at the start
     31 #	of the `make build'.
     32 #   NOINCLUDES will avoid the `make includes' usually done by `make build'.
     33 #
     34 #   See mk.conf(5) for more details.
     35 #
     36 #
     37 # Targets:
     38 #   build:
     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
     51 #	is not the root directory if cross compiling.
     52 #   release:
     53 #	Does a `make distribution', and then tars up the DESTDIR files
     54 #	into ${RELEASEDIR}/${RELEASEMACHINEDIR}, in release(7) format.
     55 #	(See etc/Makefile for more information on this.)
     56 #   regression-tests:
     57 #	Runs the regression tests in "regress" on this host.
     58 #   sets:
     59 #	Populate ${RELEASEDIR}/${RELEASEMACHINEDIR}/binary/sets
     60 #	from ${DESTDIR}
     61 #   sourcesets:
     62 #	Populate ${RELEASEDIR}/source/sets from ${NETBSDSRCDIR}
     63 #   syspkgs:
     64 #	Populate ${RELEASEDIR}/${RELEASEMACHINEDIR}/binary/syspkgs
     65 #	from ${DESTDIR}
     66 #   iso-image:
     67 #	Create CD-ROM image in RELEASEDIR/iso.
     68 #	RELEASEDIR must already have been populated by `make release'
     69 #	or equivalent.
     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.
     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.
     84 #
     85 # Targets invoked by `make build,' in order:
     86 #   cleandir:        cleans the tree.
     87 #   do-top-obj:      creates the top level object directory.
     88 #   do-tools-obj:    creates object directories for the host toolchain.
     89 #   do-tools:        builds host toolchain.
     90 #   obj:             creates object directories.
     91 #   do-distrib-dirs: creates the distribution directories.
     92 #   includes:        installs include files.
     93 #   do-tools-compat: builds the "libnbcompat" library; needed for some
     94 #                    random host tool programs in the source tree.
     95 #   do-lib-csu:      builds and installs prerequisites from lib/csu.
     96 #   do-libgcc:       builds and installs prerequisites from
     97 #                    gnu/lib/crtstuff${LIBGCC_EXT} (if necessary) and
     98 #                    gnu/lib/libgcc${LIBGCC_EXT}.
     99 #   do-libpcc:       builds and install prerequisites from
    100 #                    external/bsd/pcc/crtstuff (if necessary) and
    101 #                    external/bsd/pcc/libpcc.
    102 #   do-lib-libc:     builds and installs prerequisites from lib/libc.
    103 #   do-lib:          builds and installs prerequisites from lib.
    104 #   do-sys-rump-dev-lib: builds and installs prerequisites from sys/rump/dev/lib
    105 #   do-sys-rump-fs-lib:  builds and installs prerequisites from sys/rump/fs/lib
    106 #   do-sys-rump-kern-lib:  builds and installs prereq. from sys/rump/kern/lib
    107 #   do-sys-rump-net-lib: builds and installs prerequisites from sys/rump/net/lib
    108 #   do-sys-modules:  builds and installs kernel modules (used by rump binaries)
    109 #   do-ld.so:        builds and installs prerequisites from libexec/ld.*_so.
    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".
    117 #   do-build:        builds and installs the entire system.
    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
    121 #   do-extsrc:       builds and installs extsrc if ${MKEXTSRC} != "no".
    122 #   do-obsolete:     installs the obsolete sets (for the postinstall-* targets).
    123 #
    124 
    125 .if ${.MAKEFLAGS:M${.CURDIR}/share/mk} == ""
    126 .MAKEFLAGS: -m ${.CURDIR}/share/mk
    127 .endif
    128 
    129 #
    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}.
    134 #
    135 _SRC_TOP_OBJ_=
    136 
    137 .include <bsd.own.mk>
    138 
    139 #
    140 # Sanity check: make sure that "make build" is not invoked simultaneously
    141 # with a standard recursive target.
    142 #
    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
    153 
    154 #
    155 # _SUBDIR is used to set SUBDIR, after removing directories that have
    156 # BUILD_${dir}=no, or that have no ${dir}/Makefile.
    157 #
    158 _SUBDIR=	tools lib include gnu external crypto/external bin games
    159 _SUBDIR+=	libexec sbin usr.bin
    160 _SUBDIR+=	usr.sbin share rescue sys etc tests compat .WAIT distrib regress
    161 
    162 .for dir in ${_SUBDIR}
    163 .if "${dir}" == ".WAIT" \
    164 	|| (${BUILD_${dir}:Uyes} != "no" && exists(${dir}/Makefile))
    165 SUBDIR+=	${dir}
    166 .endif
    167 .endfor
    168 
    169 .if exists(regress)
    170 regression-tests: .PHONY .MAKE
    171 	@echo Running regression tests...
    172 	${MAKEDIRTARGET} regress regress
    173 .endif
    174 
    175 .if ${MKUNPRIVED} != "no"
    176 NOPOSTINSTALL=	# defined
    177 .endif
    178 
    179 afterinstall: .PHONY .MAKE
    180 .if ${MKMAN} != "no"
    181 	${MAKEDIRTARGET} share/man makedb
    182 .endif
    183 .if (${MKUNPRIVED} != "no" && ${MKINFO} != "no")
    184 	${MAKEDIRTARGET} gnu/usr.bin/texinfo/install-info infodir-meta
    185 .endif
    186 .if !defined(NOPOSTINSTALL)
    187 	${MAKEDIRTARGET} . postinstall-check
    188 .endif
    189 
    190 _POSTINSTALL=	${.CURDIR}/usr.sbin/postinstall/postinstall
    191 
    192 postinstall-check: .PHONY
    193 	@echo "   === Post installation checks ==="
    194 	AWK=${TOOL_AWK:Q} MAKE=${MAKE:Q} ${HOST_SH} ${_POSTINSTALL} -s ${.CURDIR} -d ${DESTDIR}/ check; if [ $$? -gt 1 ]; then exit 1; fi
    195 	@echo "   ================================"
    196 
    197 postinstall-fix: .NOTMAIN .PHONY
    198 	@echo "   === Post installation fixes ==="
    199 	AWK=${TOOL_AWK:Q} MAKE=${MAKE:Q} ${HOST_SH} ${_POSTINSTALL} -s ${.CURDIR} -d ${DESTDIR}/ fix
    200 	@echo "   ==============================="
    201 
    202 postinstall-fix-obsolete: .NOTMAIN .PHONY
    203 	@echo "   === Removing obsolete files ==="
    204 	AWK=${TOOL_AWK:Q} MAKE=${MAKE:Q} ${HOST_SH} ${_POSTINSTALL} -s ${.CURDIR} -d ${DESTDIR}/ fix obsolete
    205 	@echo "   ==============================="
    206 
    207 
    208 #
    209 # Targets (in order!) called by "make build".
    210 #
    211 .if defined(HAVE_GCC)
    212 .if ${HAVE_GCC} == "4"
    213 LIBGCC_EXT=4
    214 BUILD_CC_LIB_BASEDIR= gnu/lib
    215 BUILD_CC_LIB_BASETARGET= gnu-lib
    216 .else
    217 LIBGCC_EXT=
    218 BUILD_CC_LIB_BASEDIR= external/gpl3/gcc/lib
    219 BUILD_CC_LIB_BASETARGET= external-gpl3-gcc-lib
    220 .endif
    221 .endif
    222 
    223 BUILDTARGETS+=	check-tools
    224 .if ${MKUPDATE} == "no" && !defined(NOCLEANDIR)
    225 BUILDTARGETS+=	cleandir
    226 .endif
    227 .if ${MKOBJDIRS} != "no"
    228 BUILDTARGETS+=	do-top-obj
    229 .endif
    230 .if ${USETOOLS} == "yes"	# {
    231 .if ${MKOBJDIRS} != "no"
    232 BUILDTARGETS+=	do-tools-obj
    233 .endif
    234 BUILDTARGETS+=	do-tools
    235 .endif # USETOOLS		# }
    236 .if ${MKOBJDIRS} != "no"
    237 BUILDTARGETS+=	obj
    238 .endif
    239 BUILDTARGETS+=	clean_METALOG
    240 .if !defined(NODISTRIBDIRS)
    241 BUILDTARGETS+=	do-distrib-dirs
    242 .endif
    243 .if !defined(NOINCLUDES)
    244 BUILDTARGETS+=	includes
    245 .endif
    246 BUILDTARGETS+=	do-tools-compat
    247 BUILDTARGETS+=	do-lib-csu
    248 .if ${MKGCC} != "no"
    249 BUILDTARGETS+=	do-libgcc
    250 .endif
    251 .if ${MKPCC} != "no"
    252 BUILDTARGET+=	do-libpcc
    253 .endif
    254 BUILDTARGETS+=	do-lib-libc
    255 BUILDTARGETS+=	do-lib
    256 .if ${MKKMOD} != "no"
    257 BUILDTARGETS+=	do-sys-modules
    258 .endif
    259 BUILDTARGETS+=	do-sys-rump-dev-lib do-sys-rump-fs-lib
    260 BUILDTARGETS+=	do-sys-rump-kern-lib do-sys-rump-net-lib
    261 .if ${MKCOMPAT} != "no"
    262 BUILDTARGETS+=	do-compat-lib-csu
    263 BUILDTARGETS+=	do-compat-libgcc
    264 BUILDTARGETS+=	do-compat-lib-libc
    265 .endif
    266 BUILDTARGETS+=	do-ld.so
    267 BUILDTARGETS+=	do-build
    268 .if ${MKX11} != "no"
    269 BUILDTARGETS+=	do-x11
    270 .endif
    271 .if ${MKEXTSRC} != "no"
    272 BUILDTARGETS+=	do-extsrc
    273 .endif
    274 BUILDTARGETS+=	do-obsolete
    275 
    276 #
    277 # Enforce proper ordering of some rules.
    278 #
    279 
    280 .ORDER:		${BUILDTARGETS}
    281 includes-lib:	.PHONY includes-include includes-sys
    282 includes-gnu:	.PHONY includes-lib
    283 
    284 #
    285 # Build the system and install into DESTDIR.
    286 #
    287 
    288 START_TIME!=	date
    289 
    290 build: .PHONY .MAKE
    291 .if defined(BUILD_DONE)
    292 	@echo "Build already installed into ${DESTDIR}"
    293 .else
    294 	@echo "Build started at: ${START_TIME}"
    295 .for tgt in ${BUILDTARGETS}
    296 	${MAKEDIRTARGET} . ${tgt}
    297 .endfor
    298 	${MAKEDIRTARGET} etc install-etc-release
    299 	@echo   "Build started at:  ${START_TIME}"
    300 	@printf "Build finished at: " && date
    301 .endif
    302 
    303 #
    304 # Build a full distribution, but not a release (i.e. no sets into
    305 # ${RELEASEDIR}).  "buildworld" enforces a build to ${DESTDIR} != /
    306 #
    307 
    308 distribution buildworld: .PHONY .MAKE
    309 .if make(buildworld) && \
    310     (!defined(DESTDIR) || ${DESTDIR} == "" || ${DESTDIR} == "/")
    311 	@echo "Won't make ${.TARGET} with DESTDIR=/"
    312 	@false
    313 .endif
    314 	${MAKEDIRTARGET} . build NOPOSTINSTALL=1
    315 	${MAKEDIRTARGET} etc distribution INSTALL_DONE=1
    316 .if defined(DESTDIR) && ${DESTDIR} != "" && ${DESTDIR} != "/"
    317 	${MAKEDIRTARGET} . postinstall-fix-obsolete
    318 	${MAKEDIRTARGET} distrib/sets checkflist
    319 .endif
    320 	@echo   "make ${.TARGET} started at:  ${START_TIME}"
    321 	@printf "make ${.TARGET} finished at: " && date
    322 
    323 #
    324 # Install the distribution from $DESTDIR to $INSTALLWORLDDIR (defaults to `/')
    325 # If installing to /, ensures that the host's operating system is NetBSD and
    326 # the host's `uname -m` == ${MACHINE}.
    327 #
    328 
    329 HOST_UNAME_S!=	uname -s
    330 HOST_UNAME_M!=	uname -m
    331 
    332 installworld: .PHONY .MAKE
    333 .if (!defined(DESTDIR) || ${DESTDIR} == "" || ${DESTDIR} == "/")
    334 	@echo "Can't make ${.TARGET} to DESTDIR=/"
    335 	@false
    336 .endif
    337 .if !defined(INSTALLWORLDDIR) || \
    338     ${INSTALLWORLDDIR} == "" || ${INSTALLWORLDDIR} == "/"
    339 .if (${HOST_UNAME_S} != "NetBSD")
    340 	@echo "Won't cross-make ${.TARGET} from ${HOST_UNAME_S} to NetBSD with INSTALLWORLDDIR=/"
    341 	@false
    342 .endif
    343 .if (${HOST_UNAME_M} != ${MACHINE})
    344 	@echo "Won't cross-make ${.TARGET} from ${HOST_UNAME_M} to ${MACHINE} with INSTALLWORLDDIR=/"
    345 	@false
    346 .endif
    347 .endif
    348 	${MAKEDIRTARGET} distrib/sets installsets \
    349 		INSTALLDIR=${INSTALLWORLDDIR:U/} INSTALLSETS=${INSTALLSETS:Q}
    350 	${MAKEDIRTARGET} . postinstall-check DESTDIR=${INSTALLWORLDDIR}
    351 	@echo   "make ${.TARGET} started at:  ${START_TIME}"
    352 	@printf "make ${.TARGET} finished at: " && date
    353 
    354 #
    355 # Install modules from $DESTDIR to $INSTALLMODULESDIR
    356 #
    357 installmodules: .PHONY .MAKE
    358 .if (!defined(DESTDIR) || ${DESTDIR} == "" || ${DESTDIR} == "/")
    359 	@echo "Can't make ${.TARGET} to DESTDIR=/"
    360 	@false
    361 .endif
    362 .if !defined(INSTALLMODULESDIR) || \
    363     ${INSTALLMODULESDIR} == "" || ${INSTALLMODULESDIR} == "/"
    364 .if (${HOST_UNAME_S} != "NetBSD")
    365 	@echo "Won't cross-make ${.TARGET} from ${HOST_UNAME_S} to NetBSD with INSTALLMODULESDIR=/"
    366 	@false
    367 .endif
    368 .if (${HOST_UNAME_M} != ${MACHINE})
    369 	@echo "Won't cross-make ${.TARGET} from ${HOST_UNAME_M} to ${MACHINE} with INSTALLMODULESDIR=/"
    370 	@false
    371 .endif
    372 .endif
    373 	${MAKEDIRTARGET} sys/modules install DESTDIR=${INSTALLMODULESDIR:U/}
    374 	@echo   "make ${.TARGET} started at:  ${START_TIME}"
    375 	@printf "make ${.TARGET} finished at: " && date
    376 
    377 #
    378 # Create sets from $DESTDIR or $NETBSDSRCDIR into $RELEASEDIR
    379 #
    380 
    381 .for tgt in sets sourcesets syspkgs
    382 ${tgt}: .PHONY .MAKE
    383 	${MAKEDIRTARGET} distrib/sets ${tgt}
    384 .endfor
    385 
    386 #
    387 # Build a release or snapshot (implies "make distribution").  Note that
    388 # in this case, the set lists will be checked before the tar files
    389 # are made.
    390 #
    391 
    392 release snapshot: .PHONY .MAKE
    393 	${MAKEDIRTARGET} . distribution
    394 	${MAKEDIRTARGET} etc release DISTRIBUTION_DONE=1
    395 	@echo   "make ${.TARGET} started at:  ${START_TIME}"
    396 	@printf "make ${.TARGET} finished at: " && date
    397 
    398 #
    399 # Create a CD-ROM image.
    400 #
    401 
    402 iso-image: .PHONY
    403 	${MAKEDIRTARGET} distrib iso_image
    404 	${MAKEDIRTARGET} etc iso-image
    405 	@echo   "make ${.TARGET} started at:  ${START_TIME}"
    406 	@printf "make ${.TARGET} finished at: " && date
    407 
    408 iso-image-source: .PHONY
    409 	${MAKEDIRTARGET} distrib iso_image CDSOURCE=true
    410 	${MAKEDIRTARGET} etc iso-image
    411 	@echo   "make ${.TARGET} started at:  ${START_TIME}"
    412 	@printf "make ${.TARGET} finished at: " && date
    413 
    414 #
    415 # Create bootable live images.
    416 #
    417 
    418 live-image: .PHONY
    419 	${MAKEDIRTARGET} etc live-image
    420 	@echo   "make ${.TARGET} started at:  ${START_TIME}"
    421 	@printf "make ${.TARGET} finished at: " && date
    422 
    423 #
    424 # Create bootable installation images.
    425 #
    426 
    427 install-image: .PHONY
    428 	${MAKEDIRTARGET} etc install-image
    429 	@echo   "make ${.TARGET} started at:  ${START_TIME}"
    430 	@printf "make ${.TARGET} finished at: " && date
    431 
    432 #
    433 # Special components of the "make build" process.
    434 #
    435 
    436 check-tools: .PHONY
    437 .if ${TOOLCHAIN_MISSING} != "no" && !defined(EXTERNAL_TOOLCHAIN)
    438 	@echo '*** WARNING:  Building on MACHINE=${MACHINE} with missing toolchain.'
    439 	@echo '*** May result in a failed build or corrupt binaries!'
    440 .elif defined(EXTERNAL_TOOLCHAIN)
    441 	@echo '*** Using external toolchain rooted at ${EXTERNAL_TOOLCHAIN}.'
    442 .endif
    443 .if defined(NBUILDJOBS)
    444 	@echo '*** WARNING: NBUILDJOBS is obsolete; use -j directly instead!'
    445 .endif
    446 
    447 # Delete or sanitise a leftover METALOG from a previous build.
    448 clean_METALOG: .PHONY .MAKE
    449 .if ${MKUPDATE} != "no"
    450 	${MAKEDIRTARGET} distrib/sets clean_METALOG
    451 .endif
    452 
    453 do-distrib-dirs: .PHONY .MAKE
    454 .if !defined(DESTDIR) || ${DESTDIR} == ""
    455 	${MAKEDIRTARGET} etc distrib-dirs DESTDIR=/
    456 .else
    457 	${MAKEDIRTARGET} etc distrib-dirs DESTDIR=${DESTDIR}
    458 .endif
    459 
    460 .for targ in cleandir obj includes
    461 do-${targ}: .PHONY ${targ}
    462 	@true
    463 .endfor
    464 
    465 .if defined(HAVE_GCC)
    466 .if ${USE_COMPILERCRTSTUFF} == "yes"
    467 BUILD_CC_LIB= ${BUILD_CC_LIB_BASEDIR}/crtstuff${LIBGCC_EXT}
    468 .endif
    469 BUILD_CC_LIB+= ${BUILD_CC_LIB_BASEDIR}/libgcc${LIBGCC_EXT}
    470 .elif defined(HAVE_PCC)
    471 BUILD_CC_LIB+= external/bsd/pcc/crtstuff
    472 BUILD_CC_LIB+= external/bsd/pcc/libpcc
    473 .endif
    474 
    475 .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
    476 do-${dir:S/\//-/g}: .PHONY .MAKE
    477 .for targ in dependall install
    478 	${MAKEDIRTARGET} ${dir} ${targ}
    479 .endfor
    480 .endfor
    481 
    482 .if ${MKCOMPAT} != "no"
    483 COMPAT_SUBDIR_LIST=lib/csu ${BUILD_CC_LIB} lib/libc
    484 .for dir in ${COMPAT_SUBDIR_LIST}
    485 do-compat-${dir:S/\//-/g}: .PHONY .MAKE
    486 .for targ in dependall install
    487 	${MAKEDIRTARGET} compat ${targ} BOOTSTRAP_SUBDIRS="../../../${dir}"
    488 .endfor
    489 .endfor
    490 .endif
    491 
    492 do-top-obj: .PHONY .MAKE
    493 	${MAKEDIRTARGET} . obj NOSUBDIR=
    494 
    495 do-tools-obj: .PHONY .MAKE
    496 	${MAKEDIRTARGET} tools obj
    497 
    498 do-libgcc: .PHONY .MAKE
    499 .if defined(HAVE_GCC)
    500 .if ${MKGCC} != "no"
    501 .if ${USE_COMPILERCRTSTUFF} == "yes"
    502 	${MAKEDIRTARGET} . do-${BUILD_CC_LIB_BASETARGET}-crtstuff${LIBGCC_EXT}
    503 .endif
    504 	${MAKEDIRTARGET} . do-${BUILD_CC_LIB_BASETARGET}-libgcc${LIBGCC_EXT}
    505 .endif
    506 .endif
    507 
    508 do-compat-libgcc: .PHONY .MAKE
    509 .if defined(HAVE_GCC)
    510 .if ${MKGCC} != "no"
    511 .if ${USE_COMPILERCRTSTUFF} == "yes"
    512 	${MAKEDIRTARGET} . do-compat-${BUILD_CC_LIB_BASETARGET}-crtstuff${LIBGCC_EXT}
    513 .endif
    514 	${MAKEDIRTARGET} . do-compat-${BUILD_CC_LIB_BASETARGET}-libgcc${LIBGCC_EXT}
    515 .endif
    516 .endif
    517 
    518 do-libpcc: .PHONY .MAKE
    519 .if defined(HAVE_PCC)
    520 .if ${MKPCC} != "no"
    521 .if ${USE_COMPILERCRTSTUFF} == "yes"
    522 	${MAKEDIRTARGET} . do-pcc-lib-crtstuff
    523 .endif
    524 	${MAKEDIRTARGET} . do-pcc-lib-libpcc
    525 .endif
    526 .endif
    527 
    528 do-ld.so: .PHONY .MAKE
    529 .for targ in dependall install
    530 	${MAKEDIRTARGET} libexec/ld.elf_so ${targ}
    531 .endfor
    532 
    533 do-build: .PHONY .MAKE
    534 .for targ in dependall install
    535 	${MAKEDIRTARGET} . ${targ} BUILD_tools=no BUILD_lib=no
    536 .endfor
    537 
    538 do-x11: .PHONY .MAKE
    539 .if ${MKX11} != "no"
    540 .if ${X11FLAVOUR} == "Xorg"
    541 	${MAKEDIRTARGET} external/mit/xorg build
    542 .else
    543 	${MAKEDIRTARGET} x11 build
    544 .endif
    545 .else
    546 	@echo "MKX11 is not enabled"
    547 	@false
    548 .endif
    549 
    550 do-extsrc: .PHONY .MAKE
    551 .if ${MKEXTSRC} != "no"
    552 	${MAKEDIRTARGET} extsrc build
    553 .else
    554 	@echo "MKEXTSRC is not enabled"
    555 	@false
    556 .endif
    557 
    558 do-obsolete: .PHONY .MAKE
    559 	${MAKEDIRTARGET} etc install-obsolete-lists
    560 
    561 #
    562 # Speedup stubs for some subtrees that don't need to run these rules.
    563 # (Tells <bsd.subdir.mk> not to recurse for them.)
    564 #
    565 
    566 .for dir in bin etc distrib games libexec regress sbin usr.bin usr.sbin tools
    567 includes-${dir}: .PHONY
    568 	@true
    569 .endfor
    570 .for dir in etc distrib regress
    571 install-${dir}: .PHONY
    572 	@true
    573 .endfor
    574 
    575 #
    576 # XXX this needs to change when distrib Makefiles are recursion compliant
    577 # XXX many distrib subdirs need "cd etc && make snap_pre snap_kern" first...
    578 #
    579 dependall-distrib depend-distrib all-distrib: .PHONY
    580 	@true
    581 
    582 .include <bsd.sys.mk>
    583 .include <bsd.obj.mk>
    584 .include <bsd.kernobj.mk>
    585 .include <bsd.subdir.mk>
    586 
    587 #
    588 # Display current make(1) parameters
    589 #
    590 params: .PHONY .MAKE
    591 	${MAKEDIRTARGET} etc params
    592