#!/usr/bin/make -f

# these rules originally written by Joey Hess for hothasktags package

%:
	dh $@

override_dh_auto_configure:
	ghc --make Setup
	./Setup configure

override_dh_auto_build:
	$(MAKE) man
	./Setup build
	PATH="$(PATH):dist/build/patat/" $(MAKE) completion
	mkdir -p bash-completion/completions
	cp extra/patat.bash-completion bash-completion/completions/patat

override_dh_auto_clean:
	$(MAKE) clean
	if [ -x Setup ]; then ./Setup clean; fi
	rm -f Setup Setup.o Setup.hi

override_dh_auto_test:
	PATH="$(PATH):dist/build/patat/" bash test.sh

override_dh_strip:
	# GHC cannot produce debugging symbols so the -dbgsym package
	# ends up empty, so disable generating it
	dh_strip --no-automatic-dbgsym
