#!/usr/bin/make -f
# -*- makefile -*-
include /usr/share/ocaml/ocamlvars.mk

OCAMLBUILD := ocamlbuild -classic-display $(if $(OCAML_OPT_ARCH),,-byte-plugin)

TARGETS := react.cmo $(if $(OCAML_OPT_ARCH),react.cmx test.native,test.byte)

%:
	dh --with ocaml $@

.PHONY: override_dh_auto_build
override_dh_auto_build:
	$(OCAMLBUILD) $(TARGETS)
ifeq ($(OCAML_OPT_ARCH),)
	./test.byte
else
	./test.native
	ocamlopt -shared -o _build/src/react.cmxs _build/src/react.cmx
endif

.PHONY: override_dh_auto_clean
override_dh_auto_clean:
	$(OCAMLBUILD) -clean

.PHONY: override_dh_compress
override_dh_compress:
	dh_compress -X.ml
