File: rules

package info (click to toggle)
flint 2.5.2-19
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 30,308 kB
  • sloc: ansic: 289,367; cpp: 11,210; python: 1,280; sh: 649; makefile: 283
file content (49 lines) | stat: -rwxr-xr-x 1,653 bytes parent folder | download
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
#!/usr/bin/make -f

include /usr/share/dpkg/pkg-info.mk
include /usr/share/dpkg/buildtools.mk

EXTRA_SHARED_FLAGS=-Wl,-soname,libflint-$(DEB_VERSION_UPSTREAM).so
MAKE_OVERRIDE = AT= QUIET_CXX= QUIET_CC= QUIET_AR= INCS=-I$(CURDIR) \
                ABI_FLAG='$(LDFLAGS)'

# Without -ansi, testsuite hangs running d_mat's t-qr on any-i386
# TODO: Fix source itself?
DEB_HOST_ARCH_CPU ?= $(shell dpkg-architecture -qDEB_HOST_ARCH_CPU)
ifeq ($(DEB_HOST_ARCH_CPU),i386)
export DEB_CFLAGS_MAINT_APPEND = -ansi
endif

export DEB_BUILD_MAINT_OPTIONS = hardening=+all

# FTBFS on mips and mipsel seems to be caused by a bug in gcc 6,
# see https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78176
ifeq ($(DEB_HOST_ARCH_CPU), $(filter $(DEB_HOST_ARCH_CPU), mips mipsel))
export DEB_CFLAGS_MAINT_APPEND = -march=mips2
export DEB_CXXFLAGS_MAINT_APPEND = -march=mips2
endif

%:
	dh $@

# upstream Makefile has only CFLAGS, not CPPFLAGS and not even CXXFLAGS, so
# inject flags using configure. let's hope CFLAGS will always be good enough
# even for $(CXX)
override_dh_auto_configure:
	./configure --prefix="/usr" --with-ntl CC='$(CC)' CXX='$(CXX)' CFLAGS='$(CPPFLAGS) $(CFLAGS)'
	sed -i Makefile -e "/^FLINT_LIB\>=/s/libflint/libflint-$(DEB_VERSION_UPSTREAM)/"

override_dh_auto_build:
	dh_auto_build --parallel -- $(MAKE_OVERRIDE) \
	    EXTRA_SHARED_FLAGS="$(EXTRA_SHARED_FLAGS)"
	$(MAKE) -C doc/latex

override_dh_auto_install:
	dh_auto_install
	cd debian/tmp/usr/lib ; ln -sf libflint-$(DEB_VERSION_UPSTREAM).so.* libflint-$(DEB_VERSION_UPSTREAM).so

override_dh_auto_test:
	dh_auto_test -- $(MAKE_OVERRIDE)

override_dh_installchangelogs:
	dh_installchangelogs NEWS