#!/usr/bin/make -f

include /usr/share/dpkg/architecture.mk

export DEB_BUILD_MAINT_OPTIONS = hardening=+all
export DEB_CFLAGS_MAINT_APPEND = -Wall -pedantic

%:
	dh $@

override_dh_auto_build:
	dpkg-architecture -a$(DEB_BUILD_ARCH) -f -c dh_auto_build -- CFLAGS="$(CFLAGS)"

execute_after_dh_auto_build:
	help2man --no-info --name 'random bonsai tree generator' \
		--version-string $(shell dpkg-parsechangelog -S version) \
		--section 6 --output cbonsai.6 ./cbonsai
ifneq ($(DEB_BUILD_ARCH),$(DEB_HOST_ARCH))
	dh_auto_clean
	dh_auto_build -- CFLAGS="$(CFLAGS)"
endif

override_dh_auto_install:
