blob: 1cfd33e066e5a2fd24f3e37412952412545302a9 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
|
# $NetBSD: Makefile,v 1.113 2007/01/14 16:17:29 apb Exp $
.include <bsd.own.mk>
.if ${HAVE_GCC} == "4"
TOOLCHAIN_BITS= gmake .WAIT
.endif
.if ${TOOLCHAIN_MISSING} == "no"
TOOLCHAIN_BITS+= binutils .WAIT
TOOLCHAIN_BITS+= gcc
. if ${MKCROSSGDB:Uno} != "no"
TOOLCHAIN_BITS+= gdb
. endif
TOOLCHAIN_BITS+= .WAIT dbsym mdsetimage
# XXX Eventually, we want to be able to build dbsym and mdsetimage
# XXX if EXTERNAL_TOOLCHAIN is set.
.endif
LINT_BITS=
.if ${MKLINT} != "no"
LINT_BITS= lint lint2
.endif
# Dependencies in SUBDIR below ordered to maximize parallel ability.
.if !defined(NOSUBDIR) # {
SUBDIR= host-mkdep .WAIT compat .WAIT \
binstall .WAIT mktemp .WAIT \
cap_mkdb crunchgen ctags genassym gencat hexdump join \
${LINT_BITS} \
lorder m4 makewhatis mkdep mtree rpcgen sed tsort uudecode \
texinfo .WAIT \
yacc .WAIT \
lex .WAIT \
${TOOLCHAIN_BITS} \
asn1_compile cat cksum compile_et config db \
file lint1 \
makefs menuc mkcsmapper mkesdb mklocale mknod msgc \
pax .WAIT \
disklabel .WAIT \
paxctl .WAIT \
fdisk .WAIT \
installboot .WAIT \
pwd_mkdb stat sunlabel zic
.if ${MKMAN} != "no"
SUBDIR+= groff
.endif
.if ${MKMAINTAINERTOOLS:Uno} != "no"
SUBDIR+= autoconf .WAIT gettext
.endif
.if ${MACHINE} == "hp700"
SUBDIR+= hp700-mkboot
.endif
.if ${MACHINE} == "ibmnws"
SUBDIR+= ibmnws-ncdcs
.endif
.if ${MACHINE} == "macppc"
SUBDIR+= macppc-fixcoff
.endif
.if ${MACHINE} == "prep"
SUBDIR+= prep-mkbootimage
.endif
.if (${MACHINE_ARCH} == "mipsel" || ${MACHINE_ARCH} == "mipseb")
SUBDIR+= mips-elf2ecoff
.endif
.if (${MACHINE} == "sgimips")
SUBDIR+= sgivol
.endif
.if ${MACHINE} == "acorn32"
SUBDIR+= sparkcrc
.endif
.if (${MACHINE} == "sparc" || ${MACHINE} == "sparc64")
SUBDIR+= fgen
.endif
.if ${MACHINE} == "bebox"
SUBDIR+= bebox-elf2pef
SUBDIR+= bebox-mkbootimage
.endif
.if ${MACHINE} == "amiga"
SUBDIR+= amiga-elf2bb
SUBDIR+= amiga-txlt
.endif
.if ${MACHINE} == "hp300"
SUBDIR+= hp300-mkboot
.endif
.endif # ! NOSUBDIR # }
check_MKTOOLS: .PHONY .NOTMAIN
.if ${MKTOOLS:Uyes} == "no"
@echo '*** WARNING: "MKTOOLS" is set to "no"; this will prevent building and'
@echo '*** updating your host toolchain. This should be used only as a'
@echo '*** temporary workaround for toolchain problems, as it will result'
@echo '*** in version skew and build errors over time!'
.endif
.if ${MKTOOLS:Uyes} == "no" || ${USETOOLS} != "yes" # {
realall realdepend install: check_MKTOOLS
.for dir in ${SUBDIR:N.WAIT}
all-${dir} depend-${dir} dependall-${dir} install-${dir}:
@true
.endfor
.endif # }
.include <bsd.subdir.mk>
.include <bsd.obj.mk>
.if !defined(PREVIOUSTOOLDIR)
. if exists(PREVIOUSTOOLDIR)
PREVIOUSTOOLDIR!= cat PREVIOUSTOOLDIR
. else
PREVIOUSTOOLDIR=
. endif
.endif
CLEANFILES+= PREVIOUSTOOLDIR
realall realdepend: .MAKE
.if !empty(PREVIOUSTOOLDIR) && "${PREVIOUSTOOLDIR}" != "${TOOLDIR}"
@echo "*** WARNING: TOOLDIR has moved?"
@echo "*** PREVIOUSTOOLDIR '${PREVIOUSTOOLDIR}'"
@echo "*** != TOOLDIR '${TOOLDIR}'"
@echo "*** Cleaning mis-matched tools"
rm -f PREVIOUSTOOLDIR
(cd ${.CURDIR} && ${MAKE} PREVIOUSTOOLDIR=${TOOLDIR} cleandir)
.endif
echo ${TOOLDIR} >PREVIOUSTOOLDIR
# For each .WAIT point, make sure the immediately preceding target is
# installed before building anything after that point.
# (dsl: which means that with: 'a b .WAIT c' the build of 'c' waits for the
# install of 'b', but not the install of 'a'.)
#
# We use the "internal" targets and dependencies generated by <bsd.subdir.mk>
# to achieve this. These targets look like:
# subdir-all: all-dir1 [.WAIT] all-dir2 etc..
# subdir-install: install-dir1 [.WAIT] install-dir2 etc..
# and so on for each element in ${TARGETS}, with .WAIT sources inserted at
# places corresponding to the .WAITs in our $SUBDIR variable.
#
# Also, since we're now mixing `install' with `all' and `depend' targets
# an order relationship between those in each individual subdirectory
# must be established.
#
_deps:=
_prev:=
.for d in ${SUBDIR}
_this:= ${d}
.if ${_this} == ".WAIT"
# setup dependency to apply to all/depend targets in the next group
_deps:= ${_deps} ${_prev:S/^/install-/}
# if we're building *only* individual targets (i.e. "dependall-yacc"),
# make sure prerequisite tools build before installing
# XXX: dsl: this is likely to generate a dependency loop since there is
# a .ORDER releation between the nodes as well.
.if !make(all) && !make(dependall) && !make(install)
install-${_prev}: dependall-${_prev}
.endif
.else
# order depend/all/install targets for ${d} subdir.
.ORDER: depend-${d} all-${d} dependall-${d} install-${d}
# prevent cleandir in real{all,depend} from interfering with subdir makes
.ORDER: realdepend dependall-${d}
.ORDER: realdepend depend-${d}
.ORDER: realall all-${d}
# make all/depend-${d} dependent on list of install targets
depend-${d} all-${d} dependall-${d}: ${_deps}
.endif
# stash current name in case the next entry is .WAIT
_prev:= ${d}
.endfor
cleandir:
rm -f ${CLEANFILES}
|