#!/usr/bin/make -f

# Made with the aid of dh_make, by Craig Small
# Sample debian/rules that uses debhelper. GNU copyright 1997 by Joey Hess.
# Some lines taken from debmake, by Christoph Lameter.

ifndef PERL
PERL=/usr/bin/perl
endif

build: build-stamp
build-stamp:
	dh_testdir

	$(PERL) Makefile.PL INSTALLDIRS=vendor 
	$(MAKE) CFLAGS="-O2 -g -Wall"

	touch build-stamp

clean:
	dh_testdir
	dh_testroot
	rm -f build-stamp install-stamp
	-${MAKE} realclean

	dh_clean

test: build-stamp
	chmod +x debian/xvfb-run
	debian/xvfb-run $(MAKE) test

install: install-stamp
install-stamp: build-stamp test
	dh_testdir
	dh_testroot
	dh_clean
	dh_installdirs

	$(MAKE) install PREFIX=$(CURDIR)/debian/libpoe-perl/usr

	touch install-stamp

binary-indep: build install
	dh_testdir
	dh_testroot
	dh_installdocs
	dh_installexamples
	dh_installchangelogs CHANGES
	dh_compress
	dh_fixperms
	dh_installdeb
	dh_perl
	dh_gencontrol
	dh_md5sums
	dh_builddeb

binary-arch: build install

source diff:                                                                  
	@echo >&2 'source and diff are obsolete - use dpkg-source -b'; false

binary: binary-indep binary-arch

.PHONY: binary binary-arch binary-indep clean test
