OCAMLPACKS = xml-light2 uuid

# -----------------------------------------------------------------------
# autogen stuff
# -----------------------------------------------------------------------

# should move this into global constants file in root and stop using
# relative paths...
AUTOGEN_DIR = ../../autogen

# only gen_api requires datamodel library:
OCAMLINCLUDES += .. 
OCAML_LIBS += ../datamodel

OCamlProgram(main, main)

# -----------------------------------------------------------------------
# programs that depend on autogen files
# -----------------------------------------------------------------------

.PHONY: clean
clean:
        rm -f *~ *.opt *.run *.a *.cma *.cmxa *.cmo *.cmi *.o *.cmx *.omc *.annot gen_api

.PHONY: js_binding
js_binding: main
	./main > api.js
	cp api.js ../../../js/

.PHONY: install
install:
	mkdir -p $(DESTDIR)$(OPTDIR)/debug/www
	cp api.js $(DESTDIR)$(OPTDIR)/debug/www
