File: rules

package info (click to toggle)
silo-llnl 4.11-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 26,928 kB
  • sloc: ansic: 97,865; sh: 12,504; cpp: 7,121; pascal: 1,303; makefile: 1,294; fortran: 974; python: 359; xml: 109; csh: 74; f90: 69; perl: 54
file content (104 lines) | stat: -rwxr-xr-x 3,050 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
#!/usr/bin/make -f

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

# magic debhelper rule
%:
	dh $@ 

include /usr/share/mpi-default-dev/debian_defaults
MPI:=$(ARCH_DEFAULT_MPI_IMPL)
MPI_INC:=/usr/lib/$(MPI)/include

ifeq ($(shell dpkg-architecture -qDEB_TARGET_ARCH_BITS), 64)
    FPZIP:= --enable-fpzip
else
    FPZIP:= --disable-fpzip
endif

ifeq ($(MPI),lam)
  CC:=mpicc.lam
  CXX:=mpic++.lam
else
  CXX:=mpic++
  CC:=mpicc
endif

export CONFIG_SHELL=/bin/sh

# QT version 4 or 5
export QT_SELECT=5

PY3VERS:= `py3versions -s`
DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
LIBDIR:=/usr/lib/$(DEB_HOST_MULTIARCH)

export DEFAULT_SZIP=/usr

QT_INC:=/usr/include/$(DEB_HOST_MULTIARCH)/qt5
QT_BINDIR=/usr/bin
QT_INCLUDES:=-I$(QT_INC) -I$(QT_INC)/QtGui -I$(QT_INC)/QtCore -I$(QT_INC)/QtWidgets
QT_LIBS:=-lQt5Core -lQt5Gui -lQt5Widgets

# Work with either old or new-style (co-installable)  HDF5 layouts
ifneq ($(wildcard $(LIBDIR)/hdf5/$(MPI)/libhdf5.so),)
HDF5_INC:=/usr/include/hdf5/$(MPI)
HDF5_LIB:=$(LIBDIR)/hdf5/$(MPI)
else
ifneq ($(wildcard $(LIBDIR)/hdf5/serial/libhdf5.so),)
HDF5_INC:=/usr/include/hdf5/serial
HDF5_LIB:=$(LIBDIR)/hdf5/serial
else
HDF5_INC:=/usr/include
HDF5_LIB:=/usr/lib
endif
endif

override_dh_auto_configure:
	dh_auto_configure -- \
		--with-versioned-symbols \
		--enable-pythonmodule \
		--enable-silex \
		--with-szlib \
		--disable-hzip \
		$(FPZIP) \
		--with-hdf5=$(HDF5_INC),$(HDF5_DIR) \
		--enable-install-lite-headers \
		--with-Qt-bin-dir=$(QT_BINDIR) --with-Qt-include-dir=$(QT_INC) \
		CC=$(CC) CXX=$(CXX) CFLAGS="$(CFLAGS) -fPIC " CXXFLAGS="$(CXXFLAGS) -fPIC " \
		LDFLAGS="$(LDFLAGS) -L$(HDF5_LIB) " \
		CPPFLAGS=" $(QT_INCLUDES) -I$(MPI_INC) $(CPPFLAGS)"

# Iterate over some directories to avoid stepping into tools/silex, which doesn't build.
override_dh_auto_build:
	for d in src tools/browser tools/silock ; do \
		$(MAKE) -C $$d CC=$(CC) CXX=$(CXX) ; done
	$(MAKE) -C tools/silex CXX=$(CXX) QT_MOC=moc QT_LIBS="$(QT_LIBS)" 
	set -e ; for p in $(PY3VERS) ; do   \
		echo "Build python interface for $$p" ; \
		$(MAKE) -C tools/python clean all check CXX=$(CXX) PYTHON_CPPFLAGS="-I/usr/include/$$p" ; \
		mkdir -p  debian/tmp/usr/lib/pyshared/$$p ;  \
		cp tools/python/.libs/Silo.so debian/Silo.so.$$p  ; \
	done

override_dh_auto_test:
	for d in tests src tools/browser tools/silock ; do \
                $(MAKE) -C $$d check; done

override_dh_auto_install:
	# move the python modules to where dh_python* will spot them ...
	set -e; for p in $(PY3VERS); do \
		mkdir -p debian/tmp/usr/lib/$$p/site-packages ; \
		chrpath -d debian/Silo.so.$$p ; \
		cp debian/Silo.so.$$p debian/tmp/usr/lib/$$p/site-packages/Silo.so ; \
	done
	for p in src tools/browser tools/silock  tools/silex ; do \
		$(MAKE) -C $$p install prefix=`pwd`/debian/tmp ; done
	dh_install
	find debian/tmp -name '*.la' -delete

override_dh_auto_clean:
	dh_clean
	rm -f debian/Silo.so.* config.log
	( [ -f Makefile ] && make distclean || echo "No Makefile present ; skipping make distclean" )