Makefile revision 1.300
11.300Sapb# $NetBSD: Makefile,v 1.300 2012/11/04 11:02:11 apb Exp $ 21.95Scjs 31.193Slukem# 41.95Scjs# This is the top-level makefile for building NetBSD. For an outline of 51.95Scjs# how to build a snapshot or release, as well as other release engineering 61.221Ssalo# information, see http://www.NetBSD.org/developers/releng/index.html 71.95Scjs# 81.95Scjs# Not everything you can set or do is documented in this makefile. In 91.95Scjs# particular, you should review the files in /usr/share/mk (especially 101.95Scjs# bsd.README) for general information on building programs and writing 111.95Scjs# Makefiles within this structure, and see the comments in src/etc/Makefile 121.95Scjs# for further information on installation and release set options. 131.95Scjs# 141.95Scjs# Variables listed below can be set on the make command line (highest 151.95Scjs# priority), in /etc/mk.conf (middle priority), or in the environment 161.95Scjs# (lowest priority). 171.95Scjs# 181.95Scjs# Variables: 191.101Ssommerfe# DESTDIR is the target directory for installation of the compiled 201.101Ssommerfe# software. It defaults to /. Note that programs are built against 211.101Ssommerfe# libraries installed in DESTDIR. 221.214Slukem# MKMAN, if `no', will prevent building of manual pages. 231.214Slukem# MKOBJDIRS, if not `no', will build object directories at 241.101Ssommerfe# an appropriate point in a build. 251.214Slukem# MKSHARE, if `no', will prevent building and installing 261.95Scjs# anything in /usr/share. 271.214Slukem# MKUPDATE, if not `no', will avoid a `make cleandir' at the start of 281.178Senami# `make build', as well as having the effects listed in 291.178Senami# /usr/share/mk/bsd.README. 301.125Smrg# NOCLEANDIR, if defined, will avoid a `make cleandir' at the start 311.178Senami# of the `make build'. 321.119Stoddpw# NOINCLUDES will avoid the `make includes' usually done by `make build'. 331.95Scjs# 341.214Slukem# See mk.conf(5) for more details. 351.214Slukem# 361.214Slukem# 371.95Scjs# Targets: 381.137Stv# build: 391.196Slukem# Builds a full release of NetBSD in DESTDIR, except for the 401.196Slukem# /etc configuration files. 411.196Slukem# If BUILD_DONE is set, this is an empty target. 421.196Slukem# distribution: 431.196Slukem# Builds a full release of NetBSD in DESTDIR, including the /etc 441.196Slukem# configuration files. 451.196Slukem# buildworld: 461.196Slukem# As per `make distribution', except that it ensures that DESTDIR 471.196Slukem# is not the root directory. 481.196Slukem# installworld: 491.196Slukem# Install the distribution from DESTDIR to INSTALLWORLDDIR (which 501.196Slukem# defaults to the root directory). Ensures that INSTALLWORLDDIR 511.291Sabs# is not the root directory if cross compiling. 521.137Stv# release: 531.240Slukem# Does a `make distribution', and then tars up the DESTDIR files 541.252Slukem# into ${RELEASEDIR}/${RELEASEMACHINEDIR}, in release(7) format. 551.196Slukem# (See etc/Makefile for more information on this.) 561.137Stv# regression-tests: 571.137Stv# Runs the regression tests in "regress" on this host. 581.206Slukem# sets: 591.252Slukem# Populate ${RELEASEDIR}/${RELEASEMACHINEDIR}/binary/sets 601.252Slukem# from ${DESTDIR} 611.206Slukem# sourcesets: 621.206Slukem# Populate ${RELEASEDIR}/source/sets from ${NETBSDSRCDIR} 631.241Sapb# syspkgs: 641.252Slukem# Populate ${RELEASEDIR}/${RELEASEMACHINEDIR}/binary/syspkgs 651.252Slukem# from ${DESTDIR} 661.243Sapb# iso-image: 671.248Sjnemeth# Create CD-ROM image in RELEASEDIR/iso. 681.243Sapb# RELEASEDIR must already have been populated by `make release' 691.243Sapb# or equivalent. 701.248Sjnemeth# iso-image-source: 711.248Sjnemeth# Create CD-ROM image with source in RELEASEDIR/iso. 721.248Sjnemeth# RELEASEDIR must already have been populated by 731.248Sjnemeth# `make release sourcesets' or equivalent. 741.290Stsutsui# live-image: 751.290Stsutsui# Create bootable live image for emulators or USB stick etc. 761.290Stsutsui# in RELEASEDIR/liveimage. 771.290Stsutsui# RELEASEDIR must already have been populated by `make release' 781.290Stsutsui# or equivalent. 791.290Stsutsui# install-image: 801.290Stsutsui# Create bootable installation image for USB stick etc. 811.290Stsutsui# in RELEASEDIR/installimage. 821.290Stsutsui# RELEASEDIR must already have been populated by `make release' 831.290Stsutsui# or equivalent. 841.123Smrg# 851.137Stv# Targets invoked by `make build,' in order: 861.155Stv# cleandir: cleans the tree. 871.261Sapb# do-top-obj: creates the top level object directory. 881.260Sapb# do-tools-obj: creates object directories for the host toolchain. 891.260Sapb# do-tools: builds host toolchain. 901.300Sapb# params: record the values of variables that might affect the 911.300Sapb# build. 921.137Stv# obj: creates object directories. 931.208Slukem# do-distrib-dirs: creates the distribution directories. 941.208Slukem# includes: installs include files. 951.202Sthorpej# do-tools-compat: builds the "libnbcompat" library; needed for some 961.202Sthorpej# random host tool programs in the source tree. 971.299Sjoerg# do-lib: builds and installs prerequisites from lib 981.262Smrg# if ${MKCOMPAT} != "no". 991.299Sjoerg# do-compat-lib: builds and installs prerequisites from compat/lib 1001.262Smrg# if ${MKCOMPAT} != "no". 1011.137Stv# do-build: builds and installs the entire system. 1021.263Smrg# do-x11: builds and installs X11 if ${MKX11} != "no"; either 1031.263Smrg# X11R7 from src/external/mit/xorg if ${X11FLAVOUR} == "Xorg" 1041.263Smrg# or X11R6 from src/x11 1051.275Suebayasi# do-extsrc: builds and installs extsrc if ${MKEXTSRC} != "no". 1061.222Slukem# do-obsolete: installs the obsolete sets (for the postinstall-* targets). 1071.193Slukem# 1081.32Scgd 1091.146Stv.if ${.MAKEFLAGS:M${.CURDIR}/share/mk} == "" 1101.146Stv.MAKEFLAGS: -m ${.CURDIR}/share/mk 1111.146Stv.endif 1121.163Stv 1131.193Slukem# 1141.163Stv# If _SRC_TOP_OBJ_ gets set here, we will end up with a directory that may 1151.163Stv# not be the top level objdir, because "make obj" can happen in the *middle* 1161.163Stv# of "make build" (long after <bsd.own.mk> is calculated it). So, pre-set 1171.163Stv# _SRC_TOP_OBJ_ here so it will not be added to ${.MAKEOVERRIDES}. 1181.193Slukem# 1191.163Stv_SRC_TOP_OBJ_= 1201.148Sjmc 1211.146Stv.include <bsd.own.mk> 1221.4Scgd 1231.193Slukem# 1241.137Stv# Sanity check: make sure that "make build" is not invoked simultaneously 1251.137Stv# with a standard recursive target. 1261.193Slukem# 1271.137Stv 1281.137Stv.if make(build) || make(release) || make(snapshot) 1291.137Stv.for targ in ${TARGETS:Nobj:Ncleandir} 1301.137Stv.if make(${targ}) && !target(.BEGIN) 1311.137Stv.BEGIN: 1321.137Stv @echo 'BUILD ABORTED: "make build" and "make ${targ}" are mutually exclusive.' 1331.137Stv @false 1341.137Stv.endif 1351.137Stv.endfor 1361.137Stv.endif 1371.58Stv 1381.261Sapb# 1391.261Sapb# _SUBDIR is used to set SUBDIR, after removing directories that have 1401.261Sapb# BUILD_${dir}=no, or that have no ${dir}/Makefile. 1411.261Sapb# 1421.271Schristos_SUBDIR= tools lib include gnu external crypto/external bin games 1431.271Schristos_SUBDIR+= libexec sbin usr.bin 1441.262Smrg_SUBDIR+= usr.sbin share rescue sys etc tests compat .WAIT distrib regress 1451.105Sassar 1461.137Stv.for dir in ${_SUBDIR} 1471.261Sapb.if "${dir}" == ".WAIT" \ 1481.261Sapb || (${BUILD_${dir}:Uyes} != "no" && exists(${dir}/Makefile)) 1491.137StvSUBDIR+= ${dir} 1501.36Sexplorer.endif 1511.137Stv.endfor 1521.21Scgd 1531.13Sbrezak.if exists(regress) 1541.242Sdslregression-tests: .PHONY .MAKE 1551.10Scgd @echo Running regression tests... 1561.232Slukem ${MAKEDIRTARGET} regress regress 1571.13Sbrezak.endif 1581.20Scgd 1591.214Slukem.if ${MKUNPRIVED} != "no" 1601.179SthorpejNOPOSTINSTALL= # defined 1611.179Sthorpej.endif 1621.179Sthorpej 1631.242Sdslafterinstall: .PHONY .MAKE 1641.137Stv.if ${MKMAN} != "no" 1651.232Slukem ${MAKEDIRTARGET} share/man makedb 1661.137Stv.endif 1671.214Slukem.if (${MKUNPRIVED} != "no" && ${MKINFO} != "no") 1681.232Slukem ${MAKEDIRTARGET} gnu/usr.bin/texinfo/install-info infodir-meta 1691.176Slukem.endif 1701.179Sthorpej.if !defined(NOPOSTINSTALL) 1711.232Slukem ${MAKEDIRTARGET} . postinstall-check 1721.159Sperry.endif 1731.170Slukem 1741.239Slukem_POSTINSTALL= ${.CURDIR}/usr.sbin/postinstall/postinstall 1751.295Sapb_POSTINSTALL_ENV= \ 1761.295Sapb AWK=${TOOL_AWK:Q} \ 1771.295Sapb DB=${TOOL_DB:Q} \ 1781.298Sapb HOST_SH=${HOST_SH:Q} \ 1791.295Sapb MAKE=${MAKE:Q} \ 1801.297Sapb PWD_MKDB=${TOOL_PWD_MKDB:Q} \ 1811.297Sapb STAT=${TOOL_STAT:Q} 1821.239Slukem 1831.228Slukempostinstall-check: .PHONY 1841.169Slukem @echo " === Post installation checks ===" 1851.295Sapb ${_POSTINSTALL_ENV} ${HOST_SH} ${_POSTINSTALL} -s ${.CURDIR} -d ${DESTDIR}/ check; if [ $$? -gt 1 ]; then exit 1; fi 1861.171Slukem @echo " ================================" 1871.171Slukem 1881.228Slukempostinstall-fix: .NOTMAIN .PHONY 1891.171Slukem @echo " === Post installation fixes ===" 1901.295Sapb ${_POSTINSTALL_ENV} ${HOST_SH} ${_POSTINSTALL} -s ${.CURDIR} -d ${DESTDIR}/ fix 1911.212Slukem @echo " ===============================" 1921.212Slukem 1931.228Slukempostinstall-fix-obsolete: .NOTMAIN .PHONY 1941.212Slukem @echo " === Removing obsolete files ===" 1951.295Sapb ${_POSTINSTALL_ENV} ${HOST_SH} ${_POSTINSTALL} -s ${.CURDIR} -d ${DESTDIR}/ fix obsolete 1961.212Slukem @echo " ===============================" 1971.169Slukem 1981.108Serh 1991.193Slukem# 2001.137Stv# Targets (in order!) called by "make build". 2011.193Slukem# 2021.256Sgmcgarry.if defined(HAVE_GCC) 2031.284Smrg.if ${HAVE_GCC} == "4" 2041.284SmrgLIBGCC_EXT=4 2051.285SmrgBUILD_CC_LIB_BASEDIR= gnu/lib 2061.285SmrgBUILD_CC_LIB_BASETARGET= gnu-lib 2071.245Smrg.else 2081.285SmrgLIBGCC_EXT= 2091.285SmrgBUILD_CC_LIB_BASEDIR= external/gpl3/gcc/lib 2101.285SmrgBUILD_CC_LIB_BASETARGET= external-gpl3-gcc-lib 2111.220Smrg.endif 2121.256Sgmcgarry.endif 2131.123Smrg 2141.156StvBUILDTARGETS+= check-tools 2151.214Slukem.if ${MKUPDATE} == "no" && !defined(NOCLEANDIR) 2161.155StvBUILDTARGETS+= cleandir 2171.155Stv.endif 2181.261Sapb.if ${MKOBJDIRS} != "no" 2191.261SapbBUILDTARGETS+= do-top-obj 2201.261Sapb.endif 2211.261Sapb.if ${USETOOLS} == "yes" # { 2221.149Stv.if ${MKOBJDIRS} != "no" 2231.260SapbBUILDTARGETS+= do-tools-obj 2241.123Smrg.endif 2251.152StvBUILDTARGETS+= do-tools 2261.261Sapb.endif # USETOOLS # } 2271.300SapbBUILDTARGETS+= params 2281.260Sapb.if ${MKOBJDIRS} != "no" 2291.260SapbBUILDTARGETS+= obj 2301.260Sapb.endif 2311.270SapbBUILDTARGETS+= clean_METALOG 2321.137Stv.if !defined(NODISTRIBDIRS) 2331.137StvBUILDTARGETS+= do-distrib-dirs 2341.131Stv.endif 2351.137Stv.if !defined(NOINCLUDES) 2361.137StvBUILDTARGETS+= includes 2371.131Stv.endif 2381.281SplunkyBUILDTARGETS+= do-lib 2391.299SjoergBUILDTARGETS+= do-compat-lib 2401.224SlukemBUILDTARGETS+= do-build 2411.263Smrg.if ${MKX11} != "no" 2421.227SlukemBUILDTARGETS+= do-x11 2431.227Slukem.endif 2441.275Suebayasi.if ${MKEXTSRC} != "no" 2451.275SuebayasiBUILDTARGETS+= do-extsrc 2461.275Suebayasi.endif 2471.200SlukemBUILDTARGETS+= do-obsolete 2481.131Stv 2491.193Slukem# 2501.137Stv# Enforce proper ordering of some rules. 2511.193Slukem# 2521.123Smrg 2531.137Stv.ORDER: ${BUILDTARGETS} 2541.228Slukemincludes-lib: .PHONY includes-include includes-sys 2551.228Slukemincludes-gnu: .PHONY includes-lib 2561.123Smrg 2571.193Slukem# 2581.300Sapb# Record the values of variables that might affect the build. 2591.300Sapb# If no values have changed, avoid updating the timestamp 2601.300Sapb# of the params file. 2611.300Sapb# 2621.300Sapb# This is referenced by _NETBSD_VERSION_DEPENDS in <bsd.own.mk>. 2631.300Sapb# 2641.300Sapb 2651.300SapbCLEANDIRFILES+= params 2661.300Sapbparams: .EXEC 2671.300Sapb ${_MKMSG_CREATE} params 2681.300Sapb @(${MAKEDIRTARGET:S/^@//} etc params) >${.TARGET}.new 2691.300Sapb @if cmp -s ${.TARGET}.new ${.TARGET} > /dev/null 2>&1; then \ 2701.300Sapb : "params is unchanged" ; \ 2711.300Sapb rm ${.TARGET}.new ; \ 2721.300Sapb else \ 2731.300Sapb : "params has changed or is new" ; \ 2741.300Sapb mv ${.TARGET}.new ${.TARGET} ; \ 2751.300Sapb fi 2761.300Sapb 2771.300Sapb# 2781.137Stv# Build the system and install into DESTDIR. 2791.193Slukem# 2801.123Smrg 2811.191SlukemSTART_TIME!= date 2821.191Slukem 2831.242Sdslbuild: .PHONY .MAKE 2841.137Stv.if defined(BUILD_DONE) 2851.137Stv @echo "Build already installed into ${DESTDIR}" 2861.137Stv.else 2871.191Slukem @echo "Build started at: ${START_TIME}" 2881.145Stv.for tgt in ${BUILDTARGETS} 2891.232Slukem ${MAKEDIRTARGET} . ${tgt} 2901.145Stv.endfor 2911.232Slukem ${MAKEDIRTARGET} etc install-etc-release 2921.191Slukem @echo "Build started at: ${START_TIME}" 2931.172Sbjh21 @printf "Build finished at: " && date 2941.71Smycroft.endif 2951.160Sthorpej 2961.193Slukem# 2971.160Sthorpej# Build a full distribution, but not a release (i.e. no sets into 2981.193Slukem# ${RELEASEDIR}). "buildworld" enforces a build to ${DESTDIR} != / 2991.193Slukem# 3001.160Sthorpej 3011.242Sdsldistribution buildworld: .PHONY .MAKE 3021.194Slukem.if make(buildworld) && \ 3031.194Slukem (!defined(DESTDIR) || ${DESTDIR} == "" || ${DESTDIR} == "/") 3041.193Slukem @echo "Won't make ${.TARGET} with DESTDIR=/" 3051.193Slukem @false 3061.193Slukem.endif 3071.232Slukem ${MAKEDIRTARGET} . build NOPOSTINSTALL=1 3081.232Slukem ${MAKEDIRTARGET} etc distribution INSTALL_DONE=1 3091.181Sthorpej.if defined(DESTDIR) && ${DESTDIR} != "" && ${DESTDIR} != "/" 3101.232Slukem ${MAKEDIRTARGET} . postinstall-fix-obsolete 3111.232Slukem ${MAKEDIRTARGET} distrib/sets checkflist 3121.181Sthorpej.endif 3131.192Slukem @echo "make ${.TARGET} started at: ${START_TIME}" 3141.185Slukem @printf "make ${.TARGET} finished at: " && date 3151.123Smrg 3161.193Slukem# 3171.193Slukem# Install the distribution from $DESTDIR to $INSTALLWORLDDIR (defaults to `/') 3181.193Slukem# If installing to /, ensures that the host's operating system is NetBSD and 3191.193Slukem# the host's `uname -m` == ${MACHINE}. 3201.193Slukem# 3211.193Slukem 3221.193SlukemHOST_UNAME_S!= uname -s 3231.193SlukemHOST_UNAME_M!= uname -m 3241.193Slukem 3251.242Sdslinstallworld: .PHONY .MAKE 3261.194Slukem.if (!defined(DESTDIR) || ${DESTDIR} == "" || ${DESTDIR} == "/") 3271.193Slukem @echo "Can't make ${.TARGET} to DESTDIR=/" 3281.193Slukem @false 3291.193Slukem.endif 3301.193Slukem.if !defined(INSTALLWORLDDIR) || \ 3311.193Slukem ${INSTALLWORLDDIR} == "" || ${INSTALLWORLDDIR} == "/" 3321.193Slukem.if (${HOST_UNAME_S} != "NetBSD") 3331.193Slukem @echo "Won't cross-make ${.TARGET} from ${HOST_UNAME_S} to NetBSD with INSTALLWORLDDIR=/" 3341.193Slukem @false 3351.193Slukem.endif 3361.193Slukem.if (${HOST_UNAME_M} != ${MACHINE}) 3371.193Slukem @echo "Won't cross-make ${.TARGET} from ${HOST_UNAME_M} to ${MACHINE} with INSTALLWORLDDIR=/" 3381.193Slukem @false 3391.193Slukem.endif 3401.193Slukem.endif 3411.232Slukem ${MAKEDIRTARGET} distrib/sets installsets \ 3421.282Sjym INSTALLDIR=${INSTALLWORLDDIR:U/} INSTALLSETS=${INSTALLSETS:Q} 3431.232Slukem ${MAKEDIRTARGET} . postinstall-check DESTDIR=${INSTALLWORLDDIR} 3441.193Slukem @echo "make ${.TARGET} started at: ${START_TIME}" 3451.193Slukem @printf "make ${.TARGET} finished at: " && date 3461.199Slukem 3471.199Slukem# 3481.287Sjmcneill# Install modules from $DESTDIR to $INSTALLMODULESDIR 3491.287Sjmcneill# 3501.287Sjmcneillinstallmodules: .PHONY .MAKE 3511.287Sjmcneill.if (!defined(DESTDIR) || ${DESTDIR} == "" || ${DESTDIR} == "/") 3521.287Sjmcneill @echo "Can't make ${.TARGET} to DESTDIR=/" 3531.287Sjmcneill @false 3541.287Sjmcneill.endif 3551.287Sjmcneill.if !defined(INSTALLMODULESDIR) || \ 3561.287Sjmcneill ${INSTALLMODULESDIR} == "" || ${INSTALLMODULESDIR} == "/" 3571.287Sjmcneill.if (${HOST_UNAME_S} != "NetBSD") 3581.287Sjmcneill @echo "Won't cross-make ${.TARGET} from ${HOST_UNAME_S} to NetBSD with INSTALLMODULESDIR=/" 3591.287Sjmcneill @false 3601.287Sjmcneill.endif 3611.287Sjmcneill.if (${HOST_UNAME_M} != ${MACHINE}) 3621.287Sjmcneill @echo "Won't cross-make ${.TARGET} from ${HOST_UNAME_M} to ${MACHINE} with INSTALLMODULESDIR=/" 3631.287Sjmcneill @false 3641.287Sjmcneill.endif 3651.287Sjmcneill.endif 3661.288Sjmcneill ${MAKEDIRTARGET} sys/modules install DESTDIR=${INSTALLMODULESDIR:U/} 3671.287Sjmcneill @echo "make ${.TARGET} started at: ${START_TIME}" 3681.287Sjmcneill @printf "make ${.TARGET} finished at: " && date 3691.287Sjmcneill 3701.287Sjmcneill# 3711.206Slukem# Create sets from $DESTDIR or $NETBSDSRCDIR into $RELEASEDIR 3721.199Slukem# 3731.199Slukem 3741.241Sapb.for tgt in sets sourcesets syspkgs 3751.242Sdsl${tgt}: .PHONY .MAKE 3761.232Slukem ${MAKEDIRTARGET} distrib/sets ${tgt} 3771.206Slukem.endfor 3781.193Slukem 3791.193Slukem# 3801.240Slukem# Build a release or snapshot (implies "make distribution"). Note that 3811.181Sthorpej# in this case, the set lists will be checked before the tar files 3821.181Sthorpej# are made. 3831.193Slukem# 3841.123Smrg 3851.242Sdslrelease snapshot: .PHONY .MAKE 3861.240Slukem ${MAKEDIRTARGET} . distribution 3871.240Slukem ${MAKEDIRTARGET} etc release DISTRIBUTION_DONE=1 3881.192Slukem @echo "make ${.TARGET} started at: ${START_TIME}" 3891.185Slukem @printf "make ${.TARGET} finished at: " && date 3901.123Smrg 3911.193Slukem# 3921.243Sapb# Create a CD-ROM image. 3931.243Sapb# 3941.243Sapb 3951.243Sapbiso-image: .PHONY 3961.247Sbouyer ${MAKEDIRTARGET} distrib iso_image 3971.243Sapb ${MAKEDIRTARGET} etc iso-image 3981.243Sapb @echo "make ${.TARGET} started at: ${START_TIME}" 3991.243Sapb @printf "make ${.TARGET} finished at: " && date 4001.243Sapb 4011.248Sjnemethiso-image-source: .PHONY 4021.248Sjnemeth ${MAKEDIRTARGET} distrib iso_image CDSOURCE=true 4031.248Sjnemeth ${MAKEDIRTARGET} etc iso-image 4041.248Sjnemeth @echo "make ${.TARGET} started at: ${START_TIME}" 4051.248Sjnemeth @printf "make ${.TARGET} finished at: " && date 4061.248Sjnemeth 4071.243Sapb# 4081.290Stsutsui# Create bootable live images. 4091.290Stsutsui# 4101.290Stsutsui 4111.290Stsutsuilive-image: .PHONY 4121.290Stsutsui ${MAKEDIRTARGET} etc live-image 4131.290Stsutsui @echo "make ${.TARGET} started at: ${START_TIME}" 4141.290Stsutsui @printf "make ${.TARGET} finished at: " && date 4151.290Stsutsui 4161.290Stsutsui# 4171.290Stsutsui# Create bootable installation images. 4181.290Stsutsui# 4191.290Stsutsui 4201.290Stsutsuiinstall-image: .PHONY 4211.290Stsutsui ${MAKEDIRTARGET} etc install-image 4221.290Stsutsui @echo "make ${.TARGET} started at: ${START_TIME}" 4231.290Stsutsui @printf "make ${.TARGET} finished at: " && date 4241.290Stsutsui 4251.290Stsutsui# 4261.137Stv# Special components of the "make build" process. 4271.193Slukem# 4281.156Stv 4291.228Slukemcheck-tools: .PHONY 4301.223Slukem.if ${TOOLCHAIN_MISSING} != "no" && !defined(EXTERNAL_TOOLCHAIN) 4311.187Sthorpej @echo '*** WARNING: Building on MACHINE=${MACHINE} with missing toolchain.' 4321.187Sthorpej @echo '*** May result in a failed build or corrupt binaries!' 4331.187Sthorpej.elif defined(EXTERNAL_TOOLCHAIN) 4341.187Sthorpej @echo '*** Using external toolchain rooted at ${EXTERNAL_TOOLCHAIN}.' 4351.156Stv.endif 4361.173Ssommerfe.if defined(NBUILDJOBS) 4371.173Ssommerfe @echo '*** WARNING: NBUILDJOBS is obsolete; use -j directly instead!' 4381.173Ssommerfe.endif 4391.123Smrg 4401.270Sapb# Delete or sanitise a leftover METALOG from a previous build. 4411.270Sapbclean_METALOG: .PHONY .MAKE 4421.270Sapb.if ${MKUPDATE} != "no" 4431.270Sapb ${MAKEDIRTARGET} distrib/sets clean_METALOG 4441.270Sapb.endif 4451.270Sapb 4461.242Sdsldo-distrib-dirs: .PHONY .MAKE 4471.147Sjmc.if !defined(DESTDIR) || ${DESTDIR} == "" 4481.232Slukem ${MAKEDIRTARGET} etc distrib-dirs DESTDIR=/ 4491.147Sjmc.else 4501.232Slukem ${MAKEDIRTARGET} etc distrib-dirs DESTDIR=${DESTDIR} 4511.147Sjmc.endif 4521.190Slukem 4531.190Slukem.for targ in cleandir obj includes 4541.228Slukemdo-${targ}: .PHONY ${targ} 4551.190Slukem @true 4561.190Slukem.endfor 4571.123Smrg 4581.299Sjoerg.for dir in tools tools/compat 4591.242Sdsldo-${dir:S/\//-/g}: .PHONY .MAKE 4601.137Stv.for targ in dependall install 4611.232Slukem ${MAKEDIRTARGET} ${dir} ${targ} 4621.137Stv.endfor 4631.184Slukem.endfor 4641.184Slukem 4651.299Sjoergdo-lib: .PHONY .MAKE 4661.299Sjoerg ${MAKEDIRTARGET} lib build_install 4671.299Sjoerg 4681.299Sjoergdo-compat-lib: .PHONY .MAKE 4691.299Sjoerg ${MAKEDIRTARGET} compat build_install BOOTSTRAP_SUBDIRS="../../../lib" 4701.276Smrg 4711.261Sapbdo-top-obj: .PHONY .MAKE 4721.261Sapb ${MAKEDIRTARGET} . obj NOSUBDIR= 4731.261Sapb 4741.260Sapbdo-tools-obj: .PHONY .MAKE 4751.260Sapb ${MAKEDIRTARGET} tools obj 4761.260Sapb 4771.242Sdsldo-build: .PHONY .MAKE 4781.154Stv.for targ in dependall install 4791.232Slukem ${MAKEDIRTARGET} . ${targ} BUILD_tools=no BUILD_lib=no 4801.154Stv.endfor 4811.200Slukem 4821.242Sdsldo-x11: .PHONY .MAKE 4831.263Smrg.if ${MKX11} != "no" 4841.263Smrg.if ${X11FLAVOUR} == "Xorg" 4851.254Smrg ${MAKEDIRTARGET} external/mit/xorg build 4861.263Smrg.else 4871.257Slukem ${MAKEDIRTARGET} x11 build 4881.263Smrg.endif 4891.254Smrg.else 4901.263Smrg @echo "MKX11 is not enabled" 4911.257Slukem @false 4921.254Smrg.endif 4931.227Slukem 4941.275Suebayasido-extsrc: .PHONY .MAKE 4951.275Suebayasi.if ${MKEXTSRC} != "no" 4961.275Suebayasi ${MAKEDIRTARGET} extsrc build 4971.275Suebayasi.else 4981.275Suebayasi @echo "MKEXTSRC is not enabled" 4991.275Suebayasi @false 5001.275Suebayasi.endif 5011.275Suebayasi 5021.242Sdsldo-obsolete: .PHONY .MAKE 5031.232Slukem ${MAKEDIRTARGET} etc install-obsolete-lists 5041.87Scjs 5051.193Slukem# 5061.137Stv# Speedup stubs for some subtrees that don't need to run these rules. 5071.137Stv# (Tells <bsd.subdir.mk> not to recurse for them.) 5081.193Slukem# 5091.129Stv 5101.292Sveego.for dir in bin etc distrib games libexec regress sbin usr.bin usr.sbin tools 5111.228Slukemincludes-${dir}: .PHONY 5121.152Stv @true 5131.152Stv.endfor 5141.152Stv.for dir in etc distrib regress 5151.228Slukeminstall-${dir}: .PHONY 5161.152Stv @true 5171.152Stv.endfor 5181.152Stv 5191.193Slukem# 5201.152Stv# XXX this needs to change when distrib Makefiles are recursion compliant 5211.193Slukem# XXX many distrib subdirs need "cd etc && make snap_pre snap_kern" first... 5221.193Slukem# 5231.228Slukemdependall-distrib depend-distrib all-distrib: .PHONY 5241.136Snathanw @true 5251.130Stv 5261.211Slukem.include <bsd.sys.mk> 5271.151Stv.include <bsd.obj.mk> 5281.209Slukem.include <bsd.kernobj.mk> 5291.146Stv.include <bsd.subdir.mk> 5301.144Stv 5311.209Slukem# 5321.209Slukem# Display current make(1) parameters 5331.209Slukem# 5341.300Sapbshow-params: .PHONY .MAKE 5351.232Slukem ${MAKEDIRTARGET} etc params 536