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.
7 ### USE OF THIS FILE REQUIRES GNU MAKE!!!
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,
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.
18 ### The variable target may be set for the target of a cross-compilation.
20 ### The variable build may be to build a tree on a machine other than the host.
24 @echo You must set the variable \"host\" to use this Makefile ; exit 1
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
30 ### from which cvs tree are we working?
33 include $(TREE)/release-info
42 GNU_MAKE := /usr/latest/bin/make -w
45 override MAKE := make -w
47 #override MAKEFLAGS :=
59 ifeq ($(patsubst %-lynx,lynx,$(host)),lynx)
62 CONFIG_SHELL := /bin/bash
65 ifneq ($(build),$(host))
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).
73 AR_FOR_TARGET := $(target)-ar
75 AS_FOR_TARGET := $(target)-as
79 CC_FOR_TARGET := $(target)-gcc
81 CXX_FOR_TARGET := $(target)-c++
84 GXX_FOR_TARGET := $(target)-g++
85 HOST_PREFIX := $(build)-
86 HOST_PREFIX_1 := $(build)-
89 MUNCH_NM := $(host)-nm
91 NM_FOR_TARGET := $(target)-nm
92 RANLIB := $(host)-ranlib
93 RANLIB_FOR_TARGET := $(target)-ranlib
96 ifeq ($(host),i386-go32)
97 MAKEINFOFLAGS = --no-split
102 "AR_FOR_TARGET=$(AR_FOR_TARGET)" \
104 "AS_FOR_TARGET=$(AS_FOR_TARGET)" \
107 "CC_FOR_BUILD=$(CC_FOR_BUILD)" \
108 "CC_FOR_TARGET=$(CC_FOR_TARGET)" \
110 "CXX_FOR_TARGET=$(CXX_FOR_TARGET)" \
112 "CXXFLAGS=$(CXXFLAGS)" \
114 "HOST_PREFIX=$(HOST_PREFIX)" \
115 "HOST_PREFIX_1=$(HOST_PREFIX_1)" \
117 "MAKEINFO=$(MAKEINFO)" \
118 "MAKEINFOFLAGS=$(MAKEINFOFLAGS)" \
120 "MUNCH_NM=$(MUNCH_NM)" \
122 "NM_FOR_TARGET=$(NM_FOR_TARGET)" \
124 "RANLIB_FOR_TARGET=$(RANLIB_FOR_TARGET)" \
125 "RELEASE_TAG=$(RELEASE_TAG)" \
126 "RUNTEST=$(relbindir)/runtest" \
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)"
139 # This is a normal build on the host machine.
144 "CXXFLAGS=$(CXXFLAGS)" \
146 "MAKEINFOFLAGS=$(MAKEINFOFLAGS)" \
149 "RELEASE_TAG=$(RELEASE_TAG)" \
156 #### we need to change the default C compiler for some hosts
157 ifeq ($(host),sparc-sun-solaris2)
161 ifeq ($(host),mips-sgi-irix4)
162 CC := cc -cckr -Wf,-XNg1500 -Wf,-XNk1000 -Wf,-XNh2000
165 ifeq ($(host),mips-mips-riscos5)
166 CC := cc -non_shared -systype sysv
169 ifeq ($(host),mips-dec-ultrix)
170 CC := cc -Wf,-XNg1000
173 ifeq ($(host),m68k-sun-sunos4.1.1)
178 # We want to use stabs for MIPS targets.
179 ifeq ($(target),mips-idt-ecoff)
180 configargs = -with-stabs
183 ifeq ($(target),mips-dec-ultrix)
184 configargs = -with-stabs
187 ifeq ($(target),mips-sgi-irix4)
188 configargs = -with-stabs
191 # We must use stabs for SVR4 targets.
192 ifeq ($(target),i386-sysv4.2)
193 configargs = -with-stabs
197 FLAGS_TO_PASS := "CC=$(CC)" $(FLAGS_TO_PASS)
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)
206 # These are the prefixes used for Cygnus builds.
207 prefixes = --prefix=$(release_root) --exec-prefix=$(release_root)/H-$(host)
209 relbindir = $(release_root)/H-$(build)/bin
211 ### general config stuff
212 WORKING_DIR := $(host)-objdir
213 STAGE1DIR := $(WORKING_DIR).1
214 STAGE2DIR := $(WORKING_DIR).2
215 STAGE3DIR := $(WORKING_DIR).3
216 STAGE4DIR := $(WORKING_DIR).4
217 INPLACEDIR := $(host)-in-place
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.
222 ifneq ($(build),$(host))
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
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 ;
237 HOLESSTAMP := $(holesys)-stamp-holes
238 HOLESDIR := $(holesys)-holes
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 ;
247 ifneq ($(target),$(host))
249 ## This is a cross compilation
251 arch = $(host)-x-$(target)
252 config = -host=$(host) -target=$(target)
253 FLAGS_TO_PASS := $(FLAGS_TO_PASS) "target=$(target)"
255 ifneq ($(build),$(host))
256 all: do-cygnus do-latest
257 build-all: build-cygnus build-latest
259 all: do-native do-latest
260 build-all: build-native build-latest
266 ## This is a native compilation
269 config = -host=$(host)
270 ifneq ($(build),$(host))
271 all: do-cygnus do-latest
273 all: $(host)-stamp-3stage-done
275 #all: in-place do1 do2 do3 comparison
279 NATIVEDIR := $(arch)-native-objdir
280 CYGNUSDIR := $(arch)-cygnus-objdir
281 LATESTDIR := $(arch)-latest-objdir
282 DOSDIR := dos-x-$(target)-objdir
285 #everything: in-place do1 do2 do3 comparison do-cygnus
289 $(MAKE) -f test-build.mk CFLAGS= build=$(host) host=i386-go32 target=$(target) do-dos
291 $(MAKE) -f test-build.mk CFLAGS= build=$(host) host=i386-go32 target=$(target) path-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
298 @echo "$(SET_CYGNUS_PATH)"
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
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)
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
320 dos-x-$(target)-stamp-dos-checked: $(HOLESSTAMP) dos-x-$(target)-stamp-dos-built
321 # cd $(DOSDIR) ; $(TIME) $(MAKE) $(FLAGS_TO_PASS) $(GNUC) check
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
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)
339 do-native: $(HOLESSTAMP) $(arch)-stamp-native
340 do-native-config: $(arch)-stamp-native-configured
341 build-native: $(HOLESSTAMP) $(arch)-stamp-native-checked
342 config-native: $(HOLESSTAMP) $(arch)-stamp-native-configured
344 $(arch)-stamp-native: $(HOLESSTAMP)
345 $(SET_NATIVE_HOLES) $(TIME) $(GNU_MAKE) -f test-build.mk $(arch)-stamp-native-installed $(FLAGS_TO_PASS)
346 if [ -f CLEAN_ALL -o -f CLEAN_CROSSES ] ; then rm -rf $(NATIVEDIR) ; else true ; fi
347 touch $(arch)-stamp-native
349 $(arch)-stamp-native-installed: $(HOLESSTAMP) $(arch)-stamp-native-checked
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
354 $(arch)-stamp-native-checked: $(arch)-stamp-native-built
355 # cd $(NATIVEDIR) ; $(TIME) $(MAKE) $(FLAGS_TO_PASS) check
358 $(arch)-stamp-native-built: $(HOLESSTAMP) $(arch)-stamp-native-configured
359 $(SET_NATIVE_HOLES) cd $(NATIVEDIR) ; $(TIME) $(MAKE) $(FLAGS_TO_PASS) all
360 $(SET_NATIVE_HOLES) cd $(NATIVEDIR) ; $(TIME) $(MAKE) $(FLAGS_TO_PASS) info
363 $(arch)-stamp-native-configured: $(HOLESSTAMP)
364 [ -d $(NATIVEDIR) ] || mkdir $(NATIVEDIR)
365 $(SET_NATIVE_HOLES) cd $(NATIVEDIR) ; $(configenv) CC="$(CC)" $(TIME) $(CONFIG_SHELL) ../$(TREE)/configure $(config) -v --srcdir=../$(TREE) $(prefixes) $(configargs)
370 do-cygnus: $(HOLESSTAMP) $(arch)-stamp-cygnus
371 build-cygnus: $(HOLESSTAMP) $(arch)-stamp-cygnus-checked
372 config-cygnus: $(HOLESSTAMP) $(arch)-stamp-cygnus-configured
374 $(SET_CYGNUS_PATH) echo $$PATH
376 vault-cygnus: $(HOLESSTAMP) $(arch)-stamp-cygnus-built
377 $(SET_CYGNUS_PATH) cd $(CYGNUSDIR) ; $(TIME) $(MAKE) $(FLAGS_TO_PASS) $(GNUC) vault-install
380 $(arch)-stamp-cygnus:
381 [ -f $(relbindir)/$(host)-gcc ] || (echo "must have gcc available"; exit 1)
382 $(SET_CYGNUS_PATH) $(TIME) $(GNU_MAKE) -f test-build.mk $(arch)-stamp-cygnus-installed $(FLAGS_TO_PASS)
383 if [ -f CLEAN_ALL -o -f CLEAN_CROSSES ] ; then rm -rf $(CYGNUSDIR) ; else true ; fi
384 touch $(arch)-stamp-cygnus
386 $(arch)-stamp-cygnus-installed: $(HOLESSTAMP) $(arch)-stamp-cygnus-checked
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
389 if [ -f VAULT-INSTALL ] ; then \
390 $(SET_CYGNUS_PATH) cd $(CYGNUSDIR) ; $(MAKE) $(FLAGS_TO_PASS) $(GNUC) vault-install ; \
394 $(arch)-stamp-cygnus-checked: $(HOLESSTAMP) $(arch)-stamp-cygnus-built
395 # cd $(CYGNUSDIR) ; $(TIME) $(MAKE) $(FLAGS_TO_PASS) $(GNUC) check
398 $(arch)-stamp-cygnus-built: $(HOLESSTAMP) $(arch)-stamp-cygnus-configured
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
403 $(arch)-stamp-cygnus-configured: $(HOLESSTAMP)
404 [ -d $(CYGNUSDIR) ] || mkdir $(CYGNUSDIR)
405 $(SET_CYGNUS_PATH) cd $(CYGNUSDIR) ; $(configenv) $(GNUC) $(TIME) $(CONFIG_SHELL) ../$(TREE)/configure $(config) -v --srcdir=../$(TREE) $(prefixes) $(configargs)
409 do-latest: $(HOLESSTAMP) $(arch)-stamp-latest
410 build-latest: $(HOLESSTAMP) $(arch)-stamp-latest-checked
412 $(arch)-stamp-latest:
413 $(SET_LATEST_PATH) $(TIME) $(GNU_MAKE) -f test-build.mk $(arch)-stamp-latest-installed $(FLAGS_TO_PASS)
414 touch $(arch)-stamp-latest
416 $(arch)-stamp-latest-installed: $(HOLESSTAMP) $(arch)-stamp-latest-checked
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
421 $(arch)-stamp-latest-checked: $(arch)-stamp-latest-built
422 # $(SET_LATEST_PATH) cd $(LATESTDIR) ; $(TIME) $(MAKE) $(FLAGS_TO_PASS) $(GNUC) check
425 $(arch)-stamp-latest-built: $(arch)-stamp-latest-configured
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
430 $(arch)-stamp-latest-configured:
431 [ -d $(LATESTDIR) ] || mkdir $(LATESTDIR)
432 $(SET_LATEST_PATH) cd $(LATESTDIR) ; $(configenv) $(GNUC) $(TIME) $(CONFIG_SHELL) ../$(TREE)/configure $(config) -v --srcdir=../$(TREE) $(prefixes) $(configargs)
437 in-place: $(host)-stamp-in-place
439 $(host)-stamp-in-place:
440 PATH=/bin:/usr/bin:/usr/ucb ; \
442 SHELL=/bin/sh ; export SHELL ; \
443 $(TIME) $(GNU_MAKE) -f test-build.mk $(host)-stamp-in-place-installed host=$(host) $(FLAGS_TO_PASS)
445 if [ -f CLEAN_ALL ] ; then \
446 rm -rf $(INPLACEDIR) ; \
448 mv $(INPLACEDIR) $(STAGE1DIR) ; \
451 $(host)-stamp-in-place-installed: $(host)-stamp-in-place-checked
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)
456 $(host)-stamp-in-place-checked: $(host)-stamp-in-place-built
457 # cd $(INPLACEDIR) ; $(TIME) $(MAKE) $(FLAGS_TO_PASS) "CFLAGS=$(CFLAGS)" check host=$(host)
460 $(host)-stamp-in-place-built: $(host)-stamp-in-place-configured
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)
465 $(host)-stamp-in-place-configured: $(host)-stamp-in-place-cp
466 cd $(INPLACEDIR) ; $(configenv) CC="$(CC)" $(TIME) $(CONFIG_SHELL) ./configure $(config) -v $(prefixes) $(configargs)
469 $(host)-stamp-in-place-cp:
472 (cd $(TREE) ; tar cf - .) | (cd $(INPLACEDIR) ; tar xf -)
475 $(host)-stamp-3stage-done: do1 do2 do3 comparison
480 do1: $(HOLESSTAMP) $(host)-stamp-stage1
481 do1-config: $(HOLESSTAMP) $(host)-stamp-stage1-configured
482 do1-build: $(HOLESSTAMP) $(host)-stamp-stage1-checked
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 ; \
488 $(SET_NATIVE_HOLES) cd $(WORKING_DIR) ; $(MAKE) $(FLAGS_TO_PASS) host=$(host) "CFLAGS=$(CFLAGS)" vault-install ; \
491 $(host)-stamp-stage1:
492 if [ -d $(STAGE1DIR) ] ; then \
493 mv $(STAGE1DIR) $(WORKING_DIR) ; \
497 $(SET_NATIVE_HOLES) $(TIME) $(GNU_MAKE) -f test-build.mk $(FLAGS_TO_PASS) host=$(host) $(host)-stamp-stage1-installed
499 if [ -f CLEAN_ALL ] ; then \
500 rm -rf $(WORKING_DIR) ; \
502 mv $(WORKING_DIR) $(STAGE1DIR) ; \
505 $(host)-stamp-stage1-installed: $(host)-stamp-stage1-checked
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)
508 ifeq ($(host),rs6000-ibm-aix)
509 -rm $(relbindir)/make
513 $(host)-stamp-stage1-checked: $(host)-stamp-stage1-built
514 # $(SET_NATIVE_HOLES) cd $(WORKING_DIR) ; $(TIME) $(MAKE) $(FLAGS_TO_PASS) "CFLAGS=$(CFLAGS)" check host=$(host)
517 $(host)-stamp-stage1-built: $(host)-stamp-stage1-configured
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)
522 $(host)-stamp-stage1-configured:
523 [ -d $(WORKING_DIR) ] || mkdir $(WORKING_DIR)
524 $(SET_NATIVE_HOLES) cd $(WORKING_DIR) ; \
525 $(configenv) CC="$(CC)" $(TIME) $(CONFIG_SHELL) ../$(TREE)/configure $(config) -v --srcdir=../$(TREE) $(prefixes) $(configargs)
529 do2: $(HOLESDIR) $(host)-stamp-stage2
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 ; \
535 $(SET_CYGNUS_PATH) cd $(WORKING_DIR) ; $(MAKE) $(FLAGS_TO_PASS) host=$(host) "CFLAGS=$(CFLAGS)" vault-install ; \
540 $(host)-stamp-stage2:
541 if [ -d $(STAGE2DIR) ] ; then \
542 mv $(STAGE2DIR) $(WORKING_DIR) ; \
546 $(SET_CYGNUS_PATH) $(TIME) $(GNU_MAKE) $(FLAGS_TO_PASS) -f test-build.mk -w $(host)-stamp-stage2-installed
547 mv $(WORKING_DIR) $(STAGE2DIR)
551 $(host)-stamp-stage2-installed: $(host)-stamp-stage2-checked
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)
556 $(host)-stamp-stage2-checked: $(host)-stamp-stage2-built
557 # $(SET_CYGNUS_PATH) cd $(WORKING_DIR) ; $(TIME) $(MAKE) -w $(FLAGS_TO_PASS) $(GNUC) "CFLAGS=$(CFLAGS)" check host=$(host)
560 $(host)-stamp-stage2-built: $(host)-stamp-stage2-configured
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)
565 $(host)-stamp-stage2-configured:
566 [ -d $(WORKING_DIR) ] || mkdir $(WORKING_DIR)
567 $(SET_CYGNUS_PATH) cd $(WORKING_DIR) ; \
568 $(configenv) $(GNUC) $(TIME) $(CONFIG_SHELL) ../$(TREE)/configure $(config) -v --srcdir=../$(TREE) $(prefixes) $(configargs)
572 do3: $(HOLESDIR) $(host)-stamp-stage3
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 ; \
578 $(SET_CYGNUS_PATH) cd $(WORKING_DIR) ; $(MAKE) $(FLAGS_TO_PASS) host=$(host) "CFLAGS=$(CFLAGS)" vault-install ; \
581 $(host)-stamp-stage3:
582 if [ -d $(STAGE3DIR) ] ; then \
583 mv $(STAGE3DIR) $(WORKING_DIR) ; \
587 $(SET_CYGNUS_PATH) $(TIME) $(GNU_MAKE) $(FLAGS_TO_PASS) -f test-build.mk -w $(host)-stamp-stage3-installed
588 mv $(WORKING_DIR) $(STAGE3DIR)
592 $(host)-stamp-stage3-installed: $(host)-stamp-stage3-checked
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)
595 if [ -f VAULT-INSTALL ] ; then \
596 $(SET_CYGNUS_PATH) cd $(CYGNUSDIR) ; $(MAKE) $(FLAGS_TO_PASS) $(GNUC) vault-install ; \
600 $(host)-stamp-stage3-checked: $(host)-stamp-stage3-built
601 # $(SET_CYGNUS_PATH) cd $(WORKING_DIR) ; $(TIME) $(MAKE) -w $(FLAGS_TO_PASS) $(GNUC) "CFLAGS=$(CFLAGS)" check host=$(host)
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)
608 $(host)-stamp-stage3-built: $(host)-stamp-stage3-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)
613 $(host)-stamp-stage3-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)
620 do4: $(HOLESDIR) $(host)-stamp-stage4
622 $(host)-stamp-stage4:
623 if [ -d $(STAGE4DIR) ] ; then \
624 mv $(STAGE4DIR) $(WORKING_DIR) ; \
628 $(SET_CYGNUS_PATH) $(TIME) $(GNU_MAKE) $(FLAGS_TO_PASS) -f test-build.mk -w $(host)-stamp-stage4-checked
629 mv $(WORKING_DIR) $(STAGE4DIR)
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)
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)
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)
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)
653 # These things are needed by a three-stage, but are not included locally.
710 ### so far only sun make supports VPATH
711 ifeq ($(subst sun3,sun4,$(holesys)),sun4)
717 ### solaris 2 -- don't use /usr/ucb/cc
718 ifeq (sparc-sun-solaris2,$(holesys))
719 SET_NATIVE_HOLES := SHELL=$(SHELL) ; PATH=/opt/SUNWspro/bin:`pwd`/$(HOLESDIR) ; export PATH ; export SHELL ;
720 HOLE_DIRS := /usr/ccs/bin
725 ifeq ($(host),i386-go32)
726 DOS_HOLES := aout2exe doschk file
729 ifeq ($(host),i386-lynx)
733 ifeq ($(host),m68k-lynx)
737 ### These things are also needed by a three-stage, but in this case, the GNU version of the tool is required.
745 ### look in these directories for things missing from a three-stage
753 ### look in these directories for alternate versions of some tools.
754 PARTIAL_HOLE_DIRS := \
756 /usr/progressive/bin \
757 $(PARTIAL_HOLE_DIRS) \
759 /usr/unsupported/bin \
762 $(HOLESDIR): $(holesys)-stamp-holes
764 $(holesys)-stamp-holes:
767 @for i in $(HOLES) ; do \
769 for j in $(HOLE_DIRS) ; do \
770 if [ -x $$j/$$i ] ; then \
771 ln -s $$j/$$i $(HOLESDIR) || cp $$j/$$i $(HOLESDIR) ; \
772 echo $$i from $$j ; \
779 *) echo $$i is NOT found ;; \
782 @for i in $(PARTIAL_HOLES) ; do \
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 ; \
795 *) echo $$i is NOT found ;; \
799 cd $(HOLESDIR); rm -f $(NUKEM)
803 # Get the cross-tools for build cross host when not building on the host.
805 BUILD_HOST_HOLES := \
817 BUILD_HOLES_DIRS := $(release_root)/H-$(build)/bin $(PARTIAL_HOLE_DIRS)
819 ifdef BUILD_HOST_HOLES_DIR
820 $(BUILD_HOST_HOLES_DIR): $(build)-x-$(host)-stamp-holes
823 ifneq ($(build),$(host))
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 \
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 ; \
839 *) echo $$i is NOT found ;; \
845 # Get the cross tools for build cross target when not building on the host.
847 BUILD_TARGET_HOLES := \
859 ifdef BUILD_TARGET_HOLES_DIR
860 $(BUILD_TARGET_HOLES_DIR): $(build)-x-$(target)-stamp-holes
863 ifneq ($(build),$(target))
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 \
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 ; \
879 *) echo $$i is NOT found ;; \
886 comparison: $(host)-stamp-3stage-compared
887 comparison-stage3to4: $(host)-stamp-4stage-compared
889 $(host)-stamp-3stage-compared:
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)
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 \
899 touch .bad-compare ; \
904 for i in `cd $(STAGE3DIR) ; find . -name \*.o -print` ; do \
905 cmp $(STAGE2DIR)/$$i $(STAGE3DIR)/$$i || touch .bad-compare ; \
908 if [ -f CLEAN_ALL ] ; then \
909 rm -rf $(STAGE2DIR) $(STAGE3DIR) ; \
911 if [ -f CLEAN_STAGES ] ; then \
912 if [ -f .bad-compare ] ; then \
915 rm -rf $(STAGE1DIR) $(STAGE2DIR) ; \
922 $(host)-stamp-4stage-compared:
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)
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 \
932 touch .bad-compare ; \
937 for i in `cd $(STAGE4DIR) ; find . -name \*.o -print` ; do \
938 cmp $(STAGE3DIR)/$$i $(STAGE4DIR)/$$i || touch .bad-compare ; \
941 if [ -f CLEAN_ALL ] ; then \
942 rm -rf $(STAGE2DIR) $(STAGE3DIR) $(STAGE4DIR) ; \
944 if [ -f CLEAN_STAGES ] ; then \
945 if [ -f .bad-compare ] ; then \
948 rm -rf $(STAGE1DIR) $(STAGE2DIR) $(STAGE3DIR) ; \
956 rm -rf $(HOLESDIR) $(INPLACEDIR) $(WORKING_DIR)* $(host)-stamp-* *~