#!/usr/bin/make -f

include /usr/share/ocaml/ocamlvars.mk

DESTDIR := $(CURDIR)/debian/tmp
INSTALLDIR := $(DESTDIR)$(OCAML_STDLIB_DIR)/xmlrpc-light

DEB_MAKE_CLEAN_TARGET    := clean

DEB_MAKE_BUILD_TARGET    := byte-code-library
ifeq ($(OCAML_HAVE_OCAMLOPT),yes)
DEB_MAKE_BUILD_TARGET    += native-code-library
endif

DEB_MAKE_INSTALL_TARGET  := install
ifeq ($(OCAML_HAVE_OCAMLOPT),yes)
DEB_MAKE_INSTALL_TARGET  += installopt
endif
DEB_MAKE_INSTALL_TARGET  += INSTALLDIR="$(INSTALLDIR)"

%:
	dh $@ --with ocaml

override_dh_auto_build:
	$(MAKE) $(DEB_MAKE_BUILD_TARGET)

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