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
31 ### START EDITTING HERE!!!
32 ### These things will need to be set differently for each release.
35 ### from which cvs tree are we working?
38 ### binaries should be installed into?
39 ROOTING
:= /usr
/cygnus
41 ### When working from a tagged set of source, this should be the tag. If not,
42 ### then set the macro to be empty.
45 ### The name of the cvs module for this release. The intersection of
46 ### CVS_MODULE and CVS_TAG defines the source files in this release.
49 ### Historically, this was identical to CVS_TAG. This is changing.
50 RELEASE_TAG
:= latest-930426
52 ### Historically, binaries were installed here. This is changing.
53 release_root
:= $(ROOTING
)/$(RELEASE_TAG
)
55 ### STOP EDITTING HERE!!!
56 ### With luck, eventually, nothing else will need to be editted.
62 GNU_MAKE
:= /usr
/latest
/bin
/make
-w
66 #override MAKEFLAGS :=
72 # We are building on a machine other than the host. We rely upon
73 # previously built cross-compilers from the build machine to the host
74 # (used to build the executables) and from the build machine to the
75 # target (used to build the libraries).
78 AR_FOR_TARGET
:= $(target
)-ar
80 AS_FOR_TARGET
:= $(target
)-as
83 CC_FOR_TARGET
:= $(target
)-gcc
85 CXX_FOR_TARGET
:= $(target
)-c
++
88 GXX_FOR_TARGET
:= $(target
)-g
++
89 HOST_PREFIX
:= $(build
)-
90 HOST_PREFIX_1
:= $(build
)-
92 MUNCH_NM
:= $(host
)-nm
94 NM_FOR_TARGET
:= $(target
)-nm
95 RANLIB
:= $(host
)-ranlib
96 RANLIB_FOR_TARGET
:= $(target
)-ranlib
100 "AR_FOR_TARGET=$(AR_FOR_TARGET)" \
102 "AS_FOR_TARGET=$(AS_FOR_TARGET)" \
104 "CC_FOR_BUILD=$(CC_FOR_BUILD)" \
105 "CC_FOR_TARGET=$(CC_FOR_TARGET)" \
107 "CXX_FOR_TARGET=$(CXX_FOR_TARGET)" \
110 "HOST_PREFIX=$(HOST_PREFIX)" \
111 "HOST_PREFIX_1=$(HOST_PREFIX_1)" \
112 "MAKEINFO=$(MAKEINFO)" \
114 "MUNCH_NM=$(MUNCH_NM)" \
116 "NM_FOR_TARGET=$(NM_FOR_TARGET)" \
118 "RANLIB_FOR_TARGET=$(RANLIB_FOR_TARGET)" \
119 "RELEASE_TAG=$(RELEASE_TAG)" \
124 # We must pass the build cross host tools in the environment of
125 # configure, so that autoconf scripts will run the right programs.
126 configenv
:= AR
="$(AR)" CC
="$(CC)" RANLIB
="$(RANLIB)"
130 # This is a normal build on the host machine.
138 "RELEASE_TAG=$(RELEASE_TAG)"
141 FLAGS_TO_PASS
:= "CC=$(CC)" $(FLAGS_TO_PASS
)
149 # These are the prefixes used for Cygnus builds.
150 prefixes
= --prefix=$(release_root
) --exec-prefix
=$(release_root
)/H-
$(host
)
152 relbindir
= $(release_root
)/H-
$(host
)/bin
154 ### general config stuff
155 WORKING_DIR
:= $(host
)-objdir
156 STAGE1DIR
:= $(WORKING_DIR
).1
157 STAGE2DIR
:= $(WORKING_DIR
).2
158 STAGE3DIR
:= $(WORKING_DIR
).3
159 INPLACEDIR
:= $(host
)-in-place
161 # Arrange to find the needed programs. If we are building on a
162 # machine other than the host, we must find the cross-compilers.
167 HOLESSTAMP
:= $(holesys
)-stamp-holes
$(build
)-x-
$(host
)-stamp-holes
$(build
)-x-
$(target
)-stamp-holes
168 HOLESDIR
:= $(holesys
)-holes
169 BUILD_HOST_HOLES_DIR
:= $(build
)-x-
$(host
)-holes
170 BUILD_TARGET_HOLES_DIR
:= $(build
)-x-
$(target
)-holes
172 SET_NATIVE_HOLES
:= SHELL
=sh
; PATH
=`pwd`/$(HOLESDIR
):`pwd`/$(BUILD_HOST_HOLES_DIR
):`pwd`/$(BUILD_TARGET_HOLES_DIR
) ; export PATH
; export SHELL
;
173 SET_CYGNUS_PATH
:= SHELL
=sh
; PATH
=`pwd`/$(HOLESDIR
):`pwd`/$(BUILD_HOST_HOLES_DIR
):`pwd`/$(BUILD_TARGET_HOLES_DIR
) ; export PATH
; export SHELL
;
174 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
;
179 HOLESSTAMP
:= $(holesys
)-stamp-holes
180 HOLESDIR
:= $(holesys
)-holes
182 SET_NATIVE_HOLES
:= SHELL
=sh
; PATH
=`pwd`/$(HOLESDIR
) ; export PATH
; export SHELL
;
183 SET_CYGNUS_PATH
:= SHELL
=sh
; PATH
=$(relbindir
):`pwd`/$(HOLESDIR
) ; export PATH
; export SHELL
;
184 SET_LATEST_PATH
:= SHELL
=sh
; PATH
=/usr
/latest
/bin
:`pwd`/$(HOLESDIR
) ; export PATH
; export SHELL
;
191 ## This is a cross compilation
193 arch
= $(host
)-x-
$(target
)
194 config
= -host
=$(host
) -target
=$(target
)
195 FLAGS_TO_PASS
:= $(FLAGS_TO_PASS
) "target=$(target)"
198 all: do-cygnus do-latest
199 build-all
: build-cygnus build-latest
201 all: do-native do-latest
202 build-all
: build-native build-latest
205 ifeq ($(target
),mips-idt-ecoff
)
206 configargs
= -with-gnu-as
213 ## This is a native compilation
216 config
= -host
=$(host
)
218 all: do-cygnus do-latest
220 all: $(host
)-stamp-3stage-done
222 #all: in-place do1 do2 do3 comparison
224 ifeq ($(subst mips-sgi-irix4
,mips-dec-ultrix
,$(host
)),mips-dec-ultrix
)
225 configargs
= -with-gnu-as
232 NATIVEDIR
:= $(arch
)-native-objdir
233 CYGNUSDIR
:= $(arch
)-cygnus-objdir
234 LATESTDIR
:= $(arch
)-latest-objdir
238 #everything: in-place do1 do2 do3 comparison do-cygnus
241 do-native
: $(HOLESSTAMP
) $(arch
)-stamp-native
242 do-native-config
: $(arch
)-stamp-native-configured
243 build-native
: $(HOLESSTAMP
) $(arch
)-stamp-native-checked
244 config-native
: $(HOLESSTAMP
) $(arch
)-stamp-native-configured
246 $(arch
)-stamp-native
: $(HOLESSTAMP
)
247 $(SET_NATIVE_HOLES
) $(TIME
) $(GNU_MAKE
) -f test-build.mk
$(arch
)-stamp-native-installed
$(FLAGS_TO_PASS
)
248 if
[ -f CLEAN_ALL
] ; then
rm -rf
$(NATIVEDIR
) ; else true
; fi
249 touch
$(arch
)-stamp-native
251 $(arch
)-stamp-native-installed
: $(HOLESSTAMP
) $(arch
)-stamp-native-checked
252 $(SET_NATIVE_HOLES
) cd
$(NATIVEDIR
) ; $(TIME
) $(MAKE
) $(FLAGS_TO_PASS
) install
253 $(SET_NATIVE_HOLES
) cd
$(NATIVEDIR
) ; $(TIME
) $(MAKE
) $(FLAGS_TO_PASS
) install-info
256 $(arch
)-stamp-native-checked
: $(arch
)-stamp-native-built
257 # cd $(NATIVEDIR) ; $(TIME) $(MAKE) $(FLAGS_TO_PASS) check
260 $(arch
)-stamp-native-built
: $(HOLESSTAMP
) $(arch
)-stamp-native-configured
261 $(SET_NATIVE_HOLES
) cd
$(NATIVEDIR
) ; $(TIME
) $(MAKE
) $(FLAGS_TO_PASS
) all
262 $(SET_NATIVE_HOLES
) cd
$(NATIVEDIR
) ; $(TIME
) $(MAKE
) $(FLAGS_TO_PASS
) info
265 $(arch
)-stamp-native-configured
: $(HOLESSTAMP
)
266 [ -d
$(NATIVEDIR
) ] || mkdir
$(NATIVEDIR
)
267 $(SET_NATIVE_HOLES
) cd
$(NATIVEDIR
) ; $(configenv
) $(TIME
) ..
/$(TREE
)/configure
$(config
) -v
--srcdir=..
/$(TREE
) $(prefixes
) $(configargs
)
272 do-cygnus
: $(HOLESSTAMP
) $(arch
)-stamp-cygnus
273 build-cygnus
: $(HOLESSTAMP
) $(arch
)-stamp-cygnus-checked
274 config-cygnus
: $(HOLESSTAMP
) $(arch
)-stamp-cygnus-configured
276 $(arch
)-stamp-cygnus
:
278 [ -f
$(relbindir
)/gcc
] ||
(echo
"must have gcc available"; exit
1)
280 $(SET_CYGNUS_PATH
) $(TIME
) $(GNU_MAKE
) -f test-build.mk
$(arch
)-stamp-cygnus-installed
$(FLAGS_TO_PASS
)
281 if
[ -f CLEAN_ALL
] ; then
rm -rf
$(CYGNUSDIR
) ; else true
; fi
282 touch
$(arch
)-stamp-cygnus
284 $(arch
)-stamp-cygnus-installed
: $(HOLESSTAMP
) $(arch
)-stamp-cygnus-checked
285 $(SET_CYGNUS_PATH
) cd
$(CYGNUSDIR
) ; $(TIME
) $(MAKE
) $(FLAGS_TO_PASS
) $(GNUC
) install
286 $(SET_CYGNUS_PATH
) cd
$(CYGNUSDIR
) ; $(TIME
) $(MAKE
) $(FLAGS_TO_PASS
) $(GNUC
) install-info
289 $(arch
)-stamp-cygnus-checked
: $(HOLESSTAMP
) $(arch
)-stamp-cygnus-built
290 # cd $(CYGNUSDIR) ; $(TIME) $(MAKE) $(FLAGS_TO_PASS) $(GNUC) check
293 $(arch
)-stamp-cygnus-built
: $(HOLESSTAMP
) $(arch
)-stamp-cygnus-configured
294 $(SET_CYGNUS_PATH
) cd
$(CYGNUSDIR
) ; $(TIME
) $(MAKE
) $(FLAGS_TO_PASS
) $(GNUC
) all
295 $(SET_CYGNUS_PATH
) cd
$(CYGNUSDIR
) ; $(TIME
) $(MAKE
) $(FLAGS_TO_PASS
) $(GNUC
) info
298 $(arch
)-stamp-cygnus-configured
: $(HOLESSTAMP
)
299 [ -d
$(CYGNUSDIR
) ] || mkdir
$(CYGNUSDIR
)
300 $(SET_CYGNUS_PATH
) cd
$(CYGNUSDIR
) ; $(GNUC
) $(configenv
) $(TIME
) ..
/$(TREE
)/configure
$(config
) -v
--srcdir=..
/$(TREE
) $(prefixes
) $(configargs
)
304 do-latest
: $(HOLESSTAMP
) $(arch
)-stamp-latest
305 build-latest
: $(HOLESSTAMP
) $(arch
)-stamp-latest-checked
307 $(arch
)-stamp-latest
:
308 $(SET_LATEST_PATH
) $(TIME
) $(GNU_MAKE
) -f test-build.mk
$(arch
)-stamp-latest-installed
$(FLAGS_TO_PASS
)
309 touch
$(arch
)-stamp-latest
311 $(arch
)-stamp-latest-installed
: $(HOLESSTAMP
) $(arch
)-stamp-latest-checked
312 $(SET_LATEST_PATH
) cd
$(LATESTDIR
) ; $(TIME
) $(MAKE
) $(FLAGS_TO_PASS
) $(GNUC
) install
313 $(SET_LATEST_PATH
) cd
$(LATESTDIR
) ; $(TIME
) $(MAKE
) $(FLAGS_TO_PASS
) $(GNUC
) install-info
316 $(arch
)-stamp-latest-checked
: $(arch
)-stamp-latest-built
317 # $(SET_LATEST_PATH) cd $(LATESTDIR) ; $(TIME) $(MAKE) $(FLAGS_TO_PASS) $(GNUC) check
320 $(arch
)-stamp-latest-built
: $(arch
)-stamp-latest-configured
321 $(SET_LATEST_PATH
) cd
$(LATESTDIR
) ; $(TIME
) $(MAKE
) $(FLAGS_TO_PASS
) $(GNUC
) all
322 $(SET_LATEST_PATH
) cd
$(LATESTDIR
) ; $(TIME
) $(MAKE
) $(FLAGS_TO_PASS
) $(GNUC
) info
325 $(arch
)-stamp-latest-configured
:
326 [ -d
$(LATESTDIR
) ] || mkdir
$(LATESTDIR
)
327 $(SET_LATEST_PATH
) cd
$(LATESTDIR
) ; $(GNUC
) $(configenv
) $(TIME
) ..
/$(TREE
)/configure
$(config
) -v
--srcdir=..
/$(TREE
) $(prefixes
) $(configargs
)
332 in-place
: $(host
)-stamp-in-place
334 $(host
)-stamp-in-place
:
335 PATH
=/bin
:/usr
/bin
:/usr
/ucb
; \
337 SHELL
=/bin
/sh
; export SHELL
; \
338 $(TIME
) $(GNU_MAKE
) -f test-build.mk
$(host
)-stamp-in-place-installed host
=$(host
) $(FLAGS_TO_PASS
)
340 if
[ -f CLEAN_ALL
] ; then \
341 rm -rf
$(INPLACEDIR
) ; \
343 mv
$(INPLACEDIR
) $(STAGE1DIR
) ; \
346 $(host
)-stamp-in-place-installed
: $(host
)-stamp-in-place-checked
347 cd
$(INPLACEDIR
) ; $(TIME
) $(MAKE
) $(FLAGS_TO_PASS
) "CFLAGS=$(CFLAGS)" install host
=$(host
)
348 cd
$(INPLACEDIR
) ; $(TIME
) $(MAKE
) $(FLAGS_TO_PASS
) "CFLAGS=$(CFLAGS)" install-info host
=$(host
)
351 $(host
)-stamp-in-place-checked
: $(host
)-stamp-in-place-built
352 # cd $(INPLACEDIR) ; $(TIME) $(MAKE) $(FLAGS_TO_PASS) "CFLAGS=$(CFLAGS)" check host=$(host)
355 $(host
)-stamp-in-place-built
: $(host
)-stamp-in-place-configured
356 cd
$(INPLACEDIR
) ; $(TIME
) $(MAKE
) $(FLAGS_TO_PASS
) "CFLAGS=$(CFLAGS)" all host
=$(host
)
357 cd
$(INPLACEDIR
) ; $(TIME
) $(MAKE
) $(FLAGS_TO_PASS
) "CFLAGS=$(CFLAGS)" info host
=$(host
)
360 $(host
)-stamp-in-place-configured
: $(host
)-stamp-in-place-cp
361 cd
$(INPLACEDIR
) ; $(configenv
) $(TIME
) .
/configure
$(config
) -v
$(prefixes
) $(configargs
)
364 $(host
)-stamp-in-place-cp
:
367 (cd
$(TREE
) ; tar cf
- .
) |
(cd
$(INPLACEDIR
) ; tar xf
-)
370 $(host
)-stamp-3stage-done
: do1 do2 do3 comparison
375 do1
: $(HOLESSTAMP
) $(host
)-stamp-stage1
376 do1-config
: $(HOLESSTAMP
) $(host
)-stamp-stage1-configured
377 do1-build
: $(HOLESSTAMP
) $(host
)-stamp-stage1-checked
379 $(host
)-stamp-stage1
:
380 if
[ -d
$(STAGE1DIR
) ] ; then \
381 mv
$(STAGE1DIR
) $(WORKING_DIR
) ; \
385 $(SET_NATIVE_HOLES
) $(TIME
) $(GNU_MAKE
) -f test-build.mk
$(FLAGS_TO_PASS
) host
=$(host
) $(host
)-stamp-stage1-installed
387 if
[ -f CLEAN_ALL
] ; then \
388 rm -rf
$(WORKING_DIR
) ; \
390 mv
$(WORKING_DIR
) $(STAGE1DIR
) ; \
393 $(host
)-stamp-stage1-installed
: $(host
)-stamp-stage1-checked
394 $(SET_NATIVE_HOLES
) cd
$(WORKING_DIR
) ; $(TIME
) $(MAKE
) $(FLAGS_TO_PASS
) "CFLAGS=$(CFLAGS)" install host
=$(host
)
395 $(SET_NATIVE_HOLES
) cd
$(WORKING_DIR
) ; $(TIME
) $(MAKE
) $(FLAGS_TO_PASS
) "CFLAGS=$(CFLAGS)" install-info host
=$(host
)
396 ifeq ($(host
),rs6000-ibm-aix
)
397 -rm $(relbindir
)/make
401 $(host
)-stamp-stage1-checked
: $(host
)-stamp-stage1-built
402 # $(SET_NATIVE_HOLES) cd $(WORKING_DIR) ; $(TIME) $(MAKE) $(FLAGS_TO_PASS) "CFLAGS=$(CFLAGS)" check host=$(host)
405 $(host
)-stamp-stage1-built
: $(host
)-stamp-stage1-configured
406 $(SET_NATIVE_HOLES
) cd
$(WORKING_DIR
) ; $(TIME
) $(MAKE
) $(FLAGS_TO_PASS
) "CFLAGS=$(CFLAGS)" all host
=$(host
)
407 $(SET_NATIVE_HOLES
) cd
$(WORKING_DIR
) ; $(TIME
) $(MAKE
) $(FLAGS_TO_PASS
) "CFLAGS=$(CFLAGS)" info host
=$(host
)
410 $(host
)-stamp-stage1-configured
:
411 [ -d
$(WORKING_DIR
) ] || mkdir
$(WORKING_DIR
)
412 $(SET_NATIVE_HOLES
) cd
$(WORKING_DIR
) ; \
413 $(configenv
) $(TIME
) ..
/$(TREE
)/configure
$(config
) -v
--srcdir=..
/$(TREE
) $(prefixes
) $(configargs
)
417 do2
: $(HOLESDIR
) $(host
)-stamp-stage2
419 $(host
)-stamp-stage2
:
420 if
[ -d
$(STAGE2DIR
) ] ; then \
421 mv
$(STAGE2DIR
) $(WORKING_DIR
) ; \
425 $(SET_CYGNUS_PATH
) $(TIME
) $(GNU_MAKE
) $(FLAGS_TO_PASS
) -f test-build.mk
-w
$(host
)-stamp-stage2-installed
426 mv
$(WORKING_DIR
) $(STAGE2DIR
)
430 $(host
)-stamp-stage2-installed
: $(host
)-stamp-stage2-checked
431 $(SET_CYGNUS_PATH
) cd
$(WORKING_DIR
) ; $(TIME
) $(MAKE
) -w
$(FLAGS_TO_PASS
) $(GNUC
) "CFLAGS=$(CFLAGS)" install host
=$(host
)
432 $(SET_CYGNUS_PATH
) cd
$(WORKING_DIR
) ; $(TIME
) $(MAKE
) -w
$(FLAGS_TO_PASS
) $(GNUC
) "CFLAGS=$(CFLAGS)" install-info host
=$(host
)
435 $(host
)-stamp-stage2-checked
: $(host
)-stamp-stage2-built
436 # $(SET_CYGNUS_PATH) cd $(WORKING_DIR) ; $(TIME) $(MAKE) -w $(FLAGS_TO_PASS) $(GNUC) "CFLAGS=$(CFLAGS)" check host=$(host)
439 $(host
)-stamp-stage2-built
: $(host
)-stamp-stage2-configured
440 $(SET_CYGNUS_PATH
) cd
$(WORKING_DIR
) ; $(TIME
) $(MAKE
) -w
$(FLAGS_TO_PASS
) $(GNUC
) "CFLAGS=$(CFLAGS)" all host
=$(host
)
441 $(SET_CYGNUS_PATH
) cd
$(WORKING_DIR
) ; $(TIME
) $(MAKE
) -w
$(FLAGS_TO_PASS
) $(GNUC
) "CFLAGS=$(CFLAGS)" info host
=$(host
)
444 $(host
)-stamp-stage2-configured
:
445 [ -d
$(WORKING_DIR
) ] || mkdir
$(WORKING_DIR
)
446 $(SET_CYGNUS_PATH
) cd
$(WORKING_DIR
) ; \
447 $(configenv
) $(GNUC
) $(TIME
) ..
/$(TREE
)/configure
$(config
) -v
--srcdir=..
/$(TREE
) $(prefixes
) $(configargs
)
451 do3
: $(HOLESDIR
) $(host
)-stamp-stage3
453 $(host
)-stamp-stage3
:
454 if
[ -d
$(STAGE3DIR
) ] ; then \
455 mv
$(STAGE3DIR
) $(WORKING_DIR
) ; \
459 $(SET_CYGNUS_PATH
) $(TIME
) $(GNU_MAKE
) $(FLAGS_TO_PASS
) -f test-build.mk
-w
$(host
)-stamp-stage3-checked
460 mv
$(WORKING_DIR
) $(STAGE3DIR
)
464 $(host
)-stamp-stage3-installed
: $(host
)-stamp-stage3-checked
465 $(SET_CYGNUS_PATH
) cd
$(WORKING_DIR
) ; $(TIME
) $(MAKE
) -w
$(FLAGS_TO_PASS
) $(GNUC
) "CFLAGS=$(CFLAGS)" install host
=$(host
)
466 $(SET_CYGNUS_PATH
) cd
$(WORKING_DIR
) ; $(TIME
) $(MAKE
) -w
$(FLAGS_TO_PASS
) $(GNUC
) "CFLAGS=$(CFLAGS)" install-info host
=$(host
)
469 $(host
)-stamp-stage3-checked
: $(host
)-stamp-stage3-built
470 # $(SET_CYGNUS_PATH) cd $(WORKING_DIR) ; $(TIME) $(MAKE) -w $(FLAGS_TO_PASS) $(GNUC) "CFLAGS=$(CFLAGS)" check host=$(host)
473 $(host
)-stamp-stage3-built
: $(host
)-stamp-stage3-configured
474 $(SET_CYGNUS_PATH
) cd
$(WORKING_DIR
) ; $(TIME
) $(MAKE
) -w
$(FLAGS_TO_PASS
) $(GNUC
) "CFLAGS=$(CFLAGS)" all host
=$(host
)
475 $(SET_CYGNUS_PATH
) cd
$(WORKING_DIR
) ; $(TIME
) $(MAKE
) -w
$(FLAGS_TO_PASS
) $(GNUC
) "CFLAGS=$(CFLAGS)" info host
=$(host
)
478 $(host
)-stamp-stage3-configured
:
479 [ -d
$(WORKING_DIR
) ] || mkdir
$(WORKING_DIR
)
480 $(SET_CYGNUS_PATH
) cd
$(WORKING_DIR
) ; \
481 $(configenv
) $(GNUC
) $(TIME
) ..
/$(TREE
)/configure
$(config
) -v
--srcdir=..
/$(TREE
) $(prefixes
) $(configargs
)
484 # These things are needed by a three-stage, but are not included locally.
536 ### so far only sun make supports VPATH
537 ifeq ($(subst sun3
,sun4
,$(holesys
)),sun4
)
543 ### solaris 2 -- don't use /usr/ucb/cc
544 ifeq (sparc-sun-solaris2
,$(holesys
))
545 SET_NATIVE_HOLES
:= SHELL
=sh
; PATH
=/opt
/SUNWspro
/bin
:`pwd`/$(HOLESDIR
) ; export PATH
; export SHELL
;
546 HOLE_DIRS
:= /usr
/ccs
/bin
551 ### These things are also needed by a three-stage, but in this case, the GNU version of the tool is required.
558 ### look in these directories for things missing from a three-stage
566 ### look in these directories for alternate versions of some tools.
567 PARTIAL_HOLE_DIRS
:= \
569 /usr
/progressive
/bin \
570 $(PARTIAL_HOLE_DIRS
) \
574 $(HOLESDIR
): $(holesys
)-stamp-holes
576 $(holesys
)-stamp-holes
:
579 @for i in
$(HOLES
) ; do \
581 for j in
$(HOLE_DIRS
) ; do \
582 if
[ -x
$$j/$$i ] ; then \
583 ln
-s
$$j/$$i $(HOLESDIR
) || cp
$$j/$$i $(HOLESDIR
) ; \
584 echo
$$i from
$$j ; \
591 *) echo
$$i is NOT found
;; \
594 @for i in
$(PARTIAL_HOLES
) ; do \
596 for j in
$(PARTIAL_HOLE_DIRS
) ; do \
597 if
[ -x
$$j/$$i ] ; then \
598 rm -f
$(HOLESDIR
)/$$i ; \
599 cp
$$j/$$i $(HOLESDIR
)/$$i || exit
1; \
600 echo
$$i from
$$j ; \
607 *) echo
$$i is NOT found
;; \
611 cd
$(HOLESDIR
); rm -f
$(NUKEM
)
615 # Get the cross-tools for build cross host when not building on the host.
617 BUILD_HOST_HOLES
:= \
629 BUILD_HOLES_DIRS
:= $(PARTIAL_HOLE_DIRS
)
631 $(BUILD_HOST_HOLES_DIR
): $(build
)-x-
$(host
)-stamp-holes
633 $(build
)-x-
$(host
)-stamp-holes
:
634 -rm -rf
$(BUILD_HOST_HOLES_DIR
)
635 -mkdir
$(BUILD_HOST_HOLES_DIR
)
636 @for i in
$(BUILD_HOST_HOLES
) ; do \
638 for j in
$(BUILD_HOLES_DIRS
) ; do \
639 if
[ -x
$$j/$$i ] ; then \
640 ln
-s
$$j/$$i $(BUILD_HOST_HOLES_DIR
) || cp
$$j/$$i $(BUILD_HOST_HOLES_DIR
) ; \
641 echo
$$i from
$$j ; \
648 *) echo
$$i is NOT found
;; \
653 # Get the cross tools for build cross target when not building on the host.
655 BUILD_TARGET_HOLES
:= \
667 $(BUILD_TARGET_HOLES_DIR
): $(build
)-x-
$(target
)-stamp-holes
669 $(build
)-x-
$(target
)-stamp-holes
:
670 -rm -rf
$(BUILD_TARGET_HOLES_DIR
)
671 -mkdir
$(BUILD_TARGET_HOLES_DIR
)
672 @for i in
$(BUILD_TARGET_HOLES
) ; do \
674 for j in
$(BUILD_HOLES_DIRS
) ; do \
675 if
[ -x
$$j/$$i ] ; then \
676 ln
-s
$$j/$$i $(BUILD_TARGET_HOLES_DIR
) || cp
$$j/$$i $(BUILD_TARGET_HOLES_DIR
) ; \
677 echo
$$i from
$$j ; \
684 *) echo
$$i is NOT found
;; \
690 comparison
: $(host
)-stamp-3stage-compared
692 $(host
)-stamp-3stage-compared
:
694 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
)
695 for i in
`cd $(STAGE3DIR) ; find . -name \*.o -print` ; do \
696 tail
+10c
$(STAGE2DIR
)/$$i > foo1
; \
697 tail
+10c
$(STAGE3DIR
)/$$i > foo2
; \
698 if cmp foo1 foo2
; then \
702 touch .bad-compare
; \
707 for i in
`cd $(STAGE3DIR) ; find . -name \*.o -print` ; do \
708 cmp
$(STAGE2DIR
)/$$i $(STAGE3DIR
)/$$i || touch .bad-compare
; \
711 if
[ -f CLEAN_ALL
] ; then \
712 rm -rf
$(STAGE2DIR
) $(STAGE3DIR
) ; \
714 if
[ -f CLEAN_STAGES
] ; then \
715 if
[ -f .bad-compare
] ; then \
718 rm -rf
$(STAGE1DIR
) $(STAGE2DIR
) ; \
727 rm -rf
$(HOLESDIR
) $(INPLACEDIR
) $(WORKING_DIR
)* $(host
)-stamp-
* *~