#!/usr/bin/make -f

export DEB_BUILD_MAINT_OPTIONS = hardening=+all future=+lfs

# Make sure the build environment does not accidentally affect
# the src/Makefile settings
debug=yes
static=no
pedantic=yes
PREFIX=/usr
NCURSESW_INCLUDE=/usr/include/ncursesw

export debug static pedantic PREFIX NCURSESW_INCLUDE

ifeq (,$(filter nodoc,$(DEB_BUILD_OPTIONS) $(DEB_BUILD_PROFILES)))
DEB_NODOC=0
else
DEB_NODOC=1
endif

override_dh_auto_test:
	env LC_ALL=C.UTF-8 dh_auto_test

ifeq (${DEB_NODOC},0)
override_dh_auto_build:
	dh_auto_build -D src -- all man
else
override_dh_auto_install:
	dh_auto_install -D src -- INSTALL_TARGETS='install-kak'
endif

override_dh_auto_clean:
	[ ! -f src/Makefile ] || ${MAKE} -C src clean

%:
	dh '$@' -D src
