#!/usr/bin/make -f src_version := $(shell dpkg-query -W -f='$${source:Version}' binutils-source) deb_version := $(shell echo $(src_version) | cut -d- -f1) gnu_version := $(shell echo $(deb_version) | cut -d. -f1-3) z80_version := $(src_version)+$(shell dpkg-parsechangelog \ | sed -ne "s/^Version: \(.*\)/\1/p") BUILD_DIR=$(CURDIR)/build %: dh $@ -B$(BUILD_DIR) --parallel override_dh_auto_configure: mkdir -p $(BUILD_DIR) tar -C $(BUILD_DIR) --strip-components=1 \ -xaf /usr/src/binutils/binutils-$(gnu_version).tar.* dh_auto_configure -D$(BUILD_DIR) -- --target=z80-unknown-coff override_dh_auto_install: dh_auto_install --destdir=$(CURDIR)/debian/tmp override_dh_installchangelogs: dh_installchangelogs $(BUILD_DIR)/ChangeLog override_dh_gencontrol-arch: dh_gencontrol -a -- '-v$(z80_version)' \ '-Vbu:source=$(src_version)' '-Vbu:upstream=$(deb_version)'