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