File: rules

package info (click to toggle)
lam 6.1-11
  • links: PTS
  • area: main
  • in suites: slink
  • size: 7,764 kB
  • ctags: 5,834
  • sloc: ansic: 55,525; makefile: 1,449; fortran: 184; sh: 39; asm: 26; csh: 12
file content (82 lines) | stat: -rwxr-xr-x 2,570 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
#!/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.

package=lam

ARCH:=$(shell dpkg --print-architecture)

build:
	$(checkdir)
	
	cat Config/config.linux.ix86 | awk '{if ($$1=="CPU") $$3="$(ARCH)"; print}' \
		> Config/config.linux.$(ARCH)
	ln -snf config.linux.$(ARCH) Config/config
	make DESTDIR=`pwd`/debian/tmp
	touch build

clean:
	$(checkdir)
	-ln -snf config.solaris.sparc Config/config
	-rm -f Config/config.linux.$(ARCH)
	-if [ -e ./man/man1/mpirun_lam.1 ] ; then mv ./man/man1/mpirun_lam.1 ./man/man1/mpirun.1; mv ./man/man1/lamwipe.1 ./man/man1/wipe.1; fi
	-rm -f build
	-make clean
	-rm -f `find . -name "*~"`
	-rm -rf debian/tmp debian/files* core debian/substvars

binary-indep: checkroot build
	$(checkdir)
# There are no architecture-independent files to be uploaded
# generated by this package.  If there were any they would be
# made here.

binary-arch: checkroot build
	$(checkdir)
	-rm -rf debian/tmp
	install -d debian/tmp
	cd debian/tmp && install -d `cat ../dirs`
	cat Config/config.linux.ix86 | awk '{if ($$1=="CPU") $$3="$(ARCH)"; print}' \
		> Config/config.linux.$(ARCH)
	ln -snf config.linux.$(ARCH) Config/config
	make install DESTDIR=`pwd`/debian/tmp
# Must have debmake installed for this to work. Otherwise please copy
# /usr/bin/debstd into the debian directory and change debstd to debian/debstd
	ar -r `pwd`/debian/tmp/usr/lib/lam/lib/libmpi_merge.a `find lib -name "*.o"`
	mv ./man/man1/mpirun.1 ./man/man1/mpirun_lam.1 
	mv ./man/man1/wipe.1 ./man/man1/lamwipe.1
	ln -s ../../bin `pwd`/debian/tmp/usr/lib/lam/bin
	ln -s ../../include/lam `pwd`/debian/tmp/usr/lib/lam/h
	ln -s ../../man `pwd`/debian/tmp/usr/lib/lam/man
	mkdir debian/tmp/usr/man/man8
	ln -s ../man7/undocumented.7.gz debian/tmp/usr/man/man8/lamd.8.gz
	mv debian/tmp/usr/bin/wipe debian/tmp/usr/bin/lamwipe
	debstd
	(cd debian/tmp/usr/man; \
	for i in $$(find -type l) ; do \
		j=$$(basename $$(dirname $$i)); \
		k=$$(basename $$(dirname $$(ls -l $$i | awk '{print $$11}'))); \
		if [ $$j = $$k ] ; then \
			l=$$(pwd); \
			cd $$j; \
			ln -snf $$(basename $$(ls -l $$l/$$i | awk '{print $$11}')) \
				$$(basename $$(ls -l $$l/$$i | awk '{print $$9}')); \
			cd $$l; \
		fi; \
	done)	
	dpkg-gencontrol
	chown -R root.root debian/tmp
	chmod -R go=rX debian/tmp
	dpkg --build debian/tmp ..

define checkdir
	test -f debian/rules
endef

binary: binary-indep binary-arch

checkroot:
	$(checkdir)
	test root = "`whoami`"

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