#!/usr/bin/make -f

VERSION := $(shell grep ^VERSION= Makefile.in | cut -d= -f2)
BUILD_DATE := $(shell dpkg-parsechangelog | sed -n -e 's/^Date: //p')

%:
	dh $@ --with autotools_dev,ocaml

override_dh_auto_configure:
	dh_auto_configure -- --enable-utf8

override_dh_auto_build:
	echo "let version = \""$(VERSION)"\"" > version.ml
	echo "let date = \"$(BUILD_DATE)\"" >> version.ml
	dh_auto_build

override_dh_auto_install:
	dh_auto_install
	#rm $(CURDIR)/debian/wyrd/usr/share/doc/wyrd/README

clean:
	find . -name '*.cm[iox]' -o -name '*.o'  | xargs rm -f
	-rm -f $(CURDIR)/debian/stamp*
	-rm -f $(CURDIR)/config.status $(CURDIR)/config.log $(CURDIR)/config.cache
