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
|
#!/usr/bin/make -f
# Sample debian/rules that uses debhelper.
# GNU copyright 1997 to 1999 by Joey Hess.
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
%:
dh $@ --with autotools-dev
# These are used for cross-compiling and for saving the configure script
# from having to guess our platform (since we know it already)
DEB_BUILD_GNU_TYPE := $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
DEB_HOST_GNU_TYPE := $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
CFLAGS = $(shell dpkg-buildflags --get CFLAGS) -U_FORTIFY_SOURCE
TARGET = h8300-hitachi-coff
# TODO package name should be changed in the future
p_cross = binutils-h8300-hms
override_dh_auto_clean:
dh_clean
$(RM) -r builddir-$(TARGET)
override_dh_auto_configure:
mkdir builddir-$(TARGET)
cd builddir-$(TARGET) && \
env CC="$(CC)" CFLAGS="$(CFLAGS)" ../configure --prefix=/usr \
--infodir=/usr/share/info \
--mandir=/usr/share/man \
--build=$(DEB_BUILD_GNU_TYPE) \
--host=$(DEB_HOST_GNU_TYPE) \
--target=$(TARGET)
override_dh_auto_build:
cd builddir-$(TARGET) && $(MAKE)
override_dh_auto_install:
# Add here commands to install the package into debian/$(p_cross)
cd builddir-$(TARGET) && \
$(MAKE) install prefix=$(CURDIR)/debian/$(p_cross)/usr \
mandir=$(CURDIR)/debian/$(p_cross)/usr/share/man \
infodir=$(CURDIR)/debian/$(p_cross)/usr/share/info
for i in $(CURDIR)/debian/$(p_cross)/usr/bin/$(TARGET)-* ; do \
ln -s `basename $$i` $(CURDIR)/debian/$(p_cross)/usr/bin/h8300-hms-`echo $$i | sed 's/.*$(TARGET)-//'` ; \
ln -s `basename $$i`.1 $(CURDIR)/debian/$(p_cross)/usr/share/man/man1/h8300-hms-`echo $$i | sed 's/.*$(TARGET)-//'`.1 ; \
done
# Files also in main binutils pkg
rm -rf $(CURDIR)/debian/$(p_cross)/usr/include
rm -rf $(CURDIR)/debian/$(p_cross)/usr/lib
rm -rf $(CURDIR)/debian/$(p_cross)/usr/share/info
rm -rf $(CURDIR)/debian/$(p_cross)/usr/share/locale
# install documentation
install -p -o root -g root -m 644 binutils/NEWS \
$(CURDIR)/debian/$(p_cross)/usr/share/doc/$(p_cross)/NEWS
install -p -o root -g root -m 644 binutils/MAINTAINERS \
$(CURDIR)/debian/$(p_cross)/usr/share/doc/$(p_cross)/MAINTAINERS
for pkg in bfd gas gprof ld; do \
for f in ChangeLog NEWS README PORTING MAINTAINERS TODO ; do \
[ -f $$pkg/$$f ] || continue ; \
install -p -o root -g root -m 644 $$pkg/$$f \
$(CURDIR)/debian/$(p_cross)/usr/share/doc/$(p_cross)/$$pkg/$$f ; \
done ; \
done
# Override files
install -p -o root -g root -m 644 $(CURDIR)/debian/overrides.lintian \
$(CURDIR)/debian/$(p_cross)/usr/share/lintian/overrides/$(p_cross)
|