--- /dev/null
+#!/usr/bin/make -f
+# debian/rules file - for binutils (2.17cvs20070426)
+# Based on sample debian/rules file - for GNU Hello (1.3).
+# Copyright 1994,1995 by Ian Jackson.
+# Copyright 1998-2007 James Troup
+# I hereby give you perpetual unlimited permission to copy,
+# modify and relicense this file, provided that you do not remove
+# my name from the file itself. (I assert my moral right of
+# paternity under the Copyright, Designs and Patents Act 1988.)
+# This file may have to be extensively modified
+
+include /usr/share/dpatch/dpatch.make
+
+TARGET = msp430
+rootname = binutils
+package = $(TARGET)-$(rootname)
+
+CC = gcc
+CFLAGS = -g -O2
+STRIP = strip --strip-unneeded --remove-section=.comment --remove-section=.note
+
+install_dir = install -d -m 755
+install_file = install -m 644
+install_script = install -m 755
+install_binary = install -m 755 -s
+
+ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
+ CFLAGS = -g -O0
+endif
+
+DISTRIBUTION := $(shell lsb_release -is)
+NJOBS =
+# Support parallel=<n> in DEB_BUILD_OPTIONS (see #209008)
+ifneq (,$(filter parallel=%,$(subst $(COMMA), ,$(DEB_BUILD_OPTIONS))))
+ COMMA = ,
+ NJOBS := -j $(subst parallel=,,$(filter parallel=%,$(subst $(COMMA), ,$(DEB_BUILD_OPTIONS))))
+endif
+
+
+configure-stamp: patch-stamp
+ $(checkdir)
+ifeq ($(with_check),yes)
+ @if echo "spawn true" | /usr/bin/expect -f - >/dev/null; then \
+ : ; \
+ else \
+ echo "expect is failing on your system with the above error, which means the"; \
+ echo "testsuite will fail. Please resolve the above issues and retry the build."; \
+ echo "-----------------------------------------------------------------------------"; \
+ exit 1; \
+ fi
+endif
+ rm -rf configure-stamp builddir
+ mkdir builddir
+ cd builddir \
+ && env CC="$(CC)" ../configure --host=$(DEB_HOST_GNU_TYPE) \
+ --build=$(DEB_BUILD_GNU_TYPE) --target=$(TARGET) --prefix=/usr \
+ --disable-nls --disable-shared --enable-debug --disable-threads \
+ --with-gcc --with-gnu-as --with-gnu-ld --with-stabs \
+# --disable-multilib
+# --with-pkgversion="GNU Binutils for $(TARGET) on $(DISTRIBUTION)"
+ $(MAKE) -C builddir configure-host
+ touch $@
+
+
+build: build-stamp
+build-stamp: configure-stamp
+ $(checkdir)
+ $(MAKE) -C builddir $(NJOBS) CFLAGS="$(CFLAGS)"
+ifeq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE))
+ifeq ($(with_check),yes)
+ -$(MAKE) -C builddir -k \
+ CFLAGS="$(CFLAGS)" check
+ cat builddir/binutils/binutils.sum \
+ builddir/gas/testsuite/gas.sum \
+ builddir/ld/ld.sum >> $$(pwd)/test-summary
+ @-[ -x /usr/bin/python ] \
+ && echo "Test results, compared with installed binutils:" \
+ && zcat /usr/share/doc/binutils/test-summary.gz > test-summary-installed \
+ && python debian/test-suite-compare.py test-summary-installed test-summary
+endif
+endif
+ touch $@
+
+
+install: install-stamp
+install-stamp: checkroot build-stamp
+ $(checkdir)
+ rm -rf debian/tmp
+ $(install_dir) debian/tmp
+ $(MAKE) -C builddir prefix=$$(pwd)/debian/tmp/usr \
+ mandir=$$(pwd)/debian/tmp/usr/share/man install
+ #obstack.h? configure.1?
+ rm -rf debian/tmp/usr/share/man/man1/msp430-c++filt* \
+ debian/tmp/usr/bin/msp430-c++filt debian/tmp/usr/lib* \
+ debian/tmp/usr/info debian/tmp/usr/share/locale
+ifeq ($(with_strip),yes)
+ $(STRIP) $$(file debian/tmp/usr/bin/* | awk -F: '$$0 !~ /script/ {print $$1}')
+endif
+ touch $@
+
+
+binary-indep: checkroot build install
+ : # Nothing to do
+
+
+binary-arch: checkroot build install
+ $(checkdir)
+ : # install maintainer scripts
+ $(install_dir) debian/tmp/DEBIAN
+ $(install_script) debian/binutils.postinst debian/tmp/DEBIAN/postinst
+ $(install_script) debian/binutils.postrm debian/tmp/DEBIAN/postrm
+ : # $(install_file) debian/binutils.shlibs debian/tmp/DEBIAN/shlibs
+ : # install docs
+ $(install_dir) debian/tmp/usr/share/doc/$(package)/
+ $(install_file) debian/changelog \
+ debian/tmp/usr/share/doc/$(package)/changelog.Debian
+ $(install_file) debian/copyright debian/tmp/usr/share/doc/$(package)/
+ifeq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE))
+ifeq ($(with_check),yes)
+ $(install_file) $$(pwd)/test-summary \
+ debian/tmp/usr/share/doc/$(package)/
+endif
+endif
+ $(install_file) binutils/NEWS debian/README.Debian \
+ debian/tmp/usr/share/doc/$(package)/
+ $(install_file) binutils/ChangeLog \
+ debian/tmp/usr/share/doc/$(package)/changelog
+ for pkg in bfd gas gprof ld; do \
+ $(install_dir) debian/tmp/usr/share/doc/$(package)/$$pkg; \
+ done
+ $(install_file) bfd/ChangeLog bfd/PORTING bfd/TODO \
+ debian/tmp/usr/share/doc/$(package)/bfd/
+ $(install_file) gas/ChangeLog gas/NEWS \
+ debian/tmp/usr/share/doc/$(package)/gas/
+ $(install_file) gprof/ChangeLog gprof/TODO gprof/TEST \
+ debian/tmp/usr/share/doc/$(package)/gprof/
+ $(install_file) ld/ChangeLog ld/TODO ld/NEWS \
+ debian/tmp/usr/share/doc/$(package)/ld/
+ : # These only exist in H. J. Lu releases not GNU ones.
+ for dir in binutils bfd gas gprof ld; do \
+ if [ -f $$dir/ChangeLog.linux ]; then \
+ $(install_file) $$dir/ChangeLog.linux \
+ debian/tmp/usr/share/doc/$(package)/$$dir/; \
+ fi; \
+ done
+ : # Copy bbconv.pl to the doc dir for use by interested people
+ $(install_file) gprof/bbconv.pl \
+ debian/tmp/usr/share/doc/$(package)/gprof/.
+ : # Compress stuff that needs it
+ gzip -9 debian/tmp/usr/share/man/man1/*
+ find debian/tmp/usr/share/doc/$(package)/ -type f ! -name copyright \
+ -a ! -name bbconv.pl | xargs gzip -9
+ : # Finish it all up
+ find debian/tmp -type f | xargs file | grep ELF | cut -d: -f 1 | \
+ xargs dpkg-shlibdeps
+ dpkg-gencontrol -isp $(CONFLICTS)
+ chown -R root:root debian/tmp
+ chmod -R go=rX debian/tmp
+ dpkg --build debian/tmp ..
+
+
+binary: binary-indep binary-arch
+
+
+clean: unpatch
+ $(checkdir)
+ -rm -rf debian/tmp builddir
+ -find . -name \*.gmo -o -name \*~ -o -name \*.info | xargs rm -f
+ -rm -f $$(pwd)/test-summary*
+ -rm -fr debian/patched debian/files* debian/substvars
+ -rm -f *-stamp
+
+
+define checkdir
+ test -f bfd/elf32.c -a -f debian/rules
+endef
+
+
+checkroot:
+ $(checkdir)
+ test root = "`whoami`"
+
+
+.PHONY: binary clean checkroot