summaryrefslogtreecommitdiff
path: root/Build-A-Release.mk
blob: 3b7093dbb6cf91e2d134fb0193f787fc881242d6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
### Makefile for preparing a progressive release.
###

### This makefile is distinct from test-build for several reasons.
### First, this version builds a "stage4" using src directories that
### have no CVS directories.  Second, the binaries are build from
### independent copies of the source.  That is, each host release will
### have it's own copy of the src directory.

###
### This file was written and is maintained by K. Richard Pixley,
### <rich@cygnus.com>.
###

CVS		:= /usr/latest/bin/cvs # using cvs-1.3
tree		:= progressive
rooting		:= /usr/cygnus
cvs_module	:= progressive1
gccflags	:= "-O"
release_tag	:= progressive-920529
bundle		:= emacs
host		:= sun4

ifeq (${bundle},emacs)
fixincludes :=
doc := emacs
else
fixincludes := ${host_release}/lib/fixincludes
doc := install
endif

host_release=${host}/${release_tag}
objdir=${host_release}/objdir

all: .${host}-done fluff

testfile: all blockit ${host}+.Z
${host}+.Z:
	(cd ${host} ; tar cf - ${release_tag} \
		| compress -vV \
		| ../blockit \
		> ../$@)

.${host}-done: .${host}-install .${host}-install-info
#	rm -rf ${objdir}
#	touch $@

.${host}-install: .${host}-all
	${MAKE} -C ${objdir} -w install-no-fixedincludes \
	prefix=`pwd`/${host_release} \
	exec_prefix=`pwd`/${host_release}/H-${host} \
	"CC=/usr/cygnus/${tree}.${tree}/H-${host}/bin/gcc ${gccflags}"
	touch $@

.${host}-install-info: .${host}-info
	${MAKE} -C ${objdir} -w install-info \
		prefix=`pwd`/${host_release} \
		exec_prefix=`pwd`/${host_release}/H-${host} \
		"CC=/usr/cygnus/${tree}.${tree}/H-${host}/bin/gcc \
		${gccflags}"
	touch $@

.${host}-all:	.${host}-config
	${MAKE} -C ${objdir} -w all "CC=/usr/cygnus/${tree}.${tree}/H-${host}/bin/gcc ${gccflags}"
	touch $@

.${host}-info:	.${host}-config
	${MAKE} -C ${objdir} -w info "CC=/usr/cygnus/${tree}.${tree}/H-${host}/bin/gcc ${gccflags}"
	touch $@

.${host}-config:	.${host}-src
	cd ${objdir} ; \
		../src/configure ${host} \
			-prefix=${rooting}/${release_tag} \
			-exec_prefix=${rooting}/${release_tag}/H-${host}
	touch $@

.${host}-src:	 .${release_tag}-co .${host}-dirs
	rm -rf ${host_release}/src
	(tar cf - ${release_tag} | (cd ${host_release} ; tar xvf -) ; true)
	(cd ${host_release}/${release_tag} ; find . \( -name CVS -o -name CVS.adm \) -depth -exec rm -rf {} \; )
	mv ${host_release}/${release_tag} ${host_release}/src
	touch $@

.${host}-dirs:
	[ -d ${host} ] || mkdir ${host}
	[ -d ${host_release} ] || mkdir ${host_release}
	[ -d ${objdir} ] || mkdir ${objdir}
	touch $@

.${release_tag}-co: .${release_tag}-tagged
	${CVS} co -r ${release_tag} ${cvs_module}
	mv ${tree} ${release_tag}
	touch $@

.${release_tag}-tagged:
	${CVS} rtag ${release_tag} ${cvs_module}
	touch $@

fluff:	${host_release}/src/Build-A-Release.mk \
	${host_release}/src/Pack-A-Progressive \
	${fixincludes} \
	${host_release}/src/README \
	${fixincludes} \
	${host}/Install \
	${host}/install.dvi \
	${host}/tape-labels.dvi \
	${host_release}/CYGNUS

${host}/tape-labels.dvi: ${host_release}/src/tape-labels.tex
	cp $< ${host}/`basename $<`
	(cd ${host} ; tex `basename $<`)
	rm ${host}/`basename $<`

${host}/install.dvi: ${host_release}/src/install.texinfo
	cp $< ${host}/`basename $<`
	(cd ${host} ; tex `basename $<`)
	(cd ${host} ; tex `basename $<`)
	(cd ${host} ; tex `basename $<`)
	rm ${host}/`basename $<`

print-notes: ${host}/install.dvi
	lpr $^

print-labels: ${host}/tape-labels.dvi
	lpr $^

clean-fluff:
	rm -f ${host_release}/src/Build-A-Release.mk \
		${host_release}/src/Pack-A-Progressive \
		${host_release}/lib/fixincludes \
		${host_release}/Install \
		${host_release}/src/${doc}-texi.in \
		${host_release}/src/tape-labels-tex.in \
		${host_release}/src/tape-labels.tex \
		${host_release}/src/install.texinfo \
		${host_release}/src/Install.in \
		
${host_release}/src/Build-A-Release.mk: ${release_tag}/Build-A-Release.mk
	cp $< $@

${host_release}/src/Pack-A-Progressive: ${release_tag}/Pack-A-Progressive
	cp $< $@

${host_release}/src/Install.in: ${release_tag}/Install.in
	cp $< $@

${host_release}/src/CYGNUS: ${release_tag}/CYGNUS
	cp $< $@

${host_release}/CYGNUS: ${host_release}/src/CYGNUS
	cp $< $@

${host_release}/src/${doc}-texi.in: ${release_tag}/${doc}-texi.in
	cp $< $@

${host_release}/src/tape-labels-tex.in: ${release_tag}/tape-labels-tex.in
	cp $< $@

${host_release}/lib/fixincludes:	${host_release}/src/gcc/fixincludes
	cp $< $@
	chmod a+x $@

${host}/Install: ${host_release}/Install
	cp $< $@
	chmod a+x $@

${host_release}/Install: ${host_release}/src/Install
	cp $< $@
	chmod a+x $@

${host_release}/src/install.texinfo: ${host_release}/src/${doc}-texi.in
	$(MAKE) process -f Build-A-Release.mk IN=$< OUT=$@ relno=`echo ${release_tag} | sed "/${tree}-/s///"`

${host_release}/src/tape-labels.tex: ${host_release}/src/tape-labels-tex.in
	$(MAKE) process -f Build-A-Release.mk IN=$< OUT=$@ relno=`echo ${release_tag} | sed "/${tree}-/s///"`

${host_release}/src/README: ${host_release}/src/install.texinfo
	-makeinfo +no-headers +no-split $< -o $@
### remove tags table
	sed -e '/^Tag Table/,$$d' $@ | sed -e '$$d' > $@.new
	mv -f $@.new $@

${host_release}/src/Install: ${host_release}/src/Install.in
	$(MAKE) process -f Build-A-Release.mk IN=$< OUT=$@ relno=`echo ${release_tag} | sed "/${tree}-/s///"`
	chmod a+x $@

process: process-${host}
	@if grep '||' ${OUT}.new ; then \
		echo $0 missed at least one of the triggers. 1>&2 ; \
		exit 1 ; \
	else \
		true ; \
	fi
	mv ${OUT}.new ${OUT}

process-sun4:
	sed -e "/^@clear HOSTsun4/s::@set HOSTsun4:" \
		-e "/^@set HOSTsun3/s::@clear HOSTsun3:" \
		-e "/^@set HOSTdecstation/s::@clear HOSTdecstation:" \
		-e "/^@set HOSTiris/s::@clear HOSTiris:" \
		-e "/^@set HOSTrs6000/s::@clear HOSTrs6000:" \
		-e "/^@set FIXMES/s::@clear FIXMES:" \
		-e "/\|\|RELNO\|\|/s::${relno}:g" \
		-e "/\|\|TAPdflt\|\|/s::QIC-24:g" \
		-e "/\|\|DEVdflt\|\|/s::/dev/nrst8:g" \
		-e "/\|\|BD\|\|/s::35:g" \
		-e "/\|\|SD\|\|/s::34:g" \
		-e "/\|\|DF\|\|/s::69:g" \
		-e "/\|\|HOST\|\|/s::Sun-4:g" \
		-e "/\|\|HOSTstr\|\|/s::sun4:g" \
		-e "/\|\|TARGET\|\|/s::sun4:g" \
		-e "/\|\|GCCvn\|\|/s::cygnus-2.0.2:g" \
		-e "/\|\|BUNDLE\|\|/s::${bundle}:g" \
		< ${IN} > ${OUT}.new

process-sun3:
	sed -e "/^@set HOSTsun4/s::@clear HOSTsun4:" \
		-e "/^@clear HOSTsun3/s::@set HOSTsun3:" \
		-e "/^@set HOSTdecstation/s::@clear HOSTdecstation:" \
		-e "/^@set HOSTiris/s::@clear HOSTiris:" \
		-e "/^@set HOSTrs6000/s::@clear HOSTrs6000:" \
		-e "/^@set FIXMES/s::@clear FIXMES:" \
		-e "/\|\|RELNO\|\|/s::${relno}:g" \
		-e "/\|\|TAPdflt\|\|/s::QIC-24:g" \
		-e "/\|\|DEVdflt\|\|/s::/dev/nrst8:g" \
		-e "/\|\|BD\|\|/s::32:g" \
		-e "/\|\|SD\|\|/s::34:g" \
		-e "/\|\|DF\|\|/s::65:g" \
		-e "/\|\|HOST\|\|/s::Sun-3:g" \
		-e "/\|\|HOSTstr\|\|/s::sun3:g" \
		-e "/\|\|TARGET\|\|/s::sun3:g" \
		-e "/\|\|GCCvn\|\|/s::cygnus-2.0.2:g" \
		-e "/\|\|BUNDLE\|\|/s::${bundle}:g" \
		< ${IN} > ${OUT}.new

process-decstation:
	sed -e "/^@set HOSTsun4/s::@clear HOSTsun4:" \
		-e "/^@set HOSTsun3/s::@clear HOSTsun3:" \
		-e "/^@clear HOSTdecstation/s::@set HOSTdecstation:" \
		-e "/^@set HOSTiris/s::@clear HOSTiris:" \
		-e "/^@set HOSTrs6000/s::@clear HOSTrs6000:" \
		-e "/^@set FIXMES/s::@clear FIXMES:" \
		-e "/\|\|RELNO\|\|/s::${relno}:g" \
		-e "/\|\|TAPdflt\|\|/s::QIC-24:g" \
		-e "/\|\|DEVdflt\|\|/s::/dev/nrmt0:g" \
		-e "/\|\|BD\|\|/s::27:g" \
		-e "/\|\|SD\|\|/s::34:g" \
		-e "/\|\|DF\|\|/s::61:g" \
		-e "/\|\|HOST\|\|/s::Decstation:g" \
		-e "/\|\|HOSTstr\|\|/s::decstation:g" \
		-e "/\|\|TARGET\|\|/s::decstation:g" \
		-e "/\|\|GCCvn\|\|/s::cygnus-2.0.2:g" \
		-e "/\|\|BUNDLE\|\|/s::${bundle}:g" \
		< ${IN} > ${OUT}.new
	true

process-iris4:
	sed -e "/^@set HOSTsun4/s::@clear HOSTsun4:" \
		-e "/^@set HOSTsun3/s::@clear HOSTsun3:" \
		-e "/^@set HOSTdecstation/s::@clear HOSTdecstation:" \
		-e "/^@clear HOSTiris/s::@set HOSTiris:" \
		-e "/^@set HOSTrs6000/s::@clear HOSTrs6000:" \
		-e "/^@set FIXMES/s::@clear FIXMES:" \
		-e "/\|\|RELNO\|\|/s::${relno}:g" \
		-e "/\|\|TAPdflt\|\|/s::QIC-24:g" \
		-e "/\|\|DEVdflt\|\|/s::/dev/mt/tps0d0nrns:g" \
		-e "/\|\|BD\|\|/s::25:g" \
		-e "/\|\|SD\|\|/s::34:g" \
		-e "/\|\|DF\|\|/s::59:g" \
		-e "/\|\|HOST\|\|/s::Iris:g" \
		-e "/\|\|HOSTstr\|\|/s::iris4:g" \
		-e "/\|\|TARGET\|\|/s::iris4:g" \
		-e "/\|\|GCCvn\|\|/s::cygnus-2.0.2:g" \
		-e "/\|\|BUNDLE\|\|/s::${bundle}:g" \
		< ${IN} > ${OUT}.new

process-rs6000:
	sed -e "/^@set HOSTsun4/s::@clear HOSTsun4:" \
		-e "/^@set HOSTsun3/s::@clear HOSTsun3:" \
		-e "/^@set HOSTdecstation/s::@clear HOSTdecstation:" \
		-e "/^@set HOSTiris/s::@clear HOSTiris:" \
		-e "/^@clear HOSTrs6000/s::@set HOSTrs6000:" \
		-e "/^@set FIXMES/s::@clear FIXMES:" \
		-e "/\|\|RELNO\|\|/s::${relno}:g" \
		-e "/\|\|TAPdflt\|\|/s::QIC-24:g" \
		-e "/\|\|DEVdflt\|\|/s::/dev/rmt0.1:g" \
		-e "/\|\|BD\|\|/s::36:g" \
		-e "/\|\|SD\|\|/s::34:g" \
		-e "/\|\|DF\|\|/s::70:g" \
		-e "/\|\|HOST\|\|/s::RS/6000:g" \
		-e "/\|\|HOSTstr\|\|/s::rs6000:g" \
		-e "/\|\|TARGET\|\|/s::rs6000:g" \
		-e "/\|\|GCCvn\|\|/s::cygnus-2.0.2:g" \
		-e "/\|\|BUNDLE\|\|/s::${bundle}:g" \
		< ${IN} > ${OUT}.new

clean:
	rm -rf ${host}

blockit: blockit.c

### EOF