#!/usr/bin/make -f
# -*- makefile -*-

# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

configure: configure-stamp
configure-stamp:
	dh_testdir
	qmake-qt4 DEFINES+="SPLASH_DIR=\'\\\"/usr/share/guymager\\\"\' LANGUAGE_DIR=\'\\\"/usr/share/guymager\\\"\' LANGUAGE_DIR_QT=\'\\\"/usr/share/qt4/translations\\\"\'"
	touch configure-stamp

build: build-stamp

build-stamp: configure-stamp
	dh_testdir
	$(MAKE)
	lrelease guymager.pro
	cd manuals  && ./rebuild.sh && cd -
	touch $@

clean:
	dh_testdir
	dh_testroot
	rm -f build-stamp configure-stamp
	# dpkg-buildpackage starts with cleaning, so we have to be sure that there's a
	# Makefile (and thus call qmake-qt4):
	qmake-qt4

	$(MAKE) clean
	# remove leftover files:
	rm -f guymager
	rm -f guymager_de.qm guymager_en.qm guymager_fr.qm guymager_it.qm guymager_nl.qm
	rm -f Makefile
	dh_clean

install: build
	dh_testdir
	dh_testroot
	dh_prep
	dh_installdirs

# Build architecture-independent files here.
binary-indep: build install
# We have nothing to do by default.

# Build architecture-dependent files here.
binary-arch: build install
	dh_testdir
	dh_testroot
	dh_installchangelogs
	dh_installdocs
	dh_installmenu
	dh_installman
	dh_install
	dh_link
	dh_strip
	dh_compress
	dh_fixperms
	dh_installdeb
	dh_shlibdeps
	dh_gencontrol
	dh_md5sums
	dh_builddeb

binary: binary-indep binary-arch
.PHONY: build clean binary-indep binary-arch binary install configure
