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
7 # start -> starts up broker and tutors
8 # stop -> stop broker and tutors
10 # broker -> builds broker executable
11 # tutors -> builds tutors executables
12 # client -> builds hbugs client
16 IMPLEMENTATION_FILES = \
19 hbugs_id_generator.ml \
25 $(patsubst %.ml, %.mli, $(IMPLEMENTATION_FILES))
27 include ../Makefile.common
29 include .generated_tutors.ml
32 echo -n "TUTORS_ML = " > $@
33 scripts/ls_tutors.ml | xargs >> $@
35 echo -n "GENERATED_TUTORS_ML = " > $@
36 scripts/ls_tutors.ml -auto | xargs >> $@
38 TUTORS = $(patsubst %.ml, %, $(TUTORS_ML))
39 TUTORS_OPT = $(patsubst %, %.opt, $(TUTORS))
40 GENERATED_TUTORS = $(patsubst %.ml, %, $(GENERATED_TUTORS_ML))
42 hbugs_client_gui.ml hbugs_client_gui.mli: hbugs_client_gui.glade
43 lablgladecc2 $< > hbugs_client_gui.ml
44 $(OCAMLC) -i hbugs_client_gui.ml > hbugs_client_gui.mli
49 rm -f $(TUTORS) $(TUTORS_OPT) broker{,.opt} client{,.opt}
51 rm -f $(GENERATED_TUTORS_ML) hbugs_client_gui.ml{,i}
52 rm -f .tutors.ml .generated_tutors.ml
57 hbugs_id_generator.cmo
58 TUTOR_DEPS = $(MAINS_DEPS) \
60 BROKER_DEPS = $(MAINS_DEPS) \
61 hbugs_broker_registry.cmo
62 CLIENT_DEPS = $(MAINS_DEPS) \
63 hbugs_client_gui.cmo \
66 TUTOR_DEPS_OPT = $(patsubst %.cmo, %.cmx, $(TUTOR_DEPS))
67 BROKER_DEPS_OPT = $(patsubst %.cmo, %.cmx, $(BROKER_DEPS))
68 CLIENT_DEPS_OPT = $(patsubst %.cmo, %.cmx, $(CLIENT_DEPS))
69 $(GENERATED_TUTORS_ML): scripts/build_tutors.ml data/tutors_index.xml data/hbugs_tutor.TPL.ml
70 scripts/build_tutors.ml
71 hbugs_tutors.cmo: hbugs_tutors.cmi
72 hbugs_broker_registry.cmo: hbugs_broker_registry.cmi
74 daemons: tutors broker
77 %_tutor: $(TUTOR_DEPS) %_tutor.ml
78 $(OCAMLC) -linkpkg -o $@ $^
79 %_tutor.opt: $(TUTOR_DEPS_OPT) %_tutor.ml
80 $(OCAMLOPT) -linkpkg -o $@ $^
81 broker: $(BROKER_DEPS) broker.ml
82 $(OCAMLC) -linkpkg -o $@ $^
83 broker.opt: $(BROKER_DEPS_OPT) broker.ml
84 $(OCAMLOPT) -linkpkg -o $@ $^
85 client: $(CLIENT_DEPS) client.ml
86 $(OCAMLC) -linkpkg -o $@ $^
87 client.opt: $(CLIENT_DEPS_OPT) client.ml
88 $(OCAMLOPT) -linkpkg -o $@ $^
92 scripts/brokerctl.sh start
93 scripts/sabba.sh start
95 scripts/brokerctl.sh stop