From baff08e198f8a35a5fefee0f33cf9ee4624aa05c Mon Sep 17 00:00:00 2001 From: Jules Villard Date: Wed, 20 Jun 2018 11:18:14 -0700 Subject: [PATCH] [deadcode] introduce more dependencies Summary: We inline the .ml and the .mli together using the .cmi rule (for reasons explained in the Makefile of deadcode). This relies on the fact that rules will start from the .cmx, which in turns depends on the .cmi as the last dependency and so all the dependencies of the .cmx are satisfied by the time we hit the .cmi. But that doesn't always work. For some reason, making the .cmi depend on its .cmx works, even though it's supposed to include a circular dependency (`make` should complain but doesn't). Oh, well... Reviewed By: jeremydubreil Differential Revision: D8548032 fbshipit-source-id: 0dc9335 --- infer/src/deadcode/Makefile | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/infer/src/deadcode/Makefile b/infer/src/deadcode/Makefile index 589294dd8..70c3e397d 100644 --- a/infer/src/deadcode/Makefile +++ b/infer/src/deadcode/Makefile @@ -38,7 +38,7 @@ ml_src_files_from_mlly:=$(shell find .. -not -path "../*stubs*" -regex '\.\./[a- ml_src_files:=$(shell cd .. && find . -not -path "./*stubs*" -regex '\./[a-zA-Z].*\.mli*') -ml_src_files_without_mli:=$(shell cd .. && for i in */*.ml */*/*.ml; do [ -f $${i}i ] || echo $$i; done) +ml_src_files_without_mli:=$(shell cd .. && for i in $$(find . -not -path "./*stubs*" -regex '\./[a-zA-Z].*\.ml'); do [ -f $${i}i ] || echo $$i; done) .PHONY: depend depend: @@ -49,7 +49,7 @@ depend: -I java -I labs -I python -I quandary -I unit -I unit/clang -I deadcode \ $(ml_src_files) > deadcode/.depend -%.cmi: +%.cmi: %.cmx # deal with the .ml *and* the .mli at the same time: when all the modules are inlined in one # file, you need the module value to be defined before you can refer to it, even in # signatures. Because of this, the order given by ocamldep is not enough to avoid "Unbound @@ -110,6 +110,9 @@ $(ml_src_files_without_mli:.ml=.cmx): $(QUIET)echo "(* END OF MODULE $@ *)" >> $(ALL_INFER_IN_ONE_FILE_ML) $(QUIET)echo >> $(ALL_INFER_IN_ONE_FILE_ML) +%.cmx: + $(QUIET)echo skipping '$@' + -include .depend # Concatenate all source files of infer into a single file. Assume that all source files are