#! /usr/bin/make -rf # Debian build script for asis # Copyright (c) 2003-2014 Ludovic Brenta # Copyright (c) 2013-2020 Nicolas Boulenguez # This build script is free software; you can redistribute it and/or # modify it under terms of the GNU General Public License as published # by the Free Software Foundation; either version 3, or (at your # option) any later version. This build script 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 # distributed with this build script; see file # /usr/share/common-licenses/GPL. If not, see . $(foreach line,$(shell sed -n '\ s/^ gnat, gnat-\([0-9.]\+\),$$/ \ GNAT_VERSION:=\1 \ /p;\ s/^Package: libasis\([0-9.]\+\)$$/ \ soversion:=\1 \ /p;\ ' debian/control),$(eval $(line))) DPKG_EXPORT_BUILDFLAGS := 1 DEB_BUILD_MAINT_OPTIONS := hardening=+all DEB_ADAFLAGS_MAINT_APPEND := -gnatfno -gnatwa -gnatVa DEB_LDFLAGS_MAINT_APPEND := -Wl,--no-undefined \ -Wl,--no-copy-dt-needed-entries -Wl,--no-allow-shlib-undefined include /usr/share/dpkg/buildflags.mk include /usr/share/ada/debian_packaging-$(GNAT_VERSION).mk BUILDER_OPTIONS := $(subst -j,-XPROCESSORS=,$(BUILDER_OPTIONS)) ###################################################################### %: dh $@ # Ignore upstream Makefile/configure. .PHONY: $(addprefix override_dh_auto_,configure build-arch build-indep test install clean) ###################################################################### # Build the dynamic library and tools. # Upstream Makefile does not allow to select tool, skip a static assistant, # or select gnat2xml mains. # The aggregate project increases performance, as gprbuild only parses # all projects once. tools_gpr := debian/tools.gpr override_dh_auto_build-arch: gprbuild $(tools_gpr) -p $(BUILDER_OPTIONS) -Xsoversion=$(soversion) override_dh_auto_clean:: gprclean $(tools_gpr) -Xsoversion=$(soversion) ###################################################################### # The factory generated sources are required for both -arch (for # gnat2xml gnatpp) and -indep (for the schemas via gnat2xsd). # The static ASIS library is built here as a dependency. factory_dir := tools/tool_utils factory_gpr := $(factory_dir)/generate_factory.gpr factory_exe := $(factory_dir)/ada_trees-generate_factory factory_out := ada_trees-factory override_dh_auto_configure: gprbuild $(factory_gpr) -p $(BUILDER_OPTIONS) $(factory_exe) mv -f $(factory_out).nb $(factory_dir)/$(factory_out).adb mv -f $(factory_out).ns $(factory_dir)/$(factory_out).ads override_dh_auto_clean:: gprclean asis.gpr gprclean $(factory_gpr) rm -f $(factory_dir)/$(factory_out).ad[bs] $(factory_out).n[bs] ###################################################################### xsd_dir := tools/gnat2xml xsd_gpr := $(xsd_dir)/gnat2xml.gpr xsd_main := gnat2xml-gnat2xsd xsd_exe := LD_LIBRARY_PATH=lib-dynamic $(xsd_dir)/gnat2xsd ifeq (,$(filter nodoc,$(DEB_BUILD_OPTIONS))) override_dh_auto_build-indep: gprbuild $(xsd_gpr) $(xsd_main) -p $(BUILDER_OPTIONS) $(xsd_exe) > $(xsd_dir)/ada-schema.xsd $(xsd_exe) --compact > $(xsd_dir)/ada-schema.compact.xsd endif override_dh_auto_clean:: gprclean $(xsd_gpr) rm -f $(xsd_dir)/ada-schema.xsd $(xsd_dir)/ada-schema.compact.xsd ###################################################################### examples := debian/asis-doc/usr/share/doc/asis-doc/examples .PHONY: override_dh_installexamples override_dh_installexamples: dh_installexamples --package=asis-doc --doc-main-package=asis-programs # Replace duplicate files with relative symlinks, except during -arch builds. if test -d $(examples); then \ rdfind -makeresultsfile false -makesymlinks true $(examples) && \ symlinks -r -s -c $(examples); \ fi dh_installexamples --remaining-packages .PHONY: override_dh_installdocs override_dh_installdocs: dh_installdocs --package=asis-doc --doc-main-package=asis-programs dh_installdocs --remaining-packages