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 ifneq ($(build),$(host))
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).
67 AR_FOR_TARGET := $(target)-ar
69 AS_FOR_TARGET := $(target)-as
73 CC_FOR_TARGET := $(target)-gcc
75 CXX_FOR_TARGET := $(target)-c++
78 GXX_FOR_TARGET := $(target)-g++
79 HOST_PREFIX := $(build)-
80 HOST_PREFIX_1 := $(build)-
84 NM_FOR_TARGET := $(target)-nm
85 RANLIB := $(host)-ranlib
86 RANLIB_FOR_TARGET := $(target)-ranlib
89 ifeq ($(build),hppa1.1-hp-hpux)
95 "AR_FOR_TARGET=$(AR_FOR_TARGET)" \
97 "AS_FOR_TARGET=$(AS_FOR_TARGET)" \
100 "CC_FOR_BUILD=$(CC_FOR_BUILD)" \
101 "CC_FOR_TARGET=$(CC_FOR_TARGET)" \
103 "CXX_FOR_TARGET=$(CXX_FOR_TARGET)" \
105 "CXXFLAGS=$(CXXFLAGS)" \
107 "HOST_PREFIX=$(HOST_PREFIX)" \
108 "HOST_PREFIX_1=$(HOST_PREFIX_1)" \
110 "MAKEINFO=$(MAKEINFO)" \
111 "MAKEINFOFLAGS=$(MAKEINFOFLAGS)" \
114 "NM_FOR_TARGET=$(NM_FOR_TARGET)" \
116 "RANLIB_FOR_TARGET=$(RANLIB_FOR_TARGET)" \
117 "RELEASE_TAG=$(RELEASE_TAG)" \
118 "RUNTEST=$(relbindir)/runtest" \
125 # We must pass the build cross host tools in the environment of
126 # configure, so that autoconf scripts will run the right programs.
127 configenv := AR="$(AR)" CC="$(CC)" RANLIB="$(RANLIB)"
131 # This is a normal build on the host machine.
136 "CXXFLAGS=$(CXXFLAGS)" \
138 "MAKEINFOFLAGS=$(MAKEINFOFLAGS)" \
142 "RELEASE_TAG=$(RELEASE_TAG)"
148 #### we need to change the default C compiler for some hosts
149 ifeq ($(host),sparc-sun-solaris2)
153 ifeq ($(host),mips-sgi-irix4)
154 CC := cc -cckr -Wf,-XNg1500 -Wf,-XNk1000 -Wf,-XNh2000
157 ifeq ($(host),mips-mips-riscos5)
158 CC := cc -non_shared -systype sysv
161 ifeq ($(host),mips-dec-ultrix)
162 CC := cc -Wf,-XNg1000
165 ifeq ($(host),m68k-sun-sunos4.1.1)
170 # We want to use stabs for MIPS targets.
171 ifeq ($(target),mips-idt-ecoff)
172 configargs = -with-stabs
175 ifeq ($(target),mips-dec-ultrix)
176 configargs = -with-stabs
179 ifeq ($(target),mips-sgi-irix4)
180 configargs = -with-stabs
183 # We must use stabs for SVR4 targets.
184 ifeq ($(target),i386-sysv4.2)
185 configargs = -with-stabs
189 FLAGS_TO_PASS := "CC=$(CC)" $(FLAGS_TO_PASS)
192 #### and on some, we need CONFIG_SHELL
193 ifeq ($(patsubst %-lynxos,lynxos,$(host)),lynxos)
194 FLAGS_TO_PASS := "CONFIG_SHELL=$(CONFIG_SHELL)" $(FLAGS_TO_PASS)
198 # These are the prefixes used for Cygnus builds.
199 prefixes = --prefix=$(release_root) --exec-prefix=$(release_root)/H-$(host)
201 relbindir = $(release_root)/H-$(build)/bin
203 ### general config stuff
204 WORKING_DIR := $(host)-objdir
205 STAGE1DIR := $(WORKING_DIR).1
206 STAGE2DIR := $(WORKING_DIR).2
207 STAGE3DIR := $(WORKING_DIR).3
208 STAGE4DIR := $(WORKING_DIR).4
209 INPLACEDIR := $(host)-in-place
211 # Arrange to find the needed programs. If we are building on a
212 # machine other than the host, we must find the cross-compilers.
214 ifneq ($(build),$(host))
217 HOLESSTAMP := $(holesys)-stamp-holes $(build)-x-$(host)-stamp-holes $(build)-x-$(target)-stamp-holes
218 HOLESDIR := $(holesys)-holes
219 BUILD_HOST_HOLES_DIR := $(build)-x-$(host)-holes
220 BUILD_TARGET_HOLES_DIR := $(build)-x-$(target)-holes
222 SET_NATIVE_HOLES := SHELL=$(SHELL) ; PATH=`pwd`/$(HOLESDIR):`pwd`/$(BUILD_HOST_HOLES_DIR):`pwd`/$(BUILD_TARGET_HOLES_DIR) ; export PATH ; export SHELL ;
223 SET_CYGNUS_PATH := SHELL=$(SHELL) ; PATH=`pwd`/$(HOLESDIR):`pwd`/$(BUILD_HOST_HOLES_DIR):`pwd`/$(BUILD_TARGET_HOLES_DIR) ; export PATH ; export SHELL ;
224 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 ;
229 HOLESSTAMP := $(holesys)-stamp-holes
230 HOLESDIR := $(holesys)-holes
232 SET_NATIVE_HOLES := SHELL=$(SHELL) ; PATH=`pwd`/$(HOLESDIR) ; export PATH ; export SHELL ;
233 SET_CYGNUS_PATH := SHELL=$(SHELL) ; PATH=$(relbindir):`pwd`/$(HOLESDIR) ; export PATH ; export SHELL ;
234 SET_LATEST_PATH := SHELL=$(SHELL) ; PATH=/usr/latest/bin:`pwd`/$(HOLESDIR) ; export PATH ; export SHELL ;
239 ifneq ($(target),$(host))
241 ## This is a cross compilation
243 arch = $(host)-x-$(target)
244 config = -host=$(host) -target=$(target)
245 FLAGS_TO_PASS := $(FLAGS_TO_PASS) "target=$(target)"
247 ifneq ($(build),$(host))
248 all: do-cygnus do-latest
249 build-all: build-cygnus build-latest
251 all: do-native do-latest
252 build-all: build-native build-latest
258 ## This is a native compilation
261 config = -host=$(host)
262 ifneq ($(build),$(host))
263 all: do-cygnus do-latest
265 all: $(host)-stamp-3stage-done
267 #all: in-place do1 do2 do3 comparison
271 NATIVEDIR := $(arch)-native-objdir
272 CYGNUSDIR := $(arch)-cygnus-objdir
273 LATESTDIR := $(arch)-latest-objdir
274 DOSDIR := dos-x-$(target)-objdir
277 #everything: in-place do1 do2 do3 comparison do-cygnus
281 $(MAKE) -f test-build.mk CFLAGS= build=$(host) host=i386-go32 target=$(target) do-dos
283 $(MAKE) -f test-build.mk CFLAGS= build=$(host) host=i386-go32 target=$(target) path-dos
286 do-dos: $(HOLESSTAMP) dos-x-$(target)-stamp-done
287 build-dos: $(HOLESSTAMP) dos-x-$(target)-stamp-dos-checked
288 config-dos: $(HOLESSTAMP) dos-x-$(target)-stamp-dos-configured
290 @echo "$(SET_CYGNUS_PATH)"
292 dos-x-$(target)-stamp-done:
293 [ -f $(relbindir)/$(host)-gcc ] || (echo "must have gcc available"; exit 1)
294 $(SET_CYGNUS_PATH) $(TIME) $(GNU_MAKE) -f test-build.mk dos-x-$(target)-stamp-installed $(FLAGS_TO_PASS)
295 if [ -f CLEAN_ALL -o -f CLEAN_CROSSES ] ; then rm -rf $(DOSDIR) ; else true ; fi
298 dos-x-$(target)-stamp-installed: $(HOLESSTAMP) dos-x-$(target)-stamp-intermediate
299 [ -d dos-x-$(target)-installed ] || mkdir dos-x-$(target)-installed
300 $(SET_CYGNUS_PATH) $(TREE)/release/mkdosrel dos-x-$(target)-intermediate \
301 dos-x-$(target)-installed $(target)
302 # (cd dos-x-$(target)-installed; find . -print | $(TREE)/release/make8.3)
305 dos-x-$(target)-stamp-intermediate: $(HOLESSTAMP) dos-x-$(target)-stamp-dos-checked
306 [ -d dos-x-$(target)-intermediate ] || mkdir dos-x-$(target)-intermediate
307 dir=`pwd` ; export dir ; \
308 $(SET_CYGNUS_PATH) cd $(DOSDIR) ; $(TIME) $(MAKE) $(FLAGS_TO_PASS) $(GNUC) \
309 prefix=$$dir/dos-x-$(target)-intermediate install install-info
312 dos-x-$(target)-stamp-dos-checked: $(HOLESSTAMP) dos-x-$(target)-stamp-dos-built
313 # cd $(DOSDIR) ; $(TIME) $(MAKE) $(FLAGS_TO_PASS) $(GNUC) check
316 dos-x-$(target)-stamp-dos-built: $(HOLESSTAMP) dos-x-$(target)-stamp-dos-configured
317 $(SET_CYGNUS_PATH) cd $(DOSDIR) ; $(TIME) $(MAKE) $(FLAGS_TO_PASS) $(GNUC) all info
320 dos-x-$(target)-stamp-dos-configured: $(HOLESSTAMP)
321 [ -d $(DOSDIR) ] || mkdir $(DOSDIR)
322 $(SET_CYGNUS_PATH) cd $(DOSDIR) ; $(GNUC) $(configenv) $(TIME) $(CONFIG_SHELL) \
323 ../$(TREE)/configure $(config) -v --srcdir=../$(TREE) --prefix=/cygnus \
324 --program-transform-name='' $(configargs)
331 do-native: $(HOLESSTAMP) $(arch)-stamp-native
332 do-native-config: $(arch)-stamp-native-configured
333 build-native: $(HOLESSTAMP) $(arch)-stamp-native-checked
334 config-native: $(HOLESSTAMP) $(arch)-stamp-native-configured
336 $(arch)-stamp-native: $(HOLESSTAMP)
337 $(SET_NATIVE_HOLES) $(TIME) $(GNU_MAKE) -f test-build.mk $(arch)-stamp-native-installed $(FLAGS_TO_PASS)
338 if [ -f CLEAN_ALL -o -f CLEAN_CROSSES ] ; then rm -rf $(NATIVEDIR) ; else true ; fi
339 touch $(arch)-stamp-native
341 $(arch)-stamp-native-installed: $(HOLESSTAMP) $(arch)-stamp-native-checked
342 $(SET_NATIVE_HOLES) cd $(NATIVEDIR) ; $(TIME) $(MAKE) $(FLAGS_TO_PASS) install
343 $(SET_NATIVE_HOLES) cd $(NATIVEDIR) ; $(TIME) $(MAKE) $(FLAGS_TO_PASS) install-info
346 $(arch)-stamp-native-checked: $(arch)-stamp-native-built
347 # cd $(NATIVEDIR) ; $(TIME) $(MAKE) $(FLAGS_TO_PASS) check
350 $(arch)-stamp-native-built: $(HOLESSTAMP) $(arch)-stamp-native-configured
351 $(SET_NATIVE_HOLES) cd $(NATIVEDIR) ; $(TIME) $(MAKE) $(FLAGS_TO_PASS) all
352 $(SET_NATIVE_HOLES) cd $(NATIVEDIR) ; $(TIME) $(MAKE) $(FLAGS_TO_PASS) info
355 $(arch)-stamp-native-configured: $(HOLESSTAMP)
356 [ -d $(NATIVEDIR) ] || mkdir $(NATIVEDIR)
357 $(SET_NATIVE_HOLES) cd $(NATIVEDIR) ; $(configenv) CC="$(CC)" $(TIME) $(CONFIG_SHELL) ../$(TREE)/configure $(config) -v --srcdir=../$(TREE) $(prefixes) $(configargs)
362 do-cygnus: $(HOLESSTAMP) $(arch)-stamp-cygnus
363 build-cygnus: $(HOLESSTAMP) $(arch)-stamp-cygnus-checked
364 config-cygnus: $(HOLESSTAMP) $(arch)-stamp-cygnus-configured
366 $(SET_CYGNUS_PATH) echo $$PATH
368 vault-cygnus: $(HOLESSTAMP) $(arch)-stamp-cygnus-built
369 $(SET_CYGNUS_PATH) cd $(CYGNUSDIR) ; $(TIME) $(MAKE) $(FLAGS_TO_PASS) $(GNUC) vault-install
372 $(arch)-stamp-cygnus:
373 [ -f $(relbindir)/$(host)-gcc ] || (echo "must have gcc available"; exit 1)
374 $(SET_CYGNUS_PATH) $(TIME) $(GNU_MAKE) -f test-build.mk $(arch)-stamp-cygnus-installed $(FLAGS_TO_PASS)
375 if [ -f CLEAN_ALL -o -f CLEAN_CROSSES ] ; then rm -rf $(CYGNUSDIR) ; else true ; fi
376 touch $(arch)-stamp-cygnus
378 $(arch)-stamp-cygnus-installed: $(HOLESSTAMP) $(arch)-stamp-cygnus-checked
379 $(SET_CYGNUS_PATH) cd $(CYGNUSDIR) ; $(TIME) $(MAKE) $(FLAGS_TO_PASS) $(GNUC) install
380 $(SET_CYGNUS_PATH) cd $(CYGNUSDIR) ; $(TIME) $(MAKE) $(FLAGS_TO_PASS) $(GNUC) install-info
381 if [ -f VAULT-INSTALL ] ; then \
382 $(SET_CYGNUS_PATH) cd $(CYGNUSDIR) ; $(MAKE) $(FLAGS_TO_PASS) $(GNUC) vault-install ; \
386 $(arch)-stamp-cygnus-checked: $(HOLESSTAMP) $(arch)-stamp-cygnus-built
387 # cd $(CYGNUSDIR) ; $(TIME) $(MAKE) $(FLAGS_TO_PASS) $(GNUC) check
390 $(arch)-stamp-cygnus-built: $(HOLESSTAMP) $(arch)-stamp-cygnus-configured
391 $(SET_CYGNUS_PATH) cd $(CYGNUSDIR) ; $(TIME) $(MAKE) $(FLAGS_TO_PASS) $(GNUC) all
392 $(SET_CYGNUS_PATH) cd $(CYGNUSDIR) ; $(TIME) $(MAKE) $(FLAGS_TO_PASS) $(GNUC) info
395 $(arch)-stamp-cygnus-configured: $(HOLESSTAMP)
396 [ -d $(CYGNUSDIR) ] || mkdir $(CYGNUSDIR)
397 $(SET_CYGNUS_PATH) cd $(CYGNUSDIR) ; $(configenv) $(GNUC) $(TIME) $(CONFIG_SHELL) ../$(TREE)/configure $(config) -v --srcdir=../$(TREE) $(prefixes) $(configargs)
401 do-latest: $(HOLESSTAMP) $(arch)-stamp-latest
402 build-latest: $(HOLESSTAMP) $(arch)-stamp-latest-checked
404 $(arch)-stamp-latest:
405 $(SET_LATEST_PATH) $(TIME) $(GNU_MAKE) -f test-build.mk $(arch)-stamp-latest-installed $(FLAGS_TO_PASS)
406 touch $(arch)-stamp-latest
408 $(arch)-stamp-latest-installed: $(HOLESSTAMP) $(arch)-stamp-latest-checked
409 $(SET_LATEST_PATH) cd $(LATESTDIR) ; $(TIME) $(MAKE) $(FLAGS_TO_PASS) $(GNUC) install
410 $(SET_LATEST_PATH) cd $(LATESTDIR) ; $(TIME) $(MAKE) $(FLAGS_TO_PASS) $(GNUC) install-info
413 $(arch)-stamp-latest-checked: $(arch)-stamp-latest-built
414 # $(SET_LATEST_PATH) cd $(LATESTDIR) ; $(TIME) $(MAKE) $(FLAGS_TO_PASS) $(GNUC) check
417 $(arch)-stamp-latest-built: $(arch)-stamp-latest-configured
418 $(SET_LATEST_PATH) cd $(LATESTDIR) ; $(TIME) $(MAKE) $(FLAGS_TO_PASS) $(GNUC) all
419 $(SET_LATEST_PATH) cd $(LATESTDIR) ; $(TIME) $(MAKE) $(FLAGS_TO_PASS) $(GNUC) info
422 $(arch)-stamp-latest-configured:
423 [ -d $(LATESTDIR) ] || mkdir $(LATESTDIR)
424 $(SET_LATEST_PATH) cd $(LATESTDIR) ; $(configenv) $(GNUC) $(TIME) $(CONFIG_SHELL) ../$(TREE)/configure $(config) -v --srcdir=../$(TREE) $(prefixes) $(configargs)
429 in-place: $(host)-stamp-in-place
431 $(host)-stamp-in-place:
432 PATH=/bin:/usr/bin:/usr/ucb ; \
434 SHELL=/bin/sh ; export SHELL ; \
435 $(TIME) $(GNU_MAKE) -f test-build.mk $(host)-stamp-in-place-installed host=$(host) $(FLAGS_TO_PASS)
437 if [ -f CLEAN_ALL ] ; then \
438 rm -rf $(INPLACEDIR) ; \
440 mv $(INPLACEDIR) $(STAGE1DIR) ; \
443 $(host)-stamp-in-place-installed: $(host)-stamp-in-place-checked
444 cd $(INPLACEDIR) ; $(TIME) $(MAKE) $(FLAGS_TO_PASS) "CFLAGS=$(CFLAGS)" install host=$(host)
445 cd $(INPLACEDIR) ; $(TIME) $(MAKE) $(FLAGS_TO_PASS) "CFLAGS=$(CFLAGS)" install-info host=$(host)
448 $(host)-stamp-in-place-checked: $(host)-stamp-in-place-built
449 # cd $(INPLACEDIR) ; $(TIME) $(MAKE) $(FLAGS_TO_PASS) "CFLAGS=$(CFLAGS)" check host=$(host)
452 $(host)-stamp-in-place-built: $(host)-stamp-in-place-configured
453 cd $(INPLACEDIR) ; $(TIME) $(MAKE) $(FLAGS_TO_PASS) "CFLAGS=$(CFLAGS)" all host=$(host)
454 cd $(INPLACEDIR) ; $(TIME) $(MAKE) $(FLAGS_TO_PASS) "CFLAGS=$(CFLAGS)" info host=$(host)
457 $(host)-stamp-in-place-configured: $(host)-stamp-in-place-cp
458 cd $(INPLACEDIR) ; $(configenv) CC="$(CC)" $(TIME) $(CONFIG_SHELL) ./configure $(config) -v $(prefixes) $(configargs)
461 $(host)-stamp-in-place-cp:
464 (cd $(TREE) ; tar cf - .) | (cd $(INPLACEDIR) ; tar xf -)
467 $(host)-stamp-3stage-done: do1 do2 do3 comparison
472 do1: $(HOLESSTAMP) $(host)-stamp-stage1
473 do1-config: $(HOLESSTAMP) $(host)-stamp-stage1-configured
474 do1-build: $(HOLESSTAMP) $(host)-stamp-stage1-checked
476 do1-vault: $(HOLESSTAMP) $(host)-stamp-stage1-built
477 if [ -d $(WORKING_DIR).1 ] ; then \
478 $(SET_NATIVE_HOLES) cd $(WORKING_DIR).1 ; $(MAKE) $(FLAGS_TO_PASS) host=$(host) "CFLAGS=$(CFLAGS)" vault-install ; \
480 $(SET_NATIVE_HOLES) cd $(WORKING_DIR) ; $(MAKE) $(FLAGS_TO_PASS) host=$(host) "CFLAGS=$(CFLAGS)" vault-install ; \
483 $(host)-stamp-stage1:
484 if [ -d $(STAGE1DIR) ] ; then \
485 mv $(STAGE1DIR) $(WORKING_DIR) ; \
489 $(SET_NATIVE_HOLES) $(TIME) $(GNU_MAKE) -f test-build.mk $(FLAGS_TO_PASS) host=$(host) $(host)-stamp-stage1-installed
491 if [ -f CLEAN_ALL ] ; then \
492 rm -rf $(WORKING_DIR) ; \
494 mv $(WORKING_DIR) $(STAGE1DIR) ; \
497 $(host)-stamp-stage1-installed: $(host)-stamp-stage1-checked
498 $(SET_NATIVE_HOLES) cd $(WORKING_DIR) ; $(TIME) $(MAKE) $(FLAGS_TO_PASS) "CFLAGS=$(CFLAGS)" install host=$(host)
499 $(SET_NATIVE_HOLES) cd $(WORKING_DIR) ; $(TIME) $(MAKE) $(FLAGS_TO_PASS) "CFLAGS=$(CFLAGS)" install-info host=$(host)
500 ifeq ($(host),rs6000-ibm-aix)
501 -rm $(relbindir)/make
505 $(host)-stamp-stage1-checked: $(host)-stamp-stage1-built
506 # $(SET_NATIVE_HOLES) cd $(WORKING_DIR) ; $(TIME) $(MAKE) $(FLAGS_TO_PASS) "CFLAGS=$(CFLAGS)" check host=$(host)
509 $(host)-stamp-stage1-built: $(host)-stamp-stage1-configured
510 $(SET_NATIVE_HOLES) cd $(WORKING_DIR) ; $(TIME) $(MAKE) $(FLAGS_TO_PASS) "CFLAGS=$(CFLAGS)" all host=$(host)
511 $(SET_NATIVE_HOLES) cd $(WORKING_DIR) ; $(TIME) $(MAKE) $(FLAGS_TO_PASS) "CFLAGS=$(CFLAGS)" info host=$(host)
514 $(host)-stamp-stage1-configured:
515 [ -d $(WORKING_DIR) ] || mkdir $(WORKING_DIR)
516 $(SET_NATIVE_HOLES) cd $(WORKING_DIR) ; \
517 $(configenv) CC="$(CC)" $(TIME) $(CONFIG_SHELL) ../$(TREE)/configure $(config) -v --srcdir=../$(TREE) $(prefixes) $(configargs)
521 do2: $(HOLESDIR) $(host)-stamp-stage2
523 do2-vault: $(HOLESSTAMP) $(host)-stamp-stage2-built
524 if [ -d $(WORKING_DIR).2 ] ; then \
525 $(SET_CYGNUS_PATH) cd $(WORKING_DIR).2 ; $(MAKE) $(FLAGS_TO_PASS) host=$(host) "CFLAGS=$(CFLAGS)" vault-install ; \
527 $(SET_CYGNUS_PATH) cd $(WORKING_DIR) ; $(MAKE) $(FLAGS_TO_PASS) host=$(host) "CFLAGS=$(CFLAGS)" vault-install ; \
532 $(host)-stamp-stage2:
533 if [ -d $(STAGE2DIR) ] ; then \
534 mv $(STAGE2DIR) $(WORKING_DIR) ; \
538 $(SET_CYGNUS_PATH) $(TIME) $(GNU_MAKE) $(FLAGS_TO_PASS) -f test-build.mk -w $(host)-stamp-stage2-installed
539 mv $(WORKING_DIR) $(STAGE2DIR)
543 $(host)-stamp-stage2-installed: $(host)-stamp-stage2-checked
544 $(SET_CYGNUS_PATH) cd $(WORKING_DIR) ; $(TIME) $(MAKE) -w $(FLAGS_TO_PASS) $(GNUC) "CFLAGS=$(CFLAGS)" install host=$(host)
545 $(SET_CYGNUS_PATH) cd $(WORKING_DIR) ; $(TIME) $(MAKE) -w $(FLAGS_TO_PASS) $(GNUC) "CFLAGS=$(CFLAGS)" install-info host=$(host)
548 $(host)-stamp-stage2-checked: $(host)-stamp-stage2-built
549 # $(SET_CYGNUS_PATH) cd $(WORKING_DIR) ; $(TIME) $(MAKE) -w $(FLAGS_TO_PASS) $(GNUC) "CFLAGS=$(CFLAGS)" check host=$(host)
552 $(host)-stamp-stage2-built: $(host)-stamp-stage2-configured
553 $(SET_CYGNUS_PATH) cd $(WORKING_DIR) ; $(TIME) $(MAKE) -w $(FLAGS_TO_PASS) $(GNUC) "CFLAGS=$(CFLAGS)" all host=$(host)
554 $(SET_CYGNUS_PATH) cd $(WORKING_DIR) ; $(TIME) $(MAKE) -w $(FLAGS_TO_PASS) $(GNUC) "CFLAGS=$(CFLAGS)" info host=$(host)
557 $(host)-stamp-stage2-configured:
558 [ -d $(WORKING_DIR) ] || mkdir $(WORKING_DIR)
559 $(SET_CYGNUS_PATH) cd $(WORKING_DIR) ; \
560 $(configenv) $(GNUC) $(TIME) $(CONFIG_SHELL) ../$(TREE)/configure $(config) -v --srcdir=../$(TREE) $(prefixes) $(configargs)
564 do3: $(HOLESDIR) $(host)-stamp-stage3
566 do3-vault: $(HOLESSTAMP) $(host)-stamp-stage3-built
567 if [ -d $(WORKING_DIR).3 ] ; then \
568 $(SET_CYGNUS_PATH) cd $(WORKING_DIR).3 ; $(MAKE) $(FLAGS_TO_PASS) host=$(host) "CFLAGS=$(CFLAGS)" vault-install ; \
570 $(SET_CYGNUS_PATH) cd $(WORKING_DIR) ; $(MAKE) $(FLAGS_TO_PASS) host=$(host) "CFLAGS=$(CFLAGS)" vault-install ; \
573 $(host)-stamp-stage3:
574 if [ -d $(STAGE3DIR) ] ; then \
575 mv $(STAGE3DIR) $(WORKING_DIR) ; \
579 $(SET_CYGNUS_PATH) $(TIME) $(GNU_MAKE) $(FLAGS_TO_PASS) -f test-build.mk -w $(host)-stamp-stage3-installed
580 mv $(WORKING_DIR) $(STAGE3DIR)
584 $(host)-stamp-stage3-installed: $(host)-stamp-stage3-checked
585 $(SET_CYGNUS_PATH) cd $(WORKING_DIR) ; $(TIME) $(MAKE) -w $(FLAGS_TO_PASS) $(GNUC) "CFLAGS=$(CFLAGS)" install host=$(host)
586 $(SET_CYGNUS_PATH) cd $(WORKING_DIR) ; $(TIME) $(MAKE) -w $(FLAGS_TO_PASS) $(GNUC) "CFLAGS=$(CFLAGS)" install-info host=$(host)
587 if [ -f VAULT-INSTALL ] ; then \
588 $(SET_CYGNUS_PATH) cd $(CYGNUSDIR) ; $(MAKE) $(FLAGS_TO_PASS) $(GNUC) vault-install ; \
592 $(host)-stamp-stage3-checked: $(host)-stamp-stage3-built
593 # $(SET_CYGNUS_PATH) cd $(WORKING_DIR) ; $(TIME) $(MAKE) -w $(FLAGS_TO_PASS) $(GNUC) "CFLAGS=$(CFLAGS)" check host=$(host)
596 $(host)-check-3stage: $(host)-stamp-stage3
597 $(SET_CYGNUS_PATH) cd $(STAGE3DIR) ; $(TIME) $(MAKE) -w $(FLAGS_TO_PASS) $(GNUC) "CFLAGS=$(CFLAGS)" check host=$(host)
600 $(host)-stamp-stage3-built: $(host)-stamp-stage3-configured
601 $(SET_CYGNUS_PATH) cd $(WORKING_DIR) ; $(TIME) $(MAKE) -w $(FLAGS_TO_PASS) $(GNUC) "CFLAGS=$(CFLAGS)" all host=$(host)
602 $(SET_CYGNUS_PATH) cd $(WORKING_DIR) ; $(TIME) $(MAKE) -w $(FLAGS_TO_PASS) $(GNUC) "CFLAGS=$(CFLAGS)" info host=$(host)
605 $(host)-stamp-stage3-configured:
606 [ -d $(WORKING_DIR) ] || mkdir $(WORKING_DIR)
607 $(SET_CYGNUS_PATH) cd $(WORKING_DIR) ; \
608 $(configenv) $(GNUC) $(TIME) $(CONFIG_SHELL) ../$(TREE)/configure $(config) -v --srcdir=../$(TREE) $(prefixes) $(configargs)
612 do4: $(HOLESDIR) $(host)-stamp-stage4
614 $(host)-stamp-stage4:
615 if [ -d $(STAGE4DIR) ] ; then \
616 mv $(STAGE4DIR) $(WORKING_DIR) ; \
620 $(SET_CYGNUS_PATH) $(TIME) $(GNU_MAKE) $(FLAGS_TO_PASS) -f test-build.mk -w $(host)-stamp-stage4-checked
621 mv $(WORKING_DIR) $(STAGE4DIR)
625 $(host)-stamp-stage4-installed: $(host)-stamp-stage4-checked
626 $(SET_CYGNUS_PATH) cd $(WORKING_DIR) ; $(TIME) $(MAKE) -w $(FLAGS_TO_PASS) $(GNUC) "CFLAGS=$(CFLAGS)" install host=$(host)
627 $(SET_CYGNUS_PATH) cd $(WORKING_DIR) ; $(TIME) $(MAKE) -w $(FLAGS_TO_PASS) $(GNUC) "CFLAGS=$(CFLAGS)" install-info host=$(host)
630 $(host)-stamp-stage4-checked: $(host)-stamp-stage4-built
631 # $(SET_CYGNUS_PATH) cd $(WORKING_DIR) ; $(TIME) $(MAKE) -w $(FLAGS_TO_PASS) $(GNUC) "CFLAGS=$(CFLAGS)" check host=$(host)
634 $(host)-stamp-stage4-built: $(host)-stamp-stage4-configured
635 $(SET_CYGNUS_PATH) cd $(WORKING_DIR) ; $(TIME) $(MAKE) -w $(FLAGS_TO_PASS) $(GNUC) "CFLAGS=$(CFLAGS)" all host=$(host)
636 $(SET_CYGNUS_PATH) cd $(WORKING_DIR) ; $(TIME) $(MAKE) -w $(FLAGS_TO_PASS) $(GNUC) "CFLAGS=$(CFLAGS)" info host=$(host)
639 $(host)-stamp-stage4-configured:
640 [ -d $(WORKING_DIR) ] || mkdir $(WORKING_DIR)
641 $(SET_CYGNUS_PATH) cd $(WORKING_DIR) ; \
642 $(configenv) $(GNUC) $(TIME) $(CONFIG_SHELL) ../$(TREE)/configure $(config) -v --srcdir=../$(TREE) $(prefixes) $(configargs)
645 # These things are needed by a three-stage, but are not included locally.
701 ### so far only sun make supports VPATH
702 ifeq ($(subst sun3,sun4,$(holesys)),sun4)
708 ### solaris 2 -- don't use /usr/ucb/cc
709 ifeq (sparc-sun-solaris2,$(holesys))
710 SET_NATIVE_HOLES := SHELL=$(SHELL) ; PATH=/opt/SUNWspro/bin:`pwd`/$(HOLESDIR) ; export PATH ; export SHELL ;
711 HOLE_DIRS := /usr/ccs/bin
716 ifeq ($(host),i386-go32)
717 DOS_HOLES := aout2exe doschk file
720 ### These things are also needed by a three-stage, but in this case, the GNU version of the tool is required.
728 ### look in these directories for things missing from a three-stage
736 ### look in these directories for alternate versions of some tools.
737 PARTIAL_HOLE_DIRS := \
739 /usr/progressive/bin \
740 $(PARTIAL_HOLE_DIRS) \
744 $(HOLESDIR): $(holesys)-stamp-holes
746 $(holesys)-stamp-holes:
749 @for i in $(HOLES) ; do \
751 for j in $(HOLE_DIRS) ; do \
752 if [ -x $$j/$$i ] ; then \
753 ln -s $$j/$$i $(HOLESDIR) || cp $$j/$$i $(HOLESDIR) ; \
754 echo $$i from $$j ; \
761 *) echo $$i is NOT found ;; \
764 @for i in $(PARTIAL_HOLES) ; do \
766 for j in $(PARTIAL_HOLE_DIRS) ; do \
767 if [ -x $$j/$$i ] ; then \
768 rm -f $(HOLESDIR)/$$i ; \
769 cp $$j/$$i $(HOLESDIR)/$$i || exit 1; \
770 echo $$i from $$j ; \
777 *) echo $$i is NOT found ;; \
781 cd $(HOLESDIR); rm -f $(NUKEM)
785 # Get the cross-tools for build cross host when not building on the host.
787 BUILD_HOST_HOLES := \
799 BUILD_HOLES_DIRS := $(release_root)/H-$(build)/bin $(PARTIAL_HOLE_DIRS)
801 ifdef BUILD_HOST_HOLES_DIR
802 $(BUILD_HOST_HOLES_DIR): $(build)-x-$(host)-stamp-holes
805 ifneq ($(build),$(host))
806 $(build)-x-$(host)-stamp-holes:
807 -rm -rf $(BUILD_HOST_HOLES_DIR)
808 -mkdir $(BUILD_HOST_HOLES_DIR)
809 @for i in $(BUILD_HOST_HOLES) ; do \
811 for j in $(BUILD_HOLES_DIRS) ; do \
812 if [ -x $$j/$$i ] ; then \
813 ln -s $$j/$$i $(BUILD_HOST_HOLES_DIR) || cp $$j/$$i $(BUILD_HOST_HOLES_DIR) ; \
814 echo $$i from $$j ; \
821 *) echo $$i is NOT found ;; \
827 # Get the cross tools for build cross target when not building on the host.
829 BUILD_TARGET_HOLES := \
841 ifdef BUILD_TARGET_HOLES_DIR
842 $(BUILD_TARGET_HOLES_DIR): $(build)-x-$(target)-stamp-holes
845 ifneq ($(build),$(target))
846 $(build)-x-$(target)-stamp-holes:
847 -rm -rf $(BUILD_TARGET_HOLES_DIR)
848 -mkdir $(BUILD_TARGET_HOLES_DIR)
849 @for i in $(BUILD_TARGET_HOLES) ; do \
851 for j in $(BUILD_HOLES_DIRS) ; do \
852 if [ -x $$j/$$i ] ; then \
853 ln -s $$j/$$i $(BUILD_TARGET_HOLES_DIR) || cp $$j/$$i $(BUILD_TARGET_HOLES_DIR) ; \
854 echo $$i from $$j ; \
861 *) echo $$i is NOT found ;; \
868 comparison: $(host)-stamp-3stage-compared
869 comparison-stage3to4: $(host)-stamp-4stage-compared
871 $(host)-stamp-3stage-compared:
873 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)
874 for i in `cd $(STAGE3DIR) ; find . -name \*.o -print` ; do \
875 tail +10c $(STAGE2DIR)/$$i > foo1 ; \
876 tail +10c $(STAGE3DIR)/$$i > foo2 ; \
877 if cmp foo1 foo2 ; then \
881 touch .bad-compare ; \
886 for i in `cd $(STAGE3DIR) ; find . -name \*.o -print` ; do \
887 cmp $(STAGE2DIR)/$$i $(STAGE3DIR)/$$i || touch .bad-compare ; \
890 if [ -f CLEAN_ALL ] ; then \
891 rm -rf $(STAGE2DIR) $(STAGE3DIR) ; \
893 if [ -f CLEAN_STAGES ] ; then \
894 if [ -f .bad-compare ] ; then \
897 rm -rf $(STAGE1DIR) $(STAGE2DIR) ; \
904 $(host)-stamp-4stage-compared:
906 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)
907 for i in `cd $(STAGE4DIR) ; find . -name \*.o -print` ; do \
908 tail +10c $(STAGE3DIR)/$$i > foo1 ; \
909 tail +10c $(STAGE4DIR)/$$i > foo2 ; \
910 if cmp foo1 foo2 ; then \
914 touch .bad-compare ; \
919 for i in `cd $(STAGE4DIR) ; find . -name \*.o -print` ; do \
920 cmp $(STAGE3DIR)/$$i $(STAGE4DIR)/$$i || touch .bad-compare ; \
923 if [ -f CLEAN_ALL ] ; then \
924 rm -rf $(STAGE2DIR) $(STAGE3DIR) $(STAGE4DIR) ; \
926 if [ -f CLEAN_STAGES ] ; then \
927 if [ -f .bad-compare ] ; then \
930 rm -rf $(STAGE1DIR) $(STAGE2DIR) $(STAGE3DIR) ; \
938 rm -rf $(HOLESDIR) $(INPLACEDIR) $(WORKING_DIR)* $(host)-stamp-* *~