]>
Commit | Line | Data |
---|---|---|
c12d9b4c RP |
1 | ### |
2 | ### Makefile used to three-stage build a tree of source code. Also used to | |
3 | ### compile other bundles, first with cc, then with gcc. | |
4 | ### | |
5 | ||
5ba00487 DZ |
6 | ### |
7 | ### USE OF THIS FILE REQUIRES GNU MAKE!!! | |
8 | ### | |
9 | ||
10 | ### The first versions of the file were written by Rich Pixley ([email protected]). | |
11 | ### Many subsequent additions (and current maintainance by) david d `zoo' zuhn, | |
12 | ### ([email protected]). | |
c12d9b4c RP |
13 | |
14 | ### Every invocation of this Makefile needs to have a variable set (host), | |
15 | ### which is the named used for ./configure, and also the prefix for the | |
16 | ### various files and directories used in a three stage. | |
17 | ||
18 | ifndef host | |
5ba00487 DZ |
19 | error: |
20 | @echo You must set the variable \"host\" to use this Makefile ; exit 1 | |
c12d9b4c RP |
21 | else |
22 | ||
23 | ### from here to very near the end of the file is the real guts of this | |
24 | ### Makefile, and it is not seen if the variable 'host' is not set | |
25 | ||
26 | ### | |
27 | ### START EDITTING HERE!!! | |
28 | ### These things will need to be set differently for each release. | |
29 | ### | |
30 | ||
31 | ### from which cvs tree are we working? | |
8b510607 | 32 | TREE := devo |
c12d9b4c RP |
33 | |
34 | ### binaries should be installed into? | |
35 | ROOTING := /usr/cygnus | |
36 | ||
37 | ### When working from a tagged set of source, this should be the tag. If not, | |
38 | ### then set the macro to be empty. | |
5ba00487 | 39 | CVS_TAG := |
c12d9b4c RP |
40 | |
41 | ### The name of the cvs module for this release. The intersection of | |
42 | ### CVS_MODULE and CVS_TAG defines the source files in this release. | |
5ba00487 | 43 | CVS_MODULE := latest |
c12d9b4c RP |
44 | |
45 | ### Historically, this was identical to CVS_TAG. This is changing. | |
301c3fef | 46 | RELEASE_TAG := latest-930319 |
c12d9b4c RP |
47 | |
48 | ### Historically, binaries were installed here. This is changing. | |
49 | release_root := $(ROOTING)/$(RELEASE_TAG) | |
50 | ||
51 | ### STOP EDITTING HERE!!! | |
52 | ### With luck, eventually, nothing else will need to be editted. | |
53 | ||
5ba00487 | 54 | TIME := time |
301c3fef DZ |
55 | GCC := gcc -O |
56 | GNUC := CC="$(GCC)" | |
5ba00487 DZ |
57 | CFLAGS := -g |
58 | GNU_MAKE := /usr/latest/bin/make -w | |
c12d9b4c | 59 | |
5ba00487 DZ |
60 | override MAKE := make |
61 | override MFLAGS := | |
62 | #override MAKEFLAGS := | |
c12d9b4c | 63 | |
5ba00487 | 64 | SHELL := /bin/sh |
c12d9b4c RP |
65 | |
66 | FLAGS_TO_PASS := \ | |
67 | "GCC=$(GCC)" \ | |
5ba00487 | 68 | "CFLAGS=$(CFLAGS)" \ |
c12d9b4c | 69 | "TIME=$(TIME)" \ |
5ba00487 | 70 | "MF=$(MF)" \ |
12eda620 ILT |
71 | "host=$(host)" \ |
72 | "RELEASE_TAG=$(RELEASE_TAG)" | |
5ba00487 | 73 | |
301482c7 DZ |
74 | ifneq '$(CC)' 'cc' |
75 | FLAGS_TO_PASS := "CC=$(CC)" $(FLAGS_TO_PASS) | |
76 | endif | |
77 | ||
5ba00487 | 78 | |
43ba04b1 | 79 | prefixes = --prefix=$(release_root) --exec-prefix=$(release_root)/H-$(host) |
5ba00487 DZ |
80 | relbindir = $(release_root)/H-$(host)/bin |
81 | ||
12eda620 ILT |
82 | ifeq ($(host),mips-dec-ultrix) |
83 | configargs = -with-gnu-as | |
84 | else | |
85 | configargs = | |
86 | endif | |
c12d9b4c RP |
87 | |
88 | ### general config stuff | |
5ba00487 DZ |
89 | WORKING_DIR := $(host)-objdir |
90 | STAGE1DIR := $(WORKING_DIR).1 | |
91 | STAGE2DIR := $(WORKING_DIR).2 | |
92 | STAGE3DIR := $(WORKING_DIR).3 | |
93 | INPLACEDIR := $(host)-in-place | |
94 | HOLESDIR := $(host)-holes | |
c12d9b4c | 95 | |
301482c7 DZ |
96 | SET_NATIVE_HOLES := SHELL=sh ; PATH=`pwd`/$(HOLESDIR) ; export PATH ; export SHELL ; |
97 | SET_CYGNUS_PATH := SHELL=sh ; PATH=$(relbindir):`pwd`/$(HOLESDIR) ; export PATH ; export SHELL ; | |
98 | SET_LATEST_PATH := SHELL=sh ; PATH=/usr/latest/bin:`pwd`/$(HOLESDIR) ; export PATH ; export SHELL ; | |
41a88234 ILT |
99 | |
100 | ||
101 | ||
c12d9b4c | 102 | .PHONY: all |
5ba00487 DZ |
103 | ifdef target |
104 | ## | |
105 | ## This is a cross compilation | |
106 | ## | |
107 | arch = $(host)-x-$(target) | |
108 | config = $(host) -target=$(target) | |
5ba00487 DZ |
109 | FLAGS_TO_PASS := $(FLAGS_TO_PASS) "target=$(target)" |
110 | ||
111 | all: do-native do-latest | |
112 | build-all: build-native build-latest | |
113 | ||
114 | else | |
115 | ## | |
116 | ## This is a native compilation | |
117 | ## | |
301c3fef DZ |
118 | arch = $(host) |
119 | config = $(host) | |
5ba00487 DZ |
120 | all: $(host)-stamp-3stage-done |
121 | #all: in-place do1 do2 do3 comparison | |
122 | endif | |
123 | ||
301c3fef DZ |
124 | NATIVEDIR := $(arch)-native-objdir |
125 | CYGNUSDIR := $(arch)-cygnus-objdir | |
126 | LATESTDIR := $(arch)-latest-objdir | |
127 | ||
128 | ||
5ba00487 DZ |
129 | everything: do-cross |
130 | #everything: in-place do1 do2 do3 comparison do-cygnus | |
131 | ||
132 | .PHONY: do-native | |
133 | do-native: $(host)-stamp-holes $(arch)-stamp-native | |
134 | do-native-config: $(arch)-stamp-native-configured | |
135 | build-native: $(host)-stamp-holes $(arch)-stamp-native-checked | |
136 | config-native: $(host)-stamp-holes $(arch)-stamp-native-configured | |
137 | ||
41a88234 | 138 | $(arch)-stamp-native: $(host)-stamp-holes |
301482c7 | 139 | $(SET_NATIVE_HOLES) $(TIME) $(GNU_MAKE) -f test-build.mk $(arch)-stamp-native-installed $(FLAGS_TO_PASS) |
5ba00487 DZ |
140 | if [ -f CLEAN_ALL ] ; then rm -rf $(NATIVEDIR) ; else true ; fi |
141 | touch $(arch)-stamp-native | |
142 | ||
41a88234 | 143 | $(arch)-stamp-native-installed: $(host)-stamp-holes $(arch)-stamp-native-checked |
301482c7 DZ |
144 | $(SET_NATIVE_HOLES) cd $(NATIVEDIR) ; $(TIME) $(MAKE) $(FLAGS_TO_PASS) install |
145 | $(SET_NATIVE_HOLES) cd $(NATIVEDIR) ; $(TIME) $(MAKE) $(FLAGS_TO_PASS) install-info | |
5ba00487 DZ |
146 | touch $@ |
147 | ||
148 | $(arch)-stamp-native-checked: $(arch)-stamp-native-built | |
149 | # cd $(NATIVEDIR) ; $(TIME) $(MAKE) $(FLAGS_TO_PASS) check | |
150 | touch $@ | |
151 | ||
41a88234 | 152 | $(arch)-stamp-native-built: $(host)-stamp-holes $(arch)-stamp-native-configured |
301482c7 DZ |
153 | $(SET_NATIVE_HOLES) cd $(NATIVEDIR) ; $(TIME) $(MAKE) $(FLAGS_TO_PASS) all |
154 | $(SET_NATIVE_HOLES) cd $(NATIVEDIR) ; $(TIME) $(MAKE) $(FLAGS_TO_PASS) info | |
5ba00487 DZ |
155 | touch $@ |
156 | ||
41a88234 | 157 | $(arch)-stamp-native-configured: $(host)-stamp-holes |
5ba00487 | 158 | [ -d $(NATIVEDIR) ] || mkdir $(NATIVEDIR) |
12eda620 | 159 | $(SET_NATIVE_HOLES) cd $(NATIVEDIR) ; $(TIME) ../$(TREE)/configure $(config) -v --srcdir=../$(TREE) $(prefixes) $(configargs) |
5ba00487 DZ |
160 | touch $@ |
161 | ||
162 | ||
163 | .PHONY: do-cygnus | |
164 | do-cygnus: $(host)-stamp-holes $(arch)-stamp-cygnus | |
165 | build-cygnus: $(host)-stamp-holes $(arch)-stamp-cygnus-checked | |
166 | config-cygnus: $(host)-stamp-holes $(arch)-stamp-cygnus-configured | |
167 | ||
168 | $(arch)-stamp-cygnus: | |
169 | [ -f $(relbindir)/gcc ] || (echo "must have gcc available"; exit 1) | |
41a88234 | 170 | $(SET_CYGNUS_PATH) $(TIME) $(GNU_MAKE) -f test-build.mk $(arch)-stamp-cygnus-installed $(FLAGS_TO_PASS) |
5ba00487 DZ |
171 | if [ -f CLEAN_ALL ] ; then rm -rf $(CYGNUSDIR) ; else true ; fi |
172 | touch $(arch)-stamp-cygnus | |
173 | ||
41a88234 ILT |
174 | $(arch)-stamp-cygnus-installed: $(host)-stamp-holes $(arch)-stamp-cygnus-checked |
175 | $(SET_CYGNUS_PATH) cd $(CYGNUSDIR) ; $(TIME) $(MAKE) $(FLAGS_TO_PASS) $(GNUC) install | |
176 | $(SET_CYGNUS_PATH) cd $(CYGNUSDIR) ; $(TIME) $(MAKE) $(FLAGS_TO_PASS) $(GNUC) install-info | |
5ba00487 DZ |
177 | touch $@ |
178 | ||
41a88234 | 179 | $(arch)-stamp-cygnus-checked: $(host)-stamp-holes $(arch)-stamp-cygnus-built |
5ba00487 DZ |
180 | # cd $(CYGNUSDIR) ; $(TIME) $(MAKE) $(FLAGS_TO_PASS) $(GNUC) check |
181 | touch $@ | |
182 | ||
41a88234 ILT |
183 | $(arch)-stamp-cygnus-built: $(host)-stamp-holes $(arch)-stamp-cygnus-configured |
184 | $(SET_CYGNUS_PATH) cd $(CYGNUSDIR) ; $(TIME) $(MAKE) $(FLAGS_TO_PASS) $(GNUC) all | |
185 | $(SET_CYGNUS_PATH) cd $(CYGNUSDIR) ; $(TIME) $(MAKE) $(FLAGS_TO_PASS) $(GNUC) info | |
5ba00487 DZ |
186 | touch $@ |
187 | ||
41a88234 | 188 | $(arch)-stamp-cygnus-configured: $(host)-stamp-holes |
5ba00487 | 189 | [ -d $(CYGNUSDIR) ] || mkdir $(CYGNUSDIR) |
12eda620 | 190 | $(SET_CYGNUS_PATH) cd $(CYGNUSDIR) ; $(GNUC) $(TIME) ../$(TREE)/configure $(config) -v --srcdir=../$(TREE) $(prefixes) $(configargs) |
5ba00487 DZ |
191 | touch $@ |
192 | ||
193 | .PHONY: do-latest | |
194 | do-latest: $(host)-stamp-holes $(arch)-stamp-latest | |
195 | build-latest: $(host)-stamp-holes $(arch)-stamp-latest-checked | |
196 | ||
197 | $(arch)-stamp-latest: | |
41a88234 | 198 | $(SET_LATEST_PATH) $(TIME) $(GNU_MAKE) -f test-build.mk $(arch)-stamp-latest-installed $(FLAGS_TO_PASS) |
5ba00487 DZ |
199 | touch $(arch)-stamp-latest |
200 | ||
301c3fef | 201 | |
41a88234 ILT |
202 | $(SET_LATEST_PATH) cd $(LATESTDIR) ; $(TIME) $(MAKE) $(FLAGS_TO_PASS) $(GNUC) install |
203 | $(SET_LATEST_PATH) cd $(LATESTDIR) ; $(TIME) $(MAKE) $(FLAGS_TO_PASS) $(GNUC) install-info | |
5ba00487 DZ |
204 | touch $@ |
205 | ||
206 | $(arch)-stamp-latest-checked: $(arch)-stamp-latest-built | |
41a88234 | 207 | # $(SET_LATEST_PATH) cd $(LATESTDIR) ; $(TIME) $(MAKE) $(FLAGS_TO_PASS) $(GNUC) check |
5ba00487 DZ |
208 | touch $@ |
209 | ||
210 | $(arch)-stamp-latest-built: $(arch)-stamp-latest-configured | |
41a88234 ILT |
211 | $(SET_LATEST_PATH) cd $(LATESTDIR) ; $(TIME) $(MAKE) $(FLAGS_TO_PASS) $(GNUC) all |
212 | $(SET_LATEST_PATH) cd $(LATESTDIR) ; $(TIME) $(MAKE) $(FLAGS_TO_PASS) $(GNUC) info | |
5ba00487 DZ |
213 | touch $@ |
214 | ||
215 | $(arch)-stamp-latest-configured: | |
216 | [ -d $(LATESTDIR) ] || mkdir $(LATESTDIR) | |
12eda620 | 217 | $(SET_LATEST_PATH) cd $(LATESTDIR) ; $(GNUC) $(TIME) ../$(TREE)/configure $(config) -v --srcdir=../$(TREE) $(prefixes) $(configargs) |
5ba00487 DZ |
218 | touch $@ |
219 | ||
7bea9148 RP |
220 | |
221 | .PHONY: in-place | |
222 | in-place: $(host)-stamp-in-place | |
223 | ||
5ba00487 | 224 | $(host)-stamp-in-place: |
7bea9148 | 225 | PATH=/bin:/usr/bin:/usr/ucb ; \ |
5ba00487 DZ |
226 | export PATH ; \ |
227 | SHELL=/bin/sh ; export SHELL ; \ | |
228 | $(TIME) $(GNU_MAKE) -f test-build.mk $(host)-stamp-in-place-installed host=$(host) $(FLAGS_TO_PASS) | |
7bea9148 | 229 | touch $@ |
5ba00487 DZ |
230 | if [ -f CLEAN_ALL ] ; then \ |
231 | rm -rf $(INPLACEDIR) ; \ | |
232 | else \ | |
233 | mv $(INPLACEDIR) $(STAGE1DIR) ; \ | |
234 | fi | |
7bea9148 RP |
235 | |
236 | $(host)-stamp-in-place-installed: $(host)-stamp-in-place-checked | |
41a88234 ILT |
237 | cd $(INPLACEDIR) ; $(TIME) $(MAKE) $(FLAGS_TO_PASS) "CFLAGS=$(CFLAGS)" install host=$(host) |
238 | cd $(INPLACEDIR) ; $(TIME) $(MAKE) $(FLAGS_TO_PASS) "CFLAGS=$(CFLAGS)" install-info host=$(host) | |
7bea9148 RP |
239 | touch $@ |
240 | ||
241 | $(host)-stamp-in-place-checked: $(host)-stamp-in-place-built | |
41a88234 | 242 | # cd $(INPLACEDIR) ; $(TIME) $(MAKE) $(FLAGS_TO_PASS) "CFLAGS=$(CFLAGS)" check host=$(host) |
7bea9148 RP |
243 | touch $@ |
244 | ||
245 | $(host)-stamp-in-place-built: $(host)-stamp-in-place-configured | |
41a88234 ILT |
246 | cd $(INPLACEDIR) ; $(TIME) $(MAKE) $(FLAGS_TO_PASS) "CFLAGS=$(CFLAGS)" all host=$(host) |
247 | cd $(INPLACEDIR) ; $(TIME) $(MAKE) $(FLAGS_TO_PASS) "CFLAGS=$(CFLAGS)" info host=$(host) | |
7bea9148 RP |
248 | touch $@ |
249 | ||
250 | $(host)-stamp-in-place-configured: $(host)-stamp-in-place-cp | |
12eda620 | 251 | cd $(INPLACEDIR) ; $(TIME) ./configure $(host) -v $(prefixes) $(configargs) |
7bea9148 RP |
252 | touch $@ |
253 | ||
254 | $(host)-stamp-in-place-cp: | |
255 | rm -rf $(INPLACEDIR) | |
256 | mkdir $(INPLACEDIR) | |
257 | (cd $(TREE) ; tar cf - .) | (cd $(INPLACEDIR) ; tar xf -) | |
258 | touch $@ | |
c12d9b4c | 259 | |
5ba00487 DZ |
260 | $(host)-stamp-3stage-done: do1 do2 do3 comparison |
261 | touch $@ | |
262 | ||
263 | ||
c12d9b4c | 264 | .PHONY: do1 |
41a88234 ILT |
265 | do1: $(host)-stamp-holes $(host)-stamp-stage1 |
266 | do1-config: $(host)-stamp-holes $(host)-stamp-stage1-configured | |
267 | do1-build: $(host)-stamp-holes $(host)-stamp-stage1-checked | |
c12d9b4c RP |
268 | |
269 | $(host)-stamp-stage1: | |
270 | if [ -d $(STAGE1DIR) ] ; then \ | |
271 | mv $(STAGE1DIR) $(WORKING_DIR) ; \ | |
272 | else \ | |
273 | true ; \ | |
274 | fi | |
301482c7 | 275 | $(SET_NATIVE_HOLES) $(TIME) $(GNU_MAKE) -f test-build.mk $(FLAGS_TO_PASS) host=$(host) $(host)-stamp-stage1-installed |
7bea9148 | 276 | touch $@ |
5ba00487 DZ |
277 | if [ -f CLEAN_ALL ] ; then \ |
278 | rm -rf $(WORKING_DIR) ; \ | |
279 | else \ | |
280 | mv $(WORKING_DIR) $(STAGE1DIR) ; \ | |
281 | fi | |
c12d9b4c RP |
282 | |
283 | $(host)-stamp-stage1-installed: $(host)-stamp-stage1-checked | |
301482c7 DZ |
284 | $(SET_NATIVE_HOLES) cd $(WORKING_DIR) ; $(TIME) $(MAKE) $(FLAGS_TO_PASS) "CFLAGS=$(CFLAGS)" install host=$(host) |
285 | $(SET_NATIVE_HOLES) cd $(WORKING_DIR) ; $(TIME) $(MAKE) $(FLAGS_TO_PASS) "CFLAGS=$(CFLAGS)" install-info host=$(host) | |
fdfa2371 DZ |
286 | ifeq ($(host),rs6000-ibm-aix) |
287 | rm $(relbindir)/make | |
288 | endif | |
c12d9b4c RP |
289 | touch $@ |
290 | ||
291 | $(host)-stamp-stage1-checked: $(host)-stamp-stage1-built | |
301482c7 | 292 | # $(SET_NATIVE_HOLES) cd $(WORKING_DIR) ; $(TIME) $(MAKE) $(FLAGS_TO_PASS) "CFLAGS=$(CFLAGS)" check host=$(host) |
c12d9b4c RP |
293 | touch $@ |
294 | ||
295 | $(host)-stamp-stage1-built: $(host)-stamp-stage1-configured | |
301482c7 DZ |
296 | $(SET_NATIVE_HOLES) cd $(WORKING_DIR) ; $(TIME) $(MAKE) $(FLAGS_TO_PASS) "CFLAGS=$(CFLAGS)" all host=$(host) |
297 | $(SET_NATIVE_HOLES) cd $(WORKING_DIR) ; $(TIME) $(MAKE) $(FLAGS_TO_PASS) "CFLAGS=$(CFLAGS)" info host=$(host) | |
c12d9b4c RP |
298 | touch $@ |
299 | ||
300 | $(host)-stamp-stage1-configured: | |
301 | [ -d $(WORKING_DIR) ] || mkdir $(WORKING_DIR) | |
301482c7 | 302 | $(SET_NATIVE_HOLES) cd $(WORKING_DIR) ; \ |
12eda620 | 303 | $(TIME) ../$(TREE)/configure $(host) -v --srcdir=../$(TREE) $(prefixes) $(configargs) |
c12d9b4c RP |
304 | touch $@ |
305 | ||
306 | .PHONY: do2 | |
307 | do2: $(HOLESDIR) $(host)-stamp-stage2 | |
308 | ||
309 | $(host)-stamp-stage2: | |
310 | if [ -d $(STAGE2DIR) ] ; then \ | |
311 | mv $(STAGE2DIR) $(WORKING_DIR) ; \ | |
312 | else \ | |
313 | true ; \ | |
314 | fi | |
41a88234 | 315 | $(SET_CYGNUS_PATH) $(TIME) $(GNU_MAKE) $(FLAGS_TO_PASS) -f test-build.mk -w $(host)-stamp-stage2-installed |
5ba00487 | 316 | mv $(WORKING_DIR) $(STAGE2DIR) |
7bea9148 | 317 | touch $@ |
c12d9b4c | 318 | |
c12d9b4c RP |
319 | |
320 | $(host)-stamp-stage2-installed: $(host)-stamp-stage2-checked | |
41a88234 ILT |
321 | $(SET_CYGNUS_PATH) cd $(WORKING_DIR) ; $(TIME) $(MAKE) -w $(FLAGS_TO_PASS) $(GNUC) "CFLAGS=$(CFLAGS)" install host=$(host) |
322 | $(SET_CYGNUS_PATH) cd $(WORKING_DIR) ; $(TIME) $(MAKE) -w $(FLAGS_TO_PASS) $(GNUC) "CFLAGS=$(CFLAGS)" install-info host=$(host) | |
c12d9b4c RP |
323 | touch $@ |
324 | ||
325 | $(host)-stamp-stage2-checked: $(host)-stamp-stage2-built | |
41a88234 | 326 | # $(SET_CYGNUS_PATH) cd $(WORKING_DIR) ; $(TIME) $(MAKE) -w $(FLAGS_TO_PASS) $(GNUC) "CFLAGS=$(CFLAGS)" check host=$(host) |
c12d9b4c RP |
327 | touch $@ |
328 | ||
329 | $(host)-stamp-stage2-built: $(host)-stamp-stage2-configured | |
41a88234 ILT |
330 | $(SET_CYGNUS_PATH) cd $(WORKING_DIR) ; $(TIME) $(MAKE) -w $(FLAGS_TO_PASS) $(GNUC) "CFLAGS=$(CFLAGS)" all host=$(host) |
331 | $(SET_CYGNUS_PATH) cd $(WORKING_DIR) ; $(TIME) $(MAKE) -w $(FLAGS_TO_PASS) $(GNUC) "CFLAGS=$(CFLAGS)" info host=$(host) | |
c12d9b4c RP |
332 | touch $@ |
333 | ||
334 | $(host)-stamp-stage2-configured: | |
335 | [ -d $(WORKING_DIR) ] || mkdir $(WORKING_DIR) | |
41a88234 | 336 | $(SET_CYGNUS_PATH) cd $(WORKING_DIR) ; \ |
12eda620 | 337 | $(GNUC) $(TIME) ../$(TREE)/configure $(host) -v --srcdir=../$(TREE) $(prefixes) $(configargs) |
c12d9b4c RP |
338 | touch $@ |
339 | ||
340 | .PHONY: do3 | |
341 | do3: $(HOLESDIR) $(host)-stamp-stage3 | |
342 | ||
343 | $(host)-stamp-stage3: | |
5ba00487 DZ |
344 | if [ -d $(STAGE3DIR) ] ; then \ |
345 | mv $(STAGE3DIR) $(WORKING_DIR) ; \ | |
c12d9b4c RP |
346 | else \ |
347 | true ; \ | |
348 | fi | |
41a88234 | 349 | $(SET_CYGNUS_PATH) $(TIME) $(GNU_MAKE) $(FLAGS_TO_PASS) -f test-build.mk -w $(host)-stamp-stage3-checked |
5ba00487 | 350 | mv $(WORKING_DIR) $(STAGE3DIR) |
7bea9148 | 351 | touch $@ |
c12d9b4c | 352 | |
c12d9b4c RP |
353 | |
354 | $(host)-stamp-stage3-installed: $(host)-stamp-stage3-checked | |
41a88234 ILT |
355 | $(SET_CYGNUS_PATH) cd $(WORKING_DIR) ; $(TIME) $(MAKE) -w $(FLAGS_TO_PASS) $(GNUC) "CFLAGS=$(CFLAGS)" install host=$(host) |
356 | $(SET_CYGNUS_PATH) cd $(WORKING_DIR) ; $(TIME) $(MAKE) -w $(FLAGS_TO_PASS) $(GNUC) "CFLAGS=$(CFLAGS)" install-info host=$(host) | |
c12d9b4c RP |
357 | touch $@ |
358 | ||
359 | $(host)-stamp-stage3-checked: $(host)-stamp-stage3-built | |
41a88234 | 360 | # $(SET_CYGNUS_PATH) cd $(WORKING_DIR) ; $(TIME) $(MAKE) -w $(FLAGS_TO_PASS) $(GNUC) "CFLAGS=$(CFLAGS)" check host=$(host) |
c12d9b4c RP |
361 | touch $@ |
362 | ||
363 | $(host)-stamp-stage3-built: $(host)-stamp-stage3-configured | |
41a88234 ILT |
364 | $(SET_CYGNUS_PATH) cd $(WORKING_DIR) ; $(TIME) $(MAKE) -w $(FLAGS_TO_PASS) $(GNUC) "CFLAGS=$(CFLAGS)" all host=$(host) |
365 | $(SET_CYGNUS_PATH) cd $(WORKING_DIR) ; $(TIME) $(MAKE) -w $(FLAGS_TO_PASS) $(GNUC) "CFLAGS=$(CFLAGS)" info host=$(host) | |
c12d9b4c RP |
366 | touch $@ |
367 | ||
368 | $(host)-stamp-stage3-configured: | |
369 | [ -d $(WORKING_DIR) ] || mkdir $(WORKING_DIR) | |
41a88234 | 370 | $(SET_CYGNUS_PATH) cd $(WORKING_DIR) ; \ |
12eda620 | 371 | $(GNUC) $(TIME) ../$(TREE)/configure $(host) -v --srcdir=../$(TREE) $(prefixes) $(configargs) |
c12d9b4c RP |
372 | touch $@ |
373 | ||
374 | # These things are needed by a three-stage, but are not included locally. | |
375 | ||
376 | HOLES := \ | |
377 | [ \ | |
378 | ar \ | |
379 | as \ | |
380 | awk \ | |
381 | basename \ | |
382 | cat \ | |
383 | cc \ | |
384 | chmod \ | |
385 | cmp \ | |
386 | cp \ | |
41a88234 | 387 | cpio \ |
c12d9b4c RP |
388 | date \ |
389 | diff \ | |
390 | echo \ | |
391 | egrep \ | |
392 | ex \ | |
393 | expr \ | |
301482c7 | 394 | false \ |
c12d9b4c RP |
395 | find \ |
396 | grep \ | |
5ba00487 | 397 | head \ |
c12d9b4c RP |
398 | hostname \ |
399 | install \ | |
400 | ld \ | |
401 | lex \ | |
402 | ln \ | |
403 | ls \ | |
404 | make \ | |
405 | mkdir \ | |
406 | mv \ | |
407 | nm \ | |
408 | pwd \ | |
409 | ranlib \ | |
410 | rm \ | |
411 | rmdir \ | |
412 | sed \ | |
413 | sh \ | |
414 | sort \ | |
41a88234 | 415 | tar \ |
c12d9b4c RP |
416 | test \ |
417 | time \ | |
418 | touch \ | |
419 | tr \ | |
420 | true \ | |
41a88234 | 421 | uudecode \ |
40a75cc7 | 422 | wc \ |
c12d9b4c RP |
423 | whoami |
424 | ||
425 | ### so far only sun make supports VPATH | |
426 | ifeq ($(subst sun3,sun4,$(host)),sun4) | |
427 | MAKE_HOLE := | |
428 | else | |
429 | MAKE_HOLE := make | |
430 | endif | |
431 | ||
5ba00487 DZ |
432 | ### solaris 2 -- don't use /usr/ucb/cc |
433 | ifeq (sparc-sun-solaris2,$(host)) | |
301482c7 | 434 | SET_NATIVE_HOLES := SHELL=sh ; PATH=/opt/SUNWspro/bin:`pwd`/$(HOLESDIR) ; export PATH ; export SHELL ; |
af5874bd | 435 | HOLE_DIRS := /usr/ccs/bin |
301c3fef DZ |
436 | CC_HOLE := |
437 | NUKEM := cc | |
5ba00487 DZ |
438 | endif |
439 | ||
c12d9b4c RP |
440 | ### These things are also needed by a three-stage, but in this case, the GNU version of the tool is required. |
441 | PARTIAL_HOLES := \ | |
c12d9b4c | 442 | $(MAKE_HOLE) \ |
5ba00487 | 443 | $(CC_HOLE) \ |
c12d9b4c RP |
444 | flex \ |
445 | m4 | |
446 | ||
447 | ### look in these directories for things missing from a three-stage | |
448 | HOLE_DIRS := \ | |
fdfa2371 | 449 | $(HOLE_DIRS) \ |
c12d9b4c RP |
450 | /bin \ |
451 | /usr/bin \ | |
452 | /usr/ucb \ | |
453 | /usr/unsupported/bin | |
454 | ||
455 | ### look in these directories for alternate versions of some tools. | |
456 | PARTIAL_HOLE_DIRS := \ | |
457 | /usr/latest/bin \ | |
458 | /usr/progressive/bin \ | |
fdfa2371 | 459 | $(PARTIAL_HOLE_DIRS) \ |
c12d9b4c RP |
460 | /usr/vintage/bin \ |
461 | /usr/unsupported/bin | |
462 | ||
463 | $(HOLESDIR): $(host)-stamp-holes | |
464 | ||
465 | $(host)-stamp-holes: | |
466 | -rm -rf $(HOLESDIR) | |
467 | -mkdir $(HOLESDIR) | |
5ba00487 | 468 | @for i in $(HOLES) ; do \ |
c12d9b4c RP |
469 | found= ; \ |
470 | for j in $(HOLE_DIRS) ; do \ | |
471 | if [ -x $$j/$$i ] ; then \ | |
21412832 | 472 | ln -s $$j/$$i $(HOLESDIR) || cp $$j/$$i $(HOLESDIR) ; \ |
c12d9b4c RP |
473 | echo $$i from $$j ; \ |
474 | found=t ; \ | |
475 | break ; \ | |
476 | fi ; \ | |
477 | done ; \ | |
478 | case "$$found" in \ | |
479 | t) ;; \ | |
480 | *) echo $$i is NOT found ;; \ | |
481 | esac ; \ | |
482 | done | |
5ba00487 | 483 | @for i in $(PARTIAL_HOLES) ; do \ |
c12d9b4c RP |
484 | found= ; \ |
485 | for j in $(PARTIAL_HOLE_DIRS) ; do \ | |
486 | if [ -x $$j/$$i ] ; then \ | |
487 | rm -f $(HOLESDIR)/$$i ; \ | |
488 | cp $$j/$$i $(HOLESDIR)/$$i || exit 1; \ | |
489 | echo $$i from $$j ; \ | |
490 | found=t ; \ | |
491 | break ; \ | |
492 | fi ; \ | |
493 | done ; \ | |
494 | case "$$found" in \ | |
495 | t) ;; \ | |
496 | *) echo $$i is NOT found ;; \ | |
497 | esac ; \ | |
498 | done | |
301c3fef DZ |
499 | ifdef NUKEM |
500 | cd $(HOLESDIR); rm -f $(NUKEM) | |
501 | endif | |
7bea9148 | 502 | touch $@ |
c12d9b4c RP |
503 | |
504 | .PHONY: comparison | |
5ba00487 DZ |
505 | comparison: $(host)-stamp-3stage-compared |
506 | ||
507 | $(host)-stamp-3stage-compared: | |
508 | rm -f .bad-compare | |
21412832 | 509 | ifeq ($(subst i386-sco3.2v4,mips-sgi-irix4,$(subst rs6000-ibm-aix,mips-sgi-irix4,$(subst mips-dec-ultrix,mips-sgi-irix4,$(host)))),mips-sgi-irix4) |
5ba00487 DZ |
510 | for i in `cd $(STAGE3DIR) ; find . -name \*.o -print` ; do \ |
511 | tail +10c $(STAGE2DIR)/$$i > foo1 ; \ | |
512 | tail +10c $(STAGE3DIR)/$$i > foo2 ; \ | |
513 | if cmp foo1 foo2 ; then \ | |
514 | true ; \ | |
515 | else \ | |
516 | echo $$i ; \ | |
517 | touch .bad-compare ; \ | |
518 | fi ; \ | |
519 | done | |
520 | rm -f foo1 foo2 | |
c12d9b4c | 521 | else |
5ba00487 DZ |
522 | for i in `cd $(STAGE3DIR) ; find . -name \*.o -print` ; do \ |
523 | cmp $(STAGE2DIR)/$$i $(STAGE3DIR)/$$i || touch .bad-compare ; \ | |
524 | done | |
525 | endif | |
526 | if [ -f CLEAN_ALL ] ; then \ | |
527 | rm -rf $(STAGE2DIR) $(STAGE3DIR) ; \ | |
dae8a4cf | 528 | else \ |
5ba00487 DZ |
529 | if [ -f CLEAN_STAGES ] ; then \ |
530 | if [ -f .bad-compare ] ; then \ | |
531 | true ; \ | |
532 | else \ | |
533 | rm -rf $(STAGE1DIR) $(STAGE2DIR) ; \ | |
534 | fi ; \ | |
21412832 | 535 | else true ; \ |
5ba00487 | 536 | fi ; \ |
dae8a4cf | 537 | fi |
5ba00487 | 538 | touch $@ |
c12d9b4c RP |
539 | |
540 | .PHONY: clean | |
541 | clean: | |
7bea9148 | 542 | rm -rf $(HOLESDIR) $(INPLACEDIR) $(WORKING_DIR)* $(host)-stamp-* *~ |
c12d9b4c RP |
543 | |
544 | .PHONY: very | |
545 | very: | |
7bea9148 | 546 | rm -rf $(TREE) |
c12d9b4c RP |
547 | |
548 | force: | |
549 | ||
550 | endif # host | |
551 | ||
552 | ### Local Variables: | |
553 | ### fill-column: 131 | |
554 | ### End: |