#!/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" )