File: rules

package info (click to toggle)
libtemplates-parser 20-3
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, sid
  • size: 3,224 kB
  • sloc: ada: 11,583; python: 645; makefile: 347; sh: 37
file content (93 lines) | stat: -rwxr-xr-x 3,368 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
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
#!/usr/bin/make -f
# Build script for Templates_Parser in Debian.
# Copyright (c) 2003-2008 Ludovic Brenta <lbrenta@debian.org>
# Copyright (c) 2013-2020 Nicolas Boulenguez <nicolas@debian.org>

# This build script 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.

# You should have received a copy of the GNU General Public License
# along with this program; if not, see <http://www.gnu.org/licenses/>.

# On Debian systems, the full text of the GPL is in the file
# /usr/share/common-licenses/GPL-3.

$(foreach line,$(shell sed -n '\
  s/^ gnat, gnat-\(.*\),$$/ \
    GNAT_VERSION:=\1 \
  /p;\
  s/^Package: lib[a-z-]\+\([0-9.]\+\)$$/ \
    SOVERSION:=\1 \
  /p;\
  ' debian/control),$(eval $(line)))

DEB_BUILD_MAINT_OPTIONS := hardening=+all
DEB_LDFLAGS_MAINT_APPEND := -Wl,--no-undefined \
  -Wl,--no-copy-dt-needed-entries -Wl,--no-allow-shlib-undefined
include /usr/share/dpkg/architecture.mk
include /usr/share/dpkg/buildflags.mk
include /usr/share/ada/debian_packaging-$(GNAT_VERSION).mk
BUILDER_OPTIONS := $(filter-out -j$(BUILDER_JOBS),$(BUILDER_OPTIONS))

# Some of these options are stored into makefile.setup, but not all.
MAKE_OPTS := \
  VERSION=$(SOVERSION) \
  DEFAULT_LIBRARY_TYPE=relocatable \
  GPRBUILD="gprbuild $(BUILDER_OPTIONS) $(foreach v,ADAFLAGS LDFLAGS,'-X$(v)=$($(v))')" \
  PROCESSORS=$(BUILDER_JOBS) \
  DOC_FORMATS="html info latexpdf text"

######################################################################
%:
	dh $@

# Force reconfiguration.
.PHONY: override_dh_auto_configure
override_dh_auto_configure:
	rm -f makefile.setup tp_xmlada.gpr

.PHONY: override_dh_auto_build-arch
override_dh_auto_build-arch:
	$(MAKE) $(MAKE_OPTS)

.PHONY: override_dh_auto_build-indep
override_dh_auto_build-indep:
ifeq (,$(filter nodoc,$(DEB_BUILD_OPTIONS)))
	$(MAKE) build-doc $(MAKE_OPTS) SPHINXOPTS=-j$(BUILDER_JOBS)
endif

# Skip tests, they assume that the executables are in the PATH.
.PHONY: override_dh_auto_test

# dh_ada_library replaces the install step.
.PHONY: override_dh_auto_install

.PHONY: override_dh_auto_clean
override_dh_auto_clean:
	$(MAKE) clean $(MAKE_OPTS)
	rm -f config/setup/foo.ads.std*
	rm -fr docs/__pycache__

.PHONY: override_dh_ada_library
override_dh_ada_library:
 # xmlada_*.gpr are not imported directly by upstream build project, so
 # - ada:Depends for the -dev package will not contain libxmlada*-dev.
 # - the generated project will not contain with "xmlada_*.gpr".
 # This is OK as long as XMLAda is only used in bodies and not in specs.
	dh_ada_library \
	  PRJ_BUILD=release TP_XMLADA=Installed LIBRARY_TYPE=relocatable \
	  TARGET=$(DEB_HOST_GNU_TYPE) templates_parser.gpr

# Prevent a warning about doc-main-package autodetection.
doc_pkg := libtemplates-parser-doc
.PHONY: override_dh_installdocs override_dh_installexamples
override_dh_installdocs override_dh_installexamples: override_%:
	$* --package=$(doc_pkg) --doc-main-package=$(doc_pkg)
	$* --remaining-packages