#!/usr/bin/make -f

DPKG_EXPORT_BUILDFLAGS = 1
include /usr/share/dpkg/buildflags.mk

ADAFLAGS := $(filter-out -Wformat -Werror=format-security, $(CFLAGS))
export ADAFLAGS

%:
	dh ${@}

override_dh_auto_build:
	$(MAKE) LIBRARY_KIND=dynamic
	$(MAKE) LIBRARY_KIND=static
	$(MAKE) doc

override_dh_auto_install:
	$(MAKE) LIBRARY_KIND=dynamic PREFIX=$(CURDIR)/debian/tmp/usr install
	$(MAKE) LIBRARY_KIND=static PREFIX=$(CURDIR)/debian/tmp/usr install
	cp debian/addon/*.gpr debian/tmp/usr/share/ada/adainclude

override_dh_auto_test:
	$(MAKE) utests

override_dh_install:
	dh_install --fail-missing

override_dh_compress:
	dh_compress -X.ads -X.adb -XMakefile

override_dh_strip:
	dh_strip --dbg-package=pcscada-dbg
