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
|
#!/usr/bin/make -f
# Copyright (c) 2009-2012 Stephen Leake <stephen_leake@stephe-leake.org>
# Copyright (c) 2013-2014 Nicolas Boulenguez <nicolas@debian.org>
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# On Debian systems, the full text of the GPL is in the file
# /usr/share/common-licenses/GPL-3.
include /usr/share/dpkg/default.mk
include /usr/share/ada/debian_packaging.mk
######################################################################
POLICY_TARGETS := binary binary-arch binary-indep build build-arch \
build-indep clean
.PHONY: $(POLICY_TARGETS)
$(POLICY_TARGETS):
dh $@
# Replace with up-to-date versions from autotools-dev.
BACKUPS += config.guess config.sub
config.guess.backup config.sub.backup: %.backup:
mv $* $@
ln -s /usr/share/misc/$*
# Regenerate configure.
BACKUPS += configure
configure.backup: %.backup:
mv $* $@
autoconf
# install-sh is not used but configure insists on seeing it.
BACKUPS += install-sh
install-sh.backup: %.backup:
mv $* $@
touch install-sh
# Ensure no files is ever used from gnat/, as the upstream
# Makefile hardcodes this path in many unexpected places.
BACKUPS += gnat
gnat.backup: %.backup:
mv $* $@
override_dh_auto_configure: $(addsuffix .backup,$(BACKUPS))
# gprbind and gprlib must avoid multiarch locations because their
# path will figure in the architecture-independant
# /usr/share/gprconfig/*.xml.
dh_auto_configure -- \
--prefix="$(CURDIR)/debian/tmp/usr" \
--libexecdir=\$${prefix}/lib
# Set target from DEB_HOST_GNU_TYPE instead of config.sub, which adds
# a vendor and does not match "gcc -dumpmachine" at run time.
# The problem is hidden on usual architctures by hand-crafted
# renamings in share/gprconfig/targetset.xml.
# See share/gprconfig/compilers.xml, debian/patches/gprconfig.diff.
sed -e 's/@host@/$(DEB_HOST_GNU_TYPE)/' \
src/gprconfig-sdefault.ads.in > src/gprconfig-sdefault.ads
override_dh_auto_build-arch:
$(MAKE) "GNATMAKE=gnatmake -p $(BUILDER_OPTIONS) $(foreach v,ADAFLAGS LDFLAGS,'-X$(v)=$($(v))')"
override_dh_auto_build-indep:
override_dh_auto_clean::
dh_auto_clean
# mv -f would not have the desired effect for directory targets.
for f in $(BACKUPS); do \
if test -e $$f.backup; then \
rm -fr $$f; \
mv $$f.backup $$f; \
fi; \
done
override_dh_auto_test:
# Upstream tests are not in the release archive.
override_dh_auto_install-arch:
$(MAKE) install.data install.bin
override_dh_auto_install-indep:
|