File: rules

package info (click to toggle)
scalapack 1.7.4-2
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 34,004 kB
  • ctags: 30,444
  • sloc: fortran: 310,201; ansic: 64,027; makefile: 1,838; sh: 4
file content (323 lines) | stat: -rwxr-xr-x 7,826 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
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
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
#! /usr/bin/make -f
# Made with the aid of debmake, by Christoph Lameter,
# based on the sample debian/rules file for GNU hello by Ian Jackson.
# Handmodified by P. Frauenfelder for debhelper support, 5 Sept 1998

package=scalapack

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

topdir=$(shell pwd)

export DH_COMPAT=4

export lamPACKAGES=-pscalapack-lam1 -pscalapack-lam-dev -pscalapack-lam-test
export mpichPACKAGES=-pscalapack-mpich1 -pscalapack-mpich-dev \
	-pscalapack-mpich-test
export pvmPACKAGES=-pscalapack-pvm1 -pscalapack-pvm-dev -pscalapack-pvm-test

build: build-lam build-mpich build-pvm

build-lam: build-stamp-lam

build-mpich: build-stamp-mpich

build-pvm: build-stamp-pvm

build-stamp-lam:
	dh_testdir

# next is a clean
	echo *** cleaning object files ***
	BASEDIR=$(topdir) make clean

# build the shared libraries
	echo *** building shared libraries for lam ***
	BASEDIR=$(topdir) MPI=lam FPIC=-fPIC make lib
	mkdir -p tmp
	set -e ;\
	for i in scalapack ; do \
	  cd tmp ;\
	  ar x ../$${i}_lam.a ;\
	  cd .. ;\
	  gcc -shared -Wl,-soname=lib$$i-lam.so.$(version_major) -o \
	    lib$$i-lam.so.$(version) tmp/*.o -lblas-3 -llapack-3 -lblacsCinit-lam -lblacs-lam -llam -lg2c;\
	  ln -snf lib$$i-lam.so.$(version) lib$$i-lam.so.$(version_major) ;\
	  ln -snf lib$$i-lam.so.$(version_major) lib$$i-lam.so ;\
	  rm tmp/* ;\
	done
	rmdir tmp
#	for i in $$(find -name "*.f"); do \
#		if grep '^[^\*].*TOTMEM *= *' $$i | grep -v 64000000 >/dev/null ; then \
#		cat $$i | sed 's,\(^[^\*].*TOTMEM *= *\)[0-9]*,\164000000,g' >tmp ;\
#		mv tmp $$i;\
#		fi;\
#	done

# the testing binaries
	echo *** building static testing binaries for lam ***
	BASEDIR=$(topdir) MPI=lam BUILD=shared make exe
	set -e ;\
	cd TESTING ;\
	for i in $$(find -name 'x*' -maxdepth 1); do \
	  mv $$i $$i-lam ;\
	done

# next is a clean
	echo *** cleaning object files ***
	BASEDIR=$(topdir) make clean

# build the static libraries
	echo *** building static libraries for lam ***
	BASEDIR=$(topdir) MPI=lam make lib

	touch build-stamp-lam

build-stamp-mpich:
	dh_testdir

# next is a clean
	echo *** cleaning object files ***
	BASEDIR=$(topdir) make clean

# build the shared libraries
	echo *** building shared libraries for mpich ***
	BASEDIR=$(topdir) MPI=mpich FPIC=-fPIC make lib
	mkdir -p tmp
	set -e ;\
	for i in scalapack ; do \
	  cd tmp ;\
	  ar x ../$${i}_mpich.a ;\
	  cd .. ;\
	  gcc -shared -Wl,-soname=lib$$i-mpich.so.$(version_major) -o \
	    lib$$i-mpich.so.$(version) tmp/*.o -lblas-3 -llapack-3 -lblacsCinit-mpich -lblacs-mpich -L /usr/lib/mpich/lib/shared -lmpich -lg2c;\
	  ln -snf lib$$i-mpich.so.$(version) lib$$i-mpich.so.$(version_major) ;\
	  ln -snf lib$$i-mpich.so.$(version_major) lib$$i-mpich.so ;\
	  rm tmp/* ;\
	done
	rmdir tmp

# the testing binaries
	echo *** building static testing binaries for mpich ***
	BASEDIR=$(topdir) MPI=mpich BUILD=shared make exe
	set -e ;\
	cd TESTING ;\
	for i in $$(find -name 'x*'  -maxdepth 1 ! -name 'x*-lam'); do \
	  mv $$i $$i-mpich ;\
	done

# next is a clean
	echo *** cleaning object files ***
	BASEDIR=$(topdir) make clean

# build the static libraries
	echo *** building static libraries for mpich ***
	BASEDIR=$(topdir) MPI=mpich make lib

	touch build-stamp-mpich

build-stamp-pvm:
	dh_testdir

# next is a clean
	echo *** cleaning object files ***
	BASEDIR=$(topdir) make clean

# build the shared libraries
	echo *** building shared libraries for pvm ***
	BASEDIR=$(topdir) MPI=pvm FPIC=-fPIC make lib
	mkdir -p tmp
	set -e ;\
	for i in scalapack ; do \
	  cd tmp ;\
	  ar x ../$${i}_pvm.a ;\
	  cd .. ;\
	  gcc -shared -Wl,-soname=lib$$i-pvm.so.$(version_major) -o \
	    lib$$i-pvm.so.$(version) tmp/*.o -lblas-3 -llapack-3 -lblacs-pvm -lpvm3 -lg2c;\
	  ln -snf lib$$i-pvm.so.$(version) lib$$i-pvm.so.$(version_major) ;\
	  ln -snf lib$$i-pvm.so.$(version_major) lib$$i-pvm.so ;\
	  rm tmp/* ;\
	done
	rmdir tmp

# the testing binaries
	echo *** building static testing binaries for pvm ***
	BASEDIR=$(topdir) MPI=pvm BUILD=shared make exe
	set -e ;\
	cd TESTING ;\
	for i in $$(find -name 'x*'  -maxdepth 1 ! -name 'x*-lam' ! -name 'x*-mpich'); do \
	  mv $$i $$i-pvm ;\
	done

# next is a clean
	echo *** cleaning object files ***
	BASEDIR=$(topdir) make clean

# build the static libraries
	echo *** building static libraries for pvm ***
	BASEDIR=$(topdir) MPI=pvm make lib

	touch build-stamp-pvm

clean:
	dh_testdir
	dh_testroot
	rm -f build-stamp-* install-stamp-* install-dirs-stamp
	BASEDIR=$(topdir) make clean
	rm -f *.a
	rm -f *so*
	rm -f TESTING/x*
	rm -fr tmp
#	for i in $$(find -name "*.f"); do \
#		if grep '^[^\*].*TOTMEM *= *' $$i | grep 64000000 >/dev/null ; then\
#		cat $$i | sed -e 's/\(^[^\*].*TOTMEM *= *\)[0-9]*,/\12000000,/g' -e 's/\(^[^\*].*TOTMEM *= *\)[0-9]*\( *)\)/\13000000\2/g'>tmp ;\
#		mv tmp $$i;\
#		fi;\
#	done
	dh_clean

install: install-dirs install-mpich install-lam install-pvm

install-dirs: install-dirs-stamp

install-dirs-stamp:
	dh_testdir
	dh_testroot
	dh_clean -k
	dh_installdirs -v

	touch install-dirs-stamp

install-lam: install-stamp-lam

install-mpich: install-stamp-mpich

install-pvm: install-stamp-pvm

install-stamp-lam: build-stamp-lam
	dh_testdir
	dh_testroot

	set -e ;\
	for i in scalapack ; do \
	  install lib$$i-lam.so.$(version) \
	    `pwd`/debian/scalapack1-lam/usr/lib/lib$$i-lam.so.$(version) ;\
	done

	install TESTING/x*-lam \
	  `pwd`/debian/scalapack-lam-test/usr/lib/scalapack

	set -e ;\
	for i in scalapack ; do \
	  install $${i}_lam.a \
	    `pwd`/debian/scalapack-lam-dev/usr/lib/lib$$i-lam.a ;\
	done

	touch install-stamp-lam

install-stamp-mpich: build-stamp-mpich
	dh_testdir
	dh_testroot

	set -e ;\
	for i in scalapack ; do \
	  install lib$$i-mpich.so.$(version) \
	    `pwd`/debian/scalapack1-mpich/usr/lib/lib$$i-mpich.so.$(version) ;\
	done

	install TESTING/x*-mpich \
	  `pwd`/debian/scalapack-mpich-test/usr/lib/scalapack

	set -e ;\
	for i in scalapack ; do \
	  install $${i}_mpich.a \
	    `pwd`/debian/scalapack-mpich-dev/usr/lib/lib$$i-mpich.a ;\
	done

	touch install-stamp-mpich

install-stamp-pvm: build-stamp-pvm
	dh_testdir
	dh_testroot

	set -e ;\
	for i in scalapack ; do \
	  install lib$$i-pvm.so.$(version) \
	    `pwd`/debian/scalapack1-pvm/usr/lib/lib$$i-pvm.so.$(version) ;\
	done

	install TESTING/x*-pvm \
	  `pwd`/debian/scalapack-pvm-test/usr/lib/scalapack

	set -e ;\
	for i in scalapack ; do \
	  install $${i}_pvm.a \
	    `pwd`/debian/scalapack-pvm-dev/usr/lib/lib$$i-pvm.a ;\
	done

	touch install-stamp-pvm

binary-arch: build install
	dh_testdir
	dh_testroot
	dh_installdocs README 
	dh_installexamples
	dh_installchangelogs
	dh_link
	dh_compress
	dh_fixperms
	dh_strip
	dh_makeshlibs
	dh_installdeb
	dh_shlibdeps -l$(topdir)
	dh_gencontrol
	dh_md5sums
	dh_builddeb

install-indep: install-stamp-indep

install-stamp-indep:
	dh_testdir -i
	dh_testroot -i
	dh_installdirs -i

	set -e ;\
	for i in $$(find TESTING -name '*.dat') ; do \
	  install -m 644 $$i \
	    `pwd`/debian/scalapack-test-common/usr/share/scalapack ;\
	done
	set -e ;\
	for i in $$(find REDIST/TESTING -name '*.dat') ; do \
	  install -m 644 $$i \
	    `pwd`/debian/scalapack-test-common/usr/share/scalapack ;\
	done
	set -e ;\
	for i in $$(find PBLAS -name '*.dat') ; do \
	  install -m 644 $$i \
	    `pwd`/debian/scalapack-test-common/usr/share/scalapack ;\
	done

	touch install-stamp-indep

binary-indep: install-indep
	dh_testdir -i
	dh_testroot -i
	dh_installdocs -i README 
	dh_installchangelogs -i

	dh_link -i
	dh_compress -i
	dh_strip -i
	dh_fixperms -i
	dh_installdeb -i
	dh_gencontrol -i
	dh_md5sums -i
	dh_builddeb -i

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

binary: binary-arch binary-indep

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