#!/usr/bin/make -f
# -*- makefile -*-

DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
export DEB_HOST_MULTIARCH

# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

%:
	dh $@ --buildsystem=cmake --parallel

override_dh_auto_configure:
	dh_auto_configure -- -DLIB_SUFFIX="/$(DEB_HOST_MULTIARCH)"

override_dh_installchangelogs:
	dh_installchangelogs Changelog.txt

#Note: uhd 3.10 broke the multi-arch module support.
#The rules file creates a symlink to work around this.
override_dh_install:
	mkdir -p $(CURDIR)/debian/tmp/usr/lib/uhd/modules/$(DEB_HOST_MULTIARCH)
	ln -s /usr/lib/$(DEB_HOST_MULTIARCH)/uhd/modules/libsoapySupport.so \
		$(CURDIR)/debian/tmp/usr/lib/uhd/modules/$(DEB_HOST_MULTIARCH)/libsoapySupport.so
	dh_install
