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
35 # Set TIME to time to get timings. Not done by default because time
36 # ignores the exit status.
42 GNUC
:= CC
="$(GCC)" CFLAGS
="$(GNUCFLAGS)"
45 GNU_MAKE
:= /usr
/latest
/bin
/make
-w
48 override MAKE
:= make
-w
50 #override MAKEFLAGS :=
62 ifeq ($(patsubst %-lynx
,lynx
,$(host
)),lynx
)
65 CONFIG_SHELL
:= /bin
/bash
68 ifeq ($(patsubst %-m68k-hp-hpux
,m68k-hp-hpux
,$(host
)),m68k-hp-hpux
)
69 SHELL
:= /usr
/unsupported
/bin
/bash
71 CONFIG_SHELL
:= /usr
/unsupported
/bin
/bash
74 ifneq ($(build
),$(host
))
76 # We are building on a machine other than the host. We rely upon
77 # previously built cross-compilers from the build machine to the host
78 # (used to build the executables) and from the build machine to the
79 # target (used to build the libraries).
82 AR_FOR_TARGET
:= $(target
)-ar
84 AS_FOR_TARGET
:= $(target
)-as
88 CC_FOR_TARGET
:= $(target
)-gcc
89 CFLAGS
:= $(GNUCFLAGS
)
91 CXX_FOR_TARGET
:= $(target
)-gcc
94 GXX_FOR_TARGET
:= $(target
)-g
++
95 HOST_PREFIX
:= $(build
)-
96 HOST_PREFIX_1
:= $(build
)-
99 MUNCH_NM
:= $(host
)-nm
101 NM_FOR_TARGET
:= $(target
)-nm
102 RANLIB
:= $(host
)-ranlib
103 RANLIB_FOR_TARGET
:= $(target
)-ranlib
106 ifeq ($(host
),i386-go32
)
107 MAKEINFOFLAGS
= --no-split
112 "AR_FOR_TARGET=$(AR_FOR_TARGET)" \
114 "AS_FOR_TARGET=$(AS_FOR_TARGET)" \
117 "CC_FOR_BUILD=$(CC_FOR_BUILD)" \
118 "CC_FOR_TARGET=$(CC_FOR_TARGET)" \
120 "CXX_FOR_TARGET=$(CXX_FOR_TARGET)" \
122 "CXXFLAGS=$(CXXFLAGS)" \
124 "HOST_PREFIX=$(HOST_PREFIX)" \
125 "HOST_PREFIX_1=$(HOST_PREFIX_1)" \
127 "MAKEINFO=$(MAKEINFO)" \
128 "MAKEINFOFLAGS=$(MAKEINFOFLAGS)" \
130 "MUNCH_NM=$(MUNCH_NM)" \
132 "NM_FOR_TARGET=$(NM_FOR_TARGET)" \
134 "RANLIB_FOR_TARGET=$(RANLIB_FOR_TARGET)" \
135 "RELEASE_TAG=$(RELEASE_TAG)" \
136 "RUNTEST=$(relbindir)/runtest" \
143 # We must pass the build cross host tools in the environment of
144 # configure, so that autoconf scripts will run the right programs.
145 configenv
:= AR
="$(AR)" CC
="$(CC)" RANLIB
="$(RANLIB)"
149 # This is a normal build on the host machine.
154 "CXXFLAGS=$(CXXFLAGS)" \
156 "MAKEINFOFLAGS=$(MAKEINFOFLAGS)" \
159 "RELEASE_TAG=$(RELEASE_TAG)" \
166 #### we need to change the default C compiler for some hosts
167 ifeq ($(host
),sparc-sun-solaris2
)
171 ifeq ($(host
),mips-sgi-irix4
)
172 CC
:= cc -cckr
-Wf
,-XNg1500
-Wf
,-XNk1000
-Wf
,-XNh2000
175 ifeq ($(host
),hppa1.1
-hp-hpux
)
176 CC
:= cc -Wp
,-H256000
179 ifeq ($(host
),m68k-hp-hpux
)
180 CC
:= cc -Wp
,-P
,-H256000
183 ifeq ($(host
),mips-mips-riscos5sysv
)
184 CC
:= cc -non_shared
-systype sysv
187 ifeq ($(host
),mips-dec-ultrix
)
188 CC
:= cc -Wf
,-XNg1000
191 ifeq ($(host
),m68k-sun-sunos4.1
.1)
195 # Support gdbtk everywhere
196 configargs
= --enable-gdbtk
198 # We want to use stabs for MIPS targets.
199 ifeq ($(target
),mips-idt-ecoff
)
200 configargs
:= $(configargs
) --with-stabs
203 ifeq ($(target
),mips-dec-ultrix
)
204 configargs
:= $(configargs
) --with-stabs
207 ifeq ($(target
),mips-sgi-irix4
)
208 configargs
:= $(configargs
) --with-stabs
211 ifeq ($(target
),mips-sgi-irix5
)
212 configargs
:= $(configargs
) --with-stabs
215 ifeq ($(patsubst alpha-dec-osf
%,alpha
,$(target
)),alpha
)
216 configargs
:= $(configargs
) --with-stabs
219 # We must use stabs for SVR4 targets.
220 ifeq ($(target
),i386-sysv4.2
)
221 configargs
:= $(configargs
) --with-stabs
225 FLAGS_TO_PASS
:= "CC=$(CC)" $(FLAGS_TO_PASS
)
228 #### and on some, we need CONFIG_SHELL
229 ifeq ($(patsubst %-lynxos
,lynxos
,$(host
)),lynxos
)
230 FLAGS_TO_PASS
:= "CONFIG_SHELL=$(CONFIG_SHELL)" $(FLAGS_TO_PASS
)
233 # These are the prefixes used for Cygnus builds.
234 prefixes
= --prefix=$(release_root
) --exec-prefix
=$(release_root
)/H-
$(host
)
236 relbindir
= $(release_root
)/H-
$(build
)/bin
238 ### general config stuff
239 WORKING_DIR
:= $(host
)-objdir
240 STAGE1DIR
:= $(WORKING_DIR
).1
241 STAGE2DIR
:= $(WORKING_DIR
).2
242 STAGE3DIR
:= $(WORKING_DIR
).3
243 STAGE4DIR
:= $(WORKING_DIR
).4
244 INPLACEDIR
:= $(host
)-in-place
246 # Arrange to find the needed programs. If we are building on a
247 # machine other than the host, we must find the cross-compilers.
249 ifneq ($(build
),$(host
))
252 HOLESSTAMP
:= $(holesys
)-stamp-holes
$(build
)-x-
$(host
)-stamp-holes
$(build
)-x-
$(target
)-stamp-holes
253 HOLESDIR
:= $(holesys
)-holes
254 BUILD_HOST_HOLES_DIR
:= $(build
)-x-
$(host
)-holes
255 BUILD_TARGET_HOLES_DIR
:= $(build
)-x-
$(target
)-holes
257 SET_NATIVE_HOLES
:= SHELL
=$(SHELL
) ; PATH
=`pwd`/$(HOLESDIR
):`pwd`/$(BUILD_HOST_HOLES_DIR
):`pwd`/$(BUILD_TARGET_HOLES_DIR
) ; export PATH
; export SHELL
;
258 SET_CYGNUS_PATH
:= SHELL
=$(SHELL
) ; PATH
=`pwd`/$(HOLESDIR
):`pwd`/$(BUILD_HOST_HOLES_DIR
):`pwd`/$(BUILD_TARGET_HOLES_DIR
) ; export PATH
; export SHELL
;
259 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
;
264 HOLESSTAMP
:= $(holesys
)-stamp-holes
265 HOLESDIR
:= $(holesys
)-holes
267 SET_NATIVE_HOLES
:= SHELL
=$(SHELL
) ; PATH
=`pwd`/$(HOLESDIR
) ; export PATH
; export SHELL
;
268 SET_CYGNUS_PATH
:= SHELL
=$(SHELL
) ; PATH
=$(relbindir
):`pwd`/$(HOLESDIR
) ; export PATH
; export SHELL
;
269 SET_LATEST_PATH
:= SHELL
=$(SHELL
) ; PATH
=/usr
/latest
/bin
:`pwd`/$(HOLESDIR
) ; export PATH
; export SHELL
;
274 ifneq ($(target
),$(host
))
276 ## This is a cross compilation
278 arch
= $(host
)-x-
$(target
)
279 config
= -host
=$(host
) -target
=$(target
)
280 FLAGS_TO_PASS
:= $(FLAGS_TO_PASS
) "target=$(target)"
282 ifeq ($(patsubst %-lynx
,lynx
,$(target
)),lynx
)
283 configargs
:= $(configargs
) --with-headers
=/s1
/cygnus
/dejagnu
/$(target
)/include \
284 --with-libs
=/s1
/cygnus
/dejagnu
/$(target
)/lib
287 ifeq ($(patsubst %-i386-sysv4.2
,i386-sysv4.2
,$(target
)),i386-sysv4.2
)
288 configargs
:= $(configargs
) --with-headers
=/s1
/cygnus
/dejagnu
/$(target
)/include \
289 --with-libs
=/s1
/cygnus
/dejagnu
/$(target
)/lib
292 ifeq ($(patsubst %-i386-netware
,i386-netware
,$(target
)),i386-netware
)
293 configargs
:= $(configargs
) \
294 --with-headers
=/s1
/cygnus
/dejagnu
/$(target
)/include \
295 --with-libs
=/s1
/cygnus
/dejagnu
/$(target
)/lib
298 ifeq ($(patsubst %-sparc-sun-sunos4.1
.3,sparc-sun-sunos4.1
.3,$(target
)),sparc-sun-sunos4.1
.3)
299 configargs
:= $(configargs
) \
300 --with-headers
=/s1
/cygnus
/dejagnu
/$(target
)/include \
301 --with-libs
=/s1
/cygnus
/dejagnu
/$(target
)/lib
304 ifeq ($(patsubst %-sparc-sun-solaris2
,sparc-sun-solaris2
,$(target
)),sparc-sun-solaris2
)
305 configargs
:= $(configargs
) \
306 --with-headers
=/s1
/cygnus
/dejagnu
/$(target
)/include \
307 --with-libs
=/s1
/cygnus
/dejagnu
/$(target
)/lib
310 ifeq ($(patsubst %-i960-vxworks5.1
,i960-vxworks5.1
,$(target
)),i960-vxworks5.1
)
311 configargs
:= $(configargs
) \
312 --with-headers
=/s1
/cygnus
/dejagnu
/$(target
)/include
315 ifeq ($(patsubst %-m68k-vxworks5.1
,m68k-vxworks5.1
,$(target
)),m68k-vxworks5.1
)
316 configargs
:= $(configargs
) \
317 --with-headers
=/s1
/cygnus
/dejagnu
/$(target
)/include
320 ifeq ($(patsubst %-i386-unixware
,i386-unixware
,$(target
)),i386-unixware
)
321 configargs
:= $(configargs
) \
322 --with-headers
=/s1
/cygnus
/dejagnu
/$(target
)/include \
323 --with-libs
=/s1
/cygnus
/dejagnu
/$(target
)/lib
326 ifneq ($(build
),$(host
))
327 all: do-cygnus do-latest
328 build-all
: build-cygnus build-latest
330 all: do-native do-latest
331 build-all
: build-native build-latest
337 ## This is a native compilation
340 config
= -host
=$(host
)
341 ifneq ($(build
),$(host
))
342 all: do-cygnus do-latest
344 all: $(host
)-stamp-3stage-done
346 #all: in-place do1 do2 do3 comparison
350 NATIVEDIR
:= $(arch
)-native-objdir
351 CYGNUSDIR
:= $(arch
)-cygnus-objdir
352 LATESTDIR
:= $(arch
)-latest-objdir
353 DOSDIR
:= dos-x-
$(target
)-objdir
356 #everything: in-place do1 do2 do3 comparison do-cygnus
360 $(MAKE
) -f test-build.mk CFLAGS
= build
=$(host
) host
=i386-go32 target
=$(target
) do-dos
362 $(MAKE
) -f test-build.mk CFLAGS
= build
=$(host
) host
=i386-go32 target
=$(target
) path-dos
365 do-dos
: $(HOLESSTAMP
) dos-x-
$(target
)-stamp-done
366 build-dos
: $(HOLESSTAMP
) dos-x-
$(target
)-stamp-dos-checked
367 config-dos
: $(HOLESSTAMP
) dos-x-
$(target
)-stamp-dos-configured
369 @echo
"$(SET_CYGNUS_PATH)"
371 dos-x-
$(target
)-stamp-done
:
372 [ -f
$(relbindir
)/$(host
)-gcc
] ||
(echo
"must have gcc available"; exit
1)
373 $(SET_CYGNUS_PATH
) $(TIME
) $(GNU_MAKE
) -f test-build.mk dos-x-
$(target
)-stamp-installed
$(FLAGS_TO_PASS
)
374 if
[ -f CLEAN_ALL
-o
-f CLEAN_CROSSES
] ; then
rm -rf
$(DOSDIR
) ; else true
; fi
377 dos-x-
$(target
)-stamp-installed
: $(HOLESSTAMP
) dos-x-
$(target
)-stamp-intermediate
378 [ -d dos-x-
$(target
)-installed
] || mkdir dos-x-
$(target
)-installed
379 $(SET_CYGNUS_PATH
) $(TREE
)/release
/mkdosrel dos-x-
$(target
)-intermediate \
380 dos-x-
$(target
)-installed
$(target
)
381 # (cd dos-x-$(target)-installed; find . -print | $(TREE)/release/make8.3)
384 dos-x-
$(target
)-stamp-intermediate
: $(HOLESSTAMP
) dos-x-
$(target
)-stamp-dos-checked
385 [ -d dos-x-
$(target
)-intermediate
] || mkdir dos-x-
$(target
)-intermediate
386 dir=`pwd` ; export dir ; \
387 $(SET_CYGNUS_PATH
) cd
$(DOSDIR
) ; $(TIME
) $(MAKE
) $(FLAGS_TO_PASS
) $(GNUC
) \
388 prefix=$$dir/dos-x-
$(target
)-intermediate
install install-info
391 dos-x-
$(target
)-stamp-dos-checked
: $(HOLESSTAMP
) dos-x-
$(target
)-stamp-dos-built
392 # cd $(DOSDIR) ; $(TIME) $(MAKE) $(FLAGS_TO_PASS) $(GNUC) check
395 dos-x-
$(target
)-stamp-dos-built
: $(HOLESSTAMP
) dos-x-
$(target
)-stamp-dos-configured
396 $(SET_CYGNUS_PATH
) cd
$(DOSDIR
) ; $(TIME
) $(MAKE
) $(FLAGS_TO_PASS
) $(GNUC
) all info
399 dos-x-
$(target
)-stamp-dos-configured
: $(HOLESSTAMP
)
400 [ -d
$(DOSDIR
) ] || mkdir
$(DOSDIR
)
401 $(SET_CYGNUS_PATH
) cd
$(DOSDIR
) ; $(GNUC
) $(configenv
) $(TIME
) $(CONFIG_SHELL
) \
402 ..
/$(TREE
)/configure
$(config
) -v
--srcdir=..
/$(TREE
) --prefix=/cygnus \
403 --program-transform-name
='' $(configargs
)
410 do-native
: $(HOLESSTAMP
) $(arch
)-stamp-native
411 do-native-config
: $(arch
)-stamp-native-configured
412 build-native
: $(HOLESSTAMP
) $(arch
)-stamp-native-checked
413 config-native
: $(HOLESSTAMP
) $(arch
)-stamp-native-configured
415 $(arch
)-stamp-native
: $(HOLESSTAMP
)
416 $(SET_NATIVE_HOLES
) $(TIME
) $(GNU_MAKE
) -f test-build.mk
$(arch
)-stamp-native-installed
$(FLAGS_TO_PASS
)
417 if
[ -f CLEAN_ALL
-o
-f CLEAN_CROSSES
] ; then
rm -rf
$(NATIVEDIR
) ; else true
; fi
418 touch
$(arch
)-stamp-native
420 $(arch
)-stamp-native-installed
: $(HOLESSTAMP
) $(arch
)-stamp-native-checked
421 $(SET_NATIVE_HOLES
) cd
$(NATIVEDIR
) ; $(TIME
) $(MAKE
) $(FLAGS_TO_PASS
) install
422 $(SET_NATIVE_HOLES
) cd
$(NATIVEDIR
) ; $(TIME
) $(MAKE
) $(FLAGS_TO_PASS
) install-info
425 $(arch
)-stamp-native-checked
: $(arch
)-stamp-native-built
426 # cd $(NATIVEDIR) ; $(TIME) $(MAKE) $(FLAGS_TO_PASS) check
429 $(arch
)-stamp-native-built
: $(HOLESSTAMP
) $(arch
)-stamp-native-configured
430 $(SET_NATIVE_HOLES
) cd
$(NATIVEDIR
) ; $(TIME
) $(MAKE
) $(FLAGS_TO_PASS
) all
431 $(SET_NATIVE_HOLES
) cd
$(NATIVEDIR
) ; $(TIME
) $(MAKE
) $(FLAGS_TO_PASS
) info
434 $(arch
)-stamp-native-configured
: $(HOLESSTAMP
)
435 [ -d
$(NATIVEDIR
) ] || mkdir
$(NATIVEDIR
)
436 $(SET_NATIVE_HOLES
) cd
$(NATIVEDIR
) ; $(configenv
) CC
="$(CC)" $(TIME
) $(CONFIG_SHELL
) ..
/$(TREE
)/configure
$(config
) -v
--srcdir=..
/$(TREE
) $(prefixes
) $(configargs
)
441 do-cygnus
: $(HOLESSTAMP
) $(arch
)-stamp-cygnus
442 build-cygnus
: $(HOLESSTAMP
) $(arch
)-stamp-cygnus-checked
443 config-cygnus
: $(HOLESSTAMP
) $(arch
)-stamp-cygnus-configured
445 $(SET_CYGNUS_PATH
) echo
$$PATH
447 vault-cygnus
: $(HOLESSTAMP
) $(arch
)-stamp-cygnus-built
448 $(SET_CYGNUS_PATH
) cd
$(CYGNUSDIR
) ; $(TIME
) $(MAKE
) $(FLAGS_TO_PASS
) $(GNUC
) vault-install
451 $(arch
)-stamp-cygnus
:
452 [ -f
$(relbindir
)/$(host
)-gcc
] ||
(echo
"must have gcc available"; exit
1)
453 $(SET_CYGNUS_PATH
) $(TIME
) $(GNU_MAKE
) -f test-build.mk
$(arch
)-stamp-cygnus-installed
$(FLAGS_TO_PASS
)
454 if
[ -f CLEAN_ALL
-o
-f CLEAN_CROSSES
] ; then
rm -rf
$(CYGNUSDIR
) ; else true
; fi
455 touch
$(arch
)-stamp-cygnus
457 $(arch
)-stamp-cygnus-installed
: $(HOLESSTAMP
) $(arch
)-stamp-cygnus-checked
458 $(SET_CYGNUS_PATH
) cd
$(CYGNUSDIR
) ; $(TIME
) $(MAKE
) $(FLAGS_TO_PASS
) $(GNUC
) install
459 $(SET_CYGNUS_PATH
) cd
$(CYGNUSDIR
) ; $(TIME
) $(MAKE
) $(FLAGS_TO_PASS
) $(GNUC
) install-info
460 if
[ -f VAULT-INSTALL
] ; then \
461 $(SET_CYGNUS_PATH
) cd
$(CYGNUSDIR
) ; $(MAKE
) $(FLAGS_TO_PASS
) $(GNUC
) vault-install
; \
465 $(arch
)-stamp-cygnus-checked
: $(HOLESSTAMP
) $(arch
)-stamp-cygnus-built
466 # cd $(CYGNUSDIR) ; $(TIME) $(MAKE) $(FLAGS_TO_PASS) $(GNUC) check
469 $(arch
)-stamp-cygnus-built
: $(HOLESSTAMP
) $(arch
)-stamp-cygnus-configured
470 $(SET_CYGNUS_PATH
) cd
$(CYGNUSDIR
) ; $(TIME
) $(MAKE
) $(FLAGS_TO_PASS
) $(GNUC
) all
471 $(SET_CYGNUS_PATH
) cd
$(CYGNUSDIR
) ; $(TIME
) $(MAKE
) $(FLAGS_TO_PASS
) $(GNUC
) info
474 $(arch
)-stamp-cygnus-configured
: $(HOLESSTAMP
)
475 [ -d
$(CYGNUSDIR
) ] || mkdir
$(CYGNUSDIR
)
476 $(SET_CYGNUS_PATH
) cd
$(CYGNUSDIR
) ; $(configenv
) $(GNUC
) $(TIME
) $(CONFIG_SHELL
) ..
/$(TREE
)/configure
$(config
) -v
--srcdir=..
/$(TREE
) $(prefixes
) $(configargs
)
480 do-latest
: $(HOLESSTAMP
) $(arch
)-stamp-latest
481 build-latest
: $(HOLESSTAMP
) $(arch
)-stamp-latest-checked
483 $(arch
)-stamp-latest
:
484 $(SET_LATEST_PATH
) $(TIME
) $(GNU_MAKE
) -f test-build.mk
$(arch
)-stamp-latest-installed
$(FLAGS_TO_PASS
)
485 touch
$(arch
)-stamp-latest
487 $(arch
)-stamp-latest-installed
: $(HOLESSTAMP
) $(arch
)-stamp-latest-checked
488 $(SET_LATEST_PATH
) cd
$(LATESTDIR
) ; $(TIME
) $(MAKE
) $(FLAGS_TO_PASS
) $(GNUC
) install
489 $(SET_LATEST_PATH
) cd
$(LATESTDIR
) ; $(TIME
) $(MAKE
) $(FLAGS_TO_PASS
) $(GNUC
) install-info
492 $(arch
)-stamp-latest-checked
: $(arch
)-stamp-latest-built
493 # $(SET_LATEST_PATH) cd $(LATESTDIR) ; $(TIME) $(MAKE) $(FLAGS_TO_PASS) $(GNUC) check
496 $(arch
)-stamp-latest-built
: $(arch
)-stamp-latest-configured
497 $(SET_LATEST_PATH
) cd
$(LATESTDIR
) ; $(TIME
) $(MAKE
) $(FLAGS_TO_PASS
) $(GNUC
) all
498 $(SET_LATEST_PATH
) cd
$(LATESTDIR
) ; $(TIME
) $(MAKE
) $(FLAGS_TO_PASS
) $(GNUC
) info
501 $(arch
)-stamp-latest-configured
:
502 [ -d
$(LATESTDIR
) ] || mkdir
$(LATESTDIR
)
503 $(SET_LATEST_PATH
) cd
$(LATESTDIR
) ; $(configenv
) $(GNUC
) $(TIME
) $(CONFIG_SHELL
) ..
/$(TREE
)/configure
$(config
) -v
--srcdir=..
/$(TREE
) $(prefixes
) $(configargs
)
508 in-place
: $(host
)-stamp-in-place
510 $(host
)-stamp-in-place
:
511 PATH
=/bin
:/usr
/bin
:/usr
/ucb
; \
513 SHELL
=/bin
/sh
; export SHELL
; \
514 $(TIME
) $(GNU_MAKE
) -f test-build.mk
$(host
)-stamp-in-place-installed host
=$(host
) $(FLAGS_TO_PASS
)
516 if
[ -f CLEAN_ALL
] ; then \
517 rm -rf
$(INPLACEDIR
) ; \
519 mv
$(INPLACEDIR
) $(STAGE1DIR
) ; \
522 $(host
)-stamp-in-place-installed
: $(host
)-stamp-in-place-checked
523 cd
$(INPLACEDIR
) ; $(TIME
) $(MAKE
) $(FLAGS_TO_PASS
) "CFLAGS=$(CFLAGS)" install host
=$(host
)
524 cd
$(INPLACEDIR
) ; $(TIME
) $(MAKE
) $(FLAGS_TO_PASS
) "CFLAGS=$(CFLAGS)" install-info host
=$(host
)
527 $(host
)-stamp-in-place-checked
: $(host
)-stamp-in-place-built
528 # cd $(INPLACEDIR) ; $(TIME) $(MAKE) $(FLAGS_TO_PASS) "CFLAGS=$(CFLAGS)" check host=$(host)
531 $(host
)-stamp-in-place-built
: $(host
)-stamp-in-place-configured
532 cd
$(INPLACEDIR
) ; $(TIME
) $(MAKE
) $(FLAGS_TO_PASS
) "CFLAGS=$(CFLAGS)" all host
=$(host
)
533 cd
$(INPLACEDIR
) ; $(TIME
) $(MAKE
) $(FLAGS_TO_PASS
) "CFLAGS=$(CFLAGS)" info host
=$(host
)
536 $(host
)-stamp-in-place-configured
: $(host
)-stamp-in-place-cp
537 cd
$(INPLACEDIR
) ; $(configenv
) CC
="$(CC)" $(TIME
) $(CONFIG_SHELL
) .
/configure
$(config
) -v
$(prefixes
) $(configargs
)
540 $(host
)-stamp-in-place-cp
:
543 (cd
$(TREE
) ; tar cf
- .
) |
(cd
$(INPLACEDIR
) ; tar xf
-)
546 $(host
)-stamp-3stage-done
: do1 do2 do3 comparison
551 do1
: $(HOLESSTAMP
) $(host
)-stamp-stage1
552 do1-config
: $(HOLESSTAMP
) $(host
)-stamp-stage1-configured
553 do1-build
: $(HOLESSTAMP
) $(host
)-stamp-stage1-checked
555 do1-vault
: $(HOLESSTAMP
) $(host
)-stamp-stage1-built
556 if
[ -d
$(WORKING_DIR
).1 ] ; then \
557 $(SET_NATIVE_HOLES
) cd
$(WORKING_DIR
).1 ; $(MAKE
) $(FLAGS_TO_PASS
) host
=$(host
) "CFLAGS=$(CFLAGS)" vault-install
; \
559 $(SET_NATIVE_HOLES
) cd
$(WORKING_DIR
) ; $(MAKE
) $(FLAGS_TO_PASS
) host
=$(host
) "CFLAGS=$(CFLAGS)" vault-install
; \
562 $(host
)-stamp-stage1
:
563 if
[ -d
$(STAGE1DIR
) ] ; then \
564 mv
$(STAGE1DIR
) $(WORKING_DIR
) ; \
568 $(SET_NATIVE_HOLES
) $(TIME
) $(GNU_MAKE
) -f test-build.mk
$(FLAGS_TO_PASS
) host
=$(host
) $(host
)-stamp-stage1-installed
570 if
[ -f CLEAN_ALL
] ; then \
571 rm -rf
$(WORKING_DIR
) ; \
573 mv
$(WORKING_DIR
) $(STAGE1DIR
) ; \
576 $(host
)-stamp-stage1-installed
: $(host
)-stamp-stage1-checked
577 $(SET_NATIVE_HOLES
) cd
$(WORKING_DIR
) ; $(TIME
) $(MAKE
) $(FLAGS_TO_PASS
) "CFLAGS=$(CFLAGS)" install host
=$(host
)
578 $(SET_NATIVE_HOLES
) cd
$(WORKING_DIR
) ; $(TIME
) $(MAKE
) $(FLAGS_TO_PASS
) "CFLAGS=$(CFLAGS)" install-info host
=$(host
)
579 ifeq ($(host
),rs6000-ibm-aix
)
580 -rm $(relbindir
)/make
582 ifeq ($(host
),rs6000-ibm-aix3.2
.5)
583 -rm $(relbindir
)/make
587 $(host
)-stamp-stage1-checked
: $(host
)-stamp-stage1-built
588 # $(SET_NATIVE_HOLES) cd $(WORKING_DIR) ; $(TIME) $(MAKE) $(FLAGS_TO_PASS) "CFLAGS=$(CFLAGS)" check host=$(host)
591 $(host
)-stamp-stage1-built
: $(host
)-stamp-stage1-configured
592 $(SET_NATIVE_HOLES
) cd
$(WORKING_DIR
) ; $(TIME
) $(MAKE
) $(FLAGS_TO_PASS
) "CFLAGS=$(CFLAGS)" all host
=$(host
)
593 $(SET_NATIVE_HOLES
) cd
$(WORKING_DIR
) ; $(TIME
) $(MAKE
) $(FLAGS_TO_PASS
) "CFLAGS=$(CFLAGS)" info host
=$(host
)
596 $(host
)-stamp-stage1-configured
:
597 [ -d
$(WORKING_DIR
) ] || mkdir
$(WORKING_DIR
)
598 $(SET_NATIVE_HOLES
) cd
$(WORKING_DIR
) ; \
599 $(configenv
) CC
="$(CC)" $(TIME
) $(CONFIG_SHELL
) ..
/$(TREE
)/configure
$(config
) -v
--srcdir=..
/$(TREE
) $(prefixes
) $(configargs
)
603 do2
: $(HOLESDIR
) $(host
)-stamp-stage2
605 do2-vault
: $(HOLESSTAMP
) $(host
)-stamp-stage2-built
606 if
[ -d
$(WORKING_DIR
).2 ] ; then \
607 $(SET_CYGNUS_PATH
) cd
$(WORKING_DIR
).2 ; $(MAKE
) $(FLAGS_TO_PASS
) host
=$(host
) "CFLAGS=$(GNUCFLAGS)" vault-install
; \
609 $(SET_CYGNUS_PATH
) cd
$(WORKING_DIR
) ; $(MAKE
) $(FLAGS_TO_PASS
) host
=$(host
) "CFLAGS=$(GNUCFLAGS)" vault-install
; \
614 $(host
)-stamp-stage2
:
615 if
[ -d
$(STAGE2DIR
) ] ; then \
616 mv
$(STAGE2DIR
) $(WORKING_DIR
) ; \
620 $(SET_CYGNUS_PATH
) $(TIME
) $(GNU_MAKE
) $(FLAGS_TO_PASS
) -f test-build.mk
-w
$(host
)-stamp-stage2-installed
621 mv
$(WORKING_DIR
) $(STAGE2DIR
)
625 # The SunOS make program gets confused when it is deleted while running.
626 # The signal handlers return to the wrong place, or something, and the
627 # program dumps core. To avoid trouble with installing make over itself,
628 # we delete the installed make program.
629 $(host
)-stamp-stage2-installed
: $(host
)-stamp-stage2-checked
630 -rm -f
$(relbindir
)/make
631 $(SET_CYGNUS_PATH
) cd
$(WORKING_DIR
) ; $(TIME
) $(GNU_MAKE
) -w
$(FLAGS_TO_PASS
) $(GNUC
) install host
=$(host
)
632 $(SET_CYGNUS_PATH
) cd
$(WORKING_DIR
) ; $(TIME
) $(MAKE
) -w
$(FLAGS_TO_PASS
) $(GNUC
) install-info host
=$(host
)
635 $(host
)-stamp-stage2-checked
: $(host
)-stamp-stage2-built
636 # $(SET_CYGNUS_PATH) cd $(WORKING_DIR) ; $(TIME) $(MAKE) -w $(FLAGS_TO_PASS) $(GNUC) check host=$(host)
639 $(host
)-stamp-stage2-built
: $(host
)-stamp-stage2-configured
640 $(SET_CYGNUS_PATH
) cd
$(WORKING_DIR
) ; $(TIME
) $(MAKE
) -w
$(FLAGS_TO_PASS
) $(GNUC
) all host
=$(host
)
641 $(SET_CYGNUS_PATH
) cd
$(WORKING_DIR
) ; $(TIME
) $(MAKE
) -w
$(FLAGS_TO_PASS
) $(GNUC
) info host
=$(host
)
644 $(host
)-stamp-stage2-configured
:
645 [ -d
$(WORKING_DIR
) ] || mkdir
$(WORKING_DIR
)
646 $(SET_CYGNUS_PATH
) cd
$(WORKING_DIR
) ; \
647 $(configenv
) $(GNUC
) $(TIME
) $(CONFIG_SHELL
) ..
/$(TREE
)/configure
$(config
) -v
--srcdir=..
/$(TREE
) $(prefixes
) $(configargs
)
651 do3
: $(HOLESDIR
) $(host
)-stamp-stage3
653 do3-vault
: $(HOLESSTAMP
) $(host
)-stamp-stage3-built
654 if
[ -d
$(WORKING_DIR
).3 ] ; then \
655 $(SET_CYGNUS_PATH
) cd
$(WORKING_DIR
).3 ; $(MAKE
) $(FLAGS_TO_PASS
) host
=$(host
) "CFLAGS=$(GNUCFLAGS)" vault-install
; \
657 $(SET_CYGNUS_PATH
) cd
$(WORKING_DIR
) ; $(MAKE
) $(FLAGS_TO_PASS
) host
=$(host
) "CFLAGS=$(GNUCFLAGS)" vault-install
; \
660 $(host
)-stamp-stage3
:
661 if
[ -d
$(STAGE3DIR
) ] ; then \
662 mv
$(STAGE3DIR
) $(WORKING_DIR
) ; \
666 $(SET_CYGNUS_PATH
) $(TIME
) $(GNU_MAKE
) $(FLAGS_TO_PASS
) -f test-build.mk
-w
$(host
)-stamp-stage3-installed
667 mv
$(WORKING_DIR
) $(STAGE3DIR
)
671 # The SunOS make program gets confused when it is deleted while running.
672 # The signal handlers return to the wrong place, or something, and the
673 # program dumps core. To avoid trouble with installing make over itself,
674 # we delete the installed make program.
675 $(host
)-stamp-stage3-installed
: $(host
)-stamp-stage3-checked
676 -rm -f
$(relbindir
)/make
677 $(SET_CYGNUS_PATH
) cd
$(WORKING_DIR
) ; $(TIME
) $(GNU_MAKE
) -w
$(FLAGS_TO_PASS
) $(GNUC
) install host
=$(host
)
678 $(SET_CYGNUS_PATH
) cd
$(WORKING_DIR
) ; $(TIME
) $(MAKE
) -w
$(FLAGS_TO_PASS
) $(GNUC
) install-info host
=$(host
)
679 if
[ -f VAULT-INSTALL
] ; then \
680 $(SET_CYGNUS_PATH
) cd
$(CYGNUSDIR
) ; $(MAKE
) $(FLAGS_TO_PASS
) $(GNUC
) vault-install
; \
684 $(host
)-stamp-stage3-checked
: $(host
)-stamp-stage3-built
685 # $(SET_CYGNUS_PATH) cd $(WORKING_DIR) ; $(TIME) $(MAKE) -w $(FLAGS_TO_PASS) $(GNUC) check host=$(host)
688 $(host
)-check-3stage
: $(host
)-stamp-stage3
689 $(SET_CYGNUS_PATH
) cd
$(STAGE3DIR
) ; $(TIME
) $(MAKE
) -k
-w
$(FLAGS_TO_PASS
) $(GNUC
) check host
=$(host
)
692 $(host
)-stamp-stage3-built
: $(host
)-stamp-stage3-configured
693 $(SET_CYGNUS_PATH
) cd
$(WORKING_DIR
) ; $(TIME
) $(MAKE
) -w
$(FLAGS_TO_PASS
) $(GNUC
) all host
=$(host
)
694 $(SET_CYGNUS_PATH
) cd
$(WORKING_DIR
) ; $(TIME
) $(MAKE
) -w
$(FLAGS_TO_PASS
) $(GNUC
) info host
=$(host
)
697 $(host
)-stamp-stage3-configured
:
698 [ -d
$(WORKING_DIR
) ] || mkdir
$(WORKING_DIR
)
699 $(SET_CYGNUS_PATH
) cd
$(WORKING_DIR
) ; \
700 $(configenv
) $(GNUC
) $(TIME
) $(CONFIG_SHELL
) ..
/$(TREE
)/configure
$(config
) -v
--srcdir=..
/$(TREE
) $(prefixes
) $(configargs
)
704 do4
: $(HOLESDIR
) $(host
)-stamp-stage4
706 $(host
)-stamp-stage4
:
707 if
[ -d
$(STAGE4DIR
) ] ; then \
708 mv
$(STAGE4DIR
) $(WORKING_DIR
) ; \
712 $(SET_CYGNUS_PATH
) $(TIME
) $(GNU_MAKE
) $(FLAGS_TO_PASS
) -f test-build.mk
-w
$(host
)-stamp-stage4-checked
713 mv
$(WORKING_DIR
) $(STAGE4DIR
)
717 $(host
)-stamp-stage4-installed
: $(host
)-stamp-stage4-checked
718 $(SET_CYGNUS_PATH
) cd
$(WORKING_DIR
) ; $(TIME
) $(MAKE
) -w
$(FLAGS_TO_PASS
) $(GNUC
) install host
=$(host
)
719 $(SET_CYGNUS_PATH
) cd
$(WORKING_DIR
) ; $(TIME
) $(MAKE
) -w
$(FLAGS_TO_PASS
) $(GNUC
) install-info host
=$(host
)
722 $(host
)-stamp-stage4-checked
: $(host
)-stamp-stage4-built
723 # $(SET_CYGNUS_PATH) cd $(WORKING_DIR) ; $(TIME) $(MAKE) -w $(FLAGS_TO_PASS) $(GNUC) check host=$(host)
726 $(host
)-stamp-stage4-built
: $(host
)-stamp-stage4-configured
727 $(SET_CYGNUS_PATH
) cd
$(WORKING_DIR
) ; $(TIME
) $(MAKE
) -w
$(FLAGS_TO_PASS
) $(GNUC
) all host
=$(host
)
728 $(SET_CYGNUS_PATH
) cd
$(WORKING_DIR
) ; $(TIME
) $(MAKE
) -w
$(FLAGS_TO_PASS
) $(GNUC
) info host
=$(host
)
731 $(host
)-stamp-stage4-configured
:
732 [ -d
$(WORKING_DIR
) ] || mkdir
$(WORKING_DIR
)
733 $(SET_CYGNUS_PATH
) cd
$(WORKING_DIR
) ; \
734 $(configenv
) $(GNUC
) $(TIME
) $(CONFIG_SHELL
) ..
/$(TREE
)/configure
$(config
) -v
--srcdir=..
/$(TREE
) $(prefixes
) $(configargs
)
737 # These things are needed by a three-stage, but are not included locally.
796 ### so far only sun make supports VPATH
797 ifeq ($(subst sun3
,sun4
,$(holesys
)),sun4
)
803 ### solaris 2 -- don't use /usr/ucb/cc
804 ifeq (sparc-sun-solaris2
,$(holesys
))
805 SET_NATIVE_HOLES
:= SHELL
=$(SHELL
) ; PATH
=/opt
/SUNWspro
/bin
:`pwd`/$(HOLESDIR
) ; export PATH
; export SHELL
;
806 HOLE_DIRS
:= /usr
/ccs
/bin
811 ifeq ($(host
),i386-go32
)
812 DOS_HOLES
:= aout2exe doschk file
815 ifeq ($(host
),i386-lynx
)
819 ifeq ($(host
),m68k-lynx
)
823 ifeq ($(host
),sparc-lynx
)
827 ifeq ($(host
),rs6000-lynx
)
831 ### These things are also needed by a three-stage, but in this case, the GNU version of the tool is required.
839 ### look in these directories for things missing from a three-stage
848 ### look in these directories for alternate versions of some tools.
849 PARTIAL_HOLE_DIRS
:= \
851 /usr
/progressive
/bin \
852 $(PARTIAL_HOLE_DIRS
) \
854 /usr
/unsupported
/bin \
857 $(HOLESDIR
): $(holesys
)-stamp-holes
859 $(holesys
)-stamp-holes
:
862 @for i in
$(HOLES
) ; do \
864 for j in
$(HOLE_DIRS
) ; do \
865 if
[ -x
$$j/$$i ] ; then \
866 ln
-s
$$j/$$i $(HOLESDIR
) || cp
$$j/$$i $(HOLESDIR
) ; \
867 echo
$$i from
$$j ; \
874 *) echo
$$i is NOT found
;; \
877 @for i in
$(PARTIAL_HOLES
) ; do \
879 for j in
$(PARTIAL_HOLE_DIRS
) ; do \
880 if
[ -x
$$j/$$i ] ; then \
881 rm -f
$(HOLESDIR
)/$$i ; \
882 cp
$$j/$$i $(HOLESDIR
)/$$i || exit
1; \
883 echo
$$i from
$$j ; \
890 *) echo
$$i is NOT found
;; \
894 cd
$(HOLESDIR
); rm -f
$(NUKEM
)
898 # Get the cross-tools for build cross host when not building on the host.
900 BUILD_HOST_HOLES
:= \
912 BUILD_HOLES_DIRS
:= $(release_root
)/H-
$(build
)/bin
$(PARTIAL_HOLE_DIRS
)
914 ifdef BUILD_HOST_HOLES_DIR
915 $(BUILD_HOST_HOLES_DIR
): $(build
)-x-
$(host
)-stamp-holes
918 ifneq ($(build
),$(host
))
919 $(build
)-x-
$(host
)-stamp-holes
:
920 -rm -rf
$(BUILD_HOST_HOLES_DIR
)
921 -mkdir
$(BUILD_HOST_HOLES_DIR
)
922 @for i in
$(BUILD_HOST_HOLES
) ; do \
924 for j in
$(BUILD_HOLES_DIRS
) ; do \
925 if
[ -x
$$j/$$i ] ; then \
926 ln
-s
$$j/$$i $(BUILD_HOST_HOLES_DIR
) || cp
$$j/$$i $(BUILD_HOST_HOLES_DIR
) ; \
927 echo
$$i from
$$j ; \
934 *) echo
$$i is NOT found
;; \
940 # Get the cross tools for build cross target when not building on the host.
942 BUILD_TARGET_HOLES
:= \
954 ifdef BUILD_TARGET_HOLES_DIR
955 $(BUILD_TARGET_HOLES_DIR
): $(build
)-x-
$(target
)-stamp-holes
958 ifneq ($(build
),$(target
))
959 $(build
)-x-
$(target
)-stamp-holes
:
960 -rm -rf
$(BUILD_TARGET_HOLES_DIR
)
961 -mkdir
$(BUILD_TARGET_HOLES_DIR
)
962 @for i in
$(BUILD_TARGET_HOLES
) ; do \
964 for j in
$(BUILD_HOLES_DIRS
) ; do \
965 if
[ -x
$$j/$$i ] ; then \
966 ln
-s
$$j/$$i $(BUILD_TARGET_HOLES_DIR
) || cp
$$j/$$i $(BUILD_TARGET_HOLES_DIR
) ; \
967 echo
$$i from
$$j ; \
974 *) echo
$$i is NOT found
;; \
981 comparison
: $(host
)-stamp-3stage-compared
982 comparison-stage3to4
: $(host
)-stamp-4stage-compared
984 $(host
)-stamp-3stage-compared
:
986 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
)
987 for i in
`cd $(STAGE3DIR) ; find . -name \*.o -print` ; do \
988 tail
+10c
$(STAGE2DIR
)/$$i > foo1
; \
989 tail
+10c
$(STAGE3DIR
)/$$i > foo2
; \
990 if cmp foo1 foo2
; then \
994 touch .bad-compare
; \
999 for i in
`cd $(STAGE3DIR) ; find . -name \*.o -print` ; do \
1000 cmp
$(STAGE2DIR
)/$$i $(STAGE3DIR
)/$$i || touch .bad-compare
; \
1003 if
[ -f CLEAN_ALL
] ; then \
1004 rm -rf
$(STAGE2DIR
) $(STAGE3DIR
) ; \
1006 if
[ -f CLEAN_STAGES
] ; then \
1007 if
[ -f .bad-compare
] ; then \
1010 rm -rf
$(STAGE1DIR
) $(STAGE2DIR
) ; \
1017 $(host
)-stamp-4stage-compared
:
1019 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
)
1020 for i in
`cd $(STAGE4DIR) ; find . -name \*.o -print` ; do \
1021 tail
+10c
$(STAGE3DIR
)/$$i > foo1
; \
1022 tail
+10c
$(STAGE4DIR
)/$$i > foo2
; \
1023 if cmp foo1 foo2
; then \
1027 touch .bad-compare
; \
1032 for i in
`cd $(STAGE4DIR) ; find . -name \*.o -print` ; do \
1033 cmp
$(STAGE3DIR
)/$$i $(STAGE4DIR
)/$$i || touch .bad-compare
; \
1036 if
[ -f CLEAN_ALL
] ; then \
1037 rm -rf
$(STAGE2DIR
) $(STAGE3DIR
) $(STAGE4DIR
) ; \
1039 if
[ -f CLEAN_STAGES
] ; then \
1040 if
[ -f .bad-compare
] ; then \
1043 rm -rf
$(STAGE1DIR
) $(STAGE2DIR
) $(STAGE3DIR
) ; \
1051 rm -rf
$(HOLESDIR
) $(INPLACEDIR
) $(WORKING_DIR
)* $(host
)-stamp-
* *~
1061 ### Local Variables:
1062 ### fill-column: 131