Add make target for module dependency graph

Summary:public
This extends infer/src/Makefile with a mod_dep.dot target that builds a
dot graph of module dependencies.

This also adds ocamldot, which is in the public domain and available
from http://trevorjim.com/projects/ocamldot/ocamldot.tar .

Reviewed By: cristianoc

Differential Revision: D3168488

fb-gh-sync-id: 267fb0e
fbshipit-source-id: 267fb0e
master
Josh Berdine 9 years ago committed by Facebook Github Bot 3
parent ad3e32d935
commit 7a5cc8f42c

3
.gitignore vendored

@ -123,3 +123,6 @@ buck-out/
/infer/annotations/processor_classes/
/infer/lib/java/processor.jar
infer/src/.project
/dependencies/ocamldot/ocamldot
/dependencies/ocamldot/ocamldot.ml
/infer/src/mod_dep.dot

@ -150,6 +150,7 @@ test:
$(MAKE) -C $(INFER_DIR) $(INFER_BIN)
$(MAKE) -C $(SRC_DIR) init
$(MAKE) -j$(NCPU) test_build
$(MAKE) -C $(SRC_DIR) mod_dep.dot
$(MAKE) ocaml_unit_test buck_test inferTraceBugs_test
test_xml: buck_test_xml

@ -192,6 +192,19 @@ test_build: init $(INFERPRINT_ATDGEN_STUBS) $(CLANG_ATDGEN_STUBS) $(INFER_CLANG_
$(INFERUNIT_MAIN).byte \
$(CHECKCOPYRIGHT_MAIN).byte
$(DEPENDENCIES_DIR)/ocamldot/ocamldot:
$(MAKE) -C $(DEPENDENCIES_DIR)/ocamldot
roots:=Inferanalyze CMain JMain Inferprint
src_dirs:=$(shell find * -type d)
src_files:=$(shell find $(src_dirs) -regex '.*\.ml\(i\)*' -not -path facebook/scripts/eradicate_stats.ml)
inc_flags:=$(foreach dir,$(src_dirs),-I $(dir))
root_flags:=$(foreach root,$(roots),-r $(root))
mod_dep.dot: $(DEPENDENCIES_DIR)/ocamldot/ocamldot $(src_files)
ocamldep.opt $(inc_flags) $(src_files) \
| $(DEPENDENCIES_DIR)/ocamldot/ocamldot -lr $(root_flags) \
> mod_dep.dot
ifeq (@ENABLE_OCAML_ANNOT@,yes)
java_annotations: build_java
rsync -a --include '*/' --include '*.annot' --exclude '*' $(JAVA_BUILD_DIR)/ $(ANNOT_DIR)/
@ -312,3 +325,4 @@ endif
$(REMOVE) $(INFERANALYZE_BIN) $(INFERPRINT_BIN) $(CHECKCOPYRIGHT_BIN)
$(REMOVE) $(CLANG_ATDGEN_STUBS)
$(REMOVE) $(INFER_CLANG_FCP_MIRRORED_FILES)
$(REMOVE) mod_dep.dot

Loading…
Cancel
Save