#!/usr/bin/make -f

#export DH_VERBOSE=1


export DEB_CFLAGS_MAINT_APPEND = -pipe -Wall
export DEB_LDFLAGS_MAINT_APPEND = -Wl,--no-undefined


%:
	dh $@ --with autoreconf --parallel

autoreconf:
	./autogen.sh
	cp -f /usr/share/misc/config.guess /usr/share/misc/config.sub .

override_dh_autoreconf:
	dh_autoreconf --as-needed debian/rules -- autoreconf

override_dh_auto_configure:
	dh_auto_configure -- $(confflags)

override_dh_install:
        # copy files (modifying header includes) to install as examples in the
        # -dev package
	sed -e 's:"SDL.h":\<SDL.h\>:' -e 's:"SDL_ttf.h":\<SDL_ttf.h\>:' showfont.c > debian/showfont.c
	sed -e 's:"SDL.h":\<SDL.h\>:' -e 's:"SDL_ttf.h":\<SDL_ttf.h\>:' glfont.c > debian/glfont.c

	dh_install --fail-missing -XlibSDL_ttf.la

override_dh_auto_installchangelogs:
	dh_auto_installchangelogs -- CHANGES
