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