File: rules

package info (click to toggle)
binutils-arm-none-eabi 11
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster
  • size: 44 kB
  • sloc: makefile: 45
file content (60 lines) | stat: -rwxr-xr-x 1,793 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#!/usr/bin/make -f
export DH_VERBOSE=1

target=arm-none-eabi

package=binutils-arm-none-eabi
top_dir=$(shell pwd)
binutils_dir=/usr/src/binutils
stampdir=debian/stamp

source_version := $(shell dpkg-query -W -f="\$${Version}\n" binutils-source)
deb_version := $(source_version)+$(shell dpkg-parsechangelog | sed -ne "s/^Version: \(.*\)/\1/p")
deb_upstream_version := $(shell echo $(deb_version) | cut -d- -f1)
base_version := $(shell echo $(deb_version) | sed -e 's/\([1-9]\.[0-9]\).*-.*/\1/')

upstream_dir=binutils-$(deb_upstream_version)

untar_stamp=$(stampdir)/tar

buildflags=$(shell dpkg-buildflags --export=configure)
BUILT_USING := $(shell dpkg-query -f '$${source:Package} (= $${source:Version}), ' -W binutils-source)

configure_flags = \
	--target=$(target) \
	--prefix=/usr/lib \
	--bindir=/usr/bin \
	--libdir=/usr/lib/arm-none-eabi \
	--infodir=/usr/share/doc/$(package)/info \
	--htmldir=/usr/share/doc/$(package)/html \
	--pdfdir=/usr/share/doc/$(package)/pdf \
	--mandir=/usr/share/man \
	--disable-nls \
	--enable-plugins \
	--enable-interwork \
	--with-system-zlib \
	"--with-pkgversion=$(deb_version)" \
	$(buildflags)

%:
	dh $@ -D$(upstream_dir) -Bbuild --parallel

$(untar_stamp):
	tar xf $(binutils_dir)/binutils-*.tar.*
	mkdir -p $(stampdir)
	cp /usr/share/doc/binutils-source/copyright debian/copyright
	touch $@

override_dh_auto_configure: $(untar_stamp)
	dh_auto_configure -D$(upstream_dir) -Bbuild -- $(configure_flags)

override_dh_gencontrol:
	dh_gencontrol -a -- -v$(deb_version) -Vlocal:Version=$(deb_upstream_version) -Vbinutils:Version=$(source_version) -VBuilt-Using="$(BUILT_USING)"

override_dh_auto_clean:
	rm -rf $(upstream_dir) build $(stampdir)

override_dh_installchangelogs:
	dh_installchangelogs $(upstream_dir)/ChangeLog

override_dh_auto_test: