#!/usr/bin/make -f

%:
	dh $@ --with autotools_dev

override_dh_auto_clean:
# Generate the minimal config.mak required for "make distclean"
	test -f config.mak || echo "RM_REC := rm -f -r" > config.mak
	dh_auto_clean

override_dh_auto_configure:
	./configure --prefix=/usr

override_dh_auto_build:
	dh_auto_build
	dh_auto_build -B src/tools/evdev-joystick
	sed 'sXlocal/XXg' < src/tools/evdev-joystick/80-stelladaptor-joystick.rules > debian/stella.udev

override_dh_auto_install:
	dh_auto_install
	# This is also installed as the upstream changelog
	rm $(CURDIR)/debian/stella/usr/share/doc/stella/Changes.txt
	# This is overridden by the copyright file
	rm $(CURDIR)/debian/stella/usr/share/doc/stella/License.txt
