# Warning: the modules must be in compilation order
-MODULES = xml urimanager getter pxp cic cic_annotations cic_annotations_cache \
- cic_cache cic_proof_checking cic_textual_parser cic_unification
+MODULES = \
+ xml \
+ pxp \
+ registry \
+ utf8_macros \
+ thread \
+ xmldiff \
+ urimanager \
+ logger \
+ getter \
+ cic \
+ cic_annotations \
+ cic_proof_checking \
+ cic_unification \
+ cic_omdoc \
+ metadata \
+ tactics \
+ cic_transformations \
+ cic_textual_parser2 \
+ mathql \
+ mathql_interpreter \
+ mathql_generator \
+ hbugs
OCAMLFIND_DEST_DIR = @OCAMLFIND_DEST_DIR@
OCAMLFIND_META_DIR = @OCAMLFIND_META_DIR@
-METAS = $(MODULES:%=META.helm-%)
+METAS = $(MODULES:%=METAS/META.helm-%)
CWD=`pwd`
-all: $(METAS) $(MODULES:%=%.all)
-opt: $(METAS) $(MODULES:%=%.opt)
+all: metas $(MODULES:%=%.all)
+opt: metas $(MODULES:%=%.opt)
+world: all opt
+metas: $(METAS)
depend: $(MODULES:%=%.depend)
install: $(MODULES:%=%.install)
uninstall: $(MODULES:%=%.uninstall)
clean: $(MODULES:%=%.clean)
+clean_metas:
rm -f $(METAS)
-
-dist-clean: clean
+distclean: clean clean_metas
rm -f Makefile Makefile.common configure config.log config.cache config.status
+.PHONY: all opt world metas depend install uninstall clean clean_metas distclean
+
$(MODULES:%=%.all):
export OCAMLPATH=$(CWD):$$OCAMLPATH ; cd $(@:%.all=%) && make all
$(MODULES:%=%.opt):
$(MODULES:%=%.install):
cd $(@:%.install=%) && make install
export TARGET=$(OCAMLFIND_META_DIR)/$(@:%.install=META.helm-%) ; \
- cp $(@:%.install=META.helm-%.src) $$TARGET && \
+ cp METAS/$(@:%.install=meta.helm-%.src) $$TARGET && \
echo "directory=\"$(OCAMLFIND_DEST_DIR)/$(@:%.install=%)\"" >> $$TARGET
$(MODULES:%=%.uninstall):
cd $(@:%.uninstall=%) && make uninstall
rm -f $(OCAMLFIND_META_DIR)/$(@:%.uninstall=META.helm-%)
$(MODULES:%=%.clean):
cd $(@:%.clean=%) && make clean
-META.helm-%: META.helm-%.src
- cp $< $@ && echo "directory=\"$(CWD)/$(@:META.helm-%=%)\"" >> $@
+METAS/META.helm-%: METAS/meta.helm-%.src
+ cp $< $@ && echo "directory=\"$(CWD)/$*\"" >> $@
+
+.PHONY: .dep.dot
+.dep.dot:
+ echo "digraph G {" > $@
+ echo " rankdir = TB ;" >> $@
+ for i in $(MODULES); do $(OCAMLFIND) query helm-$$i -recursive -p-format | grep helm | sed "s/^helm-/ \"$$i\" -> \"/g" | sed "s/$$/\";/g" >> $@ ; done
+ mv $@ $@.old ; ./simplify_deps/simplify_deps.opt < $@.old > $@ ; rm $@.old
+ echo "}" >> $@
+
+.PHONY: .alldep.dot
+.alldep.dot:
+ echo "digraph G {" > $@
+ echo " rankdir = TB ;" >> $@
+ for i in $(MODULES); do $(OCAMLFIND) query helm-$$i -recursive -p-format | grep -v "pxp-" | sed "s/^pxp/pxp[-*]/g" | sed "s/^/ \"helm-$$i\" -> \"/g" | sed "s/$$/\";/g" >> $@ ; done
+ mv $@ $@.old ; ./simplify_deps/simplify_deps.opt < $@.old > $@ ; rm $@.old
+ for i in $(MODULES); do echo "\"helm-$$i\" [shape=box,style=filled,fillcolor=yellow];" >> $@ ; done
+ echo "}" >> $@
+
+libraries.ps: .dep.dot
+ dot -Tps -o $@ $<
+
+libraries-complete.ps: .alldep.dot
+ dot -Tps -o $@ $<
+
+tags: TAGS
+.PHONY: TAGS
+TAGS:
+ otags -vi -r .
+