1 1.37 gmcgarry # $NetBSD: Makefile,v 1.37 2002/02/23 21:32:27 gmcgarry Exp $ 2 1.31 tv 3 1.32 tv # XXX Note: NO_DBSYM is a stopgap temporary variable for use 4 1.32 tv # with the development of non-NetBSD hosting support. This will go away. 5 1.1 tv 6 1.3 tv .include <bsd.own.mk> 7 1.3 tv 8 1.24 thorpej # XXX We can't currently build the toolchain for x86-64. 9 1.24 thorpej .if ${MACHINE_ARCH} != "x86_64" 10 1.31 tv TOOLCHAIN_BITS= toolchain .WAIT ${NO_DBSYM:D:Udbsym} mdsetimage 11 1.31 tv .endif 12 1.31 tv 13 1.16 tv # Dependencies in SUBDIR below ordered to maximize parallel ability. 14 1.14 tv .if !defined(NOSUBDIR) 15 1.29 tv SUBDIR= host-mkdep .WAIT compat .WAIT \ 16 1.16 tv binstall .WAIT \ 17 1.32 tv cap_mkdb crunchgen ctags gencat lint lint2 lorder \ 18 1.32 tv m4 makewhatis mkdep mtree rpcgen tsort uudecode \ 19 1.32 tv texinfo .WAIT \ 20 1.16 tv yacc .WAIT \ 21 1.16 tv groff \ 22 1.16 tv lex .WAIT \ 23 1.32 tv ${TOOLCHAIN_BITS} \ 24 1.32 tv asn1_compile compile_et config lint1 \ 25 1.32 tv makefs menuc mklocale msgc pax pwd_mkdb zic 26 1.22 tv 27 1.22 tv .if ${MKMAINTAINERTOOLS:Uno} != "no" 28 1.32 tv SUBDIR+= autoconf 29 1.25 mrg .endif 30 1.25 mrg 31 1.25 mrg .if ${MACHINE} == sparc || ${MACHINE} == sparc64 32 1.25 mrg SUBDIR+= sparc-installboot 33 1.22 tv .endif 34 1.37 gmcgarry 35 1.37 gmcgarry .if (${MACHINE_ARCH} == "mipsel" || ${MACHINE_ARCH} == "mipseb") 36 1.37 gmcgarry SUBDIR+= mips-elf2ecoff 37 1.37 gmcgarry .endif 38 1.37 gmcgarry 39 1.17 tv .endif 40 1.17 tv 41 1.18 jmc .if ${MKTOOLS:Uyes} == "no" || ${USETOOLS} != "yes" 42 1.17 tv realall install: _warn 43 1.19 jmc .if ${MKTOOLS:Uyes} == "no" 44 1.17 tv _warn: 45 1.17 tv @echo '*** WARNING: "MKTOOLS" is set to "no"; this will prevent building and' 46 1.17 tv @echo '*** updating your host toolchain. This should be used only as a' 47 1.17 tv @echo '*** temporary workaround for toolchain problems, as it will result' 48 1.23 wiz @echo '*** in version skew and build errors over time!' 49 1.18 jmc .else 50 1.18 jmc _warn: 51 1.18 jmc .endif 52 1.17 tv 53 1.17 tv .for dir in ${SUBDIR:N.WAIT} 54 1.17 tv all-${dir} depend-${dir} dependall-${dir} install-${dir}: 55 1.17 tv @true 56 1.17 tv .endfor 57 1.14 tv .endif 58 1.1 tv 59 1.1 tv .include <bsd.subdir.mk> 60 1.11 tv .include <bsd.obj.mk> 61 1.16 tv 62 1.36 pk # For each .WAIT point, make sure the previous targets are installed before 63 1.16 tv # building a dependent target. 64 1.36 pk # 65 1.36 pk # We use the "internal" targets and dependencies generated by <bsd.subdir.mk> 66 1.36 pk # to achieve this. These targets look like: 67 1.36 pk # subdir-all: all-dir1 [.WAIT] all-dir2 etc.. 68 1.36 pk # subdir-install: install-dir1 [.WAIT] install-dir2 etc.. 69 1.36 pk # and so on for each element in ${TARGETS}, with .WAIT sources inserted at 70 1.36 pk # places corresponding to the .WAITs in our $SUBDIR variable. 71 1.36 pk # 72 1.36 pk # In this Makefile we want additional depencies of the `all-dirN', 73 1.36 pk # `depend-dirN' and `dependall-dirN' targets in the Nth ".WAIT group" on all 74 1.36 pk # of the `install-dir[N-1]' targets in the previous ".WAIT group". 75 1.36 pk # 76 1.36 pk # Also, since we're now mixing `install' with `all' and `depend' targets 77 1.36 pk # an order relationship between those in each individual subdirectory 78 1.36 pk # must be established. 79 1.36 pk # 80 1.35 pk _dep:= 81 1.36 pk _group:= 82 1.16 tv .for d in ${SUBDIR} 83 1.16 tv _this:= ${d} 84 1.16 tv .if ${_this} == ".WAIT" 85 1.36 pk 86 1.36 pk # setup dependency to apply to all/depend targets in the next group 87 1.36 pk _dep:= ${_group:S/^/install-/} 88 1.36 pk _group:= 89 1.36 pk 90 1.16 tv .else 91 1.36 pk 92 1.36 pk # build the current ".WAIT group" 93 1.36 pk _group:= ${_group} ${d} 94 1.36 pk # order depend/all/install targets for ${d} subdir. Note the additional 95 1.36 pk # .WAIT to achieve "closure" of the predecessor/successor relationships. 96 1.36 pk .ORDER: depend-${d} all-${d} dependall-${d} .WAIT install-${d} 97 1.36 pk # make all/depend-${d} dependent on all install targets in the previous group 98 1.35 pk depend-${d} all-${d} dependall-${d}: ${_dep} 99 1.36 pk 100 1.16 tv .endif 101 1.16 tv .endfor 102 1.12 tv 103 1.12 tv cleantools: 104 1.12 tv rm -r -f tools.${HOST_OSTYPE} 105