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