Debian Codegraph @

debian/rules

raw
1 #!/usr/bin/make -f
2
3 DEB_HOST_ARCH_CPU ?= $(shell dpkg-architecture -qDEB_HOST_ARCH_CPU)
4
5 # Verbose build. See:
6 # http://qa.debian.org/bls/bytag/W-compiler-flags-hidden.html
7 export V=1
8
9 # Output Automake test log after summary. See:
10 # https://www.gnu.org/software/automake/manual/html_node/Parallel-Test-Harness.html#Parallel-Test-Harness
11 export VERBOSE=1
12
13 # If DEB_BUILD_OPTIONS=parallel=n is set, then use that many OpenMP threads
14 # in the unit test suite too.
15 ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
16 NUMJOBS = $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
17 export OMP_NUM_THREADS=$(NUMJOBS)
18 endif
19
20 # Enable build hardening.
21 export DEB_BUILD_MAINT_OPTIONS = hardening=+all
22 DPKG_EXPORT_BUILDFLAGS = 1
23 include /usr/share/dpkg/buildflags.mk
24
25 # Enable -ffast-math optimizations, as per upstream author's instructions.
26 CFLAGS += -ffast-math
27
28 # On amd64, enable libsharp's automatic dispatch to optimized routines
29 # based on support for amd64 instruction sets detected at runtime.
30 # Note that the libsharp source refers to this feature using the
31 # preprocessor macro MULTIARCH, but it has nothing to do with the
32 # Debian concept of multiarch.
33 ifeq ($(DEB_HOST_ARCH_CPU),amd64)
34 CFLAGS += -DMULTIARCH
35 endif
36
37 %:
38 dh $@