# Copyright 2003-2007 Savonet team

SRC := src
PROGNAME := ocaml-dtools
DISTFILES := @AUTOCONF_INSTALL_FILES@ bootstrap CHANGES configure configure.ac \
            COPYING Makefile README Makefile.in \
            src/OCamlMakefile src/*Makefile.in src/META.in src/*.ml src/*.mli \
            doc/html
VERSION := @VERSION@

all:
	$(MAKE) -C $(SRC)

clean:
	$(MAKE) -C $(SRC) clean

install:
	$(MAKE) -C $(SRC) install

uninstall:
	$(MAKE) -C $(SRC) uninstall

update:
	$(MAKE) -C $(SRC) update

distclean: clean
	rm -rf autom4te.cache config.log config.status
	rm -rf doc/html
	rm -f src/META src/Makefile

doc:
	$(MAKE) -C src htdoc
	mkdir -p doc
	rm -rf doc/html
	mv src/doc/dtools/html doc
	rm -rf src/doc

dist: doc
	mkdir $(PROGNAME)-$(VERSION)
	cp -R -L --parents $(DISTFILES) $(PROGNAME)-$(VERSION)
	tar zcvf ../$(PROGNAME)-$(VERSION).tar.gz $(PROGNAME)-$(VERSION)
	rm -rf $(PROGNAME)-$(VERSION)

.PHONY: doc

