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.
6 ### This file was written and is maintained by K. Richard Pixley,
9 ### Every invocation of this Makefile needs to have a variable set (host),
10 ### which is the named used for ./configure, and also the prefix for the
11 ### various files and directories used in a three stage.
14 error
:; @echo You must set the variable
\"host
\" to use this Makefile
; exit
1
17 ### from here to very near the end of the file is the real guts of this
18 ### Makefile, and it is not seen if the variable 'host' is not set
21 ### START EDITTING HERE!!!
22 ### These things will need to be set differently for each release.
25 ### from which cvs tree are we working?
28 ### binaries should be installed into?
29 ROOTING
:= /usr
/cygnus
31 ### When working from a tagged set of source, this should be the tag. If not,
32 ### then set the macro to be empty.
33 #CVS_TAG := -r emacs-920529
36 ### The name of the cvs module for this release. The intersection of
37 ### CVS_MODULE and CVS_TAG defines the source files in this release.
40 ### Historically, this was identical to CVS_TAG. This is changing.
41 RELEASE_TAG
:= latest-921102
43 ### Historically, binaries were installed here. This is changing.
44 release_root
:= $(ROOTING
)/$(RELEASE_TAG
)
46 ### STOP EDITTING HERE!!!
47 ### With luck, eventually, nothing else will need to be editted.
51 GNU_MAKE
:= /usr
/latest
/bin
/make
65 ### general config stuff
66 WORKING_DIR
:= $(host
)-objdir
67 STAGE1DIR
:= $(WORKING_DIR
).1
68 STAGE2DIR
:= $(WORKING_DIR
).2
69 STAGE3DIR
:= $(WORKING_DIR
).3
70 INPLACEDIR
:= $(host
)-in-place
71 HOLESDIR
:= $(host
)-holes
74 all: in-place
$(TREE
)-stamp-co do1 do2 do3 comparison
77 in-place
: $(host
)-stamp-in-place
79 $(host
)-stamp-in-place
: $(TREE
)-stamp-co
80 PATH
=/bin
:/usr
/bin
:/usr
/ucb
; \
82 SHELL
=/bin
/sh
; export SHELL
; \
83 $(TIME
) $(GNU_MAKE
) -f test-build.mk
$(host
)-stamp-in-place-installed host
=$(host
) $(FLAGS_TO_PASS
)
86 $(host
)-stamp-in-place-installed
: $(host
)-stamp-in-place-checked
87 (cd
$(INPLACEDIR
) ; $(TIME
) $(MAKE
) $(MF
) install host
=$(host
))
88 (cd
$(INPLACEDIR
) ; $(TIME
) $(MAKE
) $(MF
) install-info host
=$(host
))
91 $(host
)-stamp-in-place-checked
: $(host
)-stamp-in-place-built
92 # (cd $(INPLACEDIR) ; $(TIME) $(MAKE) $(MF) check host=$(host))
95 $(host
)-stamp-in-place-built
: $(host
)-stamp-in-place-configured
96 (cd
$(INPLACEDIR
) ; $(TIME
) $(MAKE
) $(MF
) all host
=$(host
))
97 (cd
$(INPLACEDIR
) ; $(TIME
) $(MAKE
) $(MF
) info host
=$(host
))
100 $(host
)-stamp-in-place-configured
: $(host
)-stamp-in-place-cp
101 (cd
$(INPLACEDIR
) ; \
102 $(TIME
) .
/configure
$(host
) -v \
103 -prefix=$(release_root
) \
104 -exec_prefix=$(release_root
)/H-
$(host
))
107 $(host
)-stamp-in-place-cp
:
110 (cd
$(TREE
) ; tar cf
- .
) |
(cd
$(INPLACEDIR
) ; tar xf
-)
114 do1
: $(host
)-stamp-holes
$(host
)-stamp-stage1
116 $(host
)-stamp-stage1
:
117 if
[ -d
$(STAGE1DIR
) ] ; then \
118 mv
$(STAGE1DIR
) $(WORKING_DIR
) ; \
122 PATH
=`pwd`/$(HOLESDIR
) ; \
124 SHELL
=sh
; export SHELL
; \
125 $(TIME
) $(GNU_MAKE
) -f test-build.mk
$(host
)-stamp-stage1-installed host
=$(host
) $(FLAGS_TO_PASS
)
127 mv
$(WORKING_DIR
) $(STAGE1DIR
)
129 $(host
)-stamp-stage1-installed
: $(host
)-stamp-stage1-checked
130 (cd
$(WORKING_DIR
) ; $(TIME
) $(MAKE
) $(MF
) install host
=$(host
))
131 (cd
$(WORKING_DIR
) ; $(TIME
) $(MAKE
) $(MF
) install-info host
=$(host
))
134 $(host
)-stamp-stage1-checked
: $(host
)-stamp-stage1-built
135 # (cd $(WORKING_DIR) ; $(TIME) $(MAKE) $(MF) check host=$(host))
138 $(host
)-stamp-stage1-built
: $(host
)-stamp-stage1-configured
139 (cd
$(WORKING_DIR
) ; $(TIME
) $(MAKE
) $(MF
) all host
=$(host
))
140 (cd
$(WORKING_DIR
) ; $(TIME
) $(MAKE
) $(MF
) info host
=$(host
))
143 $(host
)-stamp-stage1-configured
:
144 [ -d
$(WORKING_DIR
) ] || mkdir
$(WORKING_DIR
)
145 (cd
$(WORKING_DIR
) ; \
146 $(TIME
) ..
/$(TREE
)/configure
$(host
) -v
-srcdir=..
/$(TREE
) \
147 -prefix=$(release_root
) \
148 -exec_prefix=$(release_root
)/H-
$(host
))
152 do2
: $(HOLESDIR
) $(host
)-stamp-stage2
154 $(host
)-stamp-stage2
:
155 if
[ -d
$(STAGE2DIR
) ] ; then \
156 mv
$(STAGE2DIR
) $(WORKING_DIR
) ; \
160 PATH
=$(release_root
)/H-
$(host
)/bin
:`pwd`/$(HOLESDIR
) ; \
162 SHELL
=sh
; export SHELL
; \
163 $(TIME
) $(MAKE
) -f test-build.mk
-w
$(STAGE2DIR
) host
=$(host
) $(FLAGS_TO_PASS
)
166 $(STAGE2DIR
): $(host
)-stamp-stage2-installed
167 mv
$(WORKING_DIR
) $(STAGE2DIR
)
169 $(host
)-stamp-stage2-installed
: $(host
)-stamp-stage2-checked
170 (cd
$(WORKING_DIR
) ; $(TIME
) $(MAKE
) -w
$(MF
) "CC=$(GCC)" install host
=$(host
))
171 (cd
$(WORKING_DIR
) ; $(TIME
) $(MAKE
) -w
$(MF
) "CC=$(GCC)" install-info host
=$(host
))
174 $(host
)-stamp-stage2-checked
: $(host
)-stamp-stage2-built
175 # (cd $(WORKING_DIR) ; $(TIME) $(MAKE) -w $(MF) "CC=$(GCC)" check host=$(host))
178 $(host
)-stamp-stage2-built
: $(host
)-stamp-stage2-configured
179 (cd
$(WORKING_DIR
) ; $(TIME
) $(MAKE
) -w
$(MF
) "CC=$(GCC)" all host
=$(host
))
180 (cd
$(WORKING_DIR
) ; $(TIME
) $(MAKE
) -w
$(MF
) "CC=$(GCC)" info host
=$(host
))
183 $(host
)-stamp-stage2-configured
:
184 [ -d
$(WORKING_DIR
) ] || mkdir
$(WORKING_DIR
)
185 (cd
$(WORKING_DIR
) ; \
186 $(TIME
) ..
/$(TREE
)/configure
$(host
) -v
-srcdir=..
/$(TREE
) \
187 -prefix=$(release_root
) \
188 -exec_prefix=$(release_root
)/H-
$(host
))
192 do3
: $(HOLESDIR
) $(host
)-stamp-stage3
194 $(host
)-stamp-stage3
:
195 if
[ -d
$(TREE
)/gcc
] ; then \
196 if
[ -d
$(STAGE3DIR
) ] ; then \
197 mv
$(STAGE3DIR
) $(WORKING_DIR
) ; \
201 PATH
=$(release_root
)/H-
$(host
)/bin
:`pwd`/$(HOLESDIR
) ; \
203 SHELL
=sh
; export SHELL
; \
204 $(TIME
) $(MAKE
) -f test-build.mk
-w
$(STAGE3DIR
) host
=$(host
) $(FLAGS_TO_PASS
) ; \
210 $(STAGE3DIR
): $(host
)-stamp-stage3-checked
211 mv
$(WORKING_DIR
) $(STAGE3DIR
)
213 $(host
)-stamp-stage3-installed
: $(host
)-stamp-stage3-checked
214 (cd
$(WORKING_DIR
) ; $(TIME
) $(MAKE
) -w
$(MF
) "CC=$(GCC)" install host
=$(host
))
215 (cd
$(WORKING_DIR
) ; $(TIME
) $(MAKE
) -w
$(MF
) "CC=$(GCC)" install-info host
=$(host
))
218 $(host
)-stamp-stage3-checked
: $(host
)-stamp-stage3-built
219 # (cd $(WORKING_DIR) ; $(TIME) $(MAKE) -w $(MF) "CC=$(GCC)" check host=$(host))
222 $(host
)-stamp-stage3-built
: $(host
)-stamp-stage3-configured
223 (cd
$(WORKING_DIR
) ; $(TIME
) $(MAKE
) -w
$(MF
) "CC=$(GCC)" all host
=$(host
))
224 (cd
$(WORKING_DIR
) ; $(TIME
) $(MAKE
) -w
$(MF
) "CC=$(GCC)" info host
=$(host
))
227 $(host
)-stamp-stage3-configured
:
228 [ -d
$(WORKING_DIR
) ] || mkdir
$(WORKING_DIR
)
229 (cd
$(WORKING_DIR
) ; \
230 $(TIME
) ..
/$(TREE
)/configure
$(host
) -v
-srcdir=..
/$(TREE
) \
231 -prefix=$(release_root
) \
232 -exec_prefix=$(release_root
)/H-
$(host
))
235 # These things are needed by a three-stage, but are not included locally.
281 ### so far only sun make supports VPATH
282 ifeq ($(subst sun3
,sun4
,$(host
)),sun4
)
288 ### rs6000 as is busted. We cache a patched version in unsupported.
289 ifeq ($(subst sun3
,rs6000
,$(host
)),rs6000
)
295 ### These things are also needed by a three-stage, but in this case, the GNU version of the tool is required.
302 ### look in these directories for things missing from a three-stage
309 ### look in these directories for alternate versions of some tools.
310 PARTIAL_HOLE_DIRS
:= \
312 /usr
/progressive
/bin \
316 $(HOLESDIR
): $(host
)-stamp-holes
321 for i in
$(HOLES
) ; do \
323 for j in
$(HOLE_DIRS
) ; do \
324 if
[ -x
$$j/$$i ] ; then \
325 cp
$$j/$$i $(HOLESDIR
) ; \
326 echo
$$i from
$$j ; \
333 *) echo
$$i is NOT found
;; \
336 for i in
$(PARTIAL_HOLES
) ; do \
338 for j in
$(PARTIAL_HOLE_DIRS
) ; do \
339 if
[ -x
$$j/$$i ] ; then \
340 rm -f
$(HOLESDIR
)/$$i ; \
341 cp
$$j/$$i $(HOLESDIR
)/$$i || exit
1; \
342 echo
$$i from
$$j ; \
349 *) echo
$$i is NOT found
;; \
356 ifeq ($(subst rs6000
,iris4
,$(subst decstation
,iris4
,$(host
))),iris4
)
357 if
[ -d
$(TREE
)/gcc
] ; then \
358 for i in
`cd $(STAGE3DIR) ; find . -name \*.o -print` ; do \
359 tail
+10c
$(STAGE2DIR
)/$$i > foo1
; \
360 tail
+10c
$(STAGE3DIR
)/$$i > foo2
; \
361 cmp foo1 foo2 || echo
$$i ; \
367 if
[ -d
$(TREE
)/gcc
] ; then \
368 for i in
`cd $(STAGE3DIR) ; find . -name \*.o -print` ; do \
369 cmp
$(STAGE2DIR
)/$$i $(STAGE3DIR
)/$$i ; \
378 rm -rf
$(HOLESDIR
) $(INPLACEDIR
) $(WORKING_DIR
)* $(host
)-stamp-
* *~
382 rm -rf
$(TREE
) $(TREE
)-stamp-co
385 $(TREE
): $(TREE
)-stamp-co
389 $(TIME
) cvs
co $(CVS_TAG
) $(CVS_MODULE
)