#!/usr/bin/make -f

DEB_HOST_ARCH := $(shell dpkg-architecture -qDEB_HOST_ARCH)

.PHONY: override_dh_auto_configure \
        override_dh_strip \
        override_dh_install \
        override_dh_auto_test

%:
	dh $@ --parallel

override_dh_auto_configure:
	dh_auto_configure -- \
	    -DCMAKE_BUILD_TYPE=RelWithDebInfo

override_dh_strip:
	dh_strip -a --dbg-package=libignition-utils1-dbg

override_dh_install:
	dh_install
	# remove duplicate cli files from utilsx-dev.install regexp
	cd debian/libignition-utils1-cli-dev; find . -type f -exec rm -f ../libignition-utils1-dev/{} \;
	find debian/libignition-utils1-dev -type d -empty -delete

override_dh_auto_test:
ifeq ($(DEB_HOST_ARCH),armhf)
	true
else
	dh_auto_test $@ --no-parallel --buildsystem=cmake
endif
