File: rules

package info (click to toggle)
gdb-arm-none-eabi 9
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 36 kB
  • ctags: 16
  • sloc: makefile: 60
file content (78 lines) | stat: -rwxr-xr-x 2,460 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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
#!/usr/bin/make -f
export DH_VERBOSE=1

target=arm-none-eabi

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

source_version := $(shell dpkg-query -W -f="\$${Version}\n" gdb-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/')
BUILT_USING := $(shell dpkg-query -f '$${source:Package} (= $${source:Version}), ' -W gdb-source)

src_dir=gdb
build_dir=build

tar_stamp=$(stampdir)/tar

buildflags=$(shell dpkg-buildflags --export=configure)

configure_flags = \
	--target=$(target) \
	--exec-prefix=\$${prefix}/lib \
	--bindir=\$${prefix}/bin \
	--infodir=\$${prefix}/share/doc/$(package)/info \
	--htmldir=\$${prefix}/share/doc/$(package)/html \
	--pdfdir=\$${prefix}/share/doc/$(package)/pdf \
	--disable-nls \
	--with-expat \
	--with-system-readline \
	--with-system-zlib \
	--with-python=yes \
	--with-system-gdbinit=\$${prefix}/lib/arm-none-eabi/lib/gdbinit \
	--with-gdb-datadir=\$${prefix}/lib/arm-none-eabi/share/gdb \
	--without-lzma \
	--without-guile \
	--without-babeltrace \
	"--with-pkgversion=$(deb_version)" \
	$(buildflags)

%:
	dh $@ -D$(src_dir) -B$(build_dir) --with autotools-dev

$(tar_stamp):
	tar xf $(gdb_dir)/gdb.tar.*
	mkdir -p $(stampdir)
	touch $@

override_dh_auto_configure: $(tar_stamp)
	dh_auto_configure -D$(src_dir) -B$(build_dir) -- $(configure_flags)

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

override_dh_auto_clean:
	if [ -d $(src_dir) ]; then dh_auto_clean -D$(src_dir) -B$(build_dir); fi
	rm -rf $(src_dir) $(build_dir) $(stampdir) debian/tmp testrun.*
	rm -f debian/arm-none-eabi-run.1

override_dh_auto_install:
	mkdir -p $(top_dir)/debian/tmp
	touch $(src_dir)/sim/common/run.1
	cd build && make install DESTDIR=$(top_dir)/debian/tmp
	rm -f $(top_dir)/debian/tmp/usr/share/man/man1/*
	rm -f $(top_dir)/debian/tmp/usr/share/man/man5/*

override_dh_installchangelogs:
	dh_installchangelogs gdb/ChangeLog

override_dh_installman:
	help2man $(top_dir)/debian/tmp/usr/bin/arm-none-eabi-run > $(top_dir)/debian/arm-none-eabi-run.1
	dh_installman $(top_dir)/debian/arm-none-eabi-run.1

override_dh_auto_test:
	# The test cases doesn't pass using sim as target