Makefile revision 1.41
11.41Smatt# $NetBSD: Makefile,v 1.41 2002/03/29 05:05:55 matt Exp $ 21.31Stv 31.32Stv# XXX Note: NO_DBSYM is a stopgap temporary variable for use 41.32Stv# with the development of non-NetBSD hosting support. This will go away. 51.1Stv 61.3Stv.include <bsd.own.mk> 71.3Stv 81.24Sthorpej# XXX We can't currently build the toolchain for x86-64. 91.24Sthorpej.if ${MACHINE_ARCH} != "x86_64" 101.31StvTOOLCHAIN_BITS= toolchain .WAIT ${NO_DBSYM:D:Udbsym} mdsetimage 111.31Stv.endif 121.31Stv 131.16Stv# Dependencies in SUBDIR below ordered to maximize parallel ability. 141.14Stv.if !defined(NOSUBDIR) 151.29StvSUBDIR= host-mkdep .WAIT compat .WAIT \ 161.16Stv binstall .WAIT \ 171.32Stv cap_mkdb crunchgen ctags gencat lint lint2 lorder \ 181.32Stv m4 makewhatis mkdep mtree rpcgen tsort uudecode \ 191.32Stv texinfo .WAIT \ 201.16Stv yacc .WAIT \ 211.16Stv lex .WAIT \ 221.32Stv ${TOOLCHAIN_BITS} \ 231.32Stv asn1_compile compile_et config lint1 \ 241.32Stv makefs menuc mklocale msgc pax pwd_mkdb zic 251.39Stv 261.39Stv.if ${MKMAN} != "no" 271.39StvSUBDIR+= groff 281.39Stv.endif 291.22Stv 301.22Stv.if ${MKMAINTAINERTOOLS:Uno} != "no" 311.38StvSUBDIR+= autoconf gettext 321.25Smrg.endif 331.25Smrg 341.25Smrg.if ${MACHINE} == sparc || ${MACHINE} == sparc64 351.25SmrgSUBDIR+= sparc-installboot 361.41Smatt.endif 371.41Smatt 381.41Smatt.if ${MACHINE_ARCH} == vax 391.41SmattSUBDIR+= vax-installboot 401.22Stv.endif 411.37Sgmcgarry 421.37Sgmcgarry.if (${MACHINE_ARCH} == "mipsel" || ${MACHINE_ARCH} == "mipseb") 431.37SgmcgarrySUBDIR+= mips-elf2ecoff 441.37Sgmcgarry.endif 451.37Sgmcgarry 461.17Stv.endif 471.17Stv 481.18Sjmc.if ${MKTOOLS:Uyes} == "no" || ${USETOOLS} != "yes" 491.17Stvrealall install: _warn 501.19Sjmc.if ${MKTOOLS:Uyes} == "no" 511.17Stv_warn: 521.17Stv @echo '*** WARNING: "MKTOOLS" is set to "no"; this will prevent building and' 531.17Stv @echo '*** updating your host toolchain. This should be used only as a' 541.17Stv @echo '*** temporary workaround for toolchain problems, as it will result' 551.23Swiz @echo '*** in version skew and build errors over time!' 561.18Sjmc.else 571.18Sjmc_warn: 581.18Sjmc.endif 591.17Stv 601.17Stv.for dir in ${SUBDIR:N.WAIT} 611.17Stvall-${dir} depend-${dir} dependall-${dir} install-${dir}: 621.17Stv @true 631.17Stv.endfor 641.14Stv.endif 651.1Stv 661.1Stv.include <bsd.subdir.mk> 671.11Stv.include <bsd.obj.mk> 681.16Stv 691.40Stv# For each .WAIT point, make sure the immediately preceding target is 701.40Stv# installed before building anything after that point. 711.36Spk# 721.36Spk# We use the "internal" targets and dependencies generated by <bsd.subdir.mk> 731.36Spk# to achieve this. These targets look like: 741.36Spk# subdir-all: all-dir1 [.WAIT] all-dir2 etc.. 751.36Spk# subdir-install: install-dir1 [.WAIT] install-dir2 etc.. 761.36Spk# and so on for each element in ${TARGETS}, with .WAIT sources inserted at 771.36Spk# places corresponding to the .WAITs in our $SUBDIR variable. 781.36Spk# 791.36Spk# Also, since we're now mixing `install' with `all' and `depend' targets 801.36Spk# an order relationship between those in each individual subdirectory 811.36Spk# must be established. 821.36Spk# 831.40Stv_deps:= 841.40Stv_prev:= 851.40Stv 861.16Stv.for d in ${SUBDIR} 871.16Stv_this:= ${d} 881.40Stv 891.16Stv.if ${_this} == ".WAIT" 901.36Spk 911.36Spk# setup dependency to apply to all/depend targets in the next group 921.40Stv_deps:= ${_deps} ${_prev:S/^/install-/} 931.40Stv 941.40Stv# if we're building *only* individual targets (i.e. "dependall-yacc"), 951.40Stv# make sure prerequisite tools build before installing 961.40Stv.if !make(all) && !make(dependall) 971.40Stvinstall-${_prev}: dependall-${_prev} 981.40Stv.endif 991.36Spk 1001.16Stv.else 1011.36Spk 1021.36Spk# order depend/all/install targets for ${d} subdir. Note the additional 1031.36Spk# .WAIT to achieve "closure" of the predecessor/successor relationships. 1041.36Spk.ORDER: depend-${d} all-${d} dependall-${d} .WAIT install-${d} 1051.40Stv 1061.40Stv# make all/depend-${d} dependent on list of install targets 1071.40Stvdepend-${d} all-${d} dependall-${d}: ${_deps} 1081.36Spk 1091.16Stv.endif 1101.40Stv 1111.40Stv# stash current name in case the next entry is .WAIT 1121.40Stv_prev:= ${d} 1131.16Stv.endfor 1141.12Stv 1151.12Stvcleantools: 1161.12Stv rm -r -f tools.${HOST_OSTYPE} 117