| 12
 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
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 
 | #!/usr/bin/make -f
# Derived from sample debian/rules that uses debhelper.
# GNU copyright 1997 to 1999 by Joey Hess.
TARGET :=avr
PACKAGE :=gdb-avr
BUILT_USING := $(shell dpkg-query -f '$${source:Package} (= $${source:Version}), ' -W gdb-source)
DEB_BUILD_GNU_TYPE := $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
DEB_HOST_GNU_TYPE  := $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
CONFARGS = \
	--host=$(DEB_HOST_GNU_TYPE) \
	--build=$(DEB_BUILD_GNU_TYPE) \
	--prefix=/usr \
	--mandir='\$${prefix}/share/man' \
	--infodir='\$${prefix}/share/info' \
	--target=$(TARGET)\
    --with-expat \
	--disable-texinfo \
	--with-system-zlib \
	$(shell dpkg-buildflags --export=configure) 
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
unpack: unpack-stamp
unpack-stamp:
	tar xjf /usr/src/gdb.tar.bz2
	mv gdb* src
	mkdir build
	touch unpack-stamp
patch: patch-stamp
patch-stamp: unpack-stamp
	#cd src && patch -p1 < ../debian/bug_746849.patch
	touch $@
configure: configure-stamp
configure-stamp: patch-stamp
	dh_testdir
	cd build && env CC="gcc" CFLAGS="-Wno-error=unused-but-set-variable -Wno-error=unused-but-set-parameter" ../src/configure $(CONFARGS)
	cd build && make configure-gdb configure-bfd
	sed -i -s s/info:.*/info:/ build/*/doc/Makefile
	touch configure-stamp
build: configure-stamp build-stamp
build-stamp:
	dh_testdir
	cd build && $(MAKE)
	touch build-stamp
build-indep: build
build-arch: build
clean:
	dh_testdir
	dh_testroot
	rm -f build-stamp configure-stamp unpack-stamp patch-stamp
	rm -rf src build `ls -d gdb* | grep -v tar`
	dh_clean
install: build
	dh_testdir
	dh_testroot
	dh_clean -k
	dh_installdirs
	# install the package into debian/tmp.
	cd build && $(MAKE) install prefix=$(CURDIR)/debian/tmp/usr
# Build architecture-independent files.
binary-indep: build install
# Build architecture-dependent files.
binary-arch: build install
	dh_testdir
	dh_testroot
	dh_movefiles
	dh_installdocs -n
	dh_installchangelogs 
	dh_link
	dh_strip
	dh_compress
	dh_fixperms
	dh_installdeb
	dh_shlibdeps
	dh_gencontrol -- -VBuilt-Using="$(BUILT_USING)"
	dh_md5sums
	dh_builddeb
binary: binary-indep binary-arch
.PHONY: build clean binary-indep binary-arch binary install configure
 |