]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/ocaml/Makefile.common.in
added generation of KLOCs in dot diagrams
[helm.git] / helm / ocaml / Makefile.common.in
index ef569ff80cf8a9121c30364bdfc933d38111df7e..9dff7894208c365a65473fd681eab2bbebf6cd3c 100644 (file)
@@ -104,6 +104,16 @@ ocamlinit:
        for p in $(REQUIRES); do echo "#require \"$$p\";;" >> .ocamlinit; done
        echo "#load \"$(PACKAGE).cma\";;" >> .ocamlinit
 
+# $(STATS_EXCLUDE) may be defined in libraries' Makefile to exclude some file
+# from statistics collection
+STATS_FILES = \
+       $(shell find . -maxdepth 1 -type f -name \*.ml $(foreach f,$(STATS_EXCLUDE),-not -name $(f))) \
+       $(shell find . -maxdepth 1 -type f -name \*.mli $(foreach f,$(STATS_EXCLUDE),-not -name $(f)))
+.stats: $(STATS_FILES)
+       rm -f .stats
+       echo -n "LOC:" >> .stats
+       wc -l $(STATS_FILES) | tail -1 | awk '{ print $$1 }' >> .stats
+
 .PHONY: all opt world backup depend install uninstall clean ocamlinit
 
 ifneq ($(MAKECMDGOALS), depend)