#!/usr/bin/make -f
# -*- makefile -*-
# Sample debian/rules that uses debhelper.
# This file was originally written by Joey Hess and Craig Small.
# As a special exception, when this file is copied by dh-make into a
# dh-make output file, you may use that output file without restriction.
# This special exception was added by Craig Small in version 0.37 of dh-make.

DH_VERBOSE=1
export DH_OPTIONS=-v

DEB_BUILD_MAINT_OPTIONS := hardening=+all
include /usr/share/dpkg/buildflags.mk
ADAFLAGS += -gnatafno -gnatVa -gnatwa

BIN = $(DESTDIR)/usr/bin

DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)

%:
	dh $@ 

override_dh_auto_build:
	make GPRFLAGS="-R -m -q" all doc

override_dh_auto_install:
	mkdir -p $(CURDIR)/debian/tmp/usr
	$(MAKE) DESTDIR=$(CURDIR)/debian/tmp prefix=/usr install
	dh_installdirs usr/bin
	dh_install debian/tmp/usr/bin/aflex /usr/bin
	dh_installman debian/tmp/usr/share/man/man1/aflex.1
	dh_strip
	rm -rf debian/tmp

override_dh_auto_test:
	# Ignore

.PHONY: override_dh_installdocs-indep

override_dh_installdocs-indep:
	dh_installdocs -i
