File: rules

package info (click to toggle)
openmpi 1.2.7~rc2-2
  • links: PTS, VCS
  • area: main
  • in suites: lenny
  • size: 41,300 kB
  • ctags: 24,303
  • sloc: ansic: 224,835; sh: 22,627; makefile: 7,037; cpp: 6,353; asm: 3,547; lex: 528; objc: 383; perl: 348; csh: 89; f90: 49; fortran: 47; tcl: 12
file content (130 lines) | stat: -rwxr-xr-x 3,453 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
#!/usr/bin/make -f

#include /usr/share/dpatch/dpatch.make

# These are used for cross-compiling and for saving the configure script
# from having to guess our platform (since we know it already)
DEB_HOST_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
DEB_HOST_GNU_CPU   ?= $(shell dpkg-architecture -qDEB_HOST_GNU_CPU)

CFLAGS = -Wall -g

ifneq ($(DEB_HOST_GNU_TYPE),$(DEB_BUILD_GNU_TYPE))
	CROSS= --build $(DEB_BUILD_GNU_TYPE) --host $(DEB_HOST_GNU_TYPE)
else
	CROSS= --build $(DEB_BUILD_GNU_TYPE)
endif

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

ifeq (sparc,$(DEB_HOST_GNU_CPU))
	CFLAGS += -mcpu=v9
endif

config.status: #patch-stamp
	dh_testdir
	CFLAGS="$(CFLAGS)" ./configure 				\
			$(CROSS)				\
			--prefix=/usr 				\
			--mandir=\$${prefix}/share/man 		\
			--infodir=\$${prefix}/share/info 	\
			--sysconfdir=/etc/openmpi 		\
			--libdir=\$${prefix}/lib/openmpi/lib	\
			--includedir=\$${prefix}/lib/openmpi/include	\
			--with-devel-headers
# Thread support disabled because it's broken, see bug #435581
#			--enable-mpi-threads 			\
#			--enable-progress-threads

build: config.status
	$(MAKE)
	touch $@

# Everything is built in the "build" target
build-arch:  build
build-indep: build

check: build
	-$(MAKE) check 
	touch $@

clean: clean-work #unpatch
clean-work:
	dh_testdir
	dh_testroot
	rm -rf build check debian/openmpi
	xargs rm -f < debian/clean_symlinks
	[ ! -f Makefile ] || $(MAKE) distclean
        # some additional cleanups
	rm -rf opal/libltdl/.libs 
	dh_clean 

install-indep: build-indep check
	dh_testdir
	dh_testroot
	dh_clean -k -i 
	dh_installdirs -i
	dh_install -i --sourcedir=$(CURDIR)/debian/openmpi

install-arch: build-arch check
	dh_testdir
	dh_testroot
	dh_clean -k -s 
	$(MAKE) install DESTDIR=$(CURDIR)/debian/openmpi
	# Strip rpath info from all executables and libraries
	find debian/openmpi/ -type f -perm -+x -exec chrpath -d '{}' \;
	find debian/openmpi/ -type f -name '*\.so\.*' -exec chrpath -d '{}' \;
	for f in mpic++ mpicc mpicxx mpiexec mpif77 mpif90 ; do \
		cp debian/openmpi/usr/share/man/man1/$${f}.1 debian/openmpi/usr/share/man/man1/$${f}.openmpi.1 ; \
	done
	for f in ompi_info opal_wrapper orted; do \
		cp debian/$${f}.1 debian/openmpi/usr/share/man/man1/$${f}.1 ; \
	done
	chmod 644 debian/openmpi/usr/lib/openmpi/lib/mpi.mod
	sed -i 's/3OpenMPI/3/' debian/openmpi/usr/share/man/man3/*.3
	dh_install -s --sourcedir=$(CURDIR)/debian/openmpi --list-missing

binary-indep: install-indep
	dh_testdir -i
	dh_testroot -i
	dh_installchangelogs  -i
	dh_installdocs --all AUTHORS NEWS README
	dh_installexamples -popenmpi-doc examples/*
	dh_installman -i
	dh_link -i
	dh_strip -i
	dh_compress  -i
	dh_fixperms -i
	dh_makeshlibs -i
	dh_installdeb -i
	dh_shlibdeps -i
	dh_gencontrol -i
	dh_md5sums -i
	dh_builddeb -i

binary-arch: install-arch
	dh_testdir -a
	dh_testroot -a
	dh_installchangelogs  -a
	dh_installdocs --all AUTHORS NEWS README
	dh_installexamples -a
	dh_installman -a
	dh_link -a
	dh_strip -a --dbg-package=libopenmpi-dbg
	dh_compress  -a
	dh_fixperms -a
	dh_makeshlibs -a
	dh_installdeb -a
	dh_shlibdeps -a -l$(CURDIR)/debian/openmpi/usr/lib/openmpi/lib -Llibopenmpi1
	dh_gencontrol -a
	dh_md5sums -a
	dh_builddeb -a

binary: binary-arch binary-indep

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