#!/usr/bin/make -f

export CFLAGS  := $(shell dpkg-buildflags --get CFLAGS)
export LDFLAGS := $(shell dpkg-buildflags --get LDFLAGS)

export libarch := $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
export hostarch := $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)

binary binary-arch build build-arch clean:
	dh $@


binary-indep build-indep: # Nothing to do

override_dh_auto_build:
	dh_auto_build -- libarch="$(libarch)"

override_dh_auto_install:
	dh_auto_install -- libarch="$(libarch)"


.PHONY: clean                                   \
	build-indep   build-arch   build        \
	binary-indep  binary-arch  binary       \
	override_dh_auto_build override_dh_auto_install
