#!/usr/bin/make -f

%:
	dh $@ --with ocaml

export OCAMLFIND_DESTDIR = debian/tmp/$(shell /usr/bin/ocamlc -where)
export OCAMLFIND_LDCONF = ignore

ifneq ($(wildcard /usr/bin/ocamlopt),)
override_dh_auto_install:
	mkdir -p $(OCAMLFIND_DESTDIR)
	$(MAKE) install
else
override_dh_auto_build:
	$(MAKE) all-byte

override_dh_auto_install:
	mkdir -p $(OCAMLFIND_DESTDIR)
	$(MAKE) install-byte
endif
