#!/usr/bin/make -f

include /usr/share/ocaml/ocamlvars.mk

DESTDIR = $(CURDIR)/debian/tmp/$(OCAML_STDLIB_DIR)
DEB_MAKE_INSTALL_TARGET := install OCAMLFIND_DESTDIR=$(DESTDIR) OCAMLFIND_LDCONF=ignore

%:
	dh $@ --with ocaml

override_dh_autoreconf:
	./bootstrap

override_dh_auto_configure:
	dh_auto_configure -- --enable-debugging

override_dh_auto_build:
	dh_auto_build
	$(MAKE) doc

override_dh_auto_install:
	mkdir -p $(DESTDIR)
	$(MAKE) $(DEB_MAKE_INSTALL_TARGET)

override_dh_auto_clean:
	dh_auto_clean
	rm -rf doc
