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