#!/usr/bin/make -f

export DEB_BUILD_MAINT_OPTIONS = hardening=+all optimize=+lto

ifneq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
  CONFIGURE_ARGS += --without-check
endif


%:
	dh $@

override_dh_auto_configure:
	dh_auto_configure -- --enable-werror $(CONFIGURE_ARGS)

execute_after_dh_auto_test:
	cd tests/functional/ && bats end-to-end.bats

ifneq (, $(filter cross, $(DEB_BUILD_PROFILES)))
# help2man does not work while cross building
override_dh_clean:
	dh_clean -Xman/selint.1
endif
