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