#!/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.

build: build-stamp
 
-include debian/debiandirs
 
debian/debiandirs: debian/debianrules
	perl -w debian/debianrules echodirs > debian/debiandirs
 
build-stamp:
	dh_testdir
	if test ! -f configure; then \
	  $(MAKE) -f admin/Makefile.common ;\
	fi
	./configure $(configkdevelop)
	$(MAKE)

	touch build-stamp

debian-clean:
	dh_testdir
	-rm -f build-stamp install-stamp
	dh_clean
 
clean: debian-clean
	-rm -f debian/debiandirs 
	if test -d CVS; then \
	make -f admin/Makefile.common cvs-clean ;\
	fi
	-make distclean
	
binary-indep:	build
	dh_testroot
	dh_testdir

binary-arch:	build
	dh_testroot
	dh_testdir
	dh_clean -a
	install -d debian/tmp/etc/kde2
	$(MAKE) prefix=/usr DESTDIR=`pwd`/debian/tmp/ install
	-rm -rf debian/tmp/home debian/tmp/blah \
		debian/tmp/usr/share/applnk/Development/designer.desktop \
		debian/tmp/usr/share/applnk/Development/linguist.desktop
	cp kdevelop/kdeveloprc debian/tmp/etc/kde2/
	perl -w debian/debianrules cleanup
	dh_undocumented 
	dh_installmenu
	perl -w debian/debianrules docbase
	dh_installdocs
	dh_installchangelogs
	dh_strip
	dh_compress
	dh_fixperms
	chmod 755 debian/tmp/usr/share/apps/kdevelop/tools/*
	dh_perl
	dh_installdeb
	dh_shlibdeps
	dh_gencontrol
	dh_md5sums
	dh_builddeb    

# Below here is fairly generic really

binary:		binary-indep binary-arch

.PHONY: binary binary-arch binary-indep clean
