* scripttempl/h8300.sc: Add the "8-bit area" in the upper 256
[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
35eae2d8
ILT
18### The variable target may be set for the target of a cross-compilation.
19
20### The variable build may be to build a tree on a machine other than the host.
21
c12d9b4c 22ifndef host
5ba00487
DZ
23error:
24 @echo You must set the variable \"host\" to use this Makefile ; exit 1
c12d9b4c
RP
25else
26
27### from here to very near the end of the file is the real guts of this
28### Makefile, and it is not seen if the variable 'host' is not set
29
c12d9b4c 30### from which cvs tree are we working?
8b510607 31TREE := devo
c12d9b4c 32
7f0d689a 33include $(TREE)/release-info
c12d9b4c 34
3066e752
KC
35# Set TIME to time to get timings. Not done by default because time
36# ignores the exit status.
37TIME :=
c12d9b4c 38
c8f1aa31 39CONFIG_SHELL :=
1b901645
AMT
40GCC := $(host)-gcc
41GNUCFLAGS := -g -O2
42GNUC := CC="$(GCC)" CFLAGS="$(GNUCFLAGS)"
5ba00487 43CFLAGS := -g
3066e752 44CXXFLAGS := -g -O2
5ba00487 45GNU_MAKE := /usr/latest/bin/make -w
04a59f79 46MAKEINFOFLAGS :=
c12d9b4c 47
c8f1aa31 48override MAKE := make -w
5ba00487
DZ
49override MFLAGS :=
50#override MAKEFLAGS :=
c12d9b4c 51
5ba00487 52SHELL := /bin/sh
c12d9b4c 53
04a59f79
DZ
54ifndef build
55build := $(host)
56endif
57
58ifndef target
59target := $(host)
60endif
61
8456a631
KC
62ifeq ($(patsubst %-lynx,lynx,$(host)),lynx)
63SHELL := /bin/bash
64GNU_MAKE := $(MAKE)
65CONFIG_SHELL := /bin/bash
66endif
67
3066e752
KC
68ifeq ($(patsubst %-m68k-hp-hpux,m68k-hp-hpux,$(host)),m68k-hp-hpux)
69SHELL := /usr/unsupported/bin/bash
70GNU_MAKE := $(MAKE)
71CONFIG_SHELL := /usr/unsupported/bin/bash
72endif
73
04a59f79 74ifneq ($(build),$(host))
35eae2d8
ILT
75
76# We are building on a machine other than the host. We rely upon
77# previously built cross-compilers from the build machine to the host
78# (used to build the executables) and from the build machine to the
79# target (used to build the libraries).
80
81AR := $(host)-ar
82AR_FOR_TARGET := $(target)-ar
83AS := $(host)-as
84AS_FOR_TARGET := $(target)-as
c8f1aa31 85BISON := byacc
35eae2d8
ILT
86CC := $(host)-gcc
87CC_FOR_BUILD := gcc
88CC_FOR_TARGET := $(target)-gcc
1b901645 89CFLAGS := $(GNUCFLAGS)
3066e752
KC
90CXX := $(host)-gcc
91CXX_FOR_TARGET := $(target)-gcc
1b901645 92GCC := $(host)-gcc
35eae2d8
ILT
93GXX := $(host)-g++
94GXX_FOR_TARGET := $(target)-g++
95HOST_PREFIX := $(build)-
96HOST_PREFIX_1 := $(build)-
c8f1aa31 97LEX := flex
35eae2d8 98MAKEINFO := makeinfo
8456a631 99MUNCH_NM := $(host)-nm
35eae2d8
ILT
100NM := $(host)-nm
101NM_FOR_TARGET := $(target)-nm
102RANLIB := $(host)-ranlib
103RANLIB_FOR_TARGET := $(target)-ranlib
c8f1aa31
ME
104YACC := $(BISON)
105
8456a631
KC
106ifeq ($(host),i386-go32)
107MAKEINFOFLAGS = --no-split
c8f1aa31 108endif
35eae2d8
ILT
109
110FLAGS_TO_PASS := \
111 "AR=$(AR)" \
112 "AR_FOR_TARGET=$(AR_FOR_TARGET)" \
113 "AS=$(AS)" \
114 "AS_FOR_TARGET=$(AS_FOR_TARGET)" \
c8f1aa31 115 "BISON=$(BISON)" \
35eae2d8
ILT
116 "CC=$(CC)" \
117 "CC_FOR_BUILD=$(CC_FOR_BUILD)" \
118 "CC_FOR_TARGET=$(CC_FOR_TARGET)" \
119 "CXX=$(CXX)" \
120 "CXX_FOR_TARGET=$(CXX_FOR_TARGET)" \
121 "CFLAGS=$(CFLAGS)" \
04a59f79 122 "CXXFLAGS=$(CXXFLAGS)" \
35eae2d8
ILT
123 "GCC=$(GCC)" \
124 "HOST_PREFIX=$(HOST_PREFIX)" \
125 "HOST_PREFIX_1=$(HOST_PREFIX_1)" \
c8f1aa31 126 "LEX=$(LEX)" \
35eae2d8 127 "MAKEINFO=$(MAKEINFO)" \
04a59f79 128 "MAKEINFOFLAGS=$(MAKEINFOFLAGS)" \
35eae2d8 129 "MF=$(MF)" \
8456a631 130 "MUNCH_NM=$(MUNCH_NM)" \
35eae2d8
ILT
131 "NM=$(NM)" \
132 "NM_FOR_TARGET=$(NM_FOR_TARGET)" \
133 "RANLIB=$(RANLIB)" \
134 "RANLIB_FOR_TARGET=$(RANLIB_FOR_TARGET)" \
135 "RELEASE_TAG=$(RELEASE_TAG)" \
c8f1aa31 136 "RUNTEST=$(relbindir)/runtest" \
fb682d69 137 "SHELL=$(SHELL)" \
35eae2d8 138 "TIME=$(TIME)" \
c8f1aa31 139 "YACC=$(YACC)" \
35eae2d8
ILT
140 "build=$(build)" \
141 "host=$(host)"
142
143# We must pass the build cross host tools in the environment of
144# configure, so that autoconf scripts will run the right programs.
145configenv := AR="$(AR)" CC="$(CC)" RANLIB="$(RANLIB)"
146
147else
148
149# This is a normal build on the host machine.
150
c12d9b4c
RP
151FLAGS_TO_PASS := \
152 "GCC=$(GCC)" \
5ba00487 153 "CFLAGS=$(CFLAGS)" \
04a59f79 154 "CXXFLAGS=$(CXXFLAGS)" \
c12d9b4c 155 "TIME=$(TIME)" \
04a59f79 156 "MAKEINFOFLAGS=$(MAKEINFOFLAGS)" \
5ba00487 157 "MF=$(MF)" \
12eda620 158 "host=$(host)" \
8456a631
KC
159 "RELEASE_TAG=$(RELEASE_TAG)" \
160 "SHELL=$(SHELL)"
5ba00487 161
c8f1aa31
ME
162configenv :=
163
301482c7
DZ
164endif
165
c8f1aa31
ME
166#### we need to change the default C compiler for some hosts
167ifeq ($(host),sparc-sun-solaris2)
168CC := cc -Xs
169endif
170
171ifeq ($(host),mips-sgi-irix4)
60430a46 172CC := cc -cckr -Wf,-XNg1500 -Wf,-XNk1000 -Wf,-XNh2000
c8f1aa31 173endif
35eae2d8 174
3066e752
KC
175ifeq ($(host),hppa1.1-hp-hpux)
176CC := cc -Wp,-H256000
177endif
178
1b901645
AMT
179ifeq ($(host),m68k-hp-hpux)
180CC := cc -Wp,-P,-H256000
181endif
182
3066e752 183ifeq ($(host),mips-mips-riscos5sysv)
c8f1aa31
ME
184CC := cc -non_shared -systype sysv
185endif
186
187ifeq ($(host),mips-dec-ultrix)
188CC := cc -Wf,-XNg1000
189endif
190
191ifeq ($(host),m68k-sun-sunos4.1.1)
192CC := cc -J
193endif
194
1b901645
AMT
195# Support gdbtk everywhere
196configargs = --enable-gdbtk
197
60430a46
JW
198# We want to use stabs for MIPS targets.
199ifeq ($(target),mips-idt-ecoff)
1b901645 200configargs := $(configargs) --with-stabs
60430a46
JW
201endif
202
203ifeq ($(target),mips-dec-ultrix)
1b901645 204configargs := $(configargs) --with-stabs
60430a46
JW
205endif
206
207ifeq ($(target),mips-sgi-irix4)
1b901645 208configargs := $(configargs) --with-stabs
60430a46
JW
209endif
210
1b901645
AMT
211ifeq ($(target),mips-sgi-irix5)
212configargs := $(configargs) --with-stabs
3066e752
KC
213endif
214
1b901645
AMT
215ifeq ($(patsubst alpha-dec-osf%,alpha,$(target)),alpha)
216configargs := $(configargs) --with-stabs
3066e752
KC
217endif
218
60430a46
JW
219# We must use stabs for SVR4 targets.
220ifeq ($(target),i386-sysv4.2)
1b901645 221configargs := $(configargs) --with-stabs
60430a46
JW
222endif
223
c8f1aa31
ME
224ifneq ($(CC), 'cc')
225FLAGS_TO_PASS := "CC=$(CC)" $(FLAGS_TO_PASS)
35eae2d8
ILT
226endif
227
60430a46
JW
228#### and on some, we need CONFIG_SHELL
229ifeq ($(patsubst %-lynxos,lynxos,$(host)),lynxos)
230FLAGS_TO_PASS := "CONFIG_SHELL=$(CONFIG_SHELL)" $(FLAGS_TO_PASS)
231endif
232
35eae2d8 233# These are the prefixes used for Cygnus builds.
43ba04b1 234prefixes = --prefix=$(release_root) --exec-prefix=$(release_root)/H-$(host)
5ba00487 235
c8f1aa31 236relbindir = $(release_root)/H-$(build)/bin
c12d9b4c
RP
237
238### general config stuff
5ba00487
DZ
239WORKING_DIR := $(host)-objdir
240STAGE1DIR := $(WORKING_DIR).1
241STAGE2DIR := $(WORKING_DIR).2
242STAGE3DIR := $(WORKING_DIR).3
c8f1aa31 243STAGE4DIR := $(WORKING_DIR).4
5ba00487 244INPLACEDIR := $(host)-in-place
35eae2d8
ILT
245
246# Arrange to find the needed programs. If we are building on a
247# machine other than the host, we must find the cross-compilers.
248
04a59f79 249ifneq ($(build),$(host))
35eae2d8
ILT
250
251holesys := $(build)
252HOLESSTAMP := $(holesys)-stamp-holes $(build)-x-$(host)-stamp-holes $(build)-x-$(target)-stamp-holes
253HOLESDIR := $(holesys)-holes
254BUILD_HOST_HOLES_DIR := $(build)-x-$(host)-holes
255BUILD_TARGET_HOLES_DIR := $(build)-x-$(target)-holes
256
fb682d69
ME
257SET_NATIVE_HOLES := SHELL=$(SHELL) ; PATH=`pwd`/$(HOLESDIR):`pwd`/$(BUILD_HOST_HOLES_DIR):`pwd`/$(BUILD_TARGET_HOLES_DIR) ; export PATH ; export SHELL ;
258SET_CYGNUS_PATH := SHELL=$(SHELL) ; PATH=`pwd`/$(HOLESDIR):`pwd`/$(BUILD_HOST_HOLES_DIR):`pwd`/$(BUILD_TARGET_HOLES_DIR) ; export PATH ; export SHELL ;
259SET_LATEST_PATH := SHELL=$(SHELL) ; PATH=/usr/latest/bin:`pwd`/$(HOLESDIR):`pwd`/$(BUILD_HOST_HOLES_DIR):`pwd`/$(BUILD_TARGET_HOLES_DIR) ; export PATH ; export SHELL ;
35eae2d8
ILT
260
261else
262
263holesys := $(host)
264HOLESSTAMP := $(holesys)-stamp-holes
265HOLESDIR := $(holesys)-holes
c12d9b4c 266
fb682d69
ME
267SET_NATIVE_HOLES := SHELL=$(SHELL) ; PATH=`pwd`/$(HOLESDIR) ; export PATH ; export SHELL ;
268SET_CYGNUS_PATH := SHELL=$(SHELL) ; PATH=$(relbindir):`pwd`/$(HOLESDIR) ; export PATH ; export SHELL ;
269SET_LATEST_PATH := SHELL=$(SHELL) ; PATH=/usr/latest/bin:`pwd`/$(HOLESDIR) ; export PATH ; export SHELL ;
41a88234 270
35eae2d8 271endif
41a88234 272
c12d9b4c 273.PHONY: all
04a59f79 274ifneq ($(target),$(host))
5ba00487
DZ
275##
276## This is a cross compilation
277##
278arch = $(host)-x-$(target)
35eae2d8 279config = -host=$(host) -target=$(target)
5ba00487
DZ
280FLAGS_TO_PASS := $(FLAGS_TO_PASS) "target=$(target)"
281
3066e752
KC
282ifeq ($(patsubst %-lynx,lynx,$(target)),lynx)
283configargs := $(configargs) --with-headers=/s1/cygnus/dejagnu/$(target)/include \
284 --with-libs=/s1/cygnus/dejagnu/$(target)/lib
285endif
286
287ifeq ($(patsubst %-i386-sysv4.2,i386-sysv4.2,$(target)),i386-sysv4.2)
288configargs := $(configargs) --with-headers=/s1/cygnus/dejagnu/$(target)/include \
289 --with-libs=/s1/cygnus/dejagnu/$(target)/lib
290endif
291
1b901645
AMT
292ifeq ($(patsubst %-i386-netware,i386-netware,$(target)),i386-netware)
293configargs := $(configargs) \
294 --with-headers=/s1/cygnus/dejagnu/$(target)/include \
295 --with-libs=/s1/cygnus/dejagnu/$(target)/lib
296endif
297
3066e752 298ifeq ($(patsubst %-sparc-sun-sunos4.1.3,sparc-sun-sunos4.1.3,$(target)),sparc-sun-sunos4.1.3)
1b901645
AMT
299configargs := $(configargs) \
300 --with-headers=/s1/cygnus/dejagnu/$(target)/include \
301 --with-libs=/s1/cygnus/dejagnu/$(target)/lib
3066e752
KC
302endif
303
304ifeq ($(patsubst %-sparc-sun-solaris2,sparc-sun-solaris2,$(target)),sparc-sun-solaris2)
1b901645
AMT
305configargs := $(configargs) \
306 --with-headers=/s1/cygnus/dejagnu/$(target)/include \
307 --with-libs=/s1/cygnus/dejagnu/$(target)/lib
308endif
309
310ifeq ($(patsubst %-i960-vxworks5.1,i960-vxworks5.1,$(target)),i960-vxworks5.1)
311configargs := $(configargs) \
312 --with-headers=/s1/cygnus/dejagnu/$(target)/include
313endif
314
315ifeq ($(patsubst %-m68k-vxworks5.1,m68k-vxworks5.1,$(target)),m68k-vxworks5.1)
316configargs := $(configargs) \
317 --with-headers=/s1/cygnus/dejagnu/$(target)/include
318endif
319
320ifeq ($(patsubst %-i386-unixware,i386-unixware,$(target)),i386-unixware)
321configargs := $(configargs) \
322 --with-headers=/s1/cygnus/dejagnu/$(target)/include \
323 --with-libs=/s1/cygnus/dejagnu/$(target)/lib
3066e752
KC
324endif
325
04a59f79 326ifneq ($(build),$(host))
35eae2d8
ILT
327all: do-cygnus do-latest
328build-all: build-cygnus build-latest
329else
5ba00487
DZ
330all: do-native do-latest
331build-all: build-native build-latest
35eae2d8
ILT
332endif
333
5ba00487
DZ
334
335else
336##
337## This is a native compilation
338##
301c3fef 339arch = $(host)
35eae2d8 340config = -host=$(host)
04a59f79 341ifneq ($(build),$(host))
35eae2d8
ILT
342all: do-cygnus do-latest
343else
5ba00487 344all: $(host)-stamp-3stage-done
35eae2d8 345endif
5ba00487 346#all: in-place do1 do2 do3 comparison
35eae2d8 347
5ba00487
DZ
348endif
349
301c3fef
DZ
350NATIVEDIR := $(arch)-native-objdir
351CYGNUSDIR := $(arch)-cygnus-objdir
352LATESTDIR := $(arch)-latest-objdir
c8f1aa31 353DOSDIR := dos-x-$(target)-objdir
301c3fef 354
5ba00487
DZ
355everything: do-cross
356#everything: in-place do1 do2 do3 comparison do-cygnus
357
c8f1aa31
ME
358.PHONY: dos
359dos:
360 $(MAKE) -f test-build.mk CFLAGS= build=$(host) host=i386-go32 target=$(target) do-dos
361dos-path:
362 $(MAKE) -f test-build.mk CFLAGS= build=$(host) host=i386-go32 target=$(target) path-dos
363
364.PHONY: do-dos
365do-dos: $(HOLESSTAMP) dos-x-$(target)-stamp-done
366build-dos: $(HOLESSTAMP) dos-x-$(target)-stamp-dos-checked
367config-dos: $(HOLESSTAMP) dos-x-$(target)-stamp-dos-configured
368path-dos:
369 @echo "$(SET_CYGNUS_PATH)"
370
371dos-x-$(target)-stamp-done:
372 [ -f $(relbindir)/$(host)-gcc ] || (echo "must have gcc available"; exit 1)
373 $(SET_CYGNUS_PATH) $(TIME) $(GNU_MAKE) -f test-build.mk dos-x-$(target)-stamp-installed $(FLAGS_TO_PASS)
374 if [ -f CLEAN_ALL -o -f CLEAN_CROSSES ] ; then rm -rf $(DOSDIR) ; else true ; fi
375 touch $@
376
377dos-x-$(target)-stamp-installed: $(HOLESSTAMP) dos-x-$(target)-stamp-intermediate
378 [ -d dos-x-$(target)-installed ] || mkdir dos-x-$(target)-installed
379 $(SET_CYGNUS_PATH) $(TREE)/release/mkdosrel dos-x-$(target)-intermediate \
380 dos-x-$(target)-installed $(target)
381# (cd dos-x-$(target)-installed; find . -print | $(TREE)/release/make8.3)
382 touch $@
383
384dos-x-$(target)-stamp-intermediate: $(HOLESSTAMP) dos-x-$(target)-stamp-dos-checked
385 [ -d dos-x-$(target)-intermediate ] || mkdir dos-x-$(target)-intermediate
386 dir=`pwd` ; export dir ; \
387 $(SET_CYGNUS_PATH) cd $(DOSDIR) ; $(TIME) $(MAKE) $(FLAGS_TO_PASS) $(GNUC) \
388 prefix=$$dir/dos-x-$(target)-intermediate install install-info
389 touch $@
390
391dos-x-$(target)-stamp-dos-checked: $(HOLESSTAMP) dos-x-$(target)-stamp-dos-built
392# cd $(DOSDIR) ; $(TIME) $(MAKE) $(FLAGS_TO_PASS) $(GNUC) check
393 touch $@
394
395dos-x-$(target)-stamp-dos-built: $(HOLESSTAMP) dos-x-$(target)-stamp-dos-configured
396 $(SET_CYGNUS_PATH) cd $(DOSDIR) ; $(TIME) $(MAKE) $(FLAGS_TO_PASS) $(GNUC) all info
397 touch $@
398
399dos-x-$(target)-stamp-dos-configured: $(HOLESSTAMP)
400 [ -d $(DOSDIR) ] || mkdir $(DOSDIR)
401 $(SET_CYGNUS_PATH) cd $(DOSDIR) ; $(GNUC) $(configenv) $(TIME) $(CONFIG_SHELL) \
402 ../$(TREE)/configure $(config) -v --srcdir=../$(TREE) --prefix=/cygnus \
403 --program-transform-name='' $(configargs)
404 touch $@
405
406
407
408
5ba00487 409.PHONY: do-native
35eae2d8 410do-native: $(HOLESSTAMP) $(arch)-stamp-native
5ba00487 411do-native-config: $(arch)-stamp-native-configured
35eae2d8
ILT
412build-native: $(HOLESSTAMP) $(arch)-stamp-native-checked
413config-native: $(HOLESSTAMP) $(arch)-stamp-native-configured
5ba00487 414
35eae2d8 415$(arch)-stamp-native: $(HOLESSTAMP)
301482c7 416 $(SET_NATIVE_HOLES) $(TIME) $(GNU_MAKE) -f test-build.mk $(arch)-stamp-native-installed $(FLAGS_TO_PASS)
c8f1aa31 417 if [ -f CLEAN_ALL -o -f CLEAN_CROSSES ] ; then rm -rf $(NATIVEDIR) ; else true ; fi
5ba00487
DZ
418 touch $(arch)-stamp-native
419
35eae2d8 420$(arch)-stamp-native-installed: $(HOLESSTAMP) $(arch)-stamp-native-checked
301482c7
DZ
421 $(SET_NATIVE_HOLES) cd $(NATIVEDIR) ; $(TIME) $(MAKE) $(FLAGS_TO_PASS) install
422 $(SET_NATIVE_HOLES) cd $(NATIVEDIR) ; $(TIME) $(MAKE) $(FLAGS_TO_PASS) install-info
5ba00487
DZ
423 touch $@
424
425$(arch)-stamp-native-checked: $(arch)-stamp-native-built
426# cd $(NATIVEDIR) ; $(TIME) $(MAKE) $(FLAGS_TO_PASS) check
427 touch $@
428
35eae2d8 429$(arch)-stamp-native-built: $(HOLESSTAMP) $(arch)-stamp-native-configured
301482c7
DZ
430 $(SET_NATIVE_HOLES) cd $(NATIVEDIR) ; $(TIME) $(MAKE) $(FLAGS_TO_PASS) all
431 $(SET_NATIVE_HOLES) cd $(NATIVEDIR) ; $(TIME) $(MAKE) $(FLAGS_TO_PASS) info
5ba00487
DZ
432 touch $@
433
35eae2d8 434$(arch)-stamp-native-configured: $(HOLESSTAMP)
5ba00487 435 [ -d $(NATIVEDIR) ] || mkdir $(NATIVEDIR)
c8f1aa31 436 $(SET_NATIVE_HOLES) cd $(NATIVEDIR) ; $(configenv) CC="$(CC)" $(TIME) $(CONFIG_SHELL) ../$(TREE)/configure $(config) -v --srcdir=../$(TREE) $(prefixes) $(configargs)
5ba00487
DZ
437 touch $@
438
439
440.PHONY: do-cygnus
35eae2d8
ILT
441do-cygnus: $(HOLESSTAMP) $(arch)-stamp-cygnus
442build-cygnus: $(HOLESSTAMP) $(arch)-stamp-cygnus-checked
443config-cygnus: $(HOLESSTAMP) $(arch)-stamp-cygnus-configured
c8f1aa31
ME
444path-cygnus:
445 $(SET_CYGNUS_PATH) echo $$PATH
5ba00487 446
04a59f79
DZ
447vault-cygnus: $(HOLESSTAMP) $(arch)-stamp-cygnus-built
448 $(SET_CYGNUS_PATH) cd $(CYGNUSDIR) ; $(TIME) $(MAKE) $(FLAGS_TO_PASS) $(GNUC) vault-install
449
450
5ba00487 451$(arch)-stamp-cygnus:
04a59f79 452 [ -f $(relbindir)/$(host)-gcc ] || (echo "must have gcc available"; exit 1)
41a88234 453 $(SET_CYGNUS_PATH) $(TIME) $(GNU_MAKE) -f test-build.mk $(arch)-stamp-cygnus-installed $(FLAGS_TO_PASS)
c8f1aa31 454 if [ -f CLEAN_ALL -o -f CLEAN_CROSSES ] ; then rm -rf $(CYGNUSDIR) ; else true ; fi
5ba00487
DZ
455 touch $(arch)-stamp-cygnus
456
35eae2d8 457$(arch)-stamp-cygnus-installed: $(HOLESSTAMP) $(arch)-stamp-cygnus-checked
41a88234
ILT
458 $(SET_CYGNUS_PATH) cd $(CYGNUSDIR) ; $(TIME) $(MAKE) $(FLAGS_TO_PASS) $(GNUC) install
459 $(SET_CYGNUS_PATH) cd $(CYGNUSDIR) ; $(TIME) $(MAKE) $(FLAGS_TO_PASS) $(GNUC) install-info
c8f1aa31
ME
460 if [ -f VAULT-INSTALL ] ; then \
461 $(SET_CYGNUS_PATH) cd $(CYGNUSDIR) ; $(MAKE) $(FLAGS_TO_PASS) $(GNUC) vault-install ; \
60430a46 462 else true ; fi
5ba00487
DZ
463 touch $@
464
35eae2d8 465$(arch)-stamp-cygnus-checked: $(HOLESSTAMP) $(arch)-stamp-cygnus-built
5ba00487
DZ
466# cd $(CYGNUSDIR) ; $(TIME) $(MAKE) $(FLAGS_TO_PASS) $(GNUC) check
467 touch $@
468
35eae2d8 469$(arch)-stamp-cygnus-built: $(HOLESSTAMP) $(arch)-stamp-cygnus-configured
41a88234
ILT
470 $(SET_CYGNUS_PATH) cd $(CYGNUSDIR) ; $(TIME) $(MAKE) $(FLAGS_TO_PASS) $(GNUC) all
471 $(SET_CYGNUS_PATH) cd $(CYGNUSDIR) ; $(TIME) $(MAKE) $(FLAGS_TO_PASS) $(GNUC) info
5ba00487
DZ
472 touch $@
473
35eae2d8 474$(arch)-stamp-cygnus-configured: $(HOLESSTAMP)
5ba00487 475 [ -d $(CYGNUSDIR) ] || mkdir $(CYGNUSDIR)
c8f1aa31 476 $(SET_CYGNUS_PATH) cd $(CYGNUSDIR) ; $(configenv) $(GNUC) $(TIME) $(CONFIG_SHELL) ../$(TREE)/configure $(config) -v --srcdir=../$(TREE) $(prefixes) $(configargs)
5ba00487
DZ
477 touch $@
478
479.PHONY: do-latest
35eae2d8
ILT
480do-latest: $(HOLESSTAMP) $(arch)-stamp-latest
481build-latest: $(HOLESSTAMP) $(arch)-stamp-latest-checked
5ba00487
DZ
482
483$(arch)-stamp-latest:
41a88234 484 $(SET_LATEST_PATH) $(TIME) $(GNU_MAKE) -f test-build.mk $(arch)-stamp-latest-installed $(FLAGS_TO_PASS)
5ba00487
DZ
485 touch $(arch)-stamp-latest
486
35eae2d8 487$(arch)-stamp-latest-installed: $(HOLESSTAMP) $(arch)-stamp-latest-checked
41a88234
ILT
488 $(SET_LATEST_PATH) cd $(LATESTDIR) ; $(TIME) $(MAKE) $(FLAGS_TO_PASS) $(GNUC) install
489 $(SET_LATEST_PATH) cd $(LATESTDIR) ; $(TIME) $(MAKE) $(FLAGS_TO_PASS) $(GNUC) install-info
5ba00487
DZ
490 touch $@
491
492$(arch)-stamp-latest-checked: $(arch)-stamp-latest-built
41a88234 493# $(SET_LATEST_PATH) cd $(LATESTDIR) ; $(TIME) $(MAKE) $(FLAGS_TO_PASS) $(GNUC) check
5ba00487
DZ
494 touch $@
495
496$(arch)-stamp-latest-built: $(arch)-stamp-latest-configured
41a88234
ILT
497 $(SET_LATEST_PATH) cd $(LATESTDIR) ; $(TIME) $(MAKE) $(FLAGS_TO_PASS) $(GNUC) all
498 $(SET_LATEST_PATH) cd $(LATESTDIR) ; $(TIME) $(MAKE) $(FLAGS_TO_PASS) $(GNUC) info
5ba00487
DZ
499 touch $@
500
501$(arch)-stamp-latest-configured:
502 [ -d $(LATESTDIR) ] || mkdir $(LATESTDIR)
c8f1aa31 503 $(SET_LATEST_PATH) cd $(LATESTDIR) ; $(configenv) $(GNUC) $(TIME) $(CONFIG_SHELL) ../$(TREE)/configure $(config) -v --srcdir=../$(TREE) $(prefixes) $(configargs)
5ba00487
DZ
504 touch $@
505
7bea9148
RP
506
507.PHONY: in-place
508in-place: $(host)-stamp-in-place
509
5ba00487 510$(host)-stamp-in-place:
7bea9148 511 PATH=/bin:/usr/bin:/usr/ucb ; \
5ba00487
DZ
512 export PATH ; \
513 SHELL=/bin/sh ; export SHELL ; \
514 $(TIME) $(GNU_MAKE) -f test-build.mk $(host)-stamp-in-place-installed host=$(host) $(FLAGS_TO_PASS)
7bea9148 515 touch $@
5ba00487
DZ
516 if [ -f CLEAN_ALL ] ; then \
517 rm -rf $(INPLACEDIR) ; \
518 else \
519 mv $(INPLACEDIR) $(STAGE1DIR) ; \
520 fi
7bea9148
RP
521
522$(host)-stamp-in-place-installed: $(host)-stamp-in-place-checked
41a88234
ILT
523 cd $(INPLACEDIR) ; $(TIME) $(MAKE) $(FLAGS_TO_PASS) "CFLAGS=$(CFLAGS)" install host=$(host)
524 cd $(INPLACEDIR) ; $(TIME) $(MAKE) $(FLAGS_TO_PASS) "CFLAGS=$(CFLAGS)" install-info host=$(host)
7bea9148
RP
525 touch $@
526
527$(host)-stamp-in-place-checked: $(host)-stamp-in-place-built
41a88234 528# cd $(INPLACEDIR) ; $(TIME) $(MAKE) $(FLAGS_TO_PASS) "CFLAGS=$(CFLAGS)" check host=$(host)
7bea9148
RP
529 touch $@
530
531$(host)-stamp-in-place-built: $(host)-stamp-in-place-configured
41a88234
ILT
532 cd $(INPLACEDIR) ; $(TIME) $(MAKE) $(FLAGS_TO_PASS) "CFLAGS=$(CFLAGS)" all host=$(host)
533 cd $(INPLACEDIR) ; $(TIME) $(MAKE) $(FLAGS_TO_PASS) "CFLAGS=$(CFLAGS)" info host=$(host)
7bea9148
RP
534 touch $@
535
536$(host)-stamp-in-place-configured: $(host)-stamp-in-place-cp
c8f1aa31 537 cd $(INPLACEDIR) ; $(configenv) CC="$(CC)" $(TIME) $(CONFIG_SHELL) ./configure $(config) -v $(prefixes) $(configargs)
7bea9148
RP
538 touch $@
539
540$(host)-stamp-in-place-cp:
541 rm -rf $(INPLACEDIR)
542 mkdir $(INPLACEDIR)
543 (cd $(TREE) ; tar cf - .) | (cd $(INPLACEDIR) ; tar xf -)
544 touch $@
c12d9b4c 545
5ba00487
DZ
546$(host)-stamp-3stage-done: do1 do2 do3 comparison
547 touch $@
548
549
c12d9b4c 550.PHONY: do1
35eae2d8
ILT
551do1: $(HOLESSTAMP) $(host)-stamp-stage1
552do1-config: $(HOLESSTAMP) $(host)-stamp-stage1-configured
553do1-build: $(HOLESSTAMP) $(host)-stamp-stage1-checked
c12d9b4c 554
04a59f79
DZ
555do1-vault: $(HOLESSTAMP) $(host)-stamp-stage1-built
556 if [ -d $(WORKING_DIR).1 ] ; then \
557 $(SET_NATIVE_HOLES) cd $(WORKING_DIR).1 ; $(MAKE) $(FLAGS_TO_PASS) host=$(host) "CFLAGS=$(CFLAGS)" vault-install ; \
558 else \
559 $(SET_NATIVE_HOLES) cd $(WORKING_DIR) ; $(MAKE) $(FLAGS_TO_PASS) host=$(host) "CFLAGS=$(CFLAGS)" vault-install ; \
560 fi
561
c12d9b4c
RP
562$(host)-stamp-stage1:
563 if [ -d $(STAGE1DIR) ] ; then \
564 mv $(STAGE1DIR) $(WORKING_DIR) ; \
565 else \
566 true ; \
567 fi
301482c7 568 $(SET_NATIVE_HOLES) $(TIME) $(GNU_MAKE) -f test-build.mk $(FLAGS_TO_PASS) host=$(host) $(host)-stamp-stage1-installed
7bea9148 569 touch $@
5ba00487
DZ
570 if [ -f CLEAN_ALL ] ; then \
571 rm -rf $(WORKING_DIR) ; \
572 else \
573 mv $(WORKING_DIR) $(STAGE1DIR) ; \
574 fi
c12d9b4c
RP
575
576$(host)-stamp-stage1-installed: $(host)-stamp-stage1-checked
301482c7
DZ
577 $(SET_NATIVE_HOLES) cd $(WORKING_DIR) ; $(TIME) $(MAKE) $(FLAGS_TO_PASS) "CFLAGS=$(CFLAGS)" install host=$(host)
578 $(SET_NATIVE_HOLES) cd $(WORKING_DIR) ; $(TIME) $(MAKE) $(FLAGS_TO_PASS) "CFLAGS=$(CFLAGS)" install-info host=$(host)
fdfa2371 579ifeq ($(host),rs6000-ibm-aix)
35eae2d8 580 -rm $(relbindir)/make
1b901645
AMT
581endif
582ifeq ($(host),rs6000-ibm-aix3.2.5)
583 -rm $(relbindir)/make
fdfa2371 584endif
c12d9b4c
RP
585 touch $@
586
587$(host)-stamp-stage1-checked: $(host)-stamp-stage1-built
301482c7 588# $(SET_NATIVE_HOLES) cd $(WORKING_DIR) ; $(TIME) $(MAKE) $(FLAGS_TO_PASS) "CFLAGS=$(CFLAGS)" check host=$(host)
c12d9b4c
RP
589 touch $@
590
591$(host)-stamp-stage1-built: $(host)-stamp-stage1-configured
301482c7
DZ
592 $(SET_NATIVE_HOLES) cd $(WORKING_DIR) ; $(TIME) $(MAKE) $(FLAGS_TO_PASS) "CFLAGS=$(CFLAGS)" all host=$(host)
593 $(SET_NATIVE_HOLES) cd $(WORKING_DIR) ; $(TIME) $(MAKE) $(FLAGS_TO_PASS) "CFLAGS=$(CFLAGS)" info host=$(host)
c12d9b4c
RP
594 touch $@
595
596$(host)-stamp-stage1-configured:
597 [ -d $(WORKING_DIR) ] || mkdir $(WORKING_DIR)
301482c7 598 $(SET_NATIVE_HOLES) cd $(WORKING_DIR) ; \
c8f1aa31 599 $(configenv) CC="$(CC)" $(TIME) $(CONFIG_SHELL) ../$(TREE)/configure $(config) -v --srcdir=../$(TREE) $(prefixes) $(configargs)
c12d9b4c
RP
600 touch $@
601
602.PHONY: do2
603do2: $(HOLESDIR) $(host)-stamp-stage2
604
04a59f79
DZ
605do2-vault: $(HOLESSTAMP) $(host)-stamp-stage2-built
606 if [ -d $(WORKING_DIR).2 ] ; then \
1b901645 607 $(SET_CYGNUS_PATH) cd $(WORKING_DIR).2 ; $(MAKE) $(FLAGS_TO_PASS) host=$(host) "CFLAGS=$(GNUCFLAGS)" vault-install ; \
04a59f79 608 else \
1b901645 609 $(SET_CYGNUS_PATH) cd $(WORKING_DIR) ; $(MAKE) $(FLAGS_TO_PASS) host=$(host) "CFLAGS=$(GNUCFLAGS)" vault-install ; \
04a59f79
DZ
610 fi
611
612
613
c12d9b4c
RP
614$(host)-stamp-stage2:
615 if [ -d $(STAGE2DIR) ] ; then \
616 mv $(STAGE2DIR) $(WORKING_DIR) ; \
617 else \
618 true ; \
619 fi
41a88234 620 $(SET_CYGNUS_PATH) $(TIME) $(GNU_MAKE) $(FLAGS_TO_PASS) -f test-build.mk -w $(host)-stamp-stage2-installed
5ba00487 621 mv $(WORKING_DIR) $(STAGE2DIR)
7bea9148 622 touch $@
c12d9b4c 623
c12d9b4c 624
3066e752
KC
625# The SunOS make program gets confused when it is deleted while running.
626# The signal handlers return to the wrong place, or something, and the
627# program dumps core. To avoid trouble with installing make over itself,
628# we delete the installed make program.
c12d9b4c 629$(host)-stamp-stage2-installed: $(host)-stamp-stage2-checked
3066e752 630 -rm -f $(relbindir)/make
1b901645
AMT
631 $(SET_CYGNUS_PATH) cd $(WORKING_DIR) ; $(TIME) $(GNU_MAKE) -w $(FLAGS_TO_PASS) $(GNUC) install host=$(host)
632 $(SET_CYGNUS_PATH) cd $(WORKING_DIR) ; $(TIME) $(MAKE) -w $(FLAGS_TO_PASS) $(GNUC) install-info host=$(host)
c12d9b4c
RP
633 touch $@
634
635$(host)-stamp-stage2-checked: $(host)-stamp-stage2-built
1b901645 636# $(SET_CYGNUS_PATH) cd $(WORKING_DIR) ; $(TIME) $(MAKE) -w $(FLAGS_TO_PASS) $(GNUC) check host=$(host)
c12d9b4c
RP
637 touch $@
638
639$(host)-stamp-stage2-built: $(host)-stamp-stage2-configured
1b901645
AMT
640 $(SET_CYGNUS_PATH) cd $(WORKING_DIR) ; $(TIME) $(MAKE) -w $(FLAGS_TO_PASS) $(GNUC) all host=$(host)
641 $(SET_CYGNUS_PATH) cd $(WORKING_DIR) ; $(TIME) $(MAKE) -w $(FLAGS_TO_PASS) $(GNUC) info host=$(host)
c12d9b4c
RP
642 touch $@
643
644$(host)-stamp-stage2-configured:
645 [ -d $(WORKING_DIR) ] || mkdir $(WORKING_DIR)
41a88234 646 $(SET_CYGNUS_PATH) cd $(WORKING_DIR) ; \
c8f1aa31 647 $(configenv) $(GNUC) $(TIME) $(CONFIG_SHELL) ../$(TREE)/configure $(config) -v --srcdir=../$(TREE) $(prefixes) $(configargs)
c12d9b4c
RP
648 touch $@
649
650.PHONY: do3
651do3: $(HOLESDIR) $(host)-stamp-stage3
652
04a59f79
DZ
653do3-vault: $(HOLESSTAMP) $(host)-stamp-stage3-built
654 if [ -d $(WORKING_DIR).3 ] ; then \
1b901645 655 $(SET_CYGNUS_PATH) cd $(WORKING_DIR).3 ; $(MAKE) $(FLAGS_TO_PASS) host=$(host) "CFLAGS=$(GNUCFLAGS)" vault-install ; \
04a59f79 656 else \
1b901645 657 $(SET_CYGNUS_PATH) cd $(WORKING_DIR) ; $(MAKE) $(FLAGS_TO_PASS) host=$(host) "CFLAGS=$(GNUCFLAGS)" vault-install ; \
04a59f79
DZ
658 fi
659
c12d9b4c 660$(host)-stamp-stage3:
5ba00487
DZ
661 if [ -d $(STAGE3DIR) ] ; then \
662 mv $(STAGE3DIR) $(WORKING_DIR) ; \
c12d9b4c
RP
663 else \
664 true ; \
665 fi
c8f1aa31 666 $(SET_CYGNUS_PATH) $(TIME) $(GNU_MAKE) $(FLAGS_TO_PASS) -f test-build.mk -w $(host)-stamp-stage3-installed
5ba00487 667 mv $(WORKING_DIR) $(STAGE3DIR)
7bea9148 668 touch $@
c12d9b4c 669
c12d9b4c 670
3066e752
KC
671# The SunOS make program gets confused when it is deleted while running.
672# The signal handlers return to the wrong place, or something, and the
673# program dumps core. To avoid trouble with installing make over itself,
674# we delete the installed make program.
c12d9b4c 675$(host)-stamp-stage3-installed: $(host)-stamp-stage3-checked
3066e752 676 -rm -f $(relbindir)/make
1b901645
AMT
677 $(SET_CYGNUS_PATH) cd $(WORKING_DIR) ; $(TIME) $(GNU_MAKE) -w $(FLAGS_TO_PASS) $(GNUC) install host=$(host)
678 $(SET_CYGNUS_PATH) cd $(WORKING_DIR) ; $(TIME) $(MAKE) -w $(FLAGS_TO_PASS) $(GNUC) install-info host=$(host)
c8f1aa31
ME
679 if [ -f VAULT-INSTALL ] ; then \
680 $(SET_CYGNUS_PATH) cd $(CYGNUSDIR) ; $(MAKE) $(FLAGS_TO_PASS) $(GNUC) vault-install ; \
60430a46 681 else true ; fi
c12d9b4c
RP
682 touch $@
683
684$(host)-stamp-stage3-checked: $(host)-stamp-stage3-built
1b901645 685# $(SET_CYGNUS_PATH) cd $(WORKING_DIR) ; $(TIME) $(MAKE) -w $(FLAGS_TO_PASS) $(GNUC) check host=$(host)
c12d9b4c
RP
686 touch $@
687
60430a46 688$(host)-check-3stage: $(host)-stamp-stage3
1b901645 689 $(SET_CYGNUS_PATH) cd $(STAGE3DIR) ; $(TIME) $(MAKE) -k -w $(FLAGS_TO_PASS) $(GNUC) check host=$(host)
60430a46
JW
690 touch $@
691
c12d9b4c 692$(host)-stamp-stage3-built: $(host)-stamp-stage3-configured
1b901645
AMT
693 $(SET_CYGNUS_PATH) cd $(WORKING_DIR) ; $(TIME) $(MAKE) -w $(FLAGS_TO_PASS) $(GNUC) all host=$(host)
694 $(SET_CYGNUS_PATH) cd $(WORKING_DIR) ; $(TIME) $(MAKE) -w $(FLAGS_TO_PASS) $(GNUC) info host=$(host)
c12d9b4c
RP
695 touch $@
696
697$(host)-stamp-stage3-configured:
698 [ -d $(WORKING_DIR) ] || mkdir $(WORKING_DIR)
41a88234 699 $(SET_CYGNUS_PATH) cd $(WORKING_DIR) ; \
c8f1aa31
ME
700 $(configenv) $(GNUC) $(TIME) $(CONFIG_SHELL) ../$(TREE)/configure $(config) -v --srcdir=../$(TREE) $(prefixes) $(configargs)
701 touch $@
702
703.PHONY: do4
704do4: $(HOLESDIR) $(host)-stamp-stage4
705
706$(host)-stamp-stage4:
707 if [ -d $(STAGE4DIR) ] ; then \
708 mv $(STAGE4DIR) $(WORKING_DIR) ; \
709 else \
710 true ; \
711 fi
712 $(SET_CYGNUS_PATH) $(TIME) $(GNU_MAKE) $(FLAGS_TO_PASS) -f test-build.mk -w $(host)-stamp-stage4-checked
713 mv $(WORKING_DIR) $(STAGE4DIR)
714 touch $@
715
716
717$(host)-stamp-stage4-installed: $(host)-stamp-stage4-checked
1b901645
AMT
718 $(SET_CYGNUS_PATH) cd $(WORKING_DIR) ; $(TIME) $(MAKE) -w $(FLAGS_TO_PASS) $(GNUC) install host=$(host)
719 $(SET_CYGNUS_PATH) cd $(WORKING_DIR) ; $(TIME) $(MAKE) -w $(FLAGS_TO_PASS) $(GNUC) install-info host=$(host)
c8f1aa31
ME
720 touch $@
721
722$(host)-stamp-stage4-checked: $(host)-stamp-stage4-built
1b901645 723# $(SET_CYGNUS_PATH) cd $(WORKING_DIR) ; $(TIME) $(MAKE) -w $(FLAGS_TO_PASS) $(GNUC) check host=$(host)
c8f1aa31
ME
724 touch $@
725
726$(host)-stamp-stage4-built: $(host)-stamp-stage4-configured
1b901645
AMT
727 $(SET_CYGNUS_PATH) cd $(WORKING_DIR) ; $(TIME) $(MAKE) -w $(FLAGS_TO_PASS) $(GNUC) all host=$(host)
728 $(SET_CYGNUS_PATH) cd $(WORKING_DIR) ; $(TIME) $(MAKE) -w $(FLAGS_TO_PASS) $(GNUC) info host=$(host)
c8f1aa31
ME
729 touch $@
730
731$(host)-stamp-stage4-configured:
732 [ -d $(WORKING_DIR) ] || mkdir $(WORKING_DIR)
733 $(SET_CYGNUS_PATH) cd $(WORKING_DIR) ; \
734 $(configenv) $(GNUC) $(TIME) $(CONFIG_SHELL) ../$(TREE)/configure $(config) -v --srcdir=../$(TREE) $(prefixes) $(configargs)
c12d9b4c
RP
735 touch $@
736
737# These things are needed by a three-stage, but are not included locally.
738
739HOLES := \
740 [ \
741 ar \
742 as \
743 awk \
744 basename \
745 cat \
746 cc \
747 chmod \
04a59f79
DZ
748 chgrp \
749 chown \
c12d9b4c
RP
750 cmp \
751 cp \
41a88234 752 cpio \
c12d9b4c
RP
753 date \
754 diff \
04a59f79 755 dirname \
c12d9b4c
RP
756 echo \
757 egrep \
758 ex \
759 expr \
301482c7 760 false \
c12d9b4c
RP
761 find \
762 grep \
5ba00487 763 head \
c12d9b4c
RP
764 hostname \
765 install \
766 ld \
767 lex \
768 ln \
769 ls \
770 make \
771 mkdir \
772 mv \
773 nm \
774 pwd \
775 ranlib \
776 rm \
777 rmdir \
778 sed \
779 sh \
8456a631 780 sleep \
c12d9b4c 781 sort \
1b901645 782 tail \
41a88234 783 tar \
c12d9b4c
RP
784 test \
785 time \
786 touch \
787 tr \
788 true \
35eae2d8 789 uname \
04a59f79 790 uniq \
1b901645 791 uptime \
41a88234 792 uudecode \
40a75cc7 793 wc \
c12d9b4c
RP
794 whoami
795
796### so far only sun make supports VPATH
35eae2d8 797ifeq ($(subst sun3,sun4,$(holesys)),sun4)
c12d9b4c
RP
798MAKE_HOLE :=
799else
800MAKE_HOLE := make
801endif
802
5ba00487 803### solaris 2 -- don't use /usr/ucb/cc
35eae2d8 804ifeq (sparc-sun-solaris2,$(holesys))
fb682d69 805SET_NATIVE_HOLES := SHELL=$(SHELL) ; PATH=/opt/SUNWspro/bin:`pwd`/$(HOLESDIR) ; export PATH ; export SHELL ;
af5874bd 806HOLE_DIRS := /usr/ccs/bin
301c3fef
DZ
807CC_HOLE :=
808NUKEM := cc
5ba00487
DZ
809endif
810
c8f1aa31
ME
811ifeq ($(host),i386-go32)
812DOS_HOLES := aout2exe doschk file
813endif
814
8456a631
KC
815ifeq ($(host),i386-lynx)
816MAKE_HOLE := make
817endif
818
819ifeq ($(host),m68k-lynx)
820MAKE_HOLE := make
821endif
822
3066e752
KC
823ifeq ($(host),sparc-lynx)
824MAKE_HOLE := make
825endif
826
827ifeq ($(host),rs6000-lynx)
828MAKE_HOLE := make
829endif
830
c12d9b4c
RP
831### These things are also needed by a three-stage, but in this case, the GNU version of the tool is required.
832PARTIAL_HOLES := \
c12d9b4c 833 $(MAKE_HOLE) \
5ba00487 834 $(CC_HOLE) \
c8f1aa31 835 $(DOS_HOLES) \
c12d9b4c
RP
836 flex \
837 m4
838
839### look in these directories for things missing from a three-stage
840HOLE_DIRS := \
fdfa2371 841 $(HOLE_DIRS) \
c12d9b4c
RP
842 /bin \
843 /usr/bin \
844 /usr/ucb \
1b901645 845 /etc /usr/etc \
c12d9b4c
RP
846 /usr/unsupported/bin
847
848### look in these directories for alternate versions of some tools.
849PARTIAL_HOLE_DIRS := \
850 /usr/latest/bin \
851 /usr/progressive/bin \
fdfa2371 852 $(PARTIAL_HOLE_DIRS) \
c12d9b4c 853 /usr/vintage/bin \
8456a631
KC
854 /usr/unsupported/bin \
855 $(HOLE_DIRS)
c12d9b4c 856
35eae2d8 857$(HOLESDIR): $(holesys)-stamp-holes
c12d9b4c 858
35eae2d8 859$(holesys)-stamp-holes:
c12d9b4c
RP
860 -rm -rf $(HOLESDIR)
861 -mkdir $(HOLESDIR)
5ba00487 862 @for i in $(HOLES) ; do \
c12d9b4c
RP
863 found= ; \
864 for j in $(HOLE_DIRS) ; do \
865 if [ -x $$j/$$i ] ; then \
21412832 866 ln -s $$j/$$i $(HOLESDIR) || cp $$j/$$i $(HOLESDIR) ; \
c12d9b4c
RP
867 echo $$i from $$j ; \
868 found=t ; \
869 break ; \
870 fi ; \
871 done ; \
872 case "$$found" in \
873 t) ;; \
874 *) echo $$i is NOT found ;; \
875 esac ; \
876 done
5ba00487 877 @for i in $(PARTIAL_HOLES) ; do \
c12d9b4c
RP
878 found= ; \
879 for j in $(PARTIAL_HOLE_DIRS) ; do \
880 if [ -x $$j/$$i ] ; then \
881 rm -f $(HOLESDIR)/$$i ; \
882 cp $$j/$$i $(HOLESDIR)/$$i || exit 1; \
883 echo $$i from $$j ; \
884 found=t ; \
885 break ; \
886 fi ; \
887 done ; \
888 case "$$found" in \
889 t) ;; \
890 *) echo $$i is NOT found ;; \
891 esac ; \
892 done
301c3fef
DZ
893ifdef NUKEM
894 cd $(HOLESDIR); rm -f $(NUKEM)
895endif
7bea9148 896 touch $@
c12d9b4c 897
35eae2d8
ILT
898# Get the cross-tools for build cross host when not building on the host.
899
900BUILD_HOST_HOLES := \
901 byacc \
902 gcc \
903 makeinfo \
904 $(AR) \
905 $(AS) \
906 $(CC) \
907 $(CXX) \
908 $(GXX) \
909 $(NM) \
910 $(RANLIB)
911
04a59f79 912BUILD_HOLES_DIRS := $(release_root)/H-$(build)/bin $(PARTIAL_HOLE_DIRS)
35eae2d8 913
7f0d689a 914ifdef BUILD_HOST_HOLES_DIR
35eae2d8 915$(BUILD_HOST_HOLES_DIR): $(build)-x-$(host)-stamp-holes
7f0d689a 916endif
35eae2d8 917
04a59f79 918ifneq ($(build),$(host))
35eae2d8
ILT
919$(build)-x-$(host)-stamp-holes:
920 -rm -rf $(BUILD_HOST_HOLES_DIR)
921 -mkdir $(BUILD_HOST_HOLES_DIR)
922 @for i in $(BUILD_HOST_HOLES) ; do \
923 found= ; \
924 for j in $(BUILD_HOLES_DIRS) ; do \
925 if [ -x $$j/$$i ] ; then \
926 ln -s $$j/$$i $(BUILD_HOST_HOLES_DIR) || cp $$j/$$i $(BUILD_HOST_HOLES_DIR) ; \
927 echo $$i from $$j ; \
928 found=t ; \
929 break ; \
930 fi ; \
931 done ; \
932 case "$$found" in \
933 t) ;; \
934 *) echo $$i is NOT found ;; \
935 esac ; \
936 done
937 touch $@
04a59f79 938endif
35eae2d8
ILT
939
940# Get the cross tools for build cross target when not building on the host.
941
942BUILD_TARGET_HOLES := \
943 byacc \
944 gcc \
945 makeinfo \
946 $(AR_FOR_TARGET) \
947 $(AS_FOR_TARGET) \
948 $(CC_FOR_TARGET) \
949 $(CXX_FOR_TARGET) \
950 $(GXX_FOR_TARGET) \
951 $(NM_FOR_TARGET) \
952 $(RANLIB_FOR_TARGET)
953
7f0d689a 954ifdef BUILD_TARGET_HOLES_DIR
35eae2d8 955$(BUILD_TARGET_HOLES_DIR): $(build)-x-$(target)-stamp-holes
7f0d689a 956endif
35eae2d8 957
04a59f79 958ifneq ($(build),$(target))
35eae2d8
ILT
959$(build)-x-$(target)-stamp-holes:
960 -rm -rf $(BUILD_TARGET_HOLES_DIR)
961 -mkdir $(BUILD_TARGET_HOLES_DIR)
962 @for i in $(BUILD_TARGET_HOLES) ; do \
963 found= ; \
964 for j in $(BUILD_HOLES_DIRS) ; do \
965 if [ -x $$j/$$i ] ; then \
966 ln -s $$j/$$i $(BUILD_TARGET_HOLES_DIR) || cp $$j/$$i $(BUILD_TARGET_HOLES_DIR) ; \
967 echo $$i from $$j ; \
968 found=t ; \
969 break ; \
970 fi ; \
971 done ; \
972 case "$$found" in \
973 t) ;; \
974 *) echo $$i is NOT found ;; \
975 esac ; \
976 done
977 touch $@
04a59f79 978endif
35eae2d8 979
c12d9b4c 980.PHONY: comparison
5ba00487 981comparison: $(host)-stamp-3stage-compared
c8f1aa31 982comparison-stage3to4: $(host)-stamp-4stage-compared
5ba00487
DZ
983
984$(host)-stamp-3stage-compared:
985 rm -f .bad-compare
8456a631 986ifeq ($(patsubst %-lynx,mips-sgi-irix4,$(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
987 for i in `cd $(STAGE3DIR) ; find . -name \*.o -print` ; do \
988 tail +10c $(STAGE2DIR)/$$i > foo1 ; \
989 tail +10c $(STAGE3DIR)/$$i > foo2 ; \
990 if cmp foo1 foo2 ; then \
991 true ; \
992 else \
993 echo $$i ; \
994 touch .bad-compare ; \
995 fi ; \
996 done
997 rm -f foo1 foo2
c12d9b4c 998else
5ba00487
DZ
999 for i in `cd $(STAGE3DIR) ; find . -name \*.o -print` ; do \
1000 cmp $(STAGE2DIR)/$$i $(STAGE3DIR)/$$i || touch .bad-compare ; \
1001 done
1002endif
1003 if [ -f CLEAN_ALL ] ; then \
1004 rm -rf $(STAGE2DIR) $(STAGE3DIR) ; \
dae8a4cf 1005 else \
5ba00487
DZ
1006 if [ -f CLEAN_STAGES ] ; then \
1007 if [ -f .bad-compare ] ; then \
1008 true ; \
1009 else \
1010 rm -rf $(STAGE1DIR) $(STAGE2DIR) ; \
1011 fi ; \
21412832 1012 else true ; \
5ba00487 1013 fi ; \
dae8a4cf 1014 fi
5ba00487 1015 touch $@
c12d9b4c 1016
c8f1aa31
ME
1017$(host)-stamp-4stage-compared:
1018 rm -f .bad-compare
8456a631 1019ifeq ($(patsubst %-lynx,mips-sgi-irix4,$(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)
c8f1aa31
ME
1020 for i in `cd $(STAGE4DIR) ; find . -name \*.o -print` ; do \
1021 tail +10c $(STAGE3DIR)/$$i > foo1 ; \
1022 tail +10c $(STAGE4DIR)/$$i > foo2 ; \
1023 if cmp foo1 foo2 ; then \
1024 true ; \
1025 else \
1026 echo $$i ; \
1027 touch .bad-compare ; \
1028 fi ; \
1029 done
1030 rm -f foo1 foo2
1031else
1032 for i in `cd $(STAGE4DIR) ; find . -name \*.o -print` ; do \
1033 cmp $(STAGE3DIR)/$$i $(STAGE4DIR)/$$i || touch .bad-compare ; \
1034 done
1035endif
1036 if [ -f CLEAN_ALL ] ; then \
1037 rm -rf $(STAGE2DIR) $(STAGE3DIR) $(STAGE4DIR) ; \
1038 else \
1039 if [ -f CLEAN_STAGES ] ; then \
1040 if [ -f .bad-compare ] ; then \
1041 true ; \
1042 else \
1043 rm -rf $(STAGE1DIR) $(STAGE2DIR) $(STAGE3DIR) ; \
1044 fi ; \
1045 else true ; \
1046 fi ; \
1047 fi
1048
c12d9b4c
RP
1049.PHONY: clean
1050clean:
7bea9148 1051 rm -rf $(HOLESDIR) $(INPLACEDIR) $(WORKING_DIR)* $(host)-stamp-* *~
c12d9b4c
RP
1052
1053.PHONY: very
1054very:
7bea9148 1055 rm -rf $(TREE)
c12d9b4c
RP
1056
1057force:
1058
1059endif # host
1060
1061### Local Variables:
1062### fill-column: 131
1063### End:
This page took 0.189835 seconds and 4 git commands to generate.