[make] fix issue that breaks build incrementality

Summary:
The issue was as follows:
- ppx.exe depended on all the ocaml source files
- ppx.exe is an implicit prerequisit of all the (non-automatically-generated) build objects in jbuilder
- as a result, when modifying a source file, we would recompile ppx.exe, thus all the source files

ppx.exe only needs to depend on all the generated source files, so that
jbuilder can find them all.

Reviewed By: jberdine

Differential Revision: D5621007

fbshipit-source-id: 92c5b9c
master
Jules Villard 7 years ago committed by Facebook Github Bot
parent 17cc5ec7be
commit 888ca46371

@ -102,18 +102,21 @@ ifeq ($(TEST),1)
INFER_CONFIG_TARGETS += $(INFER_BUILD_DIR)/$(INFERUNIT_MAIN).exe
endif
OCAML_SOURCES = \
$(wildcard */[a-zA-Z]*.ml */[a-zA-Z]*.ml[ily]) \
OCAML_GENERATED_SOURCES = \
base/Version.ml $(STACKTREE_ATDGEN_STUBS) $(INFERPRINT_ATDGEN_STUBS)
ifeq ($(BUILD_C_ANALYZERS),yes)
OCAML_SOURCES += $(CLANG_ATDGEN_STUBS) $(CLANG_PLUGIN_MIRRORED_FILES)
OCAML_GENERATED_SOURCES += $(CLANG_ATDGEN_STUBS) $(CLANG_PLUGIN_MIRRORED_FILES)
endif
OCAML_SOURCES = \
$(wildcard */[a-zA-Z]*.ml */[a-zA-Z]*.ml[ily]) \
$(OCAML_GENERATED_SOURCES)
.PHONY: all
all: infer
$(INFER_BUILD_DIR)/.ppx/ppx_compare/ppx.exe: jbuild jbuild-workspace $(OCAML_SOURCES)
$(INFER_BUILD_DIR)/.ppx/ppx_compare/ppx.exe: jbuild jbuild-workspace $(OCAML_GENERATED_SOURCES)
# some voodoo to make jbuilder tolerate being run in parallel: force jbuilder to build its
# jbuild files and some files that have been seen to race otherwise
jbuilder build \

Loading…
Cancel
Save