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