#!/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

include /usr/share/hardening-includes/hardening.make
ifeq (,$(filter nohardening,$(DEB_BUILD_OPTIONS)))
CFLAGS+=	$(HARDENING_CFLAGS)
LDFLAGS+=	$(HARDENING_LDFLAGS)
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 $@
