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

# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

include /usr/share/ocaml/ocamlvars.mk

DESTDIR := $(CURDIR)/debian/tmp/$(OCAML_STDLIB_DIR)
CFLAGS += -Wall

%:
	dh --with ocaml,python2 $@

.PHONY: override_dh_auto_configure
override_dh_auto_configure:
	cp debian/Makefile .

.PHONY: override_dh_auto_build
override_dh_auto_build:
ifneq ($(OCAML_OPT_ARCH),)
	$(MAKE) allopt
else
	$(MAKE) all
endif

.PHONY: override_dh_auto_clean
override_dh_auto_clean:
	$(MAKE) -f debian/Makefile clean

.PHONY: override_dh_auto_install
override_dh_auto_install:
	$(MAKE) rawinstall OCAML_LIB_INSTALL=$(DESTDIR)/pycaml

.PHONY: override_dh_ocaml
override_dh_ocaml:
	dh_ocaml --runtime-map pycaml
