]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/hbugs/broker/Makefile
fixed a typo (inside a comment)
[helm.git] / helm / hbugs / broker / Makefile
index 07d255780281823d48f848389aa5ff69240ae10c..e4cb57236b0328f6df9bc34116fd0fc189fc4f12 100644 (file)
@@ -1,43 +1,61 @@
 NAME = hbugs_broker
-REQUIRES = http threads hbugs-common
-COMMONDIR = ../common
+METADIR = ../meta
+REQUIRES = http threads hbugs-common hbugs-thread-safe threads
 COMMONOPTS = -package "$(REQUIRES)" -pp camlp4o
-OCAMLC = ocamlfind ocamlc -I $(COMMONDIR) $(COMMONOPTS)
-OCAMLOPT = ocamlfind ocamlopt -I $(COMMONDIR) $(COMMONOPTS)
-OCAMLDEP = ocamlfind ocamldep $(COMMONOPTS)
+OCAMLFIND = ocamlfind
+OCAMLC = $(OCAMLFIND) ocamlc -thread $(COMMONOPTS)
+OCAMLOPT = $(OCAMLFIND) ocamlopt -thread $(COMMONOPTS)
+OCAMLDEP = $(OCAMLFIND) ocamldep $(COMMONOPTS)
 MODULES = hbugs_broker_registry
-COMMON_MODULES =       \
-       hbugs_types threadSafe hbugs_misc hbugs_id_generator hbugs_messages
+OCAMLDOC =     \
+       ocamldoc        \
+               $(shell $(OCAMLFIND) query -i-format http)      \
+               $(shell $(OCAMLFIND) query -i-format threads)   \
+               $(shell $(OCAMLFIND) query -i-format hbugs-common)      \
+               $(shell $(OCAMLFIND) query -i-format hbugs-thread-safe) \
+               $(shell $(OCAMLFIND) query -i-format hbugs-thread-safe) \
+               $(shell $(OCAMLFIND) query -i-format pxp-engine)        \
+               $(shell $(OCAMLFIND) query -i-format pcre)
+CTL = ./hbugs_broker_ctl.sh
 
 OBJS = $(patsubst %,%.cmo,$(MODULES))
 OBJSOPT = $(patsubst %,%.cmx,$(MODULES))
-COMMON_OBJS = $(patsubst %,$(COMMONDIR)/%.cmo,$(COMMON_MODULES))
-COMMON_OBJSOPT = $(patsubst %,$(COMMONDIR)/%.cmx,$(COMMON_MODULES))
+DEPS = $(shell $(OCAMLFIND) query -recursive -predicates byte -format "%d/%a" $(REQUIRES))
+DEPSOPT = $(shell $(OCAMLFIND) query -recursive -predicates native -format "%d/%a" $(REQUIRES))
 
 all: byte
 byte: $(NAME)
 opt: $(NAME).opt
 world: byte opt
+start:
+       $(CTL) start
+stop:
+       $(CTL) stop
 
 include .depend
 depend:
        $(OCAMLDEP) *.ml *.mli > .depend
 
 %.cmi: %.mli
-       OCAMLPATH=".." $(OCAMLC) -c $<
+       $(OCAMLC) -c $<
 %.cmo: %.ml %.cmi
-       OCAMLPATH=".." $(OCAMLC) -c $<
+       $(OCAMLC) -c $<
 %.cmx: %.ml %.cmi
-       OCAMLPATH=".." $(OCAMLOPT) -c $<
+       $(OCAMLOPT) -c $<
 include Makefile.overrides
+$(OBJS): $(DEPS)
+$(OBJSOPT): $(DEPSOPT)
 $(NAME): $(OBJS) $(NAME).ml
-       OCAMLPATH=".." $(OCAMLC) -linkpkg -thread -o $@ $(COMMON_OBJS) $^
+       $(OCAMLC) -linkpkg -thread -o $@ $^
 $(NAME).opt: $(OBJSOPT) $(NAME).ml
-       OCAMLPATH=".." $(OCAMLOPT) -linkpkg -thread -o $@ $(COMMON_OBJSOPT) $^
+       $(OCAMLOPT) -linkpkg -thread -o $@ $^
+$(NAME).dot: *.ml *.mli ../common/*.ml ../common/*.mli
+       $(OCAMLDOC) -dot -o $@ $^
 
 distclean: clean
+       rm -f run/*
 clean:
        rm -f *.cm[aiox] *.o $(NAME){,.opt}
 
-.PHONY: all byte opt world depend clean
+.PHONY: all byte opt world depend clean start stop