File: rules

package info (click to toggle)
umfpack 4.4-2
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 5,904 kB
  • ctags: 2,328
  • sloc: ansic: 31,039; fortran: 1,648; makefile: 1,292; sed: 162; csh: 96
file content (121 lines) | stat: -rwxr-xr-x 3,351 bytes parent folder | download | duplicates (2)
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
#!/usr/bin/make -f

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

CFLAGS = -Wall -g

ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
	CFLAGS += -O0
else
	CFLAGS += -O2
endif
ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
	INSTALL_PROGRAM += -s
endif

amd_version=1.0.0
amd_version_major=1

version=$(shell expr `pwd` : '.*-\([0-9.]*\)')
version_major=$(shell expr `pwd` : '.*-\([0-9]*\).[0-9.]*')


# shared library versions, option 1
#version=2.0.5
#major=2
# option 2, assuming the library is created as src/.libs/libfoo.so.2.0.5 or so
#version=`ls src/.libs/lib*.so.* | \
# awk '{if (match($$0,/[0-9]+\.[0-9]+\.[0-9]+$$/)) print substr($$0,RSTART)}'`
#major=`ls src/.libs/lib*.so.* | \
# awk '{if (match($$0,/\.so\.[0-9]+$$/)) print substr($$0,RSTART+4)}'`

build: build-stamp
build-stamp: 
	dh_testdir


	-mkdir -p shared/AMD shared/UMFPACK static/AMD static/UMFPACK
#
# First build the shared library
#
	cd shared/AMD ; \
	    $(MAKE)  -f ../../AMD/Source/Makefile -I ../../AMD/Source VPATH="../../AMD/Source" srcdir="../../AMD/Source" CFLAGS="-O3 -fPIC -pipe" DEBUGFLAGS="-DNDEBUG" ; \
	    gcc -shared -Wl,-soname,libamd.so.$(amd_version_major) -o libamd.so.$(amd_version) `ls *.o`

	cd static/AMD ; \
	$(MAKE) -f   ../../AMD/Source/Makefile -I ../../AMD/Source VPATH="../../AMD/Source" srcdir="../../AMD/Source" CFLAGS="-O3 -pipe" DEBUGFLAGS="-DNDEBUG" LDFLAGS="-s" ; 


	cd shared/UMFPACK ; \
	    $(MAKE) -f ../../UMFPACK/Source/Makefile -I ../../UMFPACK/Source VPATH="../../UMFPACK/Source" srcdir="../../UMFPACK/Source" CFLAGS="-O3 -fPIC -pipe" DEBUGFLAGS="-DNDEBUG" ; \
	    gcc -shared -Wl,-soname,libumfpack.so.$(version_major) -o libumfpack.so.$(version) `ls *.o` -lblas -lm

	cd static/UMFPACK ; \
	$(MAKE) -f   ../../UMFPACK/Source/Makefile -I ../../UMFPACK/Source VPATH="../../UMFPACK/Source" srcdir="../../UMFPACK/Source" CFLAGS="-O3 -pipe" DEBUGFLAGS="-DNDEBUG" LDFLAGS="-s" ; \

	cd AMD/Doc && make
	cd UMFPACK/Doc && make

	touch build-stamp

clean:
	dh_testdir
	dh_testroot
	-rm -f build-stamp configure-stamp
	-rm -rf shared static
	-rm -f debian/*.debhelper debian/dirs debian/compat
	-rm -f UMFACK/Demo/my*.out AMD/Demo/my*.out
	dh_clean 

install: build
	dh_testdir
	dh_testroot
	dh_clean -k 
	dh_installdirs

	( cd shared/AMD && ln -sf libamd.so.$(amd_version) libamd.so.$(amd_version_major) )
	( cd shared/AMD && ln -sf libamd.so.$(amd_version) libamd.so )
	( cd shared/UMFPACK && ln -sf libumfpack.so.$(version) libumfpack.so.$(version_major) )
	( cd shared/UMFPACK && ln -sf libumfpack.so.$(version) libumfpack.so )

binary-indep: build install
	dh_testdir -i
	dh_testroot -i
	dh_installchangelogs -i
	dh_installdocs -A -i
	dh_installexamples -i
	dh_install -XLicense -i
	dh_installman -i
	dh_link -i
	dh_compress -Xpdf -i
	dh_fixperms -i
	dh_installdeb -i 
	dh_gencontrol -i
	dh_md5sums -i
	dh_builddeb -i

binary-arch: build install
	dh_testdir -a
	dh_testroot -a
	dh_installchangelogs  -a
	ln -s README.txt README
	dh_installdocs -a 
	dh_installexamples -a
	dh_install -XLicense -a
	dh_installman -a
	dh_link -a
	dh_strip -a
	dh_compress -Xpdf -a
	dh_fixperms -a
	dh_makeshlibs -V -a
	dh_installdeb -a
	dh_shlibdeps -a
	dh_gencontrol -a
	dh_md5sums -a
	dh_builddeb -a

binary: binary-indep binary-arch

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