Makefile revision 1.37
1# $NetBSD: Makefile,v 1.37 2002/02/23 21:32:27 gmcgarry 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" 10TOOLCHAIN_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) 15SUBDIR= 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 groff \ 22 lex .WAIT \ 23 ${TOOLCHAIN_BITS} \ 24 asn1_compile compile_et config lint1 \ 25 makefs menuc mklocale msgc pax pwd_mkdb zic 26 27.if ${MKMAINTAINERTOOLS:Uno} != "no" 28SUBDIR+= autoconf 29.endif 30 31.if ${MACHINE} == sparc || ${MACHINE} == sparc64 32SUBDIR+= sparc-installboot 33.endif 34 35.if (${MACHINE_ARCH} == "mipsel" || ${MACHINE_ARCH} == "mipseb") 36SUBDIR+= mips-elf2ecoff 37.endif 38 39.endif 40 41.if ${MKTOOLS:Uyes} == "no" || ${USETOOLS} != "yes" 42realall install: _warn 43.if ${MKTOOLS:Uyes} == "no" 44_warn: 45 @echo '*** WARNING: "MKTOOLS" is set to "no"; this will prevent building and' 46 @echo '*** updating your host toolchain. This should be used only as a' 47 @echo '*** temporary workaround for toolchain problems, as it will result' 48 @echo '*** in version skew and build errors over time!' 49.else 50_warn: 51.endif 52 53.for dir in ${SUBDIR:N.WAIT} 54all-${dir} depend-${dir} dependall-${dir} install-${dir}: 55 @true 56.endfor 57.endif 58 59.include <bsd.subdir.mk> 60.include <bsd.obj.mk> 61 62# For each .WAIT point, make sure the previous targets are installed before 63# building a dependent target. 64# 65# We use the "internal" targets and dependencies generated by <bsd.subdir.mk> 66# to achieve this. These targets look like: 67# subdir-all: all-dir1 [.WAIT] all-dir2 etc.. 68# subdir-install: install-dir1 [.WAIT] install-dir2 etc.. 69# and so on for each element in ${TARGETS}, with .WAIT sources inserted at 70# places corresponding to the .WAITs in our $SUBDIR variable. 71# 72# In this Makefile we want additional depencies of the `all-dirN', 73# `depend-dirN' and `dependall-dirN' targets in the Nth ".WAIT group" on all 74# of the `install-dir[N-1]' targets in the previous ".WAIT group". 75# 76# Also, since we're now mixing `install' with `all' and `depend' targets 77# an order relationship between those in each individual subdirectory 78# must be established. 79# 80_dep:= 81_group:= 82.for d in ${SUBDIR} 83_this:= ${d} 84.if ${_this} == ".WAIT" 85 86# setup dependency to apply to all/depend targets in the next group 87_dep:= ${_group:S/^/install-/} 88_group:= 89 90.else 91 92# build the current ".WAIT group" 93_group:= ${_group} ${d} 94# order depend/all/install targets for ${d} subdir. Note the additional 95# .WAIT to achieve "closure" of the predecessor/successor relationships. 96.ORDER: depend-${d} all-${d} dependall-${d} .WAIT install-${d} 97# make all/depend-${d} dependent on all install targets in the previous group 98depend-${d} all-${d} dependall-${d}: ${_dep} 99 100.endif 101.endfor 102 103cleantools: 104 rm -r -f tools.${HOST_OSTYPE} 105