Debian Codegraph @

debian/rules

raw symbols SCIP
1 #!/usr/bin/make -f
2 #
3 # Makefile for Ada Reference Manual.
4 # Copyright (c) 2010-2012 Stephen Leake <[email protected]>
5 # Copyright (c) 2013-2024 Nicolas Boulenguez <[email protected]>
6 #
7 # This program is free software; you can redistribute it and/or modify
8 # it under the terms of the GNU General Public License as published by
9 # the Free Software Foundation; either version 3 of the License, or
10 # (at your option) any later version.
11 #
12 # This program is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 # GNU General Public License for more details.
16 #
17 # You should have received a copy of the GNU General Public License
18 # along with this program. If not, see <http://www.gnu.org/licenses/>.
19
20 YEARS := $(shell \
21 sed -n 's/^Package: ada-reference-manual-//p' debian/control)
22 FORMATS := html info txt pdf
23
24 # For now, ADAFLAGS and LDFLAGS must be passed via the command line
25 # because build/Makefile does not look in the environment.
26
27 # Prevent new compiler warnings from breaking Debian builds.
28 DEB_ADAFLAGS_MAINT_APPEND := -gnatwn
29
30 DEB_BUILD_MAINT_OPTIONS := hardening=+all
31 include /usr/share/dpkg/buildflags.mk
32 include /usr/share/ada/packaging.mk
33
34 %:
35 dh $@ --sourcedirectory=build
36
37 # Ignore the upstream build/ directory.
38 .PHONY: build
39 build:
40 dh $@ --sourcedirectory=build
41
42 ######################################################################
43 # Default settings do not produce PDF format.
44 .PHONY: override_dh_auto_build
45 override_dh_auto_build:
46 dh_auto_build -- \
47 BUILDER_OPTIONS='$(GNATMAKEFLAGS)' \
48 $(foreach v,ADAFLAGS FORMATS LDFLAGS YEARS,'$(v)=$($(v))')
49
50 ######################################################################
51 .PHONY: override_dh_compress
52 override_dh_compress:
53 dh_compress --all --exclude=.TXT
54
55 ######################################################################
56 .PHONY: override_dh_installinfo
57 override_dh_installinfo: $(addprefix installinfo-,$(YEARS))
58 installinfo-%:
59 dh_installinfo --package=ada-reference-manual-$* \
60 build/aarm$*.info build/arm$*.info
61
62 ######################################################################
63 # Debhelper files for doc-base.
64
65 # This must be updated when the packages change in debian/control.
66 ISO_2005 := 2007
67 ISO_2012 := 2012
68 ISO_2020 := 202x
69
70 define foreach_year_template
71
72 installdocs-$(y): debian/ada-reference-manual-$(y).doc-base.aarm$(y) \
73 debian/ada-reference-manual-$(y).doc-base.arm$(y)
74 debian/ada-reference-manual-$(y).doc-base.%$(y): debian/doc_base_template_%
75 sed 's/@YEAR@/$(y)/g; s/@ISO@/$(ISO_$(y))/g' $$< > $$@
76
77 endef
78 $(foreach y,$(YEARS),$(eval $(foreach_year_template)))
79
80 .PHONY: override_dh_installdocs
81 override_dh_installdocs: $(addprefix installdocs-,$(YEARS))
82 installdocs-%:
83 dh_installdocs --package=ada-reference-manual-$* README.txt \
84 build/aarm$*.html/ build/aarm$*.txt/ build/aarm$*.pdf \
85 build/arm$*.html/ build/arm$*.txt/ build/arm$*.pdf
86
87 ######################################################################
88 # Check that some .txt docs are still duplicates, then symlink.
89
90 .PHONY: override_dh_link
91 override_dh_link: $(addprefix link-,$(YEARS))
92 link-%:
93 diff -q \
94 debian/ada-reference-manual-$*/usr/share/doc/ada-reference-manual-$*/aarm$*.txt/aa-Lib.TXT \
95 debian/ada-reference-manual-$*/usr/share/doc/ada-reference-manual-$*/arm$*.txt/rm-Lib.TXT
96 diff -q \
97 debian/ada-reference-manual-$*/usr/share/doc/ada-reference-manual-$*/aarm$*.txt/aa-TOC.TXT \
98 debian/ada-reference-manual-$*/usr/share/doc/ada-reference-manual-$*/arm$*.txt/rm-TOC.TXT
99 dh_link --package=ada-reference-manual-$* \
100 usr/share/doc/ada-reference-manual-$*/aarm$*.txt/aa-Lib.TXT \
101 usr/share/doc/ada-reference-manual-$*/arm$*.txt/rm-Lib.TXT \
102 usr/share/doc/ada-reference-manual-$*/aarm$*.txt/aa-TOC.TXT \
103 usr/share/doc/ada-reference-manual-$*/arm$*.txt/rm-TOC.TXT