#!/usr/bin/make -f DPKG_EXPORT_BUILDFLAGS := 1 DEB_BUILD_MAINT_OPTIONS := hardening=+all DEB_LDFLAGS_MAINT_APPEND := \ -Wl,--no-allow-shlib-undefined \ -Wl,--no-copy-dt-needed-entries \ -Wl,--no-undefined include /usr/share/dpkg/buildflags.mk include /usr/share/dpkg/buildopts.mk include $(wildcard /usr/share/ada/packaging.mk) # wildcard means: not during -indep builds. %: # Skip Makefile clean and install targets. Actually, even parsing # it would require gprconfig during -indep builds. dh $@ --buildsystem=none project := -Pgnatcoll.gpr -XBUILD=PROD static := -XLIBRARY_TYPE=static shared := -XLIBRARY_TYPE=relocatable -XGNATCOLL_VERSION=$(gnatcoll_SO_VERSION) # Prevent Makefile from messing with gprconfig # (NORMALIZED_TARGET is wrong at least for i386 and hurd-i386). override_dh_auto_build-arch: gprconfig --batch $(GPRCONFIGFLAGS) gprbuild $(project) $(static) $(GPRBUILDFLAGS) gprbuild $(project) $(shared) $(GPRBUILDFLAGS) override_dh_auto_install-arch: gprinstall $(project) $(static) $(static_GPRINSTALLFLAGS) gprinstall $(project) $(shared) $(call shared_GPRINSTALLFLAGS,gnatcoll) override_dh_auto_build-indep: ifeq (,$(filter nodoc,$(DEB_BUILD_OPTIONS))) # Write distrib/gnatcoll/runtime.py, present in VCS and debian/clean: cd distrib && python3 gen_gps.py $(MAKE) -Cdocs html latexpdf text \ $(DEB_BUILD_OPTION_PARALLEL:%=SPHINXOPTS=-j%) endif # Copy the part removed from gnatcoll.gpr by # debian/patches/gprinstall-no-artifacts.diff # but under the -indep and nodoc conditions. override_dh_auto_install-indep: mkdir -p debian/tmp/usr/share/examples/gnatcoll cp --reflink=auto -aftdebian/tmp/usr/share/examples/gnatcoll examples/* mkdir -p debian/tmp/usr/share/doc/gnatcoll # Remove a duplicate path component. cp --reflink=auto -aftdebian/tmp/usr/share/doc/gnatcoll \ docs/_build/html cp --reflink=auto -aftdebian/tmp/usr/share/doc/gnatcoll \ docs/_build/latex/GNATColl.pdf