#!/usr/bin/make -f

#export DH_VERBOSE=1

export DH_COMPAT=4


configure: configure-stamp
configure-stamp:
	dh_testdir
	touch configure-stamp


build: build-stamp
build-stamp: configure-stamp 
	dh_testdir
	# compile
	$(MAKE) all
	# make jar file
	$(MAKE) jar
	# native compile
	#gcj -fpic -fjni -g  -O2 -shared -o libdebbug-java.so com/tildemh/debbug/*.java
	
	touch build-stamp

clean:
	dh_testdir
	dh_testroot
	rm -f build-stamp configure-stamp
	-$(MAKE) clean 
	-rm rf gjdoc*
	dh_clean

install: build
	dh_testdir
	dh_testroot
	dh_clean -k
	dh_install -plibdebbug-java build/*.jar usr/share/java
	dh_install -plibdebbug-java build/doc/* usr/share/doc/libdebbug-java-doc/API

binary-indep: build install
	dh_testdir
	dh_testroot
	dh_installdocs -A README
	-dh_javadoc -plibdebbug-java --sourcedir src com.tildemh.debbug
	dh_installchangelogs 
	dh_link
	dh_compress
	dh_fixperms
	dh_installdeb
	dh_gencontrol
	dh_md5sums
	dh_builddeb

binary-arch: build install

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