#!/usr/bin/make -f # -*- makefile -*- # Makefile for MRPT Debian package. export DEB_BUILD_MAINT_OPTIONS=hardening=+all,+fortify # default: dont build expensive caller graphs with dot in the documentation pkg export MRPT_genCALLERGRAPHS=NO # For multiarch support: DEB_HOST_ARCH ?= $(shell dpkg-architecture -qDEB_HOST_ARCH) DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH) DEB_HOST_ARCH_OS ?= $(shell dpkg-architecture -qDEB_HOST_ARCH_OS) # SSE options ifeq ($(DEB_HOST_ARCH),amd64) CMAKE_ARCH_FLAGS = -DMRPT_AUTODETECT_SSE=OFF -DDISABLE_SSE2=OFF -DDISABLE_SSE3=ON -DDISABLE_SSE4_1=ON -DDISABLE_SSE4_2=ON -DDISABLE_SSE4_A=ON else CMAKE_ARCH_FLAGS = -DMRPT_AUTODETECT_SSE=OFF -DDISABLE_SSE2=ON -DDISABLE_SSE3=ON -DDISABLE_SSE4_1=ON -DDISABLE_SSE4_2=ON -DDISABLE_SSE4_A=ON endif # Unit tests can be run with target "test", or "test_gdb", which shows stack # traces on failure: MRPT_TEST_TARGET = test CMAKE_FLAGS = \ -DCMAKE_INSTALL_PREFIX="$(CURDIR)/debian/" \ -DCMAKE_INSTALL_LIBDIR="lib/$(DEB_HOST_MULTIARCH)" \ -DCMAKE_VERBOSE_MAKEFILE=ON \ -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_HOST="$(DEB_HOST_GNU_TYPE)" \ -DCMAKE_BUILD="$(DEB_BUILD_GNU_TYPE)" \ -DCMAKE_MRPT_USE_DEB_POSTFIXS="1" \ -DCMAKE_VERBOSE_MAKEFILE=ON \ -DCMAKE_C_FLAGS_RELEASE="$(CFLAGS)" \ -DCMAKE_CXX_FLAGS_RELEASE="$(CXXFLAGS)" \ -DCMAKE_SHARED_LINKER_FLAGS_RELEASE="$(LDFLAGS)" \ -DCMAKE_EXE_LINKER_FLAGS_RELEASE="$(LDFLAGS)" \ $(CMAKE_ARCH_FLAGS) \ # Don't set: CMAKE_SKIP_RPATH=ON --> it makes unit tests to fail, # and the rpath is removed anyway by cmake's install target. %: dh $@ --buildsystem=cmake override_dh_auto_build-arch: dh_auto_build -O--buildsystem=cmake override_dh_auto_build-indep: # Build doc targets: dh_auto_build -O--buildsystem=cmake -- \ documentation_html \ man_pages_all \ documentation_psgz_guides # clean useless doxygen files: find $(CURDIR)/doc/ -name '*.md5' | xargs -I FIL rm FIL override_dh_auto_configure: dh_auto_configure -- $(CMAKE_FLAGS) override_dh_auto_install: # Do nothing? echo "[override_dh_auto_install]" override_dh_auto_test-indep: echo "[override_dh_auto_test-indep] Do nothing." override_dh_auto_test-arch: # Tests for arch-dependent : echo "[override_dh_auto_test-arch]" dh_auto_build -O--buildsystem=cmake -- $(MRPT_TEST_TARGET) -j1 override_dh_install-indep: echo "[override_dh_install-indep]" $(MAKE) -C obj-$(DEB_HOST_GNU_TYPE)/doc install $(MAKE) -C obj-$(DEB_HOST_GNU_TYPE)/share install # Fix Doxygen's embedded JQuery lib: rm $(CURDIR)/debian/mrpt-doc/usr/share/doc/mrpt-doc/html/jquery.js || true ln -s /usr/share/javascript/jquery/jquery.js $(CURDIR)/debian/mrpt-doc/usr/share/doc/mrpt-doc/html/jquery.js || true override_dh_install-arch: echo "[override_dh_install-arch]" # Install: dh_auto_build -O--buildsystem=cmake -- install # Move all the ".so" files to the proper place: the -dev package: mkdir -p $(CURDIR)/debian/libmrpt-dev/usr/lib/$(DEB_HOST_MULTIARCH) find $(CURDIR)/debian/ -name "*.so" | grep -v 'libmrpt-dev' | xargs -I FIL mv -f FIL $(CURDIR)/debian/libmrpt-dev/usr/lib/$(DEB_HOST_MULTIARCH)