#!/usr/bin/make -f
# -*- makefile -*-

DESTDIR=$(CURDIR)/debian/tmp
include /usr/share/ocaml/ocamlvars.mk

OCAMLFIND_DESTDIR=$(DESTDIR)/$(OCAML_STDLIB_DIR)
export OCAMLFIND_DESTDIR

CONFIGURE_OPTS := -use-findlib -installbindir $(DESTDIR)/usr/bin

%:
	dh $@ --with ocaml

override_dh_auto_configure:
	./configure $(CONFIGURE_OPTS)

override_dh_auto_build:
	$(MAKE) library
ifeq ($(OCAML_HAVE_OCAMLOPT),yes)
	$(MAKE) libraryopt
endif

override_dh_auto_install:
	mkdir -p $(OCAMLFIND_DESTDIR) $(OCAMLFIND_DESTDIR)/stublibs $(DESTDIR)/usr/bin
	dh_auto_install

override_dh_auto_clean:
	./configure $(CONFIGURE_OPTS)
	dh_auto_clean
	rm -f config/Makefile config/auto-aux/tst

override_dh_missing:
	dh_missing --fail-missing -X.so.owner

override_dh_dwz:
