Makefile revision 1.39
11.39Stv#	$NetBSD: Makefile,v 1.39 2002/03/07 18:57:18 tv Exp $
21.31Stv
31.32Stv# XXX Note: NO_DBSYM is a stopgap temporary variable for use
41.32Stv# with the development of non-NetBSD hosting support.  This will go away.
51.1Stv
61.3Stv.include <bsd.own.mk>
71.3Stv
81.24Sthorpej# XXX We can't currently build the toolchain for x86-64.
91.24Sthorpej.if ${MACHINE_ARCH} != "x86_64"
101.31StvTOOLCHAIN_BITS= toolchain .WAIT ${NO_DBSYM:D:Udbsym} mdsetimage
111.31Stv.endif
121.31Stv
131.16Stv# Dependencies in SUBDIR below ordered to maximize parallel ability.
141.14Stv.if !defined(NOSUBDIR)
151.29StvSUBDIR=	host-mkdep .WAIT compat .WAIT \
161.16Stv	binstall .WAIT \
171.32Stv		cap_mkdb crunchgen ctags gencat lint lint2 lorder \
181.32Stv		m4 makewhatis mkdep mtree rpcgen tsort uudecode \
191.32Stv	texinfo .WAIT \
201.16Stv	yacc .WAIT \
211.16Stv	lex .WAIT \
221.32Stv	${TOOLCHAIN_BITS} \
231.32Stv		asn1_compile compile_et config lint1 \
241.32Stv		makefs menuc mklocale msgc pax pwd_mkdb zic
251.39Stv
261.39Stv.if ${MKMAN} != "no"
271.39StvSUBDIR+=	groff
281.39Stv.endif
291.22Stv
301.22Stv.if ${MKMAINTAINERTOOLS:Uno} != "no"
311.38StvSUBDIR+=	autoconf gettext
321.25Smrg.endif
331.25Smrg
341.25Smrg.if ${MACHINE} == sparc || ${MACHINE} == sparc64
351.25SmrgSUBDIR+=	sparc-installboot
361.22Stv.endif
371.37Sgmcgarry
381.37Sgmcgarry.if (${MACHINE_ARCH} == "mipsel" || ${MACHINE_ARCH} == "mipseb")
391.37SgmcgarrySUBDIR+=	mips-elf2ecoff
401.37Sgmcgarry.endif
411.37Sgmcgarry
421.17Stv.endif
431.17Stv
441.18Sjmc.if ${MKTOOLS:Uyes} == "no" || ${USETOOLS} != "yes"
451.17Stvrealall install: _warn
461.19Sjmc.if ${MKTOOLS:Uyes} == "no"
471.17Stv_warn:
481.17Stv	@echo '*** WARNING: "MKTOOLS" is set to "no"; this will prevent building and'
491.17Stv	@echo '*** updating your host toolchain.  This should be used only as a'
501.17Stv	@echo '*** temporary workaround for toolchain problems, as it will result'
511.23Swiz	@echo '*** in version skew and build errors over time!'
521.18Sjmc.else
531.18Sjmc_warn:
541.18Sjmc.endif
551.17Stv
561.17Stv.for dir in ${SUBDIR:N.WAIT}
571.17Stvall-${dir} depend-${dir} dependall-${dir} install-${dir}:
581.17Stv	@true
591.17Stv.endfor
601.14Stv.endif
611.1Stv
621.1Stv.include <bsd.subdir.mk>
631.11Stv.include <bsd.obj.mk>
641.16Stv
651.36Spk# For each .WAIT point, make sure the previous targets are installed before
661.16Stv# building a dependent target.
671.36Spk#
681.36Spk# We use the "internal" targets and dependencies generated by <bsd.subdir.mk>
691.36Spk# to achieve this. These targets look like:
701.36Spk#	subdir-all:	all-dir1     [.WAIT] all-dir2     etc..
711.36Spk#	subdir-install:	install-dir1 [.WAIT] install-dir2 etc..
721.36Spk# and so on for each element in ${TARGETS}, with .WAIT sources inserted at
731.36Spk# places corresponding to the .WAITs in our $SUBDIR variable.
741.36Spk#
751.36Spk# In this Makefile we want additional depencies of the `all-dirN',
761.36Spk# `depend-dirN' and `dependall-dirN' targets in the Nth ".WAIT group" on all
771.36Spk# of the `install-dir[N-1]' targets in the previous ".WAIT group".
781.36Spk#
791.36Spk# Also, since we're now mixing `install' with `all' and `depend' targets
801.36Spk# an order relationship between those in each individual subdirectory
811.36Spk# must be established.
821.36Spk#
831.35Spk_dep:=
841.36Spk_group:=
851.16Stv.for d in ${SUBDIR}
861.16Stv_this:=		${d}
871.16Stv.if ${_this} == ".WAIT"
881.36Spk
891.36Spk# setup dependency to apply to all/depend targets in the next group
901.36Spk_dep:=		${_group:S/^/install-/}
911.36Spk_group:=
921.36Spk
931.16Stv.else
941.36Spk
951.36Spk# build the current ".WAIT group"
961.36Spk_group:=	${_group} ${d}
971.36Spk# order depend/all/install targets for ${d} subdir.  Note the additional
981.36Spk# .WAIT to achieve "closure" of the predecessor/successor relationships.
991.36Spk.ORDER: depend-${d} all-${d} dependall-${d} .WAIT install-${d}
1001.36Spk# make all/depend-${d} dependent on all install targets in the previous group
1011.35Spkdepend-${d} all-${d} dependall-${d}: ${_dep}
1021.36Spk
1031.16Stv.endif
1041.16Stv.endfor
1051.12Stv
1061.12Stvcleantools:
1071.12Stv	rm -r -f tools.${HOST_OSTYPE}
108