#!/usr/bin/make -f

#export DH_VERBOSE=1
export NV_VERBOSE=1

# see FEATURE AREAS in dpkg-buildflags(1)
export DEB_BUILD_MAINT_OPTIONS = hardening=+all

include /usr/share/dpkg/buildflags.mk
include /usr/share/dpkg/pkg-info.mk

# Redefine DATE to something stable to make the build reproducible
export DATE		 = date -d "@$(SOURCE_DATE_EPOCH)"
# Cheat for user and hostname
export WHOAMI		 = echo buildd
export HOSTNAME_CMD	 = echo debian

PKG_CONFIG_XORG_XSERVER_LIBDIR	 = $(shell pkg-config --variable=libdir xorg-server)
CPPFLAGS		+= -DPKG_CONFIG_XORG_XSERVER_LIBDIR=\"$(PKG_CONFIG_XORG_XSERVER_LIBDIR)\"

export PREFIX		 = /usr
export DO_STRIP		 =
export CC_ONLY_CFLAGS	 = $(CPPFLAGS)
# reproducible builds: instead of _out/$(uname)_($uname -m) use a fixed directory
export OUTPUTDIR         = _out/debian

ifneq (,$(filter noopt,$(DEB_BUILD_OPTIONS)))
export DEBUG		 = 1
endif


%:
	dh $@

override_dh_auto_clean:
	dh_auto_clean
	$(RM) -r _out
