AUTOGEN_HELPER_DIR = ../database

OCAMLINCLUDES = ../idl/ocaml_backend $(AUTOGEN_HELPER_DIR) ../idl
OCAMLPACKS    = xml-light2 sexpr http-svr log
.PHONY: clean
clean:
	rm -rf *.*

DB_ACTIONS_FILES = db_actions $(AUTOGEN_HELPER_DIR)/string_unmarshall_helper $(AUTOGEN_HELPER_DIR)/string_marshall_helper $(AUTOGEN_HELPER_DIR)/db_action_helper $(AUTOGEN_HELPER_DIR)/db_remote_marshall $(AUTOGEN_HELPER_DIR)/db_filter_types $(AUTOGEN_HELPER_DIR)/db_filter $(AUTOGEN_HELPER_DIR)/db_filter_parse $(AUTOGEN_HELPER_DIR)/db_filter_lex
OCamlProgram(db_actions, $(DB_ACTIONS_FILES))

HTMLGEN=../idl/ocaml_backend/htmldoc.cma
.PHONY: custom_actions_doc
custom_actions_doc: $(HTMLGEN) ../idl/ocaml_backend/server.cma
	mkdir -p doc/api
	ocamldoc -g $(HTMLGEN) -d doc/api custom_actions.ml

.PHONY: api_docs
api_docs: custom_actions_doc

.PHONY: install
install:
	mkdir -p $(DESTDIR)$(OPTDIR)/debug
	$(IPROG) rbac_static.csv $(DESTDIR)$(OPTDIR)/debug
