File: rules

package info (click to toggle)
mpb 1.11.1-3
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 3,856 kB
  • sloc: ansic: 13,270; javascript: 9,901; makefile: 212; lisp: 44; sh: 4
file content (115 lines) | stat: -rwxr-xr-x 3,516 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
#!/usr/bin/make -f
# -*- makefile -*-

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

export DEB_BUILD_MAINT_OPTIONS = hardening=+all
arch = $(shell dpkg-architecture -qDEB_BUILD_ARCH)

install_file    = /usr/bin/install -p -o root -g root -m 644
CONFIG_OPTS = --build=$(DEB_BUILD_GNU_TYPE) \
              --cache-file=../config.cache \
              --prefix=/usr \
              --mandir=\$${prefix}/share/man \
	      --disable-silent-rules \
	      --with-libctl=/usr/share/libctl \
	      --enable-maintainer-mode

CFLAGS += -fPIC

DEST_DIR = $(CURDIR)/debian/build-tmp/mpb/usr
DEST_DIR_MPI = $(CURDIR)/debian/build-tmp/mpb-mpi/usr
LA_DIR = $(CURDIR)/debian/build-tmp

# Which MPI implementation?
# set ARCH_DEFAULT_MPI_IMPL
include /usr/share/mpi-default-dev/debian_defaults

ifneq ($(wildcard /usr/lib/$(DEB_HOST_MULTIARCH)/hdf5/$(ARCH_DEFAULT_MPI_IMPL)/libhdf5.so),)
  export DEB_CPPFLAGS_MAINT_APPEND := -I/usr/include/hdf5/$(ARCH_DEFAULT_MPI_IMPL)
  export DEB_LDFLAGS_MAINT_APPEND := -Wl,-L/usr/lib/$(DEB_HOST_MULTIARCH)/hdf5/$(ARCH_DEFAULT_MPI_IMPL)
endif

%:
	dh $@ --with autoreconf

override_dh_clean:
	dh_clean
	rm -f config.log config.sub config.guess config.cache ../config.cache
	rm -f mpb/mpb
	rm -f mpb/mpb-split
	rm -f mpb/mpbi-split
	rm -f utils/mpb-data
	rm -f src/mpb.h
	rm -f src/mpbi.h
	rm -f src/mpb_mpi.h
	rm -f src/mpbi_mpi.h
	rm -f src/libmpb.la
	rm -rf debian/build-tmp

override_dh_auto_configure:
	# we build 4 binaries and need to reconfigure for each
	# so nothing done here
#	dh_auto_configure -- $(CONFIG_OPTS)

override_dh_auto_build:
	echo ${arch}
	# there is a problem with zdotc on mipsel
	# so deactivate the last patch except
	# on mipsel
ifneq ($(arch),mipsel)
	quilt pop
endif
	# normal version
	echo "Step1: normal version start"
	#XXX dh_auto_configure -- $(CONFIG_OPTS)
	-F77=gfortran CC=mpicc SH_JOB=/bin/bash ./configure $(CONFIG_OPTS)
	cat config.log
	dh_auto_build
	make install prefix=$(DEST_DIR)
	make clean
	echo "Step1: normal version end"

	# version with inverse symmetry
	#XXX dh_auto_configure -- --with-inv-symmetry $(CONFIG_OPTS)
	F77=gfortran CC=mpicc SH_JOB=/bin/bash ./configure --with-inv-symmetry $(CONFIG_OPTS)
	echo "Step2: inverse version start"
	dh_auto_build
	make install prefix=$(DEST_DIR)
	make clean
	echo "Step2: inverse version end"

	# normal version with mpi
	echo "Step3: mpi version start"
	#XXX dh_auto_configure -- --with-mpi $(CONFIG_OPTS)
	F77=gfortran CC=mpicc SH_JOB=/bin/bash ./configure --with-mpi $(CONFIG_OPTS)
	dh_auto_build
	make install prefix=$(DEST_DIR_MPI)
	make clean
	echo "Step3: mpi version end"

	# version with inverse symmetry with mpi
	echo "Step4: mpi inv version start"
	#XXX dh_auto_configure -- --with-mpi --with-inv-symmetry $(CONFIG_OPTS)
	F77=gfortran CC=mpicc SH_JOB=/bin/bash ./configure --with-mpi --with-inv-symmetry $(CONFIG_OPTS)
	dh_auto_build
	echo "Step4: mpi inv version end"
	make install prefix=$(DEST_DIR_MPI)
	#make clean <- still needed in dh_auto_install
	# clear depdenncy_libs in *.la
	sed -i "/dependency_libs/ s/'.*'/''/" `find $(LA_DIR)/* -name '*.la'`
	# create mpbi-data.1
	cp $(DEST_DIR)/share/man/man1/mpb-data.1 $(DEST_DIR)/share/man/man1/mpbi-data.1

override_dh_auto_install:
	# last build is for inv + mpi
	dh_auto_install
	rm -f config.cache ../config.cache

override_dh_auto_test:
	# tests are done during build, so nothing to do here

override_dh_installdocs:
	dh_installdocs
	rm -rf debian/mpb-doc/usr/share/doc/mpb-doc/html/mpb-mkdocs-theme/license