#!/usr/bin/make -f
# Sample debian/rules that uses debhelper.
# GNU copyright 1997 to 1999 by Joey Hess.

#cflags="-Wall -O2"
#
#ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS)))
#  cflags +=" -g"
#endif

APPNAME := accelemymote-gui

configure: configure-stamp
configure-stamp:
	dh_testdir
	# Add here commands to configure the package.
	qmake
# ./$(APPNAME).pro
#	$(MAKE) -f /usr/share/quilt/quilt.make patch
#	./configure --prefix=/opt/maemo/usr --mandir=\$${prefix}/share/man LDFLAGS="-Wl,--as-needed -Wl,-z,defs"

	touch configure-stamp

build: configure-stamp build-stamp
build-stamp: configure-stamp
	dh_testdir

	# Add here commands to compile the package.
	$(MAKE) 

	touch build-stamp

clean:
	dh_testdir
	dh_testroot

	# Add here commands to clean up after the build process.
#	[ ! -f Makefile ] || $(MAKE) distclean
#	$(MAKE) -f /usr/share/quilt/quilt.make unpatch
#	make clean
	rm -f build-stamp configure-stamp $(APPNAME) *.o moc_*

	dh_clean
#	rm -f config.log

dest=$(CURDIR)/debian/$(APPNAME)

install: build
	dh_testdir
	dh_testroot
	dh_clean -k
	dh_installdirs
	$(MAKE) install DESTDIR=$(dest)

# 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_install
	dh_installdocs
#	dh_installman
#	dh_installchangelogs NEWS
#	mv $(dest)/usr/share/doc $(dest)/opt/maemo/usr/share/
	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
