Makefile revision 1.37
11.37Sgmcgarry# $NetBSD: Makefile,v 1.37 2002/02/23 21:32:27 gmcgarry 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 groff \ 221.16Stv lex .WAIT \ 231.32Stv ${TOOLCHAIN_BITS} \ 241.32Stv asn1_compile compile_et config lint1 \ 251.32Stv makefs menuc mklocale msgc pax pwd_mkdb zic 261.22Stv 271.22Stv.if ${MKMAINTAINERTOOLS:Uno} != "no" 281.32StvSUBDIR+= autoconf 291.25Smrg.endif 301.25Smrg 311.25Smrg.if ${MACHINE} == sparc || ${MACHINE} == sparc64 321.25SmrgSUBDIR+= sparc-installboot 331.22Stv.endif 341.37Sgmcgarry 351.37Sgmcgarry.if (${MACHINE_ARCH} == "mipsel" || ${MACHINE_ARCH} == "mipseb") 361.37SgmcgarrySUBDIR+= mips-elf2ecoff 371.37Sgmcgarry.endif 381.37Sgmcgarry 391.17Stv.endif 401.17Stv 411.18Sjmc.if ${MKTOOLS:Uyes} == "no" || ${USETOOLS} != "yes" 421.17Stvrealall install: _warn 431.19Sjmc.if ${MKTOOLS:Uyes} == "no" 441.17Stv_warn: 451.17Stv @echo '*** WARNING: "MKTOOLS" is set to "no"; this will prevent building and' 461.17Stv @echo '*** updating your host toolchain. This should be used only as a' 471.17Stv @echo '*** temporary workaround for toolchain problems, as it will result' 481.23Swiz @echo '*** in version skew and build errors over time!' 491.18Sjmc.else 501.18Sjmc_warn: 511.18Sjmc.endif 521.17Stv 531.17Stv.for dir in ${SUBDIR:N.WAIT} 541.17Stvall-${dir} depend-${dir} dependall-${dir} install-${dir}: 551.17Stv @true 561.17Stv.endfor 571.14Stv.endif 581.1Stv 591.1Stv.include <bsd.subdir.mk> 601.11Stv.include <bsd.obj.mk> 611.16Stv 621.36Spk# For each .WAIT point, make sure the previous targets are installed before 631.16Stv# building a dependent target. 641.36Spk# 651.36Spk# We use the "internal" targets and dependencies generated by <bsd.subdir.mk> 661.36Spk# to achieve this. These targets look like: 671.36Spk# subdir-all: all-dir1 [.WAIT] all-dir2 etc.. 681.36Spk# subdir-install: install-dir1 [.WAIT] install-dir2 etc.. 691.36Spk# and so on for each element in ${TARGETS}, with .WAIT sources inserted at 701.36Spk# places corresponding to the .WAITs in our $SUBDIR variable. 711.36Spk# 721.36Spk# In this Makefile we want additional depencies of the `all-dirN', 731.36Spk# `depend-dirN' and `dependall-dirN' targets in the Nth ".WAIT group" on all 741.36Spk# of the `install-dir[N-1]' targets in the previous ".WAIT group". 751.36Spk# 761.36Spk# Also, since we're now mixing `install' with `all' and `depend' targets 771.36Spk# an order relationship between those in each individual subdirectory 781.36Spk# must be established. 791.36Spk# 801.35Spk_dep:= 811.36Spk_group:= 821.16Stv.for d in ${SUBDIR} 831.16Stv_this:= ${d} 841.16Stv.if ${_this} == ".WAIT" 851.36Spk 861.36Spk# setup dependency to apply to all/depend targets in the next group 871.36Spk_dep:= ${_group:S/^/install-/} 881.36Spk_group:= 891.36Spk 901.16Stv.else 911.36Spk 921.36Spk# build the current ".WAIT group" 931.36Spk_group:= ${_group} ${d} 941.36Spk# order depend/all/install targets for ${d} subdir. Note the additional 951.36Spk# .WAIT to achieve "closure" of the predecessor/successor relationships. 961.36Spk.ORDER: depend-${d} all-${d} dependall-${d} .WAIT install-${d} 971.36Spk# make all/depend-${d} dependent on all install targets in the previous group 981.35Spkdepend-${d} all-${d} dependall-${d}: ${_dep} 991.36Spk 1001.16Stv.endif 1011.16Stv.endfor 1021.12Stv 1031.12Stvcleantools: 1041.12Stv rm -r -f tools.${HOST_OSTYPE} 105