#!/usr/bin/make -f
# debhelper rules file for hexer.

CFLAGS:=	$(shell dpkg-buildflags --get CFLAGS)
CPPFLAGS:=	$(shell dpkg-buildflags --get CPPFLAGS)
LDFLAGS:=	$(shell dpkg-buildflags --get LDFLAGS)
DEB_BUILD_ARCH:=	$(shell dpkg-architecture -qDEB_HOST_ARCH)

ifneq (,$(findstring kfreebsd,$(DEB_BUILD_ARCH)))
	CFLAGS+=	-DBSD
endif
ifneq (,$(filter werror,$(DEB_BUILD_OPTIONS)))
	CFLAGS+=	-Werror
endif
ifneq (,$(filter hardening,$(DEB_BUILD_OPTIONS)))
export DEB_BUILD_HARDENING=1
else
export DEB_BUILD_HARDENING=0
endif
export CFLAGS CPPFLAGS LDFLAGS

override_dh_auto_configure:
	cp -f config.linux config.h

override_dh_auto_install:
	dh_auto_install -- PREFIX=/usr MANDIR=/usr/share/man/man1

%:
	dh $@
