#!/usr/bin/make -f
# See debhelper(7) (uncomment to enable)
# output every command that modifies files on the build system.
#export DH_VERBOSE = 1

DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)

ifeq ($(origin CC),default)
	CXX := $(DEB_HOST_GNU_TYPE)-g++
endif

%:
	dh $@ 

override_dh_install:
	$(MAKE) -f build/linux/Makefile install PREFIX=/usr DESTDIR=$$(pwd)/debian/tmp CXX=$(CXX)
	d-shlibmove --commit --multiarch --shlibs-local --exclude-la \
				--movedev "debian/tmp/usr/include/*" usr/include \
				debian/tmp/usr/lib/lib*.so

override_dh_auto_build:
	$(MAKE) -f debian/Makefile
