#!/usr/bin/make -f

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

include /usr/share/ocaml/ocamlvars.mk

DESTDIR = $(CURDIR)/debian/tmp/$(OCAML_STDLIB_DIR)

MYCFLAGS = "-O2 -g -fPIC -DHAVE_CONFIG_H"

export NO_CUSTOM=y

%:
	dh $@ --with ocaml

override_dh_auto_configure:
	./configure --enable-widec

override_dh_auto_build:
	$(MAKE) CFLAGS=$(MYCFLAGS) byte
ifneq ($(OCAML_OPT_ARCH),)
	$(MAKE) CFLAGS=$(MYCFLAGS) opt
endif
	$(MAKE) htdoc

override_dh_auto_install:
	mkdir -p $(DESTDIR)
	$(MAKE) install OCAMLFIND_DESTDIR=$(DESTDIR) OCAMLFIND_LDCONF=ignore
