#!/usr/bin/make -f

rwildcard=$(wildcard $1$2) $(foreach d,$(wildcard $1*),$(call rwildcard,$d/,$2))

# How to recursively find all files with the same name in a given folder
ALL_PYX := $(call rwildcard,gpyfft/,*.pyx)
#NOTA: No space before *

export PYBUILD_NAME=gpyfft

%:
	dh $@ --buildsystem=pybuild

execute_after_dh_clean:
	rm -f $(patsubst %.pyx,%.cpp,${ALL_PYX})
	rm -f gpyfft/*.so
	rm -rf docs/build

execute_after_dh_auto_build-indep:
	dh_auto_build -- -s custom --build-args="cd docs && PYTHONPATH={build_dir} http_proxy='127.0.0.1:9' {interpreter} -m sphinx -N -bhtml source build/html"

execute_after_dh_auto_install-indep:
	dh_installdocs -p python-gpyfft-doc "docs/build/html"
