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