#!/usr/bin/make -f

include /usr/share/ocaml/ocamlvars.mk

export DESTDIR := $(CURDIR)/debian/tmp
export OCAMLFIND_DESTDIR := $(DESTDIR)$(OCAML_STDLIB_DIR)
export OCAML_HAVE_OCAMLOPT

# without --no-parallel, ocamlbuild errors out because it cannot create the
#_build directory as it already exists
%:
	dh $@ --with ocaml --no-parallel

override_dh_auto_clean:
	dh_auto_clean -- -f Makefile.simple

override_dh_auto_build:
	dh_auto_build -- -f Makefile.simple

# skip because requires source directory to be git repository
override_dh_auto_test:

override_dh_install:
	dh_install --fail-missing

override_dh_auto_install:
	mkdir -p $(OCAMLFIND_DESTDIR)
	mkdir -p $(DESTDIR)/usr/bin
	mkdir -p $(DESTDIR)/usr/share/emacs/site-lisp
	mkdir -p $(DESTDIR)/usr/share/ocp-indent/vim/indent
	dh_auto_install -- -f Makefile.simple
