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

include /usr/share/ocaml/ocamlvars.mk

ifeq ($(OCAML_HAVE_OCAMLOPT),yes)
  BUILD_TARGET=all
else
  BUILD_TARGET=byte
endif

%:
	dh $@ --with ocaml

.PHONY: override_dh_auto_build
override_dh_auto_build:
	$(MAKE) $(BUILD_TARGET)
	$(MAKE) doc

.PHONY: override_dh_auto_install
override_dh_auto_install:
	$(MAKE) install INSTALLDIR=$(CURDIR)/debian/libconfig-file-ocaml-dev$(OCAML_STDLIB_DIR)/config-file
	mkdir -p $(CURDIR)/debian/libconfig-file-ocaml-dev/usr/share/doc/libconfig-file-ocaml-dev/html
	mv ocamldoc $(CURDIR)/debian/libconfig-file-ocaml-dev/usr/share/doc/libconfig-file-ocaml-dev/html/api

.PHONY: override_dh_auto_test
override_dh_auto_test:
# Upstream test target is buggy, ignore it
