]> matita.cs.unibo.it Git - helm.git/blob - ocaml/hbugs/Makefile
made executable again
[helm.git] / ocaml / 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 REQUIRES =      \
16         pcre lablgtk2.glade     \
17         helm-thread helm-xml helm-pxp helm-tactics
18
19 IMPLEMENTATION_FILES =                  \
20         hbugs_misc.ml                   \
21         hbugs_common.ml                 \
22         hbugs_id_generator.ml           \
23         hbugs_messages.ml               \
24         hbugs_client_gui.ml             \
25         hbugs_client.ml
26 INTERFACE_FILES = \
27         hbugs_types.mli \
28         $(patsubst %.ml, %.mli, $(IMPLEMENTATION_FILES))
29
30 include ../Makefile.common
31 include .tutors.ml
32 include .generated_tutors.ml
33
34 .tutors.ml:
35         echo -n "TUTORS_ML = " > $@
36         scripts/ls_tutors.ml | xargs >> $@
37 .generated_tutors.ml:
38         echo -n "GENERATED_TUTORS_ML = " > $@
39         scripts/ls_tutors.ml -auto | xargs >> $@
40
41 TUTORS = $(patsubst %.ml, %, $(TUTORS_ML))
42 TUTORS_OPT = $(patsubst %, %.opt, $(TUTORS))
43 GENERATED_TUTORS = $(patsubst %.ml, %, $(GENERATED_TUTORS_ML))
44
45 hbugs_client_gui.ml hbugs_client_gui.mli: hbugs_client_gui.glade
46         lablgladecc2 $< > hbugs_client_gui.ml
47         $(OCAMLC) -i hbugs_client_gui.ml > hbugs_client_gui.mli
48
49 clean: clean_mains
50 .PHONY: clean_mains
51 clean_mains:
52         rm -f $(TUTORS) $(TUTORS_OPT) broker{,.opt} client{,.opt}
53 distclean: clean
54         rm -f $(GENERATED_TUTORS_ML) hbugs_client_gui.ml{,i}
55         rm -f .tutors.ml .generated_tutors.ml
56
57 MAINS_DEPS =                            \
58         hbugs_misc.cmo                  \
59         hbugs_messages.cmo              \
60         hbugs_id_generator.cmo
61 TUTOR_DEPS = $(MAINS_DEPS)              \
62         hbugs_tutors.cmo
63 BROKER_DEPS = $(MAINS_DEPS)             \
64         hbugs_broker_registry.cmo
65 CLIENT_DEPS = $(MAINS_DEPS)             \
66         hbugs_client_gui.cmo            \
67         hbugs_common.cmo                \
68         hbugs_client.cmo
69 TUTOR_DEPS_OPT = $(patsubst %.cmo, %.cmx, $(TUTOR_DEPS))
70 BROKER_DEPS_OPT = $(patsubst %.cmo, %.cmx, $(BROKER_DEPS))
71 CLIENT_DEPS_OPT = $(patsubst %.cmo, %.cmx, $(CLIENT_DEPS))
72 $(GENERATED_TUTORS_ML): scripts/build_tutors.ml data/tutors_index.xml data/hbugs_tutor.TPL.ml
73         scripts/build_tutors.ml
74 hbugs_tutors.cmo: hbugs_tutors.cmi
75 hbugs_broker_registry.cmo: hbugs_broker_registry.cmi
76 .PHONY: daemons
77 daemons: tutors broker
78 .PHONY: tutors
79 tutors: all $(TUTORS)
80 %_tutor: $(TUTOR_DEPS) %_tutor.ml
81         $(OCAMLC) -linkpkg -o $@ $^
82 %_tutor.opt: $(TUTOR_DEPS_OPT) %_tutor.ml
83         $(OCAMLOPT) -linkpkg -o $@ $^
84 broker: $(BROKER_DEPS) broker.ml
85         $(OCAMLC) -linkpkg -o $@ $^
86 broker.opt: $(BROKER_DEPS_OPT) broker.ml
87         $(OCAMLOPT) -linkpkg -o $@ $^
88 client: $(CLIENT_DEPS) client.ml
89         $(OCAMLC) -linkpkg -o $@ $^
90 client.opt: $(CLIENT_DEPS_OPT) client.ml
91         $(OCAMLOPT) -linkpkg -o $@ $^
92
93 .PHONY: start stop
94 start:
95         scripts/brokerctl.sh start
96         scripts/sabba.sh start
97 stop:
98         scripts/brokerctl.sh stop
99         scripts/sabba.sh stop
100