#!/usr/bin/make -f
# -*- makefile -*-
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

CPPFLAGS=$(shell dpkg-buildflags --get CPPFLAGS)
CXXFLAGS=$(shell dpkg-buildflags --get CXXFLAGS)
LDFLAGS=$(shell dpkg-buildflags --get LDFLAGS)

# Warnings
CXXFLAGS += -Wall -fno-strict-aliasing

ifneq (,$(filter werror,$(DEB_BUILD_OPTIONS)))
	CXXFLAGS+=	-Werror
endif

include /usr/share/hardening-includes/hardening.make
ifeq (,$(filter nohardening,$(DEB_BUILD_OPTIONS)))
CXXFLAGS+=	$(HARDENING_CFLAGS)
LDFLAGS+=	$(HARDENING_LDFLAGS)
endif

export CPPFLAGS CXXFLAGS LDFLAGS

override_dh_auto_configure:
	autoreconf -fvi
	dh_auto_configure -- --datadir=/usr/share/games

override_dh_clean:
	find ./ -name Makefile.in -delete
	dh_clean

override_dh_auto_install:
	dh_auto_install
	# The data package
	mv $(CURDIR)/debian/tmp/var/games/tecnoballz/tecnoballz.hi \
		$(CURDIR)/debian/tmp/var/games/tecnoballz/tecnoballz.hi.clean

override_dh_builddeb:
	dh_builddeb -- -Zxz

%:
	dh $@
