]> matita.cs.unibo.it Git - helm.git/blob - helm/hbugs/broker/Makefile
e4cb57236b0328f6df9bc34116fd0fc189fc4f12
[helm.git] / helm / hbugs / broker / Makefile
1 NAME = hbugs_broker
2 METADIR = ../meta
3 REQUIRES = http threads hbugs-common hbugs-thread-safe threads
4 COMMONOPTS = -package "$(REQUIRES)" -pp camlp4o
5 OCAMLFIND = ocamlfind
6 OCAMLC = $(OCAMLFIND) ocamlc -thread $(COMMONOPTS)
7 OCAMLOPT = $(OCAMLFIND) ocamlopt -thread $(COMMONOPTS)
8 OCAMLDEP = $(OCAMLFIND) ocamldep $(COMMONOPTS)
9 MODULES = hbugs_broker_registry
10 OCAMLDOC =      \
11         ocamldoc        \
12                 $(shell $(OCAMLFIND) query -i-format http)      \
13                 $(shell $(OCAMLFIND) query -i-format threads)   \
14                 $(shell $(OCAMLFIND) query -i-format hbugs-common)      \
15                 $(shell $(OCAMLFIND) query -i-format hbugs-thread-safe) \
16                 $(shell $(OCAMLFIND) query -i-format hbugs-thread-safe) \
17                 $(shell $(OCAMLFIND) query -i-format pxp-engine)        \
18                 $(shell $(OCAMLFIND) query -i-format pcre)
19 CTL = ./hbugs_broker_ctl.sh
20
21 OBJS = $(patsubst %,%.cmo,$(MODULES))
22 OBJSOPT = $(patsubst %,%.cmx,$(MODULES))
23 DEPS = $(shell $(OCAMLFIND) query -recursive -predicates byte -format "%d/%a" $(REQUIRES))
24 DEPSOPT = $(shell $(OCAMLFIND) query -recursive -predicates native -format "%d/%a" $(REQUIRES))
25
26 all: byte
27 byte: $(NAME)
28 opt: $(NAME).opt
29 world: byte opt
30 start:
31         $(CTL) start
32 stop:
33         $(CTL) stop
34
35 include .depend
36 depend:
37         $(OCAMLDEP) *.ml *.mli > .depend
38
39 %.cmi: %.mli
40         $(OCAMLC) -c $<
41 %.cmo: %.ml %.cmi
42         $(OCAMLC) -c $<
43 %.cmx: %.ml %.cmi
44         $(OCAMLOPT) -c $<
45 include Makefile.overrides
46 $(OBJS): $(DEPS)
47 $(OBJSOPT): $(DEPSOPT)
48 $(NAME): $(OBJS) $(NAME).ml
49         $(OCAMLC) -linkpkg -thread -o $@ $^
50 $(NAME).opt: $(OBJSOPT) $(NAME).ml
51         $(OCAMLOPT) -linkpkg -thread -o $@ $^
52 $(NAME).dot: *.ml *.mli ../common/*.ml ../common/*.mli
53         $(OCAMLDOC) -dot -o $@ $^
54
55 distclean: clean
56         rm -f run/*
57 clean:
58         rm -f *.cm[aiox] *.o $(NAME){,.opt}
59
60 .PHONY: all byte opt world depend clean start stop
61