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