#!/usr/bin/make -f

#export DH_VERBOSE=1
export NV_VERBOSE=1

# Redefine DATE to something stable to make the build reproducible
BUILDDATE	:= $(shell dpkg-parsechangelog -S Date)
DATE		 = date -d "$(BUILDDATE)"
# Cheat for user and hostname
WHOAMI		 = echo buildd
HOSTNAME_CMD	 = echo debian
export DATE WHOAMI HOSTNAME_CMD

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

export PREFIX = /usr

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


%:
	dh $@

override_dh_auto_build:
	CC_ONLY_CFLAGS="$(CPPFLAGS)" STRIP_CMD=true dh_auto_build

override_dh_auto_clean:
	dh_auto_clean
	$(RM) -r _out
