#!/usr/bin/make -f

# -*- sh -*-

export DH_VERBOSE=1
export DH_COMPAT=3

DESTDIR=$(CURDIR)/debian/tmp

configure: configure-stamp
configure-stamp:
	dh_testdir
	# Add here commands to configure the package.
	

	touch configure-stamp

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

	# Remove backup files
	find . \( -name "*~" -o -name ".#*" \) -exec rm {} \;

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

	touch build-stamp

clean:
	dh_testdir
	dh_testroot
	rm -f build-stamp configure-stamp

	# Add here commands to clean up after the build process.
	-$(MAKE) clean

	dh_clean
	rm -f $(CURDIR)/debian/{build,configure}-stamp
	rm -rf $(CURDIR)/debian/libconfig-dev $(CURDIR)/debian/libconfig $(CURDIR)/debian/tmp

install: build
	dh_testdir
	dh_testroot
	dh_clean -k
	dh_installdirs

	# Add here commands to install the package into debian/tmp
	-$(MAKE) DESTDIR=$(DESTDIR) prefix=$(DESTDIR)/usr install

# Build architecture-dependent files here.
binary-arch: build install
	dh_testdir
	dh_testroot
	dh_movefiles
	dh_installdocs
	dh_installexamples
	dh_installchangelogs
	dh_link
	dh_strip
	dh_compress
	dh_fixperms
	dh_makeshlibs
	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
