#!/usr/bin/make -f

DPKG_EXPORT_BUILDFLAGS=1
include /usr/share/dpkg/buildflags.mk

build: build-arch build-indep
build-arch: build-stamp
build-indep: build-stamp
build-stamp:
	dh_testdir

	xmkmf
	make CDEBUGFLAGS="$(CFLAGS) $(LDFLAGS)"
	touch build-stamp

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

	[ ! -f Makefile ] || make clean
	-rm -f Makefile
	dh_clean

install: install-stamp
install-stamp: build-stamp
	dh_testdir
	dh_testroot
	dh_prep
	dh_installdirs

	make install DESTDIR=`pwd`/debian/ascdc

	touch install-stamp

binary-indep:	build install
# 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 install
	dh_testdir
	dh_testroot
	dh_installdocs README
	dh_installchangelogs
	dh_installman debian/ascdc.man
	dh_strip
	dh_compress
	dh_fixperms
	dh_installdeb
	dh_shlibdeps
	dh_gencontrol
	dh_md5sums
	dh_builddeb

# Below here is fairly generic really

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

