File: rules

package info (click to toggle)
maxima 5.10.0-6
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 44,268 kB
  • ctags: 17,987
  • sloc: lisp: 152,894; fortran: 14,667; perl: 14,204; tcl: 10,103; sh: 3,376; makefile: 2,202; ansic: 471; awk: 7
file content (252 lines) | stat: -rwxr-xr-x 8,552 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
#!/usr/bin/make -f
#-*- makefile -*-
# Made with the aid of dh_make, by Craig Small
# Sample debian/rules that uses debhelper. GNU copyright 1997 by Joey Hess.
# Some lines taken from debmake, by Christoph Lameter.

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

# This is the debhelper compatability version to use.
#export DH_COMPAT=3

NO_STRIP:=
#ALT_LINK:=
#ifeq ($(DEB_BUILD_ARCH),mips)
#ALT_LINK:=--enable-gcl-alt-link
#endif
#ifeq ($(DEB_BUILD_ARCH),mipsel)
#ALT_LINK:=--enable-gcl-alt-link
#endif
#ifeq ($(DEB_BUILD_ARCH),ia64)
#ALT_LINK:=--enable-gcl-alt-link
#NO_STRIP:=-Xmaxima
#endif
#ifeq ($(DEB_BUILD_ARCH),hppa)
#ALT_LINK:=--enable-gcl-alt-link
#endif
#ifeq ($(DEB_BUILD_ARCH),alpha)
#ALT_LINK:=--enable-gcl-alt-link
#endif
ifeq ($(DEB_BUILD_ARCH),powerpc)
NO_STRIP:=-Xmaxima
endif

MVERS:=$(shell head -n 1 debian/changelog | cut -f2 -d\  | tr -d '()' | cut -f1 -d-)
build: build-stamp
build-stamp: 
	dh_testdir

	aclocal
	automake

	GCL_ANSI=t ./configure --enable-gcl $$(gcl -batch -eval '#-native-reloc(princ "--enable-gcl-alt-link")(bye)') \
		--prefix=/usr \
		--libexec=/usr/lib \
		--mandir=/usr/share/man \
		--infodir=/usr/share/info 

	GCL_ANSI=t $(MAKE)

# This sets up some reasonable readline command completion by default

	cd src/binary-gcl && echo ':lisp (setq si::*readline-prefix* "maxima::$$")(when (fboundp (quote si::sgc-on)) (si::sgc-on t))(setq maxima::*maxima-started* nil)(si::save-system "foo")' | ./maxima -eval '(run)' && mv foo maxima


# Reenable if/when gcl uses __mulsi et. al. on m68k, now configured for (020) unoptimally
#	[ "$$(dpkg --print-architecture)" != "m68k" ] || cp debian/rtest8.mac.m68k tests/rtest8.mac

	chmod +x ./maxima-local
	./maxima-local --lisp=gcl --batch-string="run_testsuite(true,true);"  >tmp 2>&1 & \
		j=$$! ; echo Waiting on pid $$j ; \
		tail -f --pid=$$j --retry tests/tests-gcl.log tmp & wait $$j

#	cat tmp tests/tests-gcl.log >debian/test_results.out

#	grep "Error(s) found in.*:" tests/tests-gcl.log | sed 's,Error(s) found in ,,1'	>tmp

#	! [ -e tests/known-bugs ] || diff -u tests/known-bugs tmp

#	[ -e tests/known-bugs ] || grep -q "No Errors Found" tests/tests-gcl.log

	cat tmp >debian/test_results.out

	grep -q "No unexpected errors found." debian/test_results.out

	rm -f tmp

#	cd doc/maximabook &&\
#		TEXINPUTS=../../interfaces/emacs/emaxima:.:$$TEXINPUTS latex maxima && \
#		TEXINPUTS=../../interfaces/emacs/emaxima:.:$$TEXINPUTS latex maxima && \
#		TEXINPUTS=../../interfaces/emacs/emaxima:.:$$TEXINPUTS latex maxima && \
#		dvips -o maxima.ps maxima

	touch build-stamp

BOOK:=debian/maximabook-19-Sept-2004.pdf

clean:
	dh_testdir
	dh_testroot
	rm -f build-stamp install-stamp

	-GCL_ANSI=t $(MAKE) clean
	-rm -f debian/test_results.out tests/tests-gcl.log
	-for i in $$(find -name Makefile) ; do\
		! [ -e $$i.am ] || rm -f $$i;\
		! [ -e $$i.am ] || rm -f $$i.in;\
	 done
	-rm -f src/maxima doc/man/maxima.1 interfaces/xmaxima/Tkmaxima/Header.tcl \
		interfaces/xmaxima/Tkmaxima/tclIndex interfaces/xmaxima/autoconf-variables.tcl \
		interfaces/xmaxima/xmaxima src/autoconf-variables.lisp
	rm -f src/factor.fn src/nparse.fn tests/gazonk0.fn
#	cd doc/maximabook && \
#		rm -f maxima.aux maxima.dvi maxima.idx maxima.lof \
#			maxima.log maxima.out maxima.toc maxima.ps
	rm -f debian/*.install
	rm -f $(BOOK) config.log config.status plotting/mgnuplot plotting/omplotdata \
			src/maxima.bat src/rmaxima maxima-local xmaxima-local maxima.spec maxima.iss
	rm -rf src/numerical/slatec/fortran/CVS src/*gazonk* interfaces/xmaxima/win32/Makefile
	dh_clean


LOC_DOC=<a href=file://usr/share/doc/maxima/html/maxima_toc.html> (local copy) </a>

foo:
	echo hello $(MVERS)

debian/%.install: debian/%.install.in
	cat $< | sed "s,@MVERS@,$(MVERS),g" >$@

INSTALLS:=$(shell ls -1 debian/*.install.in | sed 's,\.in$$,,1')

debian/%.pdf: debian/%.pdf.uu
	cat $< | uudecode >$@

install: install-stamp
install-stamp: build-stamp $(BOOK) $(INSTALLS)
	dh_testdir
	dh_testroot
	dh_clean -k

	$(MAKE) install DESTDIR=$$(pwd)/debian/tmp INSTALL="/usr/bin/install -D"

	mkdir -p $$(pwd)/debian/tmp/usr/share/doc/maxima-doc
	cp -a debian/tmp/usr/share/maxima/$(MVERS)/doc/* \
		$$(pwd)/debian/tmp/usr/share/doc/maxima-doc 
	rm -rf debian/tmp/usr/share/maxima/$(MVERS)/doc
	ln -snf ../../doc/maxima-doc debian/tmp/usr/share/maxima/$(MVERS)/doc

	mkdir -p $$(pwd)/debian/tmp/usr/share/doc/xmaxima
	cp -a debian/tmp/usr/share/maxima/$(MVERS)/xmaxima/* \
		$$(pwd)/debian/tmp/usr/share/doc/xmaxima 
	rm -rf debian/tmp/usr/share/maxima/$(MVERS)/xmaxima
	ln -snf ../../doc/xmaxima debian/tmp/usr/share/maxima/$(MVERS)/xmaxima

	mkdir -p debian/tmp/usr/share/emacs/site-lisp/maxima
	cp -a debian/tmp/usr/share/maxima/$(MVERS)/emacs/* \
		debian/tmp/usr/share/emacs/site-lisp/maxima
	rm debian/tmp/usr/share/emacs/site-lisp/maxima/dbl.el
	mkdir -p debian/tmp/usr/share/texmf/tex/latex
	mv debian/tmp/usr/share/emacs/site-lisp/maxima/*sty \
		debian/tmp/usr/share/texmf/tex/latex
	rm -rf debian/tmp/usr/share/maxima/$(MVERS)/emacs
	ln -snf ../../emacs/site-lisp/maxima debian/tmp/usr/share/maxima/$(MVERS)/emacs

	for i in debian/tmp/usr/bin/xmaxima \
		debian/tmp/usr/lib/maxima/$(MVERS)/omplotdata \
		debian/tmp/usr/lib/maxima/$(MVERS)/mgnuplot ; do \
		cat $$i | sed  -e 's,^#!/bin/sh,#!/usr/bin/wish,1' \
			-e 's,^exec wish,#exec wish,1' \
			-e 's,\$${prefix}/share,/usr/share,1' \
                        -e 's,[Nn]etscape,sensible-browser,g' >tmp && chmod 755 tmp && \
			mv tmp $$i ; done

	mkdir -p debian/tmp/usr/share/applications
	cp debian/xmaxima.desktop debian/tmp/usr/share/applications
	mkdir -p debian/tmp/usr/share/pixmaps
	ln -s /usr/share/doc/xmaxima/maxima-icon.png debian/tmp/usr/share/pixmaps/maxima-icon.png


# GCL must be able to write to directory in which tests are run
#	cd debian/tmp/usr/share/maxima/$(MVERS)/tests && patch -p1 <../../../../../../tests.lisp.patch
#	cat debian/tmp/usr/share/maxima/$(MVERS)/tests/tests.lisp | sed "s,@MVERS@,$(MVERS),g" >tmp && \
#		mv tmp debian/tmp/usr/share/maxima/$(MVERS)/tests/tests.lisp

#	cd debian/tmp/usr/bin && patch -p1 <../../../xmaxima.patch
#	cat debian/tmp/usr/bin/xmaxima | sed "s,@MVERS@,$(MVERS),g" >tmp && \
#		chmod 755 tmp && mv tmp debian/tmp/usr/bin/xmaxima

	cp $(BOOK) debian/tmp/usr/share/doc/maxima-doc

	cd debian/tmp/usr/share/info && \
		for i in $$(find -name "*.info"); do if ! grep -q START-INFO-DIR-ENTRY $$i ; then k=$$(basename $$i); k=$${k%.*}; awk '{if (!i) {i=1;printf("INFO-DIR-SECTION Maxima\nSTART-INFO-DIR-ENTRY\n* Maxima-%s: (%s).  A computer algebra system -- contributions.\nEND-INFO-DIR-ENTRY\n",k,k);}} {print}' k=$$k $$i >$$i.tmp; diff -u $$i $$i.tmp ; mv $$i.tmp $$i ; fi ; done

	cat debian/tmp/usr/share/info/maxima.info | \
		awk '/START-INFO-DIR-ENTRY/ {print "INFO-DIR-SECTION Maxima"}{print}' >debian/foo && \
		mv debian/foo debian/tmp/usr/share/info/maxima.info

	cat debian/tmp/usr/share/man/man1/maxima.1 | \
		sed 's,^.TH MAXIMA 1L,.TH MAXIMA 1,1' >debian/foo && \
		mv debian/foo debian/tmp/usr/share/man/man1/maxima.1

	cp -a debian/plotting debian/tips debian/tmp/usr/share/doc/maxima-doc/
	for i in $$(find debian/tmp/usr/share/doc/maxima-doc/{plotting,tips} -name "*.uu") ; do \
		cat $$i | uudecode > $${i%.uu} && rm $$i ; done

	for i in $$(find debian/tmp/usr/share/doc/maxima-doc/{plotting,tips} -name "*.shtml") ; do \
		mv $$i $${i%.shtml}.html ; done

	dh_install

	touch install-stamp

# Build architecture-independent files here.
binary-indep: build install
	dh_testdir -i
	dh_testroot -i
	dh_installdocs -i
	dh_installexamples -i
	dh_installmenu -i
	dh_installemacsen -i
	dh_installcron -i
	dh_installman -i
	dh_installinfo -p maxima-doc debian/tmp/usr/share/info/*info*
	dh_installchangelogs  -i
	dh_link -i
	dh_strip -i
	dh_compress -i -X.shtml -X.hh
	dh_fixperms -i
	dh_installdeb -i
	dh_shlibdeps -i
	dh_gencontrol -i
	dh_md5sums -i
	dh_builddeb -i

# Build architecture-dependent files here.
binary-arch: build install
	dh_testdir -a
	dh_testroot -a
	dh_installdocs -a
	dh_installexamples -a
	dh_installmenu -a
	dh_installemacsen -a
	dh_installcron -a
	dh_installman -a
	dh_installinfo -a
	dh_installchangelogs  -a
	dh_link -a
	dh_strip -a $(NO_STRIP)
	dh_compress -a
	dh_fixperms -a
	dh_installdeb -a
	dh_shlibdeps -a
	dh_gencontrol -a
	dh_md5sums -a
	dh_builddeb -a

source diff:                                                                  
	@echo >&2 'source and diff are obsolete - use dpkg-source -b'; false

binary: binary-indep binary-arch
.PHONY: build clean binary-indep binary-arch binary install