[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
master
Jules Villard 6 years ago committed by Facebook Github Bot
parent e95b0282e1
commit e572bbe2b6

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

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

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

Loading…
Cancel
Save