From e572bbe2b6839993532f828d03f5d4a82f3115aa Mon Sep 17 00:00:00 2001 From: Jules Villard Date: Tue, 5 Feb 2019 05:05:15 -0800 Subject: [PATCH] [make] do not call external build systems to clean Summary: `make clean` would fail calling `xcodebuild` to clean. It also calls `ant clean`. Instead, do the cleaning ourselves by deleting the appropriate stuff so that it's faster and more reliable. Also clean the OCaml build before cleaning the tests as that's what more important most of the time. Also don't delete the man pages as part of `make clean` as they are checked in. Also fix ant's Makefile so that the build points at the right .class files (the path to the .class files was wrong so `make -C infer/tests/build_systems/ant` would start `ant` for *each* file instead of once). Reviewed By: martintrojer Differential Revision: D13956218 fbshipit-source-id: bce27fe11 --- Makefile | 4 ++-- infer/tests/build_systems/ant/Makefile | 6 ++++-- infer/tests/build_systems/xcodebuild/Makefile | 4 +--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index 82bd82ee7..282211992 100644 --- a/Makefile +++ b/Makefile @@ -651,7 +651,7 @@ endif $(MAKE) -C $(DEPENDENCIES_DIR)/ocamldot clean) .PHONY: clean -clean: test_clean ocaml_clean +clean: ocaml_clean test_clean ifeq ($(BUILD_C_ANALYZERS),yes) $(QUIET)$(call silent_on_success,Cleaning facebook-clang-plugins C++ build,\ $(MAKE) -C $(FCP_DIR) clean) @@ -667,7 +667,7 @@ endif $(QUIET)$(call silent_on_success,Removing *.o and *.o.sh,\ find $(INFER_DIR)/tests \( -name '*.o' -o -name '*.o.sh' \) -delete) $(QUIET)$(call silent_on_success,Removing build logs,\ - $(REMOVE_DIR) _build_logs $(MAN_DIR)) + $(REMOVE_DIR) _build_logs) .PHONY: conf-clean conf-clean: clean diff --git a/infer/tests/build_systems/ant/Makefile b/infer/tests/build_systems/ant/Makefile index f6b5e43c7..389a74492 100644 --- a/infer/tests/build_systems/ant/Makefile +++ b/infer/tests/build_systems/ant/Makefile @@ -6,7 +6,9 @@ TESTS_DIR = ../.. SOURCES = $(wildcard src/infer/*.java) -OBJECTS = $(patsubst %.java,ant_out/%.class,$(SOURCES)) +OBJECTS = $(patsubst %,ant_out/codetoanalyze/java/infer/%,$(notdir $(patsubst %.java,%.class,$(SOURCES)))) +CLASS_FILES = $(notdir $(patsubst %.java,%.class,$(SOURCES))) +OBJECTS = $(CLASS_FILES:%=ant_out/codetoanalyze/java/infer/%) INFERPRINT_OPTIONS = --issues-tests include $(TESTS_DIR)/java.make @@ -20,4 +22,4 @@ infer-out/report.json: $(JAVA_DEPS) $(SOURCES) $(INFER_BIN) --project-root $(TESTS_DIR) -- $(ANT)) clean: - $(ANT) clean + $(REMOVE_DIR) ant_out diff --git a/infer/tests/build_systems/xcodebuild/Makefile b/infer/tests/build_systems/xcodebuild/Makefile index cbb23d0af..98a11393c 100644 --- a/infer/tests/build_systems/xcodebuild/Makefile +++ b/infer/tests/build_systems/xcodebuild/Makefile @@ -27,6 +27,4 @@ infer-out/report.json: $(CLANG_DEPS) $(SOURCES) --results-dir $(CURDIR)/$(@D) -- $(XCODEBUILD)) clean: - cd $(APP_DIR) && \ - $(XCODEBUILD) clean - $(REMOVE_DIR) infer-out issues.exp.test + $(REMOVE_DIR) infer-out issues.exp.test $(APP_DIR)/app_built $(APP_DIR)/build