#!/usr/bin/make -f
# -*- makefile -*-
# Sample debian/rules that uses debhelper.
# GNU copyright 1997 to 1999 by Joey Hess.

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

include /usr/share/ocaml/ocamlvars.mk

DESTDIR = $(CURDIR)/debian/tmp

%:
	dh $@ --with ocaml

.PHONY: override_dh_auto_configure
override_dh_auto_configure:
	aclocal -I support
	autoconf
	chmod +x configure
	./configure --with-gtk

.PHONY: override_dh_auto_build
override_dh_auto_build:
	$(MAKE) all
ifneq ($(OCAML_OPT_ARCH),)
	$(MAKE) opt
endif
	$(MAKE) doc

.PHONY: override_dh_auto_clean
override_dh_auto_clean:
	[ ! -f config.make ] || $(MAKE) clean
	$(RM) -f aclocal.m4 config.log config.make config.status configure
	$(RM) -rf doc

.PHONY: override_dh_auto_install
override_dh_auto_install:
	mkdir -p $(DESTDIR)
	$(MAKE) install DESTDIR=$(DESTDIR)
