Debian Codegraph @

debian/rules

raw
1 #!/usr/bin/make -f
2 # Build script for Templates_Parser in Debian.
3 # Copyright (c) 2003-2008 Ludovic Brenta <[email protected]>
4 # Copyright (c) 2013-2022 Nicolas Boulenguez <[email protected]>
5
6 # This build script is free software; you can redistribute it and/or
7 # modify it under the terms of the GNU General Public License as
8 # published by the Free Software Foundation; either version 3 of the
9 # License, or (at your option) any later version.
10
11 # This program is distributed in the hope that it will be useful, but
12 # WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 # General Public License for more details.
15
16 # You should have received a copy of the GNU General Public License
17 # along with this program; if not, see <http://www.gnu.org/licenses/>.
18
19 # On Debian systems, the full text of the GPL is in the file
20 # /usr/share/common-licenses/GPL-3.
21
22 DPKG_EXPORT_BUILDFLAGS := 1
23 DEB_BUILD_MAINT_OPTIONS := hardening=+all
24 DEB_LDFLAGS_MAINT_APPEND := \
25 -Wl,--no-allow-shlib-undefined \
26 -Wl,--no-copy-dt-needed-entries \
27 -Wl,--no-undefined
28 include /usr/share/dpkg/architecture.mk
29 include /usr/share/dpkg/buildflags.mk
30 include /usr/share/dpkg/buildopts.mk
31 include /usr/share/ada/packaging.mk
32
33 # Some options are stored into makefile.setup, but some are not.
34 # All written options are read back, but some are overriden.
35 # That is why we force all values on each Make.
36
37 # Force detection of TP_XMLADA because of a regression in GCC-12.
38 # gnat ls -Pxmlada_dom.gpr -aP/usr/share/gpr -> found
39 # gnat ls -Pxmlada_dom.gpr -> not found
40 # gnat ls -v -> says that is searches /usr/share/gpr
41 # No one will ever fix this, GCC is not supporting projects anymore.
42
43 MAKE_OPTS := \
44 VERBOSE_MAKE=1 \
45 VERSION=$(templates_parser_SO_VERSION) \
46 DEFAULT_LIBRARY_TYPE=relocatable \
47 TP_XMLADA=Installed \
48 GPRBUILD='gprbuild $(GPRBUILDFLAGS:-j%=)' \
49 LIBRARY_TYPES='static relocatable' \
50 $(DEB_BUILD_OPTION_PARALLEL:%=PROCESSORS=%) \
51 $(DEB_BUILD_OPTION_PARALLEL:%=SPHINXOPTS=-j%) \
52 DOC_FORMATS="html info latexpdf text"
53
54 ######################################################################
55 %:
56 dh $@
57
58 .PHONY: override_dh_auto_build-arch
59 override_dh_auto_build-arch:
60 # Gprbuild deals with parallelism. Make should not interfer.
61 $(MAKE) $(MAKE_OPTS)
62
63 .PHONY: override_dh_auto_build-indep
64 override_dh_auto_build-indep:
65 ifeq (,$(filter nodoc,$(DEB_BUILD_OPTIONS)))
66 # Parallelism in Make would create a race condition between sphinx
67 # processes. Anyway, sphinx already uses parallelism.
68 $(MAKE) build-doc $(MAKE_OPTS)
69 endif
70
71 # Skip tests, they assume that the executables are in the PATH.
72 .PHONY: override_dh_auto_test
73
74 override_dh_auto_install-arch:
75 $(MAKE) $(MAKE_OPTS) install LIBRARY_TYPES= \
76 GPRINST_OPTS='$(standard_GPRINSTALLFLAGS)'
77 $(MAKE) $(MAKE_OPTS) install-relocatable \
78 GPRINST_OPTS='$(call shared_GPRINSTALLFLAGS,templates_parser)'
79 $(MAKE) $(MAKE_OPTS) install-static \
80 GPRINST_OPTS='$(static_GPRINSTALLFLAGS)'
81
82 override_dh_auto_install-indep:
83
84 .PHONY: override_dh_auto_clean
85 override_dh_auto_clean:
86 $(MAKE) clean $(MAKE_OPTS)