Makefile revision 1.36
11.36Spk#	$NetBSD: Makefile,v 1.36 2002/02/18 15:35:53 pk 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		groff \
221.16Stv	lex .WAIT \
231.32Stv	${TOOLCHAIN_BITS} \
241.32Stv		asn1_compile compile_et config lint1 \
251.32Stv		makefs menuc mklocale msgc pax pwd_mkdb zic
261.22Stv
271.22Stv.if ${MKMAINTAINERTOOLS:Uno} != "no"
281.32StvSUBDIR+=	autoconf
291.25Smrg.endif
301.25Smrg
311.25Smrg.if ${MACHINE} == sparc || ${MACHINE} == sparc64
321.25SmrgSUBDIR+=	sparc-installboot
331.22Stv.endif
341.17Stv.endif
351.17Stv
361.18Sjmc.if ${MKTOOLS:Uyes} == "no" || ${USETOOLS} != "yes"
371.17Stvrealall install: _warn
381.19Sjmc.if ${MKTOOLS:Uyes} == "no"
391.17Stv_warn:
401.17Stv	@echo '*** WARNING: "MKTOOLS" is set to "no"; this will prevent building and'
411.17Stv	@echo '*** updating your host toolchain.  This should be used only as a'
421.17Stv	@echo '*** temporary workaround for toolchain problems, as it will result'
431.23Swiz	@echo '*** in version skew and build errors over time!'
441.18Sjmc.else
451.18Sjmc_warn:
461.18Sjmc.endif
471.17Stv
481.17Stv.for dir in ${SUBDIR:N.WAIT}
491.17Stvall-${dir} depend-${dir} dependall-${dir} install-${dir}:
501.17Stv	@true
511.17Stv.endfor
521.14Stv.endif
531.1Stv
541.1Stv.include <bsd.subdir.mk>
551.11Stv.include <bsd.obj.mk>
561.16Stv
571.36Spk# For each .WAIT point, make sure the previous targets are installed before
581.16Stv# building a dependent target.
591.36Spk#
601.36Spk# We use the "internal" targets and dependencies generated by <bsd.subdir.mk>
611.36Spk# to achieve this. These targets look like:
621.36Spk#	subdir-all:	all-dir1     [.WAIT] all-dir2     etc..
631.36Spk#	subdir-install:	install-dir1 [.WAIT] install-dir2 etc..
641.36Spk# and so on for each element in ${TARGETS}, with .WAIT sources inserted at
651.36Spk# places corresponding to the .WAITs in our $SUBDIR variable.
661.36Spk#
671.36Spk# In this Makefile we want additional depencies of the `all-dirN',
681.36Spk# `depend-dirN' and `dependall-dirN' targets in the Nth ".WAIT group" on all
691.36Spk# of the `install-dir[N-1]' targets in the previous ".WAIT group".
701.36Spk#
711.36Spk# Also, since we're now mixing `install' with `all' and `depend' targets
721.36Spk# an order relationship between those in each individual subdirectory
731.36Spk# must be established.
741.36Spk#
751.35Spk_dep:=
761.36Spk_group:=
771.16Stv.for d in ${SUBDIR}
781.16Stv_this:=		${d}
791.16Stv.if ${_this} == ".WAIT"
801.36Spk
811.36Spk# setup dependency to apply to all/depend targets in the next group
821.36Spk_dep:=		${_group:S/^/install-/}
831.36Spk_group:=
841.36Spk
851.16Stv.else
861.36Spk
871.36Spk# build the current ".WAIT group"
881.36Spk_group:=	${_group} ${d}
891.36Spk# order depend/all/install targets for ${d} subdir.  Note the additional
901.36Spk# .WAIT to achieve "closure" of the predecessor/successor relationships.
911.36Spk.ORDER: depend-${d} all-${d} dependall-${d} .WAIT install-${d}
921.36Spk# make all/depend-${d} dependent on all install targets in the previous group
931.35Spkdepend-${d} all-${d} dependall-${d}: ${_dep}
941.36Spk
951.16Stv.endif
961.16Stv.endfor
971.12Stv
981.12Stvcleantools:
991.12Stv	rm -r -f tools.${HOST_OSTYPE}
100