[clang models] make sure `make` compiles all source files when we retry infer to show errors

Summary:
Before: `make clean` followed by running `infer -- make`. If infer fails, it is
rerun automatically (by the `silent_on_success` Makefile function) to show the
output to the user, but by then there is nothing to build and `make` does
nothing.

Now: run directly `infer -- make clean all`. If infer fails, the command is
rerun and rebuilds all the source files, so there is a higher chance that the
same error will be displayed to the user than the one that originally caused
the command to fail.

Reviewed By: dulmarod

Differential Revision: D4578477

fbshipit-source-id: 774f45c
master
Jules Villard 8 years ago committed by Facebook Github Bot
parent e7fc96148a
commit a328455cdc

@ -16,9 +16,8 @@ all: install
$(INFER_RESULTS): $(C_MODELS_SOURCES) $(CLANG_DEPS) $(INFER_RESULTS): $(C_MODELS_SOURCES) $(CLANG_DEPS)
# make clean in src/ in case $(CLANG_DEPS) have changed # make clean in src/ in case $(CLANG_DEPS) have changed
@$(MAKE) -C src clean
$(call silent_on_success,\ $(call silent_on_success,\
$(INFER_BIN) -o $(@D) --models-mode --no-failures-allowed -- $(MAKE) -C src) $(INFER_BIN) -o $(@D) --models-mode --no-failures-allowed -- $(MAKE) -C src clean all)
$(C_MODELS_FILE): $(INFER_RESULTS) $(C_MODELS_FILE): $(INFER_RESULTS)
@$(INSTALL_DATA) $(dir $(INFER_RESULTS))/specs/*.specs $(SPECS_LIB_DIR) @$(INSTALL_DATA) $(dir $(INFER_RESULTS))/specs/*.specs $(SPECS_LIB_DIR)

@ -17,9 +17,8 @@ all: install
$(INFER_RESULTS): $(CPP_MODELS_SOURCES) $(C_MODELS_SOURCES) $(CLANG_DEPS) $(INFER_RESULTS): $(CPP_MODELS_SOURCES) $(C_MODELS_SOURCES) $(CLANG_DEPS)
# make clean in src/ in case $(CLANG_DEPS) have changed # make clean in src/ in case $(CLANG_DEPS) have changed
@$(MAKE) -C src clean
$(call silent_on_success,\ $(call silent_on_success,\
$(INFER_BIN) -o $(@D) --models-mode --no-failures-allowed -- $(MAKE) -C src) $(INFER_BIN) -o $(@D) --models-mode --no-failures-allowed -- $(MAKE) -C src clean all)
$(CPP_MODELS_FILE): $(INFER_RESULTS) $(CPP_MODELS_FILE): $(INFER_RESULTS)
@$(INSTALL_DATA) $(dir $(INFER_RESULTS))/specs/*.specs $(SPECS_LIB_DIR) @$(INSTALL_DATA) $(dir $(INFER_RESULTS))/specs/*.specs $(SPECS_LIB_DIR)

@ -16,9 +16,8 @@ all: install
$(INFER_RESULTS): $(OBJC_MODELS_SOURCES) $(CLANG_DEPS) $(INFER_RESULTS): $(OBJC_MODELS_SOURCES) $(CLANG_DEPS)
# make clean in src/ in case $(CLANG_DEPS) have changed # make clean in src/ in case $(CLANG_DEPS) have changed
@$(MAKE) -C src clean
$(call silent_on_success,\ $(call silent_on_success,\
$(INFER_BIN) -o $(@D) --models-mode --no-failures-allowed -- $(MAKE) -C src) $(INFER_BIN) -o $(@D) --models-mode --no-failures-allowed -- $(MAKE) -C src clean all)
$(OBJC_MODELS_FILE): $(INFER_RESULTS) $(OBJC_MODELS_FILE): $(INFER_RESULTS)
@$(INSTALL_DATA) $(dir $(INFER_RESULTS))/specs/*.specs $(SPECS_LIB_DIR) @$(INSTALL_DATA) $(dir $(INFER_RESULTS))/specs/*.specs $(SPECS_LIB_DIR)

Loading…
Cancel
Save