#!/usr/bin/make -f ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) IGNORE_SPEED=yes export IGNORE_SPEED endif # https://wiki.debian.org/HardeningWalkthrough#Selecting_security_hardening_options export DEB_BUILD_MAINT_OPTIONS=hardening=+all include /usr/share/dpkg/buildflags.mk export DESTDIR=$(CURDIR)/debian/tmp export PREFIX=/usr # see https://wiki.debian.org/Multiarch/Implementation DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH) export LIBPATH = $(PREFIX)/lib/$(DEB_HOST_MULTIARCH) %: dh $@ override_dh_auto_build: echo "Creating libtool executable" mkdir debian/libtool cp debian/configure.ac debian/libtool/ cd debian/libtool && LIBTOOLIZE='libtoolize -i' autoreconf -f -i dh_auto_configure --sourcedirectory=debian/libtool echo "Building libtommath" dh_auto_build --buildsystem=makefile -- -f makefile.shared LIBTOOL=$(CURDIR)/debian/libtool/libtool # move out the built doc shipped in tarball. Using .dod instead of # .bak because .bak files are cleaned up by dh_clean for i in $(CURDIR)/doc/*.pdf; do mv $$i $$i.dod; done echo "Building docs" $(MAKE) manual docs override_dh_auto_test: ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS))) echo "compiling test programs" $(MAKE) -f makefile.shared LIBTOOL=$(CURDIR)/debian/libtool/libtool test_standalone echo "running test" ./test endif override_dh_auto_install: $(MAKE) -f makefile.shared LIBTOOL=$(CURDIR)/debian/libtool/libtool install # Override if not processing -docs ifeq (,$(findstring libtommath-docs, $(shell dh_listpackages))) override_dh_install: dh_install --sourcedir=debian/tmp endif override_dh_clean: dh_clean doc/tommath.out demo/.libs/ demo/demo.lo libtommath.pc debian/libtool/ # move back the built doc shipped in tarball for i in $(CURDIR)/doc/*.pdf.dod; do if [ -e $$i ] ; then mv $$i $${i%%.dod}; fi; done override_dh_installchangelogs: dh_installchangelogs changes.txt