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 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111
|
#!/usr/bin/make -f
export DH_VERBOSE=1
include /usr/share/dpkg/pkg-info.mk
MULTILIB_LIST="--with-multilib-list=rmprofile"
PACKAGE_GCC=gcc-arm-none-eabi
PACKAGE_GCC_SOURCE=gcc-arm-none-eabi-source
TARGET=arm-none-eabi
TOP_DIR=$(shell pwd)
UPSTREAM_URL=https://developer.arm.com/-/media/Files/downloads/gnu-rm/7-2018q2/gcc-arm-none-eabi-7-2018-q2-update-src.tar.bz2
GCC_BUILD_DIR=$(TOP_DIR)/build
GCC_SOURCE_DIR=$(TOP_DIR)
GCC_DEB_TMP_DIR=$(TOP_DIR)/debian/$(PACKAGE_GCC)-tmp
GCC_DOC_TEXI_LEGEND_DIR=$(TOP_DIR)/../texi_legend.txt
GCC_SOURCE_DEB_TMP_DIR=$(TOP_DIR)/debian/$(PACKAGE_GCC_SOURCE)-tmp
export DEB_BUILD_MAINT_OPTIONS=hardening=-format
BUILDFLAGS:=$(shell dpkg-buildflags --export=configure) INHIBIT_LIBC_CFLAGS="-DUSE_TM_CLONE_REGISTRY=0"
TARGET_TOOLS=\
AR_FOR_TARGET=$(TARGET)-ar \
AS_FOR_TARGET=$(TARGET)-as \
LD_FOR_TARGET=$(TARGET)-ld \
NM_FOR_TARGET=$(TARGET)-nm \
OBJDUMP_FOR_TARGET=$(TARGET)-objdump \
RANLIB_FOR_TARGET=$(TARGET)-ranlib \
READELF_FOR_TARGET=$(TARGET)-readelf \
STRIP_FOR_TARGET=$(TARGET)-strip
CONFIGURE_GCC_FLAGS = \
--mandir=/usr/share/man \
--enable-languages=c,c++,lto \
--enable-multilib \
--disable-decimal-float \
--disable-libffi \
--disable-libgomp \
--disable-libmudflap \
--disable-libquadmath \
--disable-libssp \
--disable-libstdcxx-pch \
--disable-nls \
--disable-shared \
--disable-threads \
--enable-tls \
--build=$(DEB_BUILD_GNU_TYPE) \
--target=$(TARGET) \
--with-system-zlib \
--with-gnu-as \
--with-gnu-ld \
"--with-pkgversion=$(DEB_VERSION)" \
--without-included-gettext \
--prefix=/usr/lib \
--infodir=/usr/share/doc/$(PACKAGE_GCC)/info \
--htmldir=/usr/share/doc/$(PACKAGE_GCC)/html \
--pdfdir=/usr/share/doc/$(PACKAGE_GCC)/pdf \
--bindir=/usr/bin \
--libexecdir=/usr/lib \
--libdir=/usr/lib \
--disable-libstdc++-v3 \
--host=$(DEB_HOST_GNU_TYPE) \
--with-headers=no \
--without-newlib \
$(MULTILIB_LIST) \
$(BUILDFLAGS) \
$(TARGET_TOOLS)
%:
dh $@ -D$(GCC_SOURCE_DIR) -B$(GCC_BUILD_DIR) --parallel --with autoreconf
override_dh_autoreconf:
autoreconf2.64 -f $(GCC_SOURCE_DIR)
override_dh_auto_configure:
dh_auto_configure -D$(GCC_SOURCE_DIR) -B$(GCC_BUILD_DIR) -- $(CONFIGURE_GCC_FLAGS)
override_dh_auto_install:
$(MAKE) install -C$(GCC_BUILD_DIR) DESTDIR=$(GCC_DEB_TMP_DIR)
override_dh_auto_test:
@echo "no testing, that's way too painful"
override_dh_clean:
rm -rf $(GCC_BUILD_DIR)
rm -rf $(GCC_DEB_TMP_DIR) $(GCC_SOURCE_DEB_TMP_DIR)
rm -rf 32 x32
dh_clean
override_dh_auto_build:
dh_auto_build -B $(GCC_BUILD_DIR)
override_dh_strip:
dh_strip -X.a
override_dh_install:
dh_install -p$(PACKAGE_GCC) --sourcedir $(GCC_DEB_TMP_DIR)
mkdir -p $(GCC_SOURCE_DEB_TMP_DIR)/usr/src
tar --exclude=build --exclude=.git --exclude=debian -C $(TOP_DIR) -c -f - . | xz -T0 > $(GCC_SOURCE_DEB_TMP_DIR)/usr/src/$(PACKAGE_GCC_SOURCE).tar.xz
dh_install -p$(PACKAGE_GCC_SOURCE) --sourcedir $(GCC_SOURCE_DEB_TMP_DIR)
override_dh_compress:
dh_compress -Xexamples/
get-orig-source:
# This is just temporary, a Debian friendly way was already reported to
# upstream here
# https://answers.launchpad.net/gcc-arm-embedded/+question/671738
wget $(UPSTREAM_URL) -O ../gcc-arm-none-eabi-7-2018-q2-update-src.tar.bz2
python3 debian/repack-upstream.py ../gcc-arm-none-eabi-7-2018-q2-update-src.tar.bz2 ../gcc-arm-none-eabi_$(DEB_VERSION_UPSTREAM).orig.tar.xz
|