| 1 |
#!/usr/bin/make -f |
| 2 |
|
| 3 |
DEB_HOST_ARCH ?= $(shell dpkg-architecture -qDEB_HOST_ARCH) |
| 4 |
DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH) |
| 5 |
|
| 6 |
ifneq (,$(findstring $(DEB_HOST_ARCH), i386)) |
| 7 |
export DEB_CFLAGS_MAINT_APPEND = -ffloat-store |
| 8 |
export DEB_CXXFLAGS_MAINT_APPEND = -ffloat-store |
| 9 |
endif |
| 10 |
DEBUG_PACKAGE = $(shell awk '/^Package/ && /-dbg *$$/ { print $$2 }' debian/control) |
| 11 |
%: |
| 12 |
VERBOSE=1 dh $@ --builddirectory=build |
| 13 |
|
| 14 |
.PHONY: override_dh_strip override_dh_auto_configure override_dh_install |
| 15 |
|
| 16 |
override_dh_auto_configure: |
| 17 |
mkdir -p build |
| 18 |
(cd build && cmake .. -DCMAKE_CXX_FLAGS="" -DCMAKE_CXX_FLAGS_RELEASE="$(CPPFLAGS) $(CXXFLAGS)" -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release -DCMAKE_VERBOSE_MAKEFILE=ON -DGTEST_DIR=/usr/src/gtest -DHTML_DOCS=off -DCMAKE_LIBRARY_ARCHITECTURE="$(DEB_HOST_MULTIARCH)") |
| 19 |
|
| 20 |
override_dh_auto_build-arch: |
| 21 |
dh_auto_build --builddirectory=build -- itpp |
| 22 |
cp gtests/fastica_test_data.txt gtests/parser_test_data.txt gtests/itfile_test_data.it gtests/g711_ref_data.it gtests/audiofile_ref_data.au build/gtests |
| 23 |
dh_auto_build --builddirectory=build -- itpp_gtests |
| 24 |
(cd build/gtests && ./itpp_gtests); |
| 25 |
|
| 26 |
override_dh_auto_build-indep: |
| 27 |
(cd build && cmake .. -DHTML_DOCS=on) |
| 28 |
|
| 29 |
# No tests needed for docs |
| 30 |
override_dh_auto_test-indep: |
| 31 |
|
| 32 |
override_dh_auto_install: |
| 33 |
dh_auto_install --builddirectory=build |
| 34 |
mkdir -p debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/ |
| 35 |
mv debian/tmp/usr/lib/libitpp.so* debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/ |
| 36 |
mkdir -p debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/pkgconfig |
| 37 |
mv debian/tmp/usr/lib/pkgconfig/* debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/pkgconfig/ |
| 38 |
dh_install |
| 39 |
|
| 40 |
override_dh_strip: |
| 41 |
dh_strip --dbg-package=$(DEBUG_PACKAGE) |