]> matita.cs.unibo.it Git - helm.git/blob - helm/software/components/hbugs/Makefile
fixed recursiveness check
[helm.git] / helm / software / components / hbugs / Makefile
1
2 # Targets description:
3 #       all (default) -> builds hbugs bytecode library hbugs.cma
4 #       opt           -> builds hbugs native library hbugs.cmxa
5 #       daemons       -> builds hbugs broker and tutors executables
6 #
7 #       start         -> starts up broker and tutors
8 #       stop          -> stop broker and tutors
9 #
10 #       broker        -> builds broker executable
11 #       tutors        -> builds tutors executables
12 #       client        -> builds hbugs client
13
14 PACKAGE = hbugs
15
16 IMPLEMENTATION_FILES =                  \
17         hbugs_misc.ml                   \
18         hbugs_common.ml                 \
19         hbugs_id_generator.ml           \
20         hbugs_messages.ml               \
21         hbugs_client_gui.ml             \
22         hbugs_client.ml
23 INTERFACE_FILES = \
24         hbugs_types.mli \
25         $(patsubst %.ml, %.mli, $(IMPLEMENTATION_FILES))
26
27 include ../../Makefile.defs
28 include ../Makefile.common
29 include .tutors.ml
30 include .generated_tutors.ml
31
32 .tutors.ml:
33         echo -n "TUTORS_ML = " > $@
34         scripts/ls_tutors.ml | xargs >> $@
35 .generated_tutors.ml:
36         echo -n "GENERATED_TUTORS_ML = " > $@
37         scripts/ls_tutors.ml -auto | xargs >> $@
38
39 TUTORS = $(patsubst %.ml, %, $(TUTORS_ML))
40 TUTORS_OPT = $(patsubst %, %.opt, $(TUTORS))
41 GENERATED_TUTORS = $(patsubst %.ml, %, $(GENERATED_TUTORS_ML))
42
43 hbugs_client_gui.ml hbugs_client_gui.mli: hbugs_client_gui.glade
44         lablgladecc2 $< > hbugs_client_gui.ml
45         $(OCAMLC) -i hbugs_client_gui.ml > hbugs_client_gui.mli
46
47 clean: clean_mains
48 .PHONY: clean_mains
49 clean_mains:
50         rm -f $(TUTORS) $(TUTORS_OPT) broker{,.opt} client{,.opt}
51 distclean: clean
52         rm -f $(GENERATED_TUTORS_ML) hbugs_client_gui.ml{,i}
53         rm -f .tutors.ml .generated_tutors.ml
54
55 MAINS_DEPS =                            \
56         hbugs_misc.cmo                  \
57         hbugs_messages.cmo              \
58         hbugs_id_generator.cmo
59 TUTOR_DEPS = $(MAINS_DEPS)              \
60         hbugs_tutors.cmo
61 BROKER_DEPS = $(MAINS_DEPS)             \
62         hbugs_broker_registry.cmo
63 CLIENT_DEPS = $(MAINS_DEPS)             \
64         hbugs_client_gui.cmo            \
65         hbugs_common.cmo                \
66         hbugs_client.cmo
67 TUTOR_DEPS_OPT = $(patsubst %.cmo, %.cmx, $(TUTOR_DEPS))
68 BROKER_DEPS_OPT = $(patsubst %.cmo, %.cmx, $(BROKER_DEPS))
69 CLIENT_DEPS_OPT = $(patsubst %.cmo, %.cmx, $(CLIENT_DEPS))
70 $(GENERATED_TUTORS_ML): scripts/build_tutors.ml data/tutors_index.xml data/hbugs_tutor.TPL.ml
71         scripts/build_tutors.ml
72 hbugs_tutors.cmo: hbugs_tutors.cmi
73 hbugs_broker_registry.cmo: hbugs_broker_registry.cmi
74 .PHONY: daemons
75 daemons: tutors broker
76 .PHONY: tutors
77 tutors: all $(TUTORS)
78 %_tutor: $(TUTOR_DEPS) %_tutor.ml
79         $(OCAMLC) -linkpkg -o $@ $^
80 %_tutor.opt: $(TUTOR_DEPS_OPT) %_tutor.ml
81         $(OCAMLOPT) -linkpkg -o $@ $^
82 broker: $(BROKER_DEPS) broker.ml
83         $(OCAMLC) -linkpkg -o $@ $^
84 broker.opt: $(BROKER_DEPS_OPT) broker.ml
85         $(OCAMLOPT) -linkpkg -o $@ $^
86 client: $(CLIENT_DEPS) client.ml
87         $(OCAMLC) -linkpkg -o $@ $^
88 client.opt: $(CLIENT_DEPS_OPT) client.ml
89         $(OCAMLOPT) -linkpkg -o $@ $^
90
91 .PHONY: start stop
92 start:
93         scripts/brokerctl.sh start
94         scripts/sabba.sh start
95 stop:
96         scripts/brokerctl.sh stop
97         scripts/sabba.sh stop
98