#!/usr/bin/make -f

export DEB_BUILD_MAINT_OPTIONS = hardening=+all
DPKG_EXPORT_BUILDFLAGS = 1
include /usr/share/dpkg/buildflags.mk

ARCH = $(shell dpkg-architecture -qDEB_BUILD_ARCH)

ifeq ($(filter $(ARCH),amd64 i386),$(ARCH))
  CFLAGS += -fcf-protection
endif

%:
	dh $@

override_dh_auto_configure:
	xmkmf -a

override_dh_auto_build:
	$(MAKE) CDEBUGFLAGS="$(CFLAGS)" LDOPTIONS="$(LDFLAGS)"

override_dh_install:
	dh_install
	rm -rf $(CURDIR)/debian/xmountains/usr/bin
