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
35 ### The name of the cvs module for this release. The intersection of
36 ### CVS_MODULE and CVS_TAG defines the source files in this release.
37 CVS_MODULE
:= progressive-emacs
39 ### Historically, this was identical to CVS_TAG. This is changing.
40 RELEASE_TAG
:= progressive-920529
42 ### Historically, binaries were installed here. This is changing.
43 release_root
:= $(ROOTING
)/$(RELEASE_TAG
)
45 ### STOP EDITTING HERE!!!
46 ### With luck, eventually, nothing else will need to be editted.
50 GNU_MAKE
:= /usr
/latest
/bin
/make
64 ### general config stuff
65 WORKING_DIR
:= $(host
)-objdir
66 STAGE1DIR
:= $(WORKING_DIR
).1
67 STAGE2DIR
:= $(WORKING_DIR
).2
68 STAGE3DIR
:= $(WORKING_DIR
).3
69 HOLESDIR
:= $(host
)-holes
72 all: $(TREE
) do1 do2 do3 comparison
75 do1
: $(host
)-stamp-holes
$(host
)-stamp-stage1
78 if
[ -d
$(STAGE1DIR
) ] ; then \
79 mv
$(STAGE1DIR
) $(WORKING_DIR
) ; \
83 PATH
=`pwd`/$(HOLESDIR
) ; \
85 SHELL
=sh
; export SHELL
; \
86 $(TIME
) $(GNU_MAKE
) $(host
)-stamp-stage1-installed host
=$(host
) $(FLAGS_TO_PASS
)
87 touch
$(host
)-stamp-stage1
88 mv
$(WORKING_DIR
) $(STAGE1DIR
)
90 $(host
)-stamp-stage1-installed
: $(host
)-stamp-stage1-checked
91 (cd
$(WORKING_DIR
) ; $(TIME
) $(MAKE
) $(MF
) install host
=$(host
))
92 (cd
$(WORKING_DIR
) ; $(TIME
) $(MAKE
) $(MF
) install-info host
=$(host
))
95 $(host
)-stamp-stage1-checked
: $(host
)-stamp-stage1-built
96 # (cd $(WORKING_DIR) ; $(TIME) $(MAKE) $(MF) check host=$(host))
99 $(host
)-stamp-stage1-built
: $(host
)-stamp-stage1-configured
100 (cd
$(WORKING_DIR
) ; $(TIME
) $(MAKE
) $(MF
) all host
=$(host
))
101 (cd
$(WORKING_DIR
) ; $(TIME
) $(MAKE
) $(MF
) info host
=$(host
))
104 $(host
)-stamp-stage1-configured
:
105 [ -d
$(WORKING_DIR
) ] || mkdir
$(WORKING_DIR
)
106 (cd
$(WORKING_DIR
) ; \
107 $(TIME
) ..
/$(TREE
)/configure
$(host
) -v
-srcdir=..
/$(TREE
) \
108 -prefix=$(release_root
) \
109 -exec_prefix=$(release_root
)/H-
$(host
))
113 do2
: $(HOLESDIR
) $(host
)-stamp-stage2
115 $(host
)-stamp-stage2
:
116 if
[ -d
$(STAGE2DIR
) ] ; then \
117 mv
$(STAGE2DIR
) $(WORKING_DIR
) ; \
121 PATH
=$(release_root
)/H-
$(host
)/bin
:`pwd`/$(HOLESDIR
) ; \
123 SHELL
=sh
; export SHELL
; \
124 $(TIME
) $(MAKE
) -w
$(STAGE2DIR
) host
=$(host
) $(FLAGS_TO_PASS
)
125 touch
$(host
)-stamp-stage2
127 $(STAGE2DIR
): $(host
)-stamp-stage2-installed
128 mv
$(WORKING_DIR
) $(STAGE2DIR
)
130 $(host
)-stamp-stage2-installed
: $(host
)-stamp-stage2-checked
131 (cd
$(WORKING_DIR
) ; $(TIME
) $(MAKE
) -w
$(MF
) "CC=$(GCC)" install host
=$(host
))
132 (cd
$(WORKING_DIR
) ; $(TIME
) $(MAKE
) -w
$(MF
) "CC=$(GCC)" install-info host
=$(host
))
135 $(host
)-stamp-stage2-checked
: $(host
)-stamp-stage2-built
136 # (cd $(WORKING_DIR) ; $(TIME) $(MAKE) -w $(MF) "CC=$(GCC)" check host=$(host))
139 $(host
)-stamp-stage2-built
: $(host
)-stamp-stage2-configured
140 (cd
$(WORKING_DIR
) ; $(TIME
) $(MAKE
) -w
$(MF
) "CC=$(GCC)" all host
=$(host
))
141 (cd
$(WORKING_DIR
) ; $(TIME
) $(MAKE
) -w
$(MF
) "CC=$(GCC)" info host
=$(host
))
144 $(host
)-stamp-stage2-configured
:
145 [ -d
$(WORKING_DIR
) ] || mkdir
$(WORKING_DIR
)
146 (cd
$(WORKING_DIR
) ; \
147 $(TIME
) ..
/$(TREE
)/configure
$(host
) -v
-srcdir=..
/$(TREE
) \
148 -prefix=$(release_root
) \
149 -exec_prefix=$(release_root
)/H-
$(host
))
153 do3
: $(HOLESDIR
) $(host
)-stamp-stage3
155 $(host
)-stamp-stage3
:
156 if
[ -d
$(STAGE3DIR
) ] ; then \
157 mv
$(STAGE3DIR
) $(WORKING_DIR
) ; \
161 PATH
=$(release_root
)/H-
$(host
)/bin
:`pwd`/$(HOLESDIR
) ; \
163 SHELL
=sh
; export SHELL
; \
164 $(TIME
) $(MAKE
) -w
$(STAGE3DIR
) host
=$(host
) $(FLAGS_TO_PASS
)
165 touch
$(host
)-stamp-stage3
167 $(STAGE3DIR
): $(host
)-stamp-stage3-checked
168 mv
$(WORKING_DIR
) $(STAGE3DIR
)
170 $(host
)-stamp-stage3-installed
: $(host
)-stamp-stage3-checked
171 (cd
$(WORKING_DIR
) ; $(TIME
) $(MAKE
) -w
$(MF
) "CC=$(GCC)" install host
=$(host
))
172 (cd
$(WORKING_DIR
) ; $(TIME
) $(MAKE
) -w
$(MF
) "CC=$(GCC)" install-info host
=$(host
))
175 $(host
)-stamp-stage3-checked
: $(host
)-stamp-stage3-built
176 # (cd $(WORKING_DIR) ; $(TIME) $(MAKE) -w $(MF) "CC=$(GCC)" check host=$(host))
179 $(host
)-stamp-stage3-built
: $(host
)-stamp-stage3-configured
180 (cd
$(WORKING_DIR
) ; $(TIME
) $(MAKE
) -w
$(MF
) "CC=$(GCC)" all host
=$(host
))
181 (cd
$(WORKING_DIR
) ; $(TIME
) $(MAKE
) -w
$(MF
) "CC=$(GCC)" info host
=$(host
))
184 $(host
)-stamp-stage3-configured
:
185 [ -d
$(WORKING_DIR
) ] || mkdir
$(WORKING_DIR
)
186 (cd
$(WORKING_DIR
) ; \
187 $(TIME
) ..
/$(TREE
)/configure
$(host
) -v
-srcdir=..
/$(TREE
) \
188 -prefix=$(release_root
) \
189 -exec_prefix=$(release_root
)/H-
$(host
))
192 # These things are needed by a three-stage, but are not included locally.
237 ### so far only sun make supports VPATH
238 ifeq ($(subst sun3
,sun4
,$(host
)),sun4
)
244 ### rs6000 as is busted. We cache a patched version in unsupported.
245 ifeq ($(subst sun3
,rs6000
,$(host
)),rs6000
)
251 ### These things are also needed by a three-stage, but in this case, the GNU version of the tool is required.
258 ### look in these directories for things missing from a three-stage
265 ### look in these directories for alternate versions of some tools.
266 PARTIAL_HOLE_DIRS
:= \
268 /usr
/progressive
/bin \
272 $(HOLESDIR
): $(host
)-stamp-holes
277 for i in
$(HOLES
) ; do \
279 for j in
$(HOLE_DIRS
) ; do \
280 if
[ -x
$$j/$$i ] ; then \
281 cp
$$j/$$i $(HOLESDIR
) ; \
282 echo
$$i from
$$j ; \
289 *) echo
$$i is NOT found
;; \
292 for i in
$(PARTIAL_HOLES
) ; do \
294 for j in
$(PARTIAL_HOLE_DIRS
) ; do \
295 if
[ -x
$$j/$$i ] ; then \
296 rm -f
$(HOLESDIR
)/$$i ; \
297 cp
$$j/$$i $(HOLESDIR
)/$$i || exit
1; \
298 echo
$$i from
$$j ; \
305 *) echo
$$i is NOT found
;; \
308 touch
$(host
)-stamp-holes
312 ifeq ($(subst rs6000
,iris4
,$(subst decstation
,iris4
,$(host
))),iris4
)
313 for i in
`cd $(STAGE3DIR) ; find . -name \*.o -print` ; do \
314 tail
+10c
$(STAGE2DIR
)/$$i > foo1
; \
315 tail
+10c
$(STAGE3DIR
)/$$i > foo2
; \
316 cmp foo1 foo2 || echo
$$i ; \
319 for i in
`cd $(STAGE3DIR) ; find . -name \*.o -print` ; do \
320 cmp
$(STAGE2DIR
)/$$i $(STAGE3DIR
)/$$i ; \
326 rm -rf
$(HOLESDIR
) $(WORKING_DIR
)* $(host
)-stamp-
* *~
333 $(TIME
) cvs
co $(CVS_TAG
) $(CVS_MODULE
)