#!/usr/bin/make -f

export MMTK_USE_CYTHON=1

VERSION := $(shell dpkg-parsechangelog | sed -ne 's/^Version: \(.*\)-.*/\1/p')

get-orig-source:
	uscan --force-download --upstream-version $(VERSION) --repack

override_dh_auto_clean:
	# remove the cpython generated files distributed by upstream
	rm -f $(patsubst %.pyx,%.c,$(wildcard Src/*.pyx))
	# remove the doc
	rm -rf build

override_dh_auto_test:
	dh_auto_test
	python setup.py test

override_dh_auto_install:
	dh_auto_install
	dh_numpy

%:
	dh $@ --with python2,sphinxdoc

.PHONY: get-orig-source
