File: rules

package info (click to toggle)
gcl 2.6.12-47
  • links: PTS
  • area: main
  • in suites: stretch
  • size: 55,420 kB
  • ctags: 111,171
  • sloc: ansic: 177,186; lisp: 154,207; asm: 128,169; sh: 22,274; cpp: 11,923; tcl: 3,181; perl: 2,930; makefile: 2,348; sed: 334; yacc: 226; lex: 95; awk: 30; fortran: 24; csh: 23
file content (269 lines) | stat: -rwxr-xr-x 7,565 bytes parent folder | download
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
#!/usr/bin/make -f
# Sample debian/rules that uses debhelper. 
# GNU copyright 1997 by Joey Hess.
#
# This version is for a hypothetical package that builds an
# architecture-dependant package, as well as an architecture-independent
# package.

# Uncomment this to turn on verbose mode. 
#export DH_VERBOSE=1

# This is the debhelper compatability version to use.
ARCHT:=$(shell dpkg-architecture -qDEB_HOST_ARCH)

MCC:=gcc
# ifeq ($(ARCHT),alpha)
# MCC:=gcc-4.6
# endif
# ifeq ($(ARCHT),mips)
# MCC:=gcc-4.6
# endif
# ifeq ($(ARCHT),mipsel)
# MCC:=gcc-4.6
# endif
# ifeq ($(ARCHT),ia64)
# MCC:=gcc-4.6
# endif
# ifeq ($(ARCHT),armel)
# MCC:=gcc-4.6
# endif
# ifeq ($(ARCHT),armhf)
# MCC:=gcc-4.6
# endif

#RELOC=locbfd
#RELOC?=statsysbfd
RELOC?=custreloc
ifeq ($(ARCHT),ia64)
RELOC=dlopen
endif
# ifeq ($(ARCHT),ppc64)
# RELOC=dlopen
# endif
#ifeq ($(ARCHT),hppa)
#RELOC=dlopen
#endif

GMP?=

DEBUG=

#ifeq ($(ARCHT),hppa)
#DEBUG=--enable-debug
#endif

VERS=$(shell echo $$(cat majvers).$$(cat minvers))
#EXT:=cvs

CFG:=$(addsuffix /config.,.)# gmp4/configfsf.
# Bug in autoconf dependency on emacsen-common workaround
#CFGS:=$(addsuffix .ori,configure $(addsuffix guess,$(CFG)) $(addsuffix sub,$(CFG)))
CFGS:=$(addsuffix .ori,$(addsuffix guess,$(CFG)) $(addsuffix sub,$(CFG)))

$(filter %.guess.ori,$(CFGS)): %.ori: /usr/share/misc/config.guess %
	! [ -e $* ] || [ -e $@ ] || cp $* $@
	[ $$($< -t | tr -d '-') -le $$(./$* -t | tr -d '-') ] || cp $< $*
	touch $@

$(filter %.sub.ori,$(CFGS)): %.ori: /usr/share/misc/config.sub %
	! [ -e $* ] || [ -e $@ ] || cp $* $@
	[ $$($< -t | tr -d '-') -le $$(./$* -t | tr -d '-') ] || cp $< $*
	touch $@

configure.ori: %.ori: configure.in 
	! [ -e $* ] || [ -e $@ ] || cp $* $@
	cd $(@D) && autoconf 
	touch $@

configure-%-stamp: $(CFGS)

	dh_testdir

	! [ -e unixport/saved_pre_gcl ] || $(MAKE) clean

#	chmod -R +x gmp4/*

	[ "$*" != "trad" ] || FLAGS="--disable-ansi" ; \
	[ "$*" != "gprof" ] || FLAGS="--disable-ansi --enable-gprof" ; \
	[ "$*" != "ansi-gprof" ] || FLAGS="--enable-gprof" ; \
	eval `dpkg-buildflags --export=sh` && CC=$(MCC) ./configure \
		--host=$$(dpkg-architecture -qDEB_HOST_GNU_TYPE) \
		--disable-statsysbfd \
		--disable-custreloc \
		--disable-dlopen \
		--enable-prelink \
		--enable-$(RELOC) \
		$(GMP) \
		$(DEBUG) \
		$$FLAGS \
		--prefix=/usr \
		--mandir=\$${prefix}/share/man \
		--enable-infodir=\$${prefix}/share/info \
		--enable-emacsdir=\$${prefix}/share/emacs/site-lisp

	touch $@


build-%-stamp: configure-%-stamp
	dh_testdir

	$(MAKE)

	rm -rf debian/$*
	mkdir -p debian/$*
	$(MAKE) install DESTDIR=$$(pwd)/debian/$*
	[ "$(findstring gprof,$*)" = "" ] || (\
		tmp=debian/$*; old=/usr/lib/gcl-$(VERS); new=$$old-prof;\
		if [ "$(findstring ansi,$*)" = "" ] ; then i=saved_gcl ; else i=saved_ansi_gcl ; fi;\
		mv $$tmp/$$old $$tmp/$$new ;\
		echo "(si::reset-sys-paths \"$$new/\")(si::save-system \"debian/tmp-image\")" | $$tmp/$$new/unixport/$$i &&\
		mv debian/tmp-image $$tmp/$$new/unixport/$$i;)

	touch $@

bclean-stamp:
	$(MAKE) clean
	touch $@

ansi-tests/test_results: build-ansi-stamp
	$(MAKE) $@

build: build-arch build-indep
build-arch: build-stamp
build-indep: build-stamp
build-stamp: build-gprof-stamp build-ansi-gprof-stamp build-trad-stamp build-ansi-stamp ansi-tests/test_results
	touch $@

debian/control.rm:
	rm -f `echo $@ | sed 's,\.rm$$,,1'`

debian/control: debian/control.rm
	cp debian/control.$(EXT) debian/control

clean: debian/control debian/gcl.templates
	dh_testdir
	dh_testroot
	rm -f *stamp
	debconf-updatepo

	$(MAKE) clean

	dh_clean
	rm -rf debian/gprof debian/ansi-gprof debian/trad debian/ansi $(INS) debian/substvars debian.upstream
	rm -rf *stamp
	for i in $(CFGS) ; do ! [ -e $$i ] || mv $$i $${i%.ori} ; done

INS:=$(shell for i in debian/in.* ; do echo $$i | sed 's,in.,,1' ; done |sed "s,gcl,gcl$(EXT),g")

$(INS): debian/gcl$(EXT)% : debian/in.gcl%
	cat $< | sed 's,@EXT@,$(EXT),g' >$@

install: install-stamp
install-stamp: build-stamp debian/control $(INS)
	dh_testdir
	dh_testroot
#	dh_clean -k
	dh_prep
	dh_installdirs

	mkdir -p debian/tmp
	cp -a debian/ansi/* debian/tmp/
	cp -a debian/trad/* debian/tmp/
	cp -a debian/gprof/* debian/tmp/
	cp -a debian/ansi-gprof/* debian/tmp/

	mv debian/tmp/usr/share/emacs/site-lisp debian/tmp/usr/share/emacs/foo
	mkdir -p debian/tmp/usr/share/emacs/site-lisp
	mv debian/tmp/usr/share/emacs/foo debian/tmp/usr/share/emacs/site-lisp/gcl$(EXT)

	cat debian/tmp/usr/share/emacs/site-lisp/gcl$(EXT)/gcl.el |\
		sed "s,(provide 'gcl),(provide 'gcl$(EXT)),1" >tmp &&\
		mv tmp debian/tmp/usr/share/emacs/site-lisp/gcl$(EXT)/gcl$(EXT).el
	[ "$(EXT)" = "" ] || rm debian/tmp/usr/share/emacs/site-lisp/gcl$(EXT)/gcl.el

	cat debian/tmp/usr/share/emacs/site-lisp/gcl$(EXT)/dbl.el |\
		sed "s,(provide 'dbl),(provide 'dbl$(EXT)),1" >tmp &&\
		mv tmp debian/tmp/usr/share/emacs/site-lisp/gcl$(EXT)/dbl$(EXT).el
	[ "$(EXT)" = "" ] || rm debian/tmp/usr/share/emacs/site-lisp/gcl$(EXT)/dbl.el

	[ "$(EXT)" = "" ] || \
		for i in debian/tmp/usr/share/info/*.info*; do \
			mv $$i $$(echo $$i | sed "s,gcl,gcl$(EXT),g"); done

	mv debian/tmp/usr/share/doc debian/tmp/usr/share/foo
	mkdir -p debian/tmp/usr/share/doc/gcl-doc
	mv debian/tmp/usr/share/foo/* debian/tmp/usr/share/doc/gcl-doc
	rmdir debian/tmp/usr/share/foo

	[ "$(EXT)" = "" ] || \
		mv debian/tmp/usr/share/doc/gcl-doc debian/tmp/usr/share/doc/gcl$(EXT)-doc 

	[ "$(EXT)" = "" ] || \
		(cat debian/tmp/usr/share/man/man1/gcl.1 |sed -e 's, gcl , gcl$(EXT) ,g' 's, GCL , GCL$(EXT) ,g' >debian/foo && \
			mv debian/foo debian/tmp/usr/share/man/man1/gcl$(EXT).1)

	cat debian/tmp/usr/lib/gcl-$(VERS)/gcl-tk/demos/index.lsp | \
		sed "s,$$(pwd)/debian/tmp,,1" >debian/foo
	mv debian/foo debian/tmp/usr/lib/gcl-$(VERS)/gcl-tk/demos/index.lsp

	rm -f debian/tmp/usr/bin/*.exe debian/tmp/usr/bin/*.bat

	find debian/tmp -type f -name "*.lsp" -exec chmod ugo-x {} \;
	find debian/tmp -type f -name "*.lisp" -exec chmod ugo-x {} \;
	find debian/tmp -type f -name "*.el" -exec chmod ugo-x {} \;
	find debian/tmp -type f -name "*.tcl" -exec chmod ugo-x {} \;

	rm -f debian/tmp/usr/bin/gcl
	TKVERS=$$(cat bin/gcl | grep /tk | head -1l | sed "s,.*/tk\([0-9.]*\)\").*,\1,1"); \
		cat debian/gcl.sh | sed -e "s,@EXT@,$(EXT),g" \
					-e "s,@VERS@,$(VERS),g" \
					-e "s,@TKVERS@,$$TKVERS,g" >debian/tmp/usr/bin/gcl$(EXT)
	chmod 0755 debian/tmp/usr/bin/gcl$(EXT)

	rm -rf debian/tmp/usr/lib/gcl-$(VERS)/info

	dh_install

	touch $@

# Build architecture-independent files here.
# Pass -i to all debhelper commands in this target to reduce clutter.
binary-indep: build install
	dh_testdir -i
	dh_testroot -i
	dh_installdocs -i
	dh_installinfo -i
	dh_installchangelogs ChangeLog -i
	dh_link -i
	dh_compress -i
	dh_fixperms -i
	dh_installdeb -i
	dh_gencontrol -i
	dh_md5sums -i
	dh_builddeb -i

binary-arch: build install #debian/substvars
	dh_testdir -a
	dh_testroot -a
	dh_installdocs -a -XRELEASE-2.6.2.html
	dh_installemacsen -a
	dh_installman -a
	dh_installdebconf -a
	sed -i -e 's,@EXT@,$(EXT),g' debian/gcl$(EXT)/DEBIAN/templates
	dh_installchangelogs ChangeLog -a
	dh_strip -a -Xlibgcl -Xlibansi_gcl \
		-Xgcl-$(VERS)-prof/unixport/saved_gcl -Xgcl-$(VERS)-prof/unixport/saved_ansi_gcl
	dh_lintian -a
	dh_link -a
	dh_compress -a
	dh_fixperms -a
	dh_installdeb -a
	dh_shlibdeps -a
	dh_gencontrol -a -u"-Vgcc=$(MCC)"
	dh_md5sums -a
	dh_builddeb -a

binary: binary-indep binary-arch
.PHONY: build clean binary-indep binary-arch binary install configure
.PRECIOUS: configure-trad-stamp configure-ansi-stamp configure-gprof-stamp configure-ansi-gprof-stamp