| 1 |
|
| 2 |
|
| 3 |
src_version := $(shell dpkg-query -W -f='$${source:Version}' binutils-source) |
| 4 |
deb_version := $(shell echo $(src_version) | cut -d- -f1) |
| 5 |
gnu_version := $(shell echo $(deb_version) | cut -d. -f1-3) |
| 6 |
z80_version := $(src_version)+$(shell dpkg-parsechangelog \ |
| 7 |
| sed -ne "s/^Version: \(.*\)/\1/p") |
| 8 |
target := z80-unknown-coff |
| 9 |
|
| 10 |
BUILD_DIR=$(CURDIR)/build-dir |
| 11 |
|
| 12 |
%: |
| 13 |
dh $@ -B$(BUILD_DIR) |
| 14 |
|
| 15 |
override_dh_auto_configure: |
| 16 |
mkdir -p $(BUILD_DIR) |
| 17 |
tar -C $(BUILD_DIR) --strip-components=1 \ |
| 18 |
-xaf /usr/src/binutils/binutils-$(gnu_version).tar.* |
| 19 |
dh_auto_configure -D$(BUILD_DIR) -- \ |
| 20 |
--target=$(target) --libdir=/usr/lib/$(target) |
| 21 |
|
| 22 |
override_dh_auto_install: |
| 23 |
dh_auto_install --destdir=$(CURDIR)/debian/tmp |
| 24 |
|
| 25 |
override_dh_installchangelogs: |
| 26 |
dh_installchangelogs $(BUILD_DIR)/ChangeLog |
| 27 |
|
| 28 |
override_dh_gencontrol-arch: |
| 29 |
dh_gencontrol -a -- '-v$(z80_version)' \ |
| 30 |
'-Vbu:source=$(src_version)' '-Vbu:upstream=$(deb_version)' |