#!/usr/bin/make -f # -*- makefile -*- # debian/rules of libhmsbeagle # Uncomment this to turn on verbose mode. export DH_VERBOSE=1 export DEB_BUILD_MAINT_OPTIONS = hardening=+all include /usr/share/dpkg/default.mk lib := $(shell grep Package: debian/control | grep -v -e "$(DEB_SOURCE)-" | sed 's/Package: \+//') use_sse := $(shell if [ `dpkg-architecture -qDEB_BUILD_ARCH` = amd64 ] ; then echo yes ; else echo no ; fi) BUILDGNUTYPE := $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE) BUILDARCH := $(shell dpkg-architecture -qDEB_BUILD_ARCH) %: LC_ALL=C.UTF-8 dh $@ --with javahelper override_dh_auto_configure: ./autogen.sh dh_auto_configure -- --enable-doxygen-man --enable-march-native=no --enable-sse=$(use_sse) --with-opencl=/usr/include/CL override_dh_auto_build: $(MAKE) $(MAKE) doxygen-doc ant override_dh_auto_clean: $(MAKE) -f Makefile distclean || true rm -rf doc .config configure rm -rf lib build override_dh_installdocs: dh_installdocs find debian/$(DEB_SOURCE)-dev -name jquery.js -delete find debian/$(DEB_SOURCE)-dev -name "*.md5" -delete # run tests only on platforms supporting opencl # see https://lists.debian.org/debian-mentors/2015/08/msg00081.html num_opencl_platforms := $(shell clinfo | head -n1 | sed -e "s/.*[^0-9]\([0-9]\+\)[^0-9]*$$/\1/") override_dh_auto_test: ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS))) ifeq ($(num_opencl_platforms), 0) @echo "No OpenCL platform available, skipping test" else ifeq ($(BUILDARCH),amd64) # VERBOSE=1 dh_auto_test # pbuilder has set HOME=/nonexistent. Since some valid HOME is needed # to pass the test this is set to /tmp # # Ignore test failures which are most probably not relevant on real # hardware but occur in restricted Debian build environment # https://github.com/beagle-dev/beagle-lib/issues/121 HOME=/tmp make check VERBOSE=1 || true else echo "Pocl works only on amd64 properly - skip the tests on $(BUILDARCH)." endif endif endif override_dh_link: dh_link opencllib=`find debian/$(lib)/usr/lib -name "libhmsbeagle-opencl.so.*" | sed 's?debian/$(lib)/??' | grep -v '\.0$$'` ; \ dh_link -plibhmsbeagle-dev $${opencllib} usr/lib/$(BUILDGNUTYPE)/libhmsbeagle-opencl.so