#!/usr/bin/make -f
# Made with the aid of debmake, by Christoph Lameter,
# games on the sample debian/rules file for GNU hello by Ian Jackson.

BUILDDIR = ./build

build: $(BUILDDIR)/build-stamp

$(BUILDDIR)/build-stamp:
	dh_testdir
	if test ! -f configure; then \
	  $(MAKE) -f admin/Makefile.common ;\
	fi 
	test -d $(BUILDDIR) || mkdir $(BUILDDIR) ;\
	cd $(BUILDDIR) ;\
	CXXFLAGS="-g -O2 -Wall" \
	  ../configure --with-install-root=`pwd`/../debian/tmp \
	  --enable-debug --disable-rpath --bindir=$${kde_bindir} 
	
	make -C $(BUILDDIR)
 
	touch $(BUILDDIR)/build-stamp

clean: debian-clean
	-rm -rf $(BUILDDIR)

debian-clean:
	dh_testdir
	-rm -f $(BUILDDIR)/build-stamp

binary-indep:	build
	dh_testroot
	dh_testdir
# There are no architecture-independent files to be uploaded
# generated by this package.  If there were any they would be
# made here.

binary-arch: build
	dh_testdir
	dh_testroot
	dh_clean -k
	make -C $(BUILDDIR) bindir=`pwd`/debian/tmp/usr/games install
	perl -w debian/kderules
	dh_movefiles
	dh_undocumented 
	dh_installdocs
	dh_installmenu
	dh_installchangelogs
	dh_strip
	dh_compress
	dh_fixperms
	dh_suidregister
	dh_installdeb
	dh_shlibdeps
	dh_gencontrol
	dh_md5sums
	perl -w debian/kderules update
	dh_builddeb            

# Below here is fairly generic really

binary:		binary-indep binary-arch

.PHONY: binary binary-arch binary-indep clean
