Debian Codegraph @

debian/rules

raw
1 #!/usr/bin/make -f
2 # Sample debian/rules that uses debhelper.
3 # GNU copyright 1997 to 1999 by Joey Hess.
4
5 # Uncomment this to turn on verbose mode.
6 #export DH_VERBOSE=1
7
8 -include /usr/share/dpkg/buildtools.mk
9 include /usr/share/dpkg/buildflags.mk
10 export DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
11
12 headers = err.h machine.h matrix.h meminfo.h sparse.h zmatrix.h \
13 iter.h matlab.h matrix2.h oldnames.h sparse2.h zmatrix2.h
14
15 torm = macheps maxint torture sptort ztorture meschach.a libmeschach.a
16
17 # shared library versions, option 1
18 version=1.2
19 major=$(shell expr `echo $(version)` : '\([0-9]*\).[0-9.]*')
20 # option 2, assuming the library is created as src/.libs/libfoo.so.2.0.5 or so
21 #version=`ls src/.libs/lib*.so.* | \
22 # awk '{if (match($$0,/[0-9]+\.[0-9]+\.[0-9]+$$/)) print substr($$0,RSTART)}'`
23 #major=`ls src/.libs/lib*.so.* | \
24 # awk '{if (match($$0,/\.so\.[0-9]+$$/)) print substr($$0,RSTART+4)}'`
25
26 %:
27 dh $@
28
29 execute_after_dh_clean:
30 rm -f config.log
31
32 override_dh_autoreconf:
33 echo "meschach is not maintained upstream"
34 echo "configure.in no longer functions, so we must skip autoreconf"
35
36
37 override_dh_auto_configure:
38 ./configure --prefix=/usr --mandir=\$${prefix}/share/man --with-all
39
40 override_dh_auto_build:
41 $(MAKE) vers=$(version) CC=$(CC) CPPFLAGS="$(CPPFLAGS)" CFLAGS="$(CFLAGS) -std=gnu17 -O3 -fPIC -D_REENTRANT" shared
42 $(MAKE) clean
43 $(MAKE) vers=$(version) CC=$(CC) CPPFLAGS="$(CPPFLAGS)" CFLAGS="$(CFLAGS) -std=gnu17 -O3 -D_REENTRANT" static
44
45 override_dh_auto_install-arch:
46 install -d debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/
47 cp libmeschach.so debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/libmeschach.so.$(version)
48 ln -s libmeschach.so.$(version) debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/libmeschach.so.$(major)
49 ln -s libmeschach.so.$(version) debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/libmeschach.so
50 cp libmeschach.a debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/libmeschach.a
51 install -d debian/tmp/usr/include/meschach
52 cp $(headers) debian/tmp/usr/include/meschach