[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
master
Jules Villard 7 years ago committed by Facebook Github Bot
parent 4a1379ebc5
commit baff08e198

@ -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

Loading…
Cancel
Save