nymea/debian/rules

59 lines
1.5 KiB
Makefile
Executable File

#!/usr/bin/make -f
# -*- makefile -*-
export DH_VERBOSE=1
export QT_QPA_PLATFORM=minimal
ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
DEB_PARALLEL_JOBS ?= $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
else
DEB_PARALLEL_JOBS += $(shell getconf _NPROCESSORS_ONLN)
endif
$(info Building with DEB_BUILD_OPTIONS: [${DEB_BUILD_OPTIONS}])
MAKE_TARGETS=all
ifeq (,$(filter nodoc,$(DEB_BUILD_OPTIONS)))
MAKE_TARGETS += doc
endif
QMAKE_ADDITIONAL_ARGS=
ifneq (,$(filter coverage,$(DEB_BUILD_OPTIONS)))
QMAKE_ADDITIONAL_ARGS += CONFIG+=coverage CONFIG+=debug
endif
DPKG_EXPORT_BUILDFLAGS = 1
DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
include /usr/share/dpkg/buildflags.mk
PREPROCESS_FILES := $(wildcard debian/*.in)
$(PREPROCESS_FILES:.in=): %: %.in
sed 's,/@DEB_HOST_MULTIARCH@,$(DEB_HOST_MULTIARCH:%=/%),g' $< > $@
override_dh_auto_configure:
dh_auto_configure -- "$(QMAKE_ADDITIONAL_ARGS)"
override_dh_auto_build:
make -j$(DEB_PARALLEL_JOBS) $(MAKE_TARGETS)
override_dh_install: $(PREPROCESS_FILES:.in=)
dh_install --fail-missing
# installing the documentation as there is no extra install target
cp -a $(CURDIR)/doc/html $(CURDIR)/debian/guh-doc/usr/share/doc/guh/ || true
override_dh_auto_test:
dh_auto_test -- -k TESTARGS="-o -,txt -o test-results.xml,xunitxml"
override_dh_strip:
dh_strip --dbg-package=guh-dbg
override_dh_auto_clean:
dh_auto_clean
rm -rf $(PREPROCESS_FILES:.in=)
%:
dh $@ --buildsystem=qmake --parallel