Commit | Line | Data |
---|---|---|
c12d9b4c RP |
1 | ### |
2 | ### Makefile used to three-stage build a tree of source code. Also used to | |
3 | ### compile other bundles, first with cc, then with gcc. | |
4 | ### | |
5 | ||
5ba00487 DZ |
6 | ### |
7 | ### USE OF THIS FILE REQUIRES GNU MAKE!!! | |
8 | ### | |
9 | ||
10 | ### The first versions of the file were written by Rich Pixley (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 | 22 | ifndef host |
5ba00487 DZ |
23 | error: |
24 | @echo You must set the variable \"host\" to use this Makefile ; exit 1 | |
c12d9b4c RP |
25 | else |
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 | 31 | TREE := devo |
c12d9b4c | 32 | |
7f0d689a | 33 | include $(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. | |
37 | TIME := | |
c12d9b4c | 38 | |
c8f1aa31 | 39 | CONFIG_SHELL := |
1b901645 AMT |
40 | GCC := $(host)-gcc |
41 | GNUCFLAGS := -g -O2 | |
42 | GNUC := CC="$(GCC)" CFLAGS="$(GNUCFLAGS)" | |
5ba00487 | 43 | CFLAGS := -g |
3066e752 | 44 | CXXFLAGS := -g -O2 |
5ba00487 | 45 | GNU_MAKE := /usr/latest/bin/make -w |
04a59f79 | 46 | MAKEINFOFLAGS := |
c12d9b4c | 47 | |
c8f1aa31 | 48 | override MAKE := make -w |
5ba00487 DZ |
49 | override MFLAGS := |
50 | #override MAKEFLAGS := | |
c12d9b4c | 51 | |
5ba00487 | 52 | SHELL := /bin/sh |
c12d9b4c | 53 | |
04a59f79 DZ |
54 | ifndef build |
55 | build := $(host) | |
56 | endif | |
57 | ||
58 | ifndef target | |
59 | target := $(host) | |
60 | endif | |
61 | ||
8456a631 KC |
62 | ifeq ($(patsubst %-lynx,lynx,$(host)),lynx) |
63 | SHELL := /bin/bash | |
64 | GNU_MAKE := $(MAKE) | |
65 | CONFIG_SHELL := /bin/bash | |
66 | endif | |
67 | ||
3066e752 KC |
68 | ifeq ($(patsubst %-m68k-hp-hpux,m68k-hp-hpux,$(host)),m68k-hp-hpux) |
69 | SHELL := /usr/unsupported/bin/bash | |
70 | GNU_MAKE := $(MAKE) | |
71 | CONFIG_SHELL := /usr/unsupported/bin/bash | |
72 | endif | |
73 | ||
04a59f79 | 74 | ifneq ($(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 | ||
81 | AR := $(host)-ar | |
82 | AR_FOR_TARGET := $(target)-ar | |
83 | AS := $(host)-as | |
84 | AS_FOR_TARGET := $(target)-as | |
c8f1aa31 | 85 | BISON := byacc |
35eae2d8 ILT |
86 | CC := $(host)-gcc |
87 | CC_FOR_BUILD := gcc | |
88 | CC_FOR_TARGET := $(target)-gcc | |
1b901645 | 89 | CFLAGS := $(GNUCFLAGS) |
3066e752 KC |
90 | CXX := $(host)-gcc |
91 | CXX_FOR_TARGET := $(target)-gcc | |
1b901645 | 92 | GCC := $(host)-gcc |
35eae2d8 ILT |
93 | GXX := $(host)-g++ |
94 | GXX_FOR_TARGET := $(target)-g++ | |
95 | HOST_PREFIX := $(build)- | |
96 | HOST_PREFIX_1 := $(build)- | |
c8f1aa31 | 97 | LEX := flex |
35eae2d8 | 98 | MAKEINFO := makeinfo |
8456a631 | 99 | MUNCH_NM := $(host)-nm |
35eae2d8 ILT |
100 | NM := $(host)-nm |
101 | NM_FOR_TARGET := $(target)-nm | |
102 | RANLIB := $(host)-ranlib | |
103 | RANLIB_FOR_TARGET := $(target)-ranlib | |
c8f1aa31 ME |
104 | YACC := $(BISON) |
105 | ||
8456a631 KC |
106 | ifeq ($(host),i386-go32) |
107 | MAKEINFOFLAGS = --no-split | |
c8f1aa31 | 108 | endif |
35eae2d8 ILT |
109 | |
110 | FLAGS_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. | |
145 | configenv := AR="$(AR)" CC="$(CC)" RANLIB="$(RANLIB)" | |
146 | ||
147 | else | |
148 | ||
149 | # This is a normal build on the host machine. | |
150 | ||
c12d9b4c RP |
151 | FLAGS_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 |
162 | configenv := |
163 | ||
301482c7 DZ |
164 | endif |
165 | ||
c8f1aa31 ME |
166 | #### we need to change the default C compiler for some hosts |
167 | ifeq ($(host),sparc-sun-solaris2) | |
168 | CC := cc -Xs | |
169 | endif | |
170 | ||
171 | ifeq ($(host),mips-sgi-irix4) | |
60430a46 | 172 | CC := cc -cckr -Wf,-XNg1500 -Wf,-XNk1000 -Wf,-XNh2000 |
c8f1aa31 | 173 | endif |
35eae2d8 | 174 | |
3066e752 KC |
175 | ifeq ($(host),hppa1.1-hp-hpux) |
176 | CC := cc -Wp,-H256000 | |
177 | endif | |
178 | ||
1b901645 AMT |
179 | ifeq ($(host),m68k-hp-hpux) |
180 | CC := cc -Wp,-P,-H256000 | |
181 | endif | |
182 | ||
3066e752 | 183 | ifeq ($(host),mips-mips-riscos5sysv) |
c8f1aa31 ME |
184 | CC := cc -non_shared -systype sysv |
185 | endif | |
186 | ||
187 | ifeq ($(host),mips-dec-ultrix) | |
188 | CC := cc -Wf,-XNg1000 | |
189 | endif | |
190 | ||
191 | ifeq ($(host),m68k-sun-sunos4.1.1) | |
192 | CC := cc -J | |
193 | endif | |
194 | ||
1b901645 AMT |
195 | # Support gdbtk everywhere |
196 | configargs = --enable-gdbtk | |
197 | ||
60430a46 JW |
198 | # We want to use stabs for MIPS targets. |
199 | ifeq ($(target),mips-idt-ecoff) | |
1b901645 | 200 | configargs := $(configargs) --with-stabs |
60430a46 JW |
201 | endif |
202 | ||
203 | ifeq ($(target),mips-dec-ultrix) | |
1b901645 | 204 | configargs := $(configargs) --with-stabs |
60430a46 JW |
205 | endif |
206 | ||
207 | ifeq ($(target),mips-sgi-irix4) | |
1b901645 | 208 | configargs := $(configargs) --with-stabs |
60430a46 JW |
209 | endif |
210 | ||
1b901645 AMT |
211 | ifeq ($(target),mips-sgi-irix5) |
212 | configargs := $(configargs) --with-stabs | |
3066e752 KC |
213 | endif |
214 | ||
1b901645 AMT |
215 | ifeq ($(patsubst alpha-dec-osf%,alpha,$(target)),alpha) |
216 | configargs := $(configargs) --with-stabs | |
3066e752 KC |
217 | endif |
218 | ||
60430a46 JW |
219 | # We must use stabs for SVR4 targets. |
220 | ifeq ($(target),i386-sysv4.2) | |
1b901645 | 221 | configargs := $(configargs) --with-stabs |
60430a46 JW |
222 | endif |
223 | ||
c8f1aa31 ME |
224 | ifneq ($(CC), 'cc') |
225 | FLAGS_TO_PASS := "CC=$(CC)" $(FLAGS_TO_PASS) | |
35eae2d8 ILT |
226 | endif |
227 | ||
60430a46 JW |
228 | #### and on some, we need CONFIG_SHELL |
229 | ifeq ($(patsubst %-lynxos,lynxos,$(host)),lynxos) | |
230 | FLAGS_TO_PASS := "CONFIG_SHELL=$(CONFIG_SHELL)" $(FLAGS_TO_PASS) | |
231 | endif | |
232 | ||
35eae2d8 | 233 | # These are the prefixes used for Cygnus builds. |
43ba04b1 | 234 | prefixes = --prefix=$(release_root) --exec-prefix=$(release_root)/H-$(host) |
5ba00487 | 235 | |
c8f1aa31 | 236 | relbindir = $(release_root)/H-$(build)/bin |
c12d9b4c RP |
237 | |
238 | ### general config stuff | |
5ba00487 DZ |
239 | WORKING_DIR := $(host)-objdir |
240 | STAGE1DIR := $(WORKING_DIR).1 | |
241 | STAGE2DIR := $(WORKING_DIR).2 | |
242 | STAGE3DIR := $(WORKING_DIR).3 | |
c8f1aa31 | 243 | STAGE4DIR := $(WORKING_DIR).4 |
5ba00487 | 244 | INPLACEDIR := $(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 | 249 | ifneq ($(build),$(host)) |
35eae2d8 ILT |
250 | |
251 | holesys := $(build) | |
252 | HOLESSTAMP := $(holesys)-stamp-holes $(build)-x-$(host)-stamp-holes $(build)-x-$(target)-stamp-holes | |
253 | HOLESDIR := $(holesys)-holes | |
254 | BUILD_HOST_HOLES_DIR := $(build)-x-$(host)-holes | |
255 | BUILD_TARGET_HOLES_DIR := $(build)-x-$(target)-holes | |
256 | ||
fb682d69 ME |
257 | SET_NATIVE_HOLES := SHELL=$(SHELL) ; PATH=`pwd`/$(HOLESDIR):`pwd`/$(BUILD_HOST_HOLES_DIR):`pwd`/$(BUILD_TARGET_HOLES_DIR) ; export PATH ; export SHELL ; |
258 | SET_CYGNUS_PATH := SHELL=$(SHELL) ; PATH=`pwd`/$(HOLESDIR):`pwd`/$(BUILD_HOST_HOLES_DIR):`pwd`/$(BUILD_TARGET_HOLES_DIR) ; export PATH ; export SHELL ; | |
259 | SET_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 | |
261 | else | |
262 | ||
263 | holesys := $(host) | |
264 | HOLESSTAMP := $(holesys)-stamp-holes | |
265 | HOLESDIR := $(holesys)-holes | |
c12d9b4c | 266 | |
fb682d69 ME |
267 | SET_NATIVE_HOLES := SHELL=$(SHELL) ; PATH=`pwd`/$(HOLESDIR) ; export PATH ; export SHELL ; |
268 | SET_CYGNUS_PATH := SHELL=$(SHELL) ; PATH=$(relbindir):`pwd`/$(HOLESDIR) ; export PATH ; export SHELL ; | |
269 | SET_LATEST_PATH := SHELL=$(SHELL) ; PATH=/usr/latest/bin:`pwd`/$(HOLESDIR) ; export PATH ; export SHELL ; | |
41a88234 | 270 | |
35eae2d8 | 271 | endif |
41a88234 | 272 | |
c12d9b4c | 273 | .PHONY: all |
04a59f79 | 274 | ifneq ($(target),$(host)) |
5ba00487 DZ |
275 | ## |
276 | ## This is a cross compilation | |
277 | ## | |
278 | arch = $(host)-x-$(target) | |
35eae2d8 | 279 | config = -host=$(host) -target=$(target) |
5ba00487 DZ |
280 | FLAGS_TO_PASS := $(FLAGS_TO_PASS) "target=$(target)" |
281 | ||
3066e752 KC |
282 | ifeq ($(patsubst %-lynx,lynx,$(target)),lynx) |
283 | configargs := $(configargs) --with-headers=/s1/cygnus/dejagnu/$(target)/include \ | |
284 | --with-libs=/s1/cygnus/dejagnu/$(target)/lib | |
285 | endif | |
286 | ||
287 | ifeq ($(patsubst %-i386-sysv4.2,i386-sysv4.2,$(target)),i386-sysv4.2) | |
288 | configargs := $(configargs) --with-headers=/s1/cygnus/dejagnu/$(target)/include \ | |
289 | --with-libs=/s1/cygnus/dejagnu/$(target)/lib | |
290 | endif | |
291 | ||
1b901645 AMT |
292 | ifeq ($(patsubst %-i386-netware,i386-netware,$(target)),i386-netware) |
293 | configargs := $(configargs) \ | |
294 | --with-headers=/s1/cygnus/dejagnu/$(target)/include \ | |
295 | --with-libs=/s1/cygnus/dejagnu/$(target)/lib | |
296 | endif | |
297 | ||
3066e752 | 298 | ifeq ($(patsubst %-sparc-sun-sunos4.1.3,sparc-sun-sunos4.1.3,$(target)),sparc-sun-sunos4.1.3) |
1b901645 AMT |
299 | configargs := $(configargs) \ |
300 | --with-headers=/s1/cygnus/dejagnu/$(target)/include \ | |
301 | --with-libs=/s1/cygnus/dejagnu/$(target)/lib | |
3066e752 KC |
302 | endif |
303 | ||
304 | ifeq ($(patsubst %-sparc-sun-solaris2,sparc-sun-solaris2,$(target)),sparc-sun-solaris2) | |
1b901645 AMT |
305 | configargs := $(configargs) \ |
306 | --with-headers=/s1/cygnus/dejagnu/$(target)/include \ | |
307 | --with-libs=/s1/cygnus/dejagnu/$(target)/lib | |
308 | endif | |
309 | ||
310 | ifeq ($(patsubst %-i960-vxworks5.1,i960-vxworks5.1,$(target)),i960-vxworks5.1) | |
311 | configargs := $(configargs) \ | |
312 | --with-headers=/s1/cygnus/dejagnu/$(target)/include | |
313 | endif | |
314 | ||
315 | ifeq ($(patsubst %-m68k-vxworks5.1,m68k-vxworks5.1,$(target)),m68k-vxworks5.1) | |
316 | configargs := $(configargs) \ | |
317 | --with-headers=/s1/cygnus/dejagnu/$(target)/include | |
318 | endif | |
319 | ||
320 | ifeq ($(patsubst %-i386-unixware,i386-unixware,$(target)),i386-unixware) | |
321 | configargs := $(configargs) \ | |
322 | --with-headers=/s1/cygnus/dejagnu/$(target)/include \ | |
323 | --with-libs=/s1/cygnus/dejagnu/$(target)/lib | |
3066e752 KC |
324 | endif |
325 | ||
04a59f79 | 326 | ifneq ($(build),$(host)) |
35eae2d8 ILT |
327 | all: do-cygnus do-latest |
328 | build-all: build-cygnus build-latest | |
329 | else | |
5ba00487 DZ |
330 | all: do-native do-latest |
331 | build-all: build-native build-latest | |
35eae2d8 ILT |
332 | endif |
333 | ||
5ba00487 DZ |
334 | |
335 | else | |
336 | ## | |
337 | ## This is a native compilation | |
338 | ## | |
301c3fef | 339 | arch = $(host) |
35eae2d8 | 340 | config = -host=$(host) |
04a59f79 | 341 | ifneq ($(build),$(host)) |
35eae2d8 ILT |
342 | all: do-cygnus do-latest |
343 | else | |
5ba00487 | 344 | all: $(host)-stamp-3stage-done |
35eae2d8 | 345 | endif |
5ba00487 | 346 | #all: in-place do1 do2 do3 comparison |
35eae2d8 | 347 | |
5ba00487 DZ |
348 | endif |
349 | ||
301c3fef DZ |
350 | NATIVEDIR := $(arch)-native-objdir |
351 | CYGNUSDIR := $(arch)-cygnus-objdir | |
352 | LATESTDIR := $(arch)-latest-objdir | |
c8f1aa31 | 353 | DOSDIR := dos-x-$(target)-objdir |
301c3fef | 354 | |
5ba00487 DZ |
355 | everything: do-cross |
356 | #everything: in-place do1 do2 do3 comparison do-cygnus | |
357 | ||
c8f1aa31 ME |
358 | .PHONY: dos |
359 | dos: | |
360 | $(MAKE) -f test-build.mk CFLAGS= build=$(host) host=i386-go32 target=$(target) do-dos | |
361 | dos-path: | |
362 | $(MAKE) -f test-build.mk CFLAGS= build=$(host) host=i386-go32 target=$(target) path-dos | |
363 | ||
364 | .PHONY: do-dos | |
365 | do-dos: $(HOLESSTAMP) dos-x-$(target)-stamp-done | |
366 | build-dos: $(HOLESSTAMP) dos-x-$(target)-stamp-dos-checked | |
367 | config-dos: $(HOLESSTAMP) dos-x-$(target)-stamp-dos-configured | |
368 | path-dos: | |
369 | @echo "$(SET_CYGNUS_PATH)" | |
370 | ||
371 | dos-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 | ||
377 | dos-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 | ||
384 | dos-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 | ||
391 | dos-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 | ||
395 | dos-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 | ||
399 | dos-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 | 410 | do-native: $(HOLESSTAMP) $(arch)-stamp-native |
5ba00487 | 411 | do-native-config: $(arch)-stamp-native-configured |
35eae2d8 ILT |
412 | build-native: $(HOLESSTAMP) $(arch)-stamp-native-checked |
413 | config-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 |
441 | do-cygnus: $(HOLESSTAMP) $(arch)-stamp-cygnus |
442 | build-cygnus: $(HOLESSTAMP) $(arch)-stamp-cygnus-checked | |
443 | config-cygnus: $(HOLESSTAMP) $(arch)-stamp-cygnus-configured | |
c8f1aa31 ME |
444 | path-cygnus: |
445 | $(SET_CYGNUS_PATH) echo $$PATH | |
5ba00487 | 446 | |
04a59f79 DZ |
447 | vault-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 |
480 | do-latest: $(HOLESSTAMP) $(arch)-stamp-latest |
481 | build-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 | |
508 | in-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 |
551 | do1: $(HOLESSTAMP) $(host)-stamp-stage1 |
552 | do1-config: $(HOLESSTAMP) $(host)-stamp-stage1-configured | |
553 | do1-build: $(HOLESSTAMP) $(host)-stamp-stage1-checked | |
c12d9b4c | 554 | |
04a59f79 DZ |
555 | do1-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 | 579 | ifeq ($(host),rs6000-ibm-aix) |
35eae2d8 | 580 | -rm $(relbindir)/make |
1b901645 AMT |
581 | endif |
582 | ifeq ($(host),rs6000-ibm-aix3.2.5) | |
583 | -rm $(relbindir)/make | |
fdfa2371 | 584 | endif |
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 | |
603 | do2: $(HOLESDIR) $(host)-stamp-stage2 | |
604 | ||
04a59f79 DZ |
605 | do2-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 | |
651 | do3: $(HOLESDIR) $(host)-stamp-stage3 | |
652 | ||
04a59f79 DZ |
653 | do3-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 | |
704 | do4: $(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 | ||
739 | HOLES := \ | |
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 | 797 | ifeq ($(subst sun3,sun4,$(holesys)),sun4) |
c12d9b4c RP |
798 | MAKE_HOLE := |
799 | else | |
800 | MAKE_HOLE := make | |
801 | endif | |
802 | ||
5ba00487 | 803 | ### solaris 2 -- don't use /usr/ucb/cc |
35eae2d8 | 804 | ifeq (sparc-sun-solaris2,$(holesys)) |
fb682d69 | 805 | SET_NATIVE_HOLES := SHELL=$(SHELL) ; PATH=/opt/SUNWspro/bin:`pwd`/$(HOLESDIR) ; export PATH ; export SHELL ; |
af5874bd | 806 | HOLE_DIRS := /usr/ccs/bin |
301c3fef DZ |
807 | CC_HOLE := |
808 | NUKEM := cc | |
5ba00487 DZ |
809 | endif |
810 | ||
c8f1aa31 ME |
811 | ifeq ($(host),i386-go32) |
812 | DOS_HOLES := aout2exe doschk file | |
813 | endif | |
814 | ||
8456a631 KC |
815 | ifeq ($(host),i386-lynx) |
816 | MAKE_HOLE := make | |
817 | endif | |
818 | ||
819 | ifeq ($(host),m68k-lynx) | |
820 | MAKE_HOLE := make | |
821 | endif | |
822 | ||
3066e752 KC |
823 | ifeq ($(host),sparc-lynx) |
824 | MAKE_HOLE := make | |
825 | endif | |
826 | ||
827 | ifeq ($(host),rs6000-lynx) | |
828 | MAKE_HOLE := make | |
829 | endif | |
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. |
832 | PARTIAL_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 | |
840 | HOLE_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. | |
849 | PARTIAL_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 |
893 | ifdef NUKEM |
894 | cd $(HOLESDIR); rm -f $(NUKEM) | |
895 | endif | |
7bea9148 | 896 | touch $@ |
c12d9b4c | 897 | |
35eae2d8 ILT |
898 | # Get the cross-tools for build cross host when not building on the host. |
899 | ||
900 | BUILD_HOST_HOLES := \ | |
901 | byacc \ | |
902 | gcc \ | |
903 | makeinfo \ | |
904 | $(AR) \ | |
905 | $(AS) \ | |
906 | $(CC) \ | |
907 | $(CXX) \ | |
908 | $(GXX) \ | |
909 | $(NM) \ | |
910 | $(RANLIB) | |
911 | ||
04a59f79 | 912 | BUILD_HOLES_DIRS := $(release_root)/H-$(build)/bin $(PARTIAL_HOLE_DIRS) |
35eae2d8 | 913 | |
7f0d689a | 914 | ifdef BUILD_HOST_HOLES_DIR |
35eae2d8 | 915 | $(BUILD_HOST_HOLES_DIR): $(build)-x-$(host)-stamp-holes |
7f0d689a | 916 | endif |
35eae2d8 | 917 | |
04a59f79 | 918 | ifneq ($(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 | 938 | endif |
35eae2d8 ILT |
939 | |
940 | # Get the cross tools for build cross target when not building on the host. | |
941 | ||
942 | BUILD_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 | 954 | ifdef BUILD_TARGET_HOLES_DIR |
35eae2d8 | 955 | $(BUILD_TARGET_HOLES_DIR): $(build)-x-$(target)-stamp-holes |
7f0d689a | 956 | endif |
35eae2d8 | 957 | |
04a59f79 | 958 | ifneq ($(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 | 978 | endif |
35eae2d8 | 979 | |
c12d9b4c | 980 | .PHONY: comparison |
5ba00487 | 981 | comparison: $(host)-stamp-3stage-compared |
c8f1aa31 | 982 | comparison-stage3to4: $(host)-stamp-4stage-compared |
5ba00487 DZ |
983 | |
984 | $(host)-stamp-3stage-compared: | |
985 | rm -f .bad-compare | |
8456a631 | 986 | ifeq ($(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 | 998 | else |
5ba00487 DZ |
999 | for i in `cd $(STAGE3DIR) ; find . -name \*.o -print` ; do \ |
1000 | cmp $(STAGE2DIR)/$$i $(STAGE3DIR)/$$i || touch .bad-compare ; \ | |
1001 | done | |
1002 | endif | |
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 | 1019 | ifeq ($(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 | |
1031 | else | |
1032 | for i in `cd $(STAGE4DIR) ; find . -name \*.o -print` ; do \ | |
1033 | cmp $(STAGE3DIR)/$$i $(STAGE4DIR)/$$i || touch .bad-compare ; \ | |
1034 | done | |
1035 | endif | |
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 |
1050 | clean: | |
7bea9148 | 1051 | rm -rf $(HOLESDIR) $(INPLACEDIR) $(WORKING_DIR)* $(host)-stamp-* *~ |
c12d9b4c RP |
1052 | |
1053 | .PHONY: very | |
1054 | very: | |
7bea9148 | 1055 | rm -rf $(TREE) |
c12d9b4c RP |
1056 | |
1057 | force: | |
1058 | ||
1059 | endif # host | |
1060 | ||
1061 | ### Local Variables: | |
1062 | ### fill-column: 131 | |
1063 | ### End: |