#!/usr/bin/make -f # # Makefile for Ada Reference Manual. # Copyright (c) 2010-2012 Stephen Leake # Copyright (c) 2013-2022 Nicolas Boulenguez # # This program 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 . DOCUMENTS := aarm arm YEARS := $(shell \ sed -n 's/^Package: ada-reference-manual-\(.*\)$$/\1/p' debian/control) FORMATS := html info txt pdf # For now, ADAFLAGS and LDFLAGS must be passed via the command line # because build/Makefile does not look in the environment. DEB_BUILD_MAINT_OPTIONS := hardening=+all include /usr/share/dpkg/buildflags.mk include /usr/share/dpkg/buildopts.mk include /usr/share/ada/debian_packaging.mk %: dh $@ --sourcedirectory=build # Ignore the upstream build/ directory. .PHONY: build build: dh $@ --sourcedirectory=build ###################################################################### # Default settings do not produce PDF format. .PHONY: override_dh_auto_build override_dh_auto_build: dh_auto_build -- \ BUILDER_OPTIONS='$(GNATMAKEFLAGS)' \ $(foreach v,ADAFLAGS DOCUMENTS FORMATS LDFLAGS YEARS,'$(v)=$($(v))') ###################################################################### .PHONY: override_dh_compress override_dh_compress: dh_compress --all --exclude=.TXT ###################################################################### .PHONY: override_dh_installinfo override_dh_installinfo: $(addprefix installinfo-,$(YEARS)) installinfo-%: dh_installinfo --package=ada-reference-manual-$* \ $(foreach d,$(DOCUMENTS),build/$(d)$*.info) ###################################################################### # Debhelper files for doc-base. TITLE_aarm := Annotated Ada Reference Manual TITLE_arm := Ada Reference Manual FILEPREFIX_aarm := aa FILEPREFIX_arm := rm ISO_2005 := 2007 ISO_2012 := 2012 ISO_2020 := 202x ABSTRACT_aarm = The Annotated Ada Reference Manual, ISO/IEC \ 8652:$(ISO_$(y))(E). It contains the entire text of the Ada $(y) \ standard, plus various annotations. It is intended primarily for \ compiler writers, validation test writers, and other language \ lawyers. The annotations include detailed rationale for individual \ rules and explanations of some of the more arcane interactions among \ the rules. ABSTRACT_arm = The Ada Reference Manual, ISO/IEC \ 8652:$(ISO_$(y))(E). It contains the entire text of the Ada $(y) \ standard. define foreach_document_year_template DOC_BASE_GENERATED += debian/ada-reference-manual-$(y).doc-base.$(d)$(y) installdocs-$(y): debian/ada-reference-manual-$(y).doc-base.$(d)$(y) debian/ada-reference-manual-$(y).doc-base.$(d)$(y): debian/doc_base_template sed $$< \ -e 's@DOCUMENT@$(d)@g' \ -e 's@YEAR@$(y)@g' \ -e 's@TITLE@$(TITLE_$(d))@g' \ -e 's@ABSTRACT@$(ABSTRACT_$(d))@g' \ -e 's@FILEPREFIX@$(FILEPREFIX_$(d))@g' \ > $$@ endef $(foreach d,$(DOCUMENTS),$(foreach y,$(YEARS),\ $(eval $(foreach_document_year_template)))) .PHONY: override_dh_installdocs override_dh_installdocs: $(addprefix installdocs-,$(YEARS)) installdocs-%: dh_installdocs --package=ada-reference-manual-$* README.txt \ $(foreach d,$(DOCUMENTS),build/$(d)$*.html \ build/$(d)$*.txt \ build/$(d)$*.pdf) .PHONY: override_dh_clean override_dh_clean: dh_clean $(DOC_BASE_GENERATED) ###################################################################### # Check that some .txt docs are still duplicates, then symlink. ifeq (aarm-arm,$(findstring aarm,$(DOCUMENTS))-$(findstring arm,$(DOCUMENTS))) .PHONY: override_dh_link override_dh_link: $(addprefix link-,$(YEARS)) link-%: diff -q \ debian/ada-reference-manual-$*/usr/share/doc/ada-reference-manual-$*/aarm$*.txt/aa-Lib.TXT \ debian/ada-reference-manual-$*/usr/share/doc/ada-reference-manual-$*/arm$*.txt/rm-Lib.TXT diff -q \ debian/ada-reference-manual-$*/usr/share/doc/ada-reference-manual-$*/aarm$*.txt/aa-TOC.TXT \ debian/ada-reference-manual-$*/usr/share/doc/ada-reference-manual-$*/arm$*.txt/rm-TOC.TXT dh_link --package=ada-reference-manual-$* \ usr/share/doc/ada-reference-manual-$*/aarm$*.txt/aa-Lib.TXT \ usr/share/doc/ada-reference-manual-$*/arm$*.txt/rm-Lib.TXT \ usr/share/doc/ada-reference-manual-$*/aarm$*.txt/aa-TOC.TXT \ usr/share/doc/ada-reference-manual-$*/arm$*.txt/rm-TOC.TXT endif