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