#!/usr/bin/make -f

DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)

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

build-stamp:
	dh_testdir
	./configure --prefix=/usr --libdir=\$${prefix}/lib/$(DEB_HOST_MULTIARCH) --with-python
	make
	touch build-stamp

install: build
	dh_testdir
	dh_testroot
	make DESTDIR=`pwd`/debian/tmp install

clean:
	dh_clean
	[ ! -f Makefile ] || make distclean
	rm -rf doc/Makefile doc/libmapper.doxyfile 	jni/.deps/ 	jni/Makefile

binary-arch: build install
	dh_testdir
	dh_testroot
	dh_install
	dh_installman
	dh_installdocs
	dh_installchangelogs
	dh_strip
	dh_compress
	dh_fixperms
	dh_makeshlibs -V
	dh_perl
	dh_python2 --no-guessing-versions
	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


