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