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
41 GNU_MAKE := /usr/latest/bin/make -w
46 #override MAKEFLAGS :=
58 ifneq ($(build),$(host))
60 # We are building on a machine other than the host. We rely upon
61 # previously built cross-compilers from the build machine to the host
62 # (used to build the executables) and from the build machine to the
63 # target (used to build the libraries).
66 AR_FOR_TARGET := $(target)-ar
68 AS_FOR_TARGET := $(target)-as
71 CC_FOR_TARGET := $(target)-gcc
73 CXX_FOR_TARGET := $(target)-c++
76 GXX_FOR_TARGET := $(target)-g++
77 HOST_PREFIX := $(build)-
78 HOST_PREFIX_1 := $(build)-
80 MUNCH_NM := $(host)-nm
82 NM_FOR_TARGET := $(target)-nm
83 RANLIB := $(host)-ranlib
84 RANLIB_FOR_TARGET := $(target)-ranlib
88 "AR_FOR_TARGET=$(AR_FOR_TARGET)" \
90 "AS_FOR_TARGET=$(AS_FOR_TARGET)" \
92 "CC_FOR_BUILD=$(CC_FOR_BUILD)" \
93 "CC_FOR_TARGET=$(CC_FOR_TARGET)" \
95 "CXX_FOR_TARGET=$(CXX_FOR_TARGET)" \
97 "CXXFLAGS=$(CXXFLAGS)" \
99 "HOST_PREFIX=$(HOST_PREFIX)" \
100 "HOST_PREFIX_1=$(HOST_PREFIX_1)" \
101 "MAKEINFO=$(MAKEINFO)" \
102 "MAKEINFOFLAGS=$(MAKEINFOFLAGS)" \
104 "MUNCH_NM=$(MUNCH_NM)" \
106 "NM_FOR_TARGET=$(NM_FOR_TARGET)" \
108 "RANLIB_FOR_TARGET=$(RANLIB_FOR_TARGET)" \
109 "RELEASE_TAG=$(RELEASE_TAG)" \
114 # We must pass the build cross host tools in the environment of
115 # configure, so that autoconf scripts will run the right programs.
116 configenv := AR="$(AR)" CC="$(CC)" RANLIB="$(RANLIB)"
120 # This is a normal build on the host machine.
125 "CXXFLAGS=$(CXXFLAGS)" \
127 "MAKEINFOFLAGS=$(MAKEINFOFLAGS)" \
130 "RELEASE_TAG=$(RELEASE_TAG)"
133 FLAGS_TO_PASS := "CC=$(CC)" $(FLAGS_TO_PASS)
141 # These are the prefixes used for Cygnus builds.
142 prefixes = --prefix=$(release_root) --exec-prefix=$(release_root)/H-$(host)
144 relbindir = $(release_root)/H-$(host)/bin
146 ### general config stuff
147 WORKING_DIR := $(host)-objdir
148 STAGE1DIR := $(WORKING_DIR).1
149 STAGE2DIR := $(WORKING_DIR).2
150 STAGE3DIR := $(WORKING_DIR).3
151 INPLACEDIR := $(host)-in-place
153 # Arrange to find the needed programs. If we are building on a
154 # machine other than the host, we must find the cross-compilers.
156 ifneq ($(build),$(host))
159 HOLESSTAMP := $(holesys)-stamp-holes $(build)-x-$(host)-stamp-holes $(build)-x-$(target)-stamp-holes
160 HOLESDIR := $(holesys)-holes
161 BUILD_HOST_HOLES_DIR := $(build)-x-$(host)-holes
162 BUILD_TARGET_HOLES_DIR := $(build)-x-$(target)-holes
164 SET_NATIVE_HOLES := SHELL=sh ; PATH=`pwd`/$(HOLESDIR):`pwd`/$(BUILD_HOST_HOLES_DIR):`pwd`/$(BUILD_TARGET_HOLES_DIR) ; export PATH ; export SHELL ;
165 SET_CYGNUS_PATH := SHELL=sh ; PATH=`pwd`/$(HOLESDIR):`pwd`/$(BUILD_HOST_HOLES_DIR):`pwd`/$(BUILD_TARGET_HOLES_DIR) ; export PATH ; export SHELL ;
166 SET_LATEST_PATH := SHELL=sh ; PATH=/usr/latest/bin:`pwd`/$(HOLESDIR):`pwd`/$(BUILD_HOST_HOLES_DIR):`pwd`/$(BUILD_TARGET_HOLES_DIR) ; export PATH ; export SHELL ;
171 HOLESSTAMP := $(holesys)-stamp-holes
172 HOLESDIR := $(holesys)-holes
174 SET_NATIVE_HOLES := SHELL=sh ; PATH=`pwd`/$(HOLESDIR) ; export PATH ; export SHELL ;
175 SET_CYGNUS_PATH := SHELL=sh ; PATH=$(relbindir):`pwd`/$(HOLESDIR) ; export PATH ; export SHELL ;
176 SET_LATEST_PATH := SHELL=sh ; PATH=/usr/latest/bin:`pwd`/$(HOLESDIR) ; export PATH ; export SHELL ;
181 ifneq ($(target),$(host))
183 ## This is a cross compilation
185 arch = $(host)-x-$(target)
186 config = -host=$(host) -target=$(target)
187 FLAGS_TO_PASS := $(FLAGS_TO_PASS) "target=$(target)"
189 ifneq ($(build),$(host))
190 all: do-cygnus do-latest
191 build-all: build-cygnus build-latest
193 all: do-native do-latest
194 build-all: build-native build-latest
197 ifeq ($(target),mips-idt-ecoff)
198 configargs := $(configargs) -with-gnu-as -with-stabs
201 ifeq ($(host),i386-go32)
202 ifeq ($(subst mips-idt-ecoff,sparclite-aout,$(target)),sparclite-aout)
203 configargs := $(configargs) -with-gnu-ld
209 ## This is a native compilation
212 config = -host=$(host)
213 ifneq ($(build),$(host))
214 all: do-cygnus do-latest
216 all: $(host)-stamp-3stage-done
218 #all: in-place do1 do2 do3 comparison
220 ifeq ($(subst mips-sgi-irix4,mips-dec-ultrix,$(host)),mips-dec-ultrix)
221 configargs := $(configargs) -with-gnu-as -with-stabs
226 ifeq ($(target),m68k-hp-hpux)
227 configargs := $(configargs) -with-gnu-as
231 NATIVEDIR := $(arch)-native-objdir
232 CYGNUSDIR := $(arch)-cygnus-objdir
233 LATESTDIR := $(arch)-latest-objdir
237 #everything: in-place do1 do2 do3 comparison do-cygnus
240 do-native: $(HOLESSTAMP) $(arch)-stamp-native
241 do-native-config: $(arch)-stamp-native-configured
242 build-native: $(HOLESSTAMP) $(arch)-stamp-native-checked
243 config-native: $(HOLESSTAMP) $(arch)-stamp-native-configured
245 $(arch)-stamp-native: $(HOLESSTAMP)
246 $(SET_NATIVE_HOLES) $(TIME) $(GNU_MAKE) -f test-build.mk $(arch)-stamp-native-installed $(FLAGS_TO_PASS)
247 if [ -f CLEAN_ALL ] ; then rm -rf $(NATIVEDIR) ; else true ; fi
248 touch $(arch)-stamp-native
250 $(arch)-stamp-native-installed: $(HOLESSTAMP) $(arch)-stamp-native-checked
251 $(SET_NATIVE_HOLES) cd $(NATIVEDIR) ; $(TIME) $(MAKE) $(FLAGS_TO_PASS) install
252 $(SET_NATIVE_HOLES) cd $(NATIVEDIR) ; $(TIME) $(MAKE) $(FLAGS_TO_PASS) install-info
255 $(arch)-stamp-native-checked: $(arch)-stamp-native-built
256 # cd $(NATIVEDIR) ; $(TIME) $(MAKE) $(FLAGS_TO_PASS) check
259 $(arch)-stamp-native-built: $(HOLESSTAMP) $(arch)-stamp-native-configured
260 $(SET_NATIVE_HOLES) cd $(NATIVEDIR) ; $(TIME) $(MAKE) $(FLAGS_TO_PASS) all
261 $(SET_NATIVE_HOLES) cd $(NATIVEDIR) ; $(TIME) $(MAKE) $(FLAGS_TO_PASS) info
264 $(arch)-stamp-native-configured: $(HOLESSTAMP)
265 [ -d $(NATIVEDIR) ] || mkdir $(NATIVEDIR)
266 $(SET_NATIVE_HOLES) cd $(NATIVEDIR) ; $(configenv) $(TIME) ../$(TREE)/configure $(config) -v --srcdir=../$(TREE) $(prefixes) $(configargs)
271 do-cygnus: $(HOLESSTAMP) $(arch)-stamp-cygnus
272 build-cygnus: $(HOLESSTAMP) $(arch)-stamp-cygnus-checked
273 config-cygnus: $(HOLESSTAMP) $(arch)-stamp-cygnus-configured
275 vault-cygnus: $(HOLESSTAMP) $(arch)-stamp-cygnus-built
276 $(SET_CYGNUS_PATH) cd $(CYGNUSDIR) ; $(TIME) $(MAKE) $(FLAGS_TO_PASS) $(GNUC) vault-install
279 $(arch)-stamp-cygnus:
280 [ -f $(relbindir)/$(host)-gcc ] || (echo "must have gcc available"; exit 1)
281 $(SET_CYGNUS_PATH) $(TIME) $(GNU_MAKE) -f test-build.mk $(arch)-stamp-cygnus-installed $(FLAGS_TO_PASS)
282 if [ -f CLEAN_ALL ] ; then rm -rf $(CYGNUSDIR) ; else true ; fi
283 touch $(arch)-stamp-cygnus
285 $(arch)-stamp-cygnus-installed: $(HOLESSTAMP) $(arch)-stamp-cygnus-checked
286 $(SET_CYGNUS_PATH) cd $(CYGNUSDIR) ; $(TIME) $(MAKE) $(FLAGS_TO_PASS) $(GNUC) install
287 $(SET_CYGNUS_PATH) cd $(CYGNUSDIR) ; $(TIME) $(MAKE) $(FLAGS_TO_PASS) $(GNUC) install-info
290 $(arch)-stamp-cygnus-checked: $(HOLESSTAMP) $(arch)-stamp-cygnus-built
291 # cd $(CYGNUSDIR) ; $(TIME) $(MAKE) $(FLAGS_TO_PASS) $(GNUC) check
294 $(arch)-stamp-cygnus-built: $(HOLESSTAMP) $(arch)-stamp-cygnus-configured
295 $(SET_CYGNUS_PATH) cd $(CYGNUSDIR) ; $(TIME) $(MAKE) $(FLAGS_TO_PASS) $(GNUC) all
296 $(SET_CYGNUS_PATH) cd $(CYGNUSDIR) ; $(TIME) $(MAKE) $(FLAGS_TO_PASS) $(GNUC) info
299 $(arch)-stamp-cygnus-configured: $(HOLESSTAMP)
300 [ -d $(CYGNUSDIR) ] || mkdir $(CYGNUSDIR)
301 $(SET_CYGNUS_PATH) cd $(CYGNUSDIR) ; $(GNUC) $(configenv) $(TIME) ../$(TREE)/configure $(config) -v --srcdir=../$(TREE) $(prefixes) $(configargs)
305 do-latest: $(HOLESSTAMP) $(arch)-stamp-latest
306 build-latest: $(HOLESSTAMP) $(arch)-stamp-latest-checked
308 $(arch)-stamp-latest:
309 $(SET_LATEST_PATH) $(TIME) $(GNU_MAKE) -f test-build.mk $(arch)-stamp-latest-installed $(FLAGS_TO_PASS)
310 touch $(arch)-stamp-latest
312 $(arch)-stamp-latest-installed: $(HOLESSTAMP) $(arch)-stamp-latest-checked
313 $(SET_LATEST_PATH) cd $(LATESTDIR) ; $(TIME) $(MAKE) $(FLAGS_TO_PASS) $(GNUC) install
314 $(SET_LATEST_PATH) cd $(LATESTDIR) ; $(TIME) $(MAKE) $(FLAGS_TO_PASS) $(GNUC) install-info
317 $(arch)-stamp-latest-checked: $(arch)-stamp-latest-built
318 # $(SET_LATEST_PATH) cd $(LATESTDIR) ; $(TIME) $(MAKE) $(FLAGS_TO_PASS) $(GNUC) check
321 $(arch)-stamp-latest-built: $(arch)-stamp-latest-configured
322 $(SET_LATEST_PATH) cd $(LATESTDIR) ; $(TIME) $(MAKE) $(FLAGS_TO_PASS) $(GNUC) all
323 $(SET_LATEST_PATH) cd $(LATESTDIR) ; $(TIME) $(MAKE) $(FLAGS_TO_PASS) $(GNUC) info
326 $(arch)-stamp-latest-configured:
327 [ -d $(LATESTDIR) ] || mkdir $(LATESTDIR)
328 $(SET_LATEST_PATH) cd $(LATESTDIR) ; $(GNUC) $(configenv) $(TIME) ../$(TREE)/configure $(config) -v --srcdir=../$(TREE) $(prefixes) $(configargs)
333 in-place: $(host)-stamp-in-place
335 $(host)-stamp-in-place:
336 PATH=/bin:/usr/bin:/usr/ucb ; \
338 SHELL=/bin/sh ; export SHELL ; \
339 $(TIME) $(GNU_MAKE) -f test-build.mk $(host)-stamp-in-place-installed host=$(host) $(FLAGS_TO_PASS)
341 if [ -f CLEAN_ALL ] ; then \
342 rm -rf $(INPLACEDIR) ; \
344 mv $(INPLACEDIR) $(STAGE1DIR) ; \
347 $(host)-stamp-in-place-installed: $(host)-stamp-in-place-checked
348 cd $(INPLACEDIR) ; $(TIME) $(MAKE) $(FLAGS_TO_PASS) "CFLAGS=$(CFLAGS)" install host=$(host)
349 cd $(INPLACEDIR) ; $(TIME) $(MAKE) $(FLAGS_TO_PASS) "CFLAGS=$(CFLAGS)" install-info host=$(host)
352 $(host)-stamp-in-place-checked: $(host)-stamp-in-place-built
353 # cd $(INPLACEDIR) ; $(TIME) $(MAKE) $(FLAGS_TO_PASS) "CFLAGS=$(CFLAGS)" check host=$(host)
356 $(host)-stamp-in-place-built: $(host)-stamp-in-place-configured
357 cd $(INPLACEDIR) ; $(TIME) $(MAKE) $(FLAGS_TO_PASS) "CFLAGS=$(CFLAGS)" all host=$(host)
358 cd $(INPLACEDIR) ; $(TIME) $(MAKE) $(FLAGS_TO_PASS) "CFLAGS=$(CFLAGS)" info host=$(host)
361 $(host)-stamp-in-place-configured: $(host)-stamp-in-place-cp
362 cd $(INPLACEDIR) ; $(configenv) $(TIME) ./configure $(config) -v $(prefixes) $(configargs)
365 $(host)-stamp-in-place-cp:
368 (cd $(TREE) ; tar cf - .) | (cd $(INPLACEDIR) ; tar xf -)
371 $(host)-stamp-3stage-done: do1 do2 do3 comparison
376 do1: $(HOLESSTAMP) $(host)-stamp-stage1
377 do1-config: $(HOLESSTAMP) $(host)-stamp-stage1-configured
378 do1-build: $(HOLESSTAMP) $(host)-stamp-stage1-checked
380 do1-vault: $(HOLESSTAMP) $(host)-stamp-stage1-built
381 if [ -d $(WORKING_DIR).1 ] ; then \
382 $(SET_NATIVE_HOLES) cd $(WORKING_DIR).1 ; $(MAKE) $(FLAGS_TO_PASS) host=$(host) "CFLAGS=$(CFLAGS)" vault-install ; \
384 $(SET_NATIVE_HOLES) cd $(WORKING_DIR) ; $(MAKE) $(FLAGS_TO_PASS) host=$(host) "CFLAGS=$(CFLAGS)" vault-install ; \
387 $(host)-stamp-stage1:
388 if [ -d $(STAGE1DIR) ] ; then \
389 mv $(STAGE1DIR) $(WORKING_DIR) ; \
393 $(SET_NATIVE_HOLES) $(TIME) $(GNU_MAKE) -f test-build.mk $(FLAGS_TO_PASS) host=$(host) $(host)-stamp-stage1-installed
395 if [ -f CLEAN_ALL ] ; then \
396 rm -rf $(WORKING_DIR) ; \
398 mv $(WORKING_DIR) $(STAGE1DIR) ; \
401 $(host)-stamp-stage1-installed: $(host)-stamp-stage1-checked
402 $(SET_NATIVE_HOLES) cd $(WORKING_DIR) ; $(TIME) $(MAKE) $(FLAGS_TO_PASS) "CFLAGS=$(CFLAGS)" install host=$(host)
403 $(SET_NATIVE_HOLES) cd $(WORKING_DIR) ; $(TIME) $(MAKE) $(FLAGS_TO_PASS) "CFLAGS=$(CFLAGS)" install-info host=$(host)
404 ifeq ($(host),rs6000-ibm-aix)
405 -rm $(relbindir)/make
409 $(host)-stamp-stage1-checked: $(host)-stamp-stage1-built
410 # $(SET_NATIVE_HOLES) cd $(WORKING_DIR) ; $(TIME) $(MAKE) $(FLAGS_TO_PASS) "CFLAGS=$(CFLAGS)" check host=$(host)
413 $(host)-stamp-stage1-built: $(host)-stamp-stage1-configured
414 $(SET_NATIVE_HOLES) cd $(WORKING_DIR) ; $(TIME) $(MAKE) $(FLAGS_TO_PASS) "CFLAGS=$(CFLAGS)" all host=$(host)
415 $(SET_NATIVE_HOLES) cd $(WORKING_DIR) ; $(TIME) $(MAKE) $(FLAGS_TO_PASS) "CFLAGS=$(CFLAGS)" info host=$(host)
418 $(host)-stamp-stage1-configured:
419 [ -d $(WORKING_DIR) ] || mkdir $(WORKING_DIR)
420 $(SET_NATIVE_HOLES) cd $(WORKING_DIR) ; \
421 $(configenv) $(TIME) ../$(TREE)/configure $(config) -v --srcdir=../$(TREE) $(prefixes) $(configargs)
425 do2: $(HOLESDIR) $(host)-stamp-stage2
427 do2-vault: $(HOLESSTAMP) $(host)-stamp-stage2-built
428 if [ -d $(WORKING_DIR).2 ] ; then \
429 $(SET_CYGNUS_PATH) cd $(WORKING_DIR).2 ; $(MAKE) $(FLAGS_TO_PASS) host=$(host) "CFLAGS=$(CFLAGS)" vault-install ; \
431 $(SET_CYGNUS_PATH) cd $(WORKING_DIR) ; $(MAKE) $(FLAGS_TO_PASS) host=$(host) "CFLAGS=$(CFLAGS)" vault-install ; \
436 $(host)-stamp-stage2:
437 if [ -d $(STAGE2DIR) ] ; then \
438 mv $(STAGE2DIR) $(WORKING_DIR) ; \
442 $(SET_CYGNUS_PATH) $(TIME) $(GNU_MAKE) $(FLAGS_TO_PASS) -f test-build.mk -w $(host)-stamp-stage2-installed
443 mv $(WORKING_DIR) $(STAGE2DIR)
447 $(host)-stamp-stage2-installed: $(host)-stamp-stage2-checked
448 $(SET_CYGNUS_PATH) cd $(WORKING_DIR) ; $(TIME) $(MAKE) -w $(FLAGS_TO_PASS) $(GNUC) "CFLAGS=$(CFLAGS)" install host=$(host)
449 $(SET_CYGNUS_PATH) cd $(WORKING_DIR) ; $(TIME) $(MAKE) -w $(FLAGS_TO_PASS) $(GNUC) "CFLAGS=$(CFLAGS)" install-info host=$(host)
452 $(host)-stamp-stage2-checked: $(host)-stamp-stage2-built
453 # $(SET_CYGNUS_PATH) cd $(WORKING_DIR) ; $(TIME) $(MAKE) -w $(FLAGS_TO_PASS) $(GNUC) "CFLAGS=$(CFLAGS)" check host=$(host)
456 $(host)-stamp-stage2-built: $(host)-stamp-stage2-configured
457 $(SET_CYGNUS_PATH) cd $(WORKING_DIR) ; $(TIME) $(MAKE) -w $(FLAGS_TO_PASS) $(GNUC) "CFLAGS=$(CFLAGS)" all host=$(host)
458 $(SET_CYGNUS_PATH) cd $(WORKING_DIR) ; $(TIME) $(MAKE) -w $(FLAGS_TO_PASS) $(GNUC) "CFLAGS=$(CFLAGS)" info host=$(host)
461 $(host)-stamp-stage2-configured:
462 [ -d $(WORKING_DIR) ] || mkdir $(WORKING_DIR)
463 $(SET_CYGNUS_PATH) cd $(WORKING_DIR) ; \
464 $(configenv) $(GNUC) $(TIME) ../$(TREE)/configure $(config) -v --srcdir=../$(TREE) $(prefixes) $(configargs)
468 do3: $(HOLESDIR) $(host)-stamp-stage3
470 do3-vault: $(HOLESSTAMP) $(host)-stamp-stage3-built
471 if [ -d $(WORKING_DIR).3 ] ; then \
472 $(SET_CYGNUS_PATH) cd $(WORKING_DIR).3 ; $(MAKE) $(FLAGS_TO_PASS) host=$(host) "CFLAGS=$(CFLAGS)" vault-install ; \
474 $(SET_CYGNUS_PATH) cd $(WORKING_DIR) ; $(MAKE) $(FLAGS_TO_PASS) host=$(host) "CFLAGS=$(CFLAGS)" vault-install ; \
477 $(host)-stamp-stage3:
478 if [ -d $(STAGE3DIR) ] ; then \
479 mv $(STAGE3DIR) $(WORKING_DIR) ; \
483 $(SET_CYGNUS_PATH) $(TIME) $(GNU_MAKE) $(FLAGS_TO_PASS) -f test-build.mk -w $(host)-stamp-stage3-checked
484 mv $(WORKING_DIR) $(STAGE3DIR)
488 $(host)-stamp-stage3-installed: $(host)-stamp-stage3-checked
489 $(SET_CYGNUS_PATH) cd $(WORKING_DIR) ; $(TIME) $(MAKE) -w $(FLAGS_TO_PASS) $(GNUC) "CFLAGS=$(CFLAGS)" install host=$(host)
490 $(SET_CYGNUS_PATH) cd $(WORKING_DIR) ; $(TIME) $(MAKE) -w $(FLAGS_TO_PASS) $(GNUC) "CFLAGS=$(CFLAGS)" install-info host=$(host)
493 $(host)-stamp-stage3-checked: $(host)-stamp-stage3-built
494 # $(SET_CYGNUS_PATH) cd $(WORKING_DIR) ; $(TIME) $(MAKE) -w $(FLAGS_TO_PASS) $(GNUC) "CFLAGS=$(CFLAGS)" check host=$(host)
497 $(host)-stamp-stage3-built: $(host)-stamp-stage3-configured
498 $(SET_CYGNUS_PATH) cd $(WORKING_DIR) ; $(TIME) $(MAKE) -w $(FLAGS_TO_PASS) $(GNUC) "CFLAGS=$(CFLAGS)" all host=$(host)
499 $(SET_CYGNUS_PATH) cd $(WORKING_DIR) ; $(TIME) $(MAKE) -w $(FLAGS_TO_PASS) $(GNUC) "CFLAGS=$(CFLAGS)" info host=$(host)
502 $(host)-stamp-stage3-configured:
503 [ -d $(WORKING_DIR) ] || mkdir $(WORKING_DIR)
504 $(SET_CYGNUS_PATH) cd $(WORKING_DIR) ; \
505 $(configenv) $(GNUC) $(TIME) ../$(TREE)/configure $(config) -v --srcdir=../$(TREE) $(prefixes) $(configargs)
508 # These things are needed by a three-stage, but are not included locally.
564 ### so far only sun make supports VPATH
565 ifeq ($(subst sun3,sun4,$(holesys)),sun4)
571 ### solaris 2 -- don't use /usr/ucb/cc
572 ifeq (sparc-sun-solaris2,$(holesys))
573 SET_NATIVE_HOLES := SHELL=sh ; PATH=/opt/SUNWspro/bin:`pwd`/$(HOLESDIR) ; export PATH ; export SHELL ;
574 HOLE_DIRS := /usr/ccs/bin
579 ### These things are also needed by a three-stage, but in this case, the GNU version of the tool is required.
586 ### look in these directories for things missing from a three-stage
594 ### look in these directories for alternate versions of some tools.
595 PARTIAL_HOLE_DIRS := \
597 /usr/progressive/bin \
598 $(PARTIAL_HOLE_DIRS) \
602 $(HOLESDIR): $(holesys)-stamp-holes
604 $(holesys)-stamp-holes:
607 @for i in $(HOLES) ; do \
609 for j in $(HOLE_DIRS) ; do \
610 if [ -x $$j/$$i ] ; then \
611 ln -s $$j/$$i $(HOLESDIR) || cp $$j/$$i $(HOLESDIR) ; \
612 echo $$i from $$j ; \
619 *) echo $$i is NOT found ;; \
622 @for i in $(PARTIAL_HOLES) ; do \
624 for j in $(PARTIAL_HOLE_DIRS) ; do \
625 if [ -x $$j/$$i ] ; then \
626 rm -f $(HOLESDIR)/$$i ; \
627 cp $$j/$$i $(HOLESDIR)/$$i || exit 1; \
628 echo $$i from $$j ; \
635 *) echo $$i is NOT found ;; \
639 cd $(HOLESDIR); rm -f $(NUKEM)
643 # Get the cross-tools for build cross host when not building on the host.
645 BUILD_HOST_HOLES := \
657 BUILD_HOLES_DIRS := $(release_root)/H-$(build)/bin $(PARTIAL_HOLE_DIRS)
659 ifdef BUILD_HOST_HOLES_DIR
660 $(BUILD_HOST_HOLES_DIR): $(build)-x-$(host)-stamp-holes
663 ifneq ($(build),$(host))
664 $(build)-x-$(host)-stamp-holes:
665 -rm -rf $(BUILD_HOST_HOLES_DIR)
666 -mkdir $(BUILD_HOST_HOLES_DIR)
667 @for i in $(BUILD_HOST_HOLES) ; do \
669 for j in $(BUILD_HOLES_DIRS) ; do \
670 if [ -x $$j/$$i ] ; then \
671 ln -s $$j/$$i $(BUILD_HOST_HOLES_DIR) || cp $$j/$$i $(BUILD_HOST_HOLES_DIR) ; \
672 echo $$i from $$j ; \
679 *) echo $$i is NOT found ;; \
685 # Get the cross tools for build cross target when not building on the host.
687 BUILD_TARGET_HOLES := \
699 ifdef BUILD_TARGET_HOLES_DIR
700 $(BUILD_TARGET_HOLES_DIR): $(build)-x-$(target)-stamp-holes
703 ifneq ($(build),$(target))
704 $(build)-x-$(target)-stamp-holes:
705 -rm -rf $(BUILD_TARGET_HOLES_DIR)
706 -mkdir $(BUILD_TARGET_HOLES_DIR)
707 @for i in $(BUILD_TARGET_HOLES) ; do \
709 for j in $(BUILD_HOLES_DIRS) ; do \
710 if [ -x $$j/$$i ] ; then \
711 ln -s $$j/$$i $(BUILD_TARGET_HOLES_DIR) || cp $$j/$$i $(BUILD_TARGET_HOLES_DIR) ; \
712 echo $$i from $$j ; \
719 *) echo $$i is NOT found ;; \
726 comparison: $(host)-stamp-3stage-compared
728 $(host)-stamp-3stage-compared:
730 ifeq ($(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)
731 for i in `cd $(STAGE3DIR) ; find . -name \*.o -print` ; do \
732 tail +10c $(STAGE2DIR)/$$i > foo1 ; \
733 tail +10c $(STAGE3DIR)/$$i > foo2 ; \
734 if cmp foo1 foo2 ; then \
738 touch .bad-compare ; \
743 for i in `cd $(STAGE3DIR) ; find . -name \*.o -print` ; do \
744 cmp $(STAGE2DIR)/$$i $(STAGE3DIR)/$$i || touch .bad-compare ; \
747 if [ -f CLEAN_ALL ] ; then \
748 rm -rf $(STAGE2DIR) $(STAGE3DIR) ; \
750 if [ -f CLEAN_STAGES ] ; then \
751 if [ -f .bad-compare ] ; then \
754 rm -rf $(STAGE1DIR) $(STAGE2DIR) ; \
763 rm -rf $(HOLESDIR) $(INPLACEDIR) $(WORKING_DIR)* $(host)-stamp-* *~