Skip to content

Commit

Permalink
Make sure that the most of the artifacts are cleaned up by make clean
Browse files Browse the repository at this point in the history
Summary: Make sure that the most of the artifacts are cleaned up by `make clean`

Reviewed By: skcho

Differential Revision: D46187257

fbshipit-source-id: e7bf0610fd874f762cfa371dc2a195f412bd20dd
  • Loading branch information
geralt-encore authored and facebook-github-bot committed May 25, 2023
1 parent aabc135 commit d2cd6b1
Show file tree
Hide file tree
Showing 25 changed files with 32 additions and 11 deletions.
2 changes: 1 addition & 1 deletion infer/tests/build_systems/clang_compilation_db/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ TESTS_DIR = ../..
CMAKE_DIR = ../codetoanalyze/clang_compilation_database
CMAKE_BUILD_DIR = $(CMAKE_DIR)/_build_infer

CLEAN_EXTRA = $(CMAKE_BUILD_DIR)
CLEAN_EXTRA = $(CMAKE_BUILD_DIR) infer-out-with-index infer-out-no-index issues.exp.test.no-index issues.exp.test.with-index
INFER_OPTIONS = --report-custom-error --developer-mode --project-root $(CMAKE_DIR)
SOURCES = $(CMAKE_DIR)/hello.cpp
INFERPRINT_OPTIONS = --issues-tests
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ TESTS_DIR = ../..

INFER_OPTIONS = --report-custom-error --developer-mode
SOURCES = ../codetoanalyze/path\ with\ spaces/hel\ lo.c
CLEAN_EXTRA = compile_commands.json
CLEAN_EXTRA = compile_commands.json *.o
INFERPRINT_OPTIONS = --issues-tests

include $(TESTS_DIR)/infer.make
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ INFER_OPTIONS = --report-custom-error --developer-mode
SOURCES = \
../codetoanalyze/hello.c ../codetoanalyze/hello2.c ../codetoanalyze/hello3.c \
../codetoanalyze/path\ with\ spaces/hel\ lo.c ../codetoanalyze/path\ with\ spaces/hel\ lo2.c
CLEAN_EXTRA = compile_commands.json ../codetoanalyze/path\ with\ spaces
CLEAN_EXTRA = compile_commands.json ../codetoanalyze/path\ with\ spaces *.o
INFERPRINT_OPTIONS = --issues-tests

include $(TESTS_DIR)/infer.make
Expand Down
2 changes: 1 addition & 1 deletion infer/tests/build_systems/cmake/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ CMAKE_DIR = ../codetoanalyze/cmake
CMAKE_BUILD_DIR = $(CMAKE_DIR)/_build
CMAKE_ANALYZE_DIR = $(CMAKE_DIR)/_build_infer

CLEAN_EXTRA = $(CMAKE_BUILD_DIR) $(CMAKE_ANALYZE_DIR)
CLEAN_EXTRA = $(CMAKE_BUILD_DIR) $(CMAKE_ANALYZE_DIR) $(CMAKE_DIR)/infer-out
INFER_OPTIONS = --project-root $(TESTS_DIR)
SOURCES = $(CMAKE_DIR)/hello.c
INFERPRINT_OPTIONS = --issues-tests
Expand Down
2 changes: 1 addition & 1 deletion infer/tests/build_systems/disjunctive_domain/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,4 @@ replace: disjunctive.exp.test

.PHONY: clean
clean:
$(QUIET)$(REMOVE) disjunctive.exp.test $(SRC:.c=.o)
$(QUIET)$(REMOVE_DIR) infer-out disjunctive.exp.test $(SRC:.c=.o)
3 changes: 2 additions & 1 deletion infer/tests/build_systems/fail_on_issue/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ INFER_OPTIONS = --project-root $(CODETOANALYZE_DIR) --fail-on-issue
INFERPRINT_OPTIONS = --issues-tests

SOURCES = $(CODETOANALYZE_DIR)/hello.c
CLEAN_EXTRA = $(SOURCES:$(CODETOANALYZE_DIR)/%.c=%.o)

default: test

Expand All @@ -36,4 +37,4 @@ replace: issues.exp.test

.PHONY: clean
clean:
rm -rf issues.exp.test infer-out
rm -rf issues.exp.test infer-out $(CLEAN_EXTRA)
3 changes: 2 additions & 1 deletion infer/tests/build_systems/infer-debug/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ INFER_OPTIONS = --project-root $(CODETOANALYZE_DIR)
INFERPRINT_OPTIONS = --issues-tests

SOURCES = $(CODETOANALYZE_DIR)/hello.c
CLEAN_EXTRA = $(SOURCES:$(CODETOANALYZE_DIR)/%.c=%.o)

default: test

Expand Down Expand Up @@ -50,4 +51,4 @@ replace: output.exp.test

.PHONY: clean
clean:
rm -rf output.exp.test infer-out
rm -rf output.exp.test infer-out $(CLEAN_EXTRA)
1 change: 1 addition & 0 deletions infer/tests/build_systems/make/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ CLANG_OPTIONS = -c
INFERPRINT_OPTIONS = --issues-tests

SOURCES = $(wildcard ../codetoanalyze/make/*.c)
CLEAN_EXTRA = hello

include $(TESTS_DIR)/clang.make

Expand Down
2 changes: 2 additions & 0 deletions infer/tests/build_systems/mvn/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ SOURCES = $(shell find $(MVN_ROOT) -type f -name '*.java' -o -name 'pom.xml')

CLEAN_EXTRA = \
$(MVN_DIRS:%=../codetoanalyze/mvn/%/target) \
$(MVN_DIRS:%=../codetoanalyze/mvn/%/module1/target) \
$(MVN_DIRS:%=../codetoanalyze/mvn/%/module2parent/module2/target) \
$(MVN_DIRS:%=../codetoanalyze/mvn/%/com) \
$(MVN_DIRS:%=infer-out-%) \
$(MVN_DIRS:%=issues-%.exp.test)
Expand Down
2 changes: 1 addition & 1 deletion infer/tests/build_systems/ndk_build/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ TESTS_DIR = ../..
PROJECT_ROOT = ../codetoanalyze/ndk-build/hello_app
SOURCES = $(PROJECT_ROOT)/hello.c
INFERPRINT_OPTIONS = --issues-tests
CLEAN_EXTRA = $(PROJECT_ROOT)/libs $(PROJECT_ROOT)/obj
CLEAN_EXTRA = $(PROJECT_ROOT)/libs $(PROJECT_ROOT)/obj $(PROJECT_ROOT)/hello.o
NDKROOT = $(dir $(NDKBUILD))
NDKTOOLCHAIN = $(NDKROOT)/toolchains/llvm/prebuilt/linux-x86_64

Expand Down
1 change: 1 addition & 0 deletions infer/tests/build_systems/objc_getters_setters/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ SOURCES = $(CODETOANALYZE_DIR)/A.m $(CODETOANALYZE_DIR)/B.m
CLANG_OPTIONS = -c $(OBJC_CLANG_OPTIONS)
INFER_OPTIONS = --biabduction-only --report-custom-error --developer-mode --project-root $(TESTS_DIR)
INFERPRINT_OPTIONS = --project-root $(TESTS_DIR) --issues-tests
CLEAN_EXTRA = $(SOURCES:$(CODETOANALYZE_DIR)/%.m=%.o)

include $(TESTS_DIR)/infer.make
include $(TESTS_DIR)/objc.make
Expand Down
1 change: 1 addition & 0 deletions infer/tests/build_systems/objc_missing_fld/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ SOURCES = $(CODETOANALYZE_DIR)/A.m $(CODETOANALYZE_DIR)/B.m
CLANG_OPTIONS = -c $(OBJC_CLANG_OPTIONS)
INFER_OPTIONS = -j 1 --biabduction-only --report-custom-error --developer-mode --project-root $(TESTS_DIR)
INFERPRINT_OPTIONS = --project-root $(TESTS_DIR) --issues-tests
CLEAN_EXTRA = $(SOURCES:$(CODETOANALYZE_DIR)/%.m=%.o)

include $(TESTS_DIR)/infer.make
include $(TESTS_DIR)/objc.make
Expand Down
1 change: 1 addition & 0 deletions infer/tests/build_systems/objc_retain_cycles/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ SOURCES = $(CODETOANALYZE_DIR)/View.m $(CODETOANALYZE_DIR)/ViewController.m $(CO
CLANG_OPTIONS = -c $(OBJC_CLANG_OPTIONS)
INFER_OPTIONS = --biabduction-only --report-custom-error --developer-mode --project-root $(TESTS_DIR)
INFERPRINT_OPTIONS = --project-root $(TESTS_DIR) --issues-tests
CLEAN_EXTRA = $(SOURCES:$(CODETOANALYZE_DIR)/%.m=%.o)

include $(TESTS_DIR)/infer.make
include $(TESTS_DIR)/objc.make
Expand Down
1 change: 1 addition & 0 deletions infer/tests/build_systems/objc_retain_cycles_weak/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ SOURCES = $(CODETOANALYZE_DIR)/TimeSpent.m $(CODETOANALYZE_DIR)/AnalyticsTimeSpe
CLANG_OPTIONS = -c $(OBJC_CLANG_OPTIONS) -fobjc-arc
INFER_OPTIONS = --biabduction-only --report-custom-error --developer-mode --project-root $(TESTS_DIR)
INFERPRINT_OPTIONS = --project-root $(TESTS_DIR) --issues-tests
CLEAN_EXTRA = $(SOURCES:$(CODETOANALYZE_DIR)/%.m=%.o)

include $(TESTS_DIR)/infer.make
include $(TESTS_DIR)/objc.make
Expand Down
1 change: 1 addition & 0 deletions infer/tests/build_systems/tracebugs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ TESTS_DIR = ../..
include $(TESTS_DIR)/base.make

SOURCES = ../codetoanalyze/hello.c
CLEAN_EXTRA = hello.o

default: print

Expand Down
1 change: 1 addition & 0 deletions infer/tests/clang-arc-no-arc.make
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
ROOT_DIR = $(TESTS_DIR)/../..

CLEAN_EXTRA += duplicates.txt
CLEAN_EXTRA += $(foreach source,$(filter %.c %.cpp %.m %.mm,$(SOURCES)),$(basename $(source)).o)

include $(TESTS_DIR)/infer.make
include $(TESTS_DIR)/clang-base.make
Expand Down
1 change: 1 addition & 0 deletions infer/tests/clang-c-cpp.make
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ SOURCES = $(SOURCES_C) $(SOURCES_CPP)
ROOT_DIR = $(TESTS_DIR)/../..

CLEAN_EXTRA += duplicates.txt
CLEAN_EXTRA += $(foreach source,$(filter %.c %.cpp %.m %.mm,$(SOURCES)),$(basename $(source)).o)

include $(TESTS_DIR)/infer.make
include $(TESTS_DIR)/clang-base.make
Expand Down
2 changes: 2 additions & 0 deletions infer/tests/clang-frontend.make
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.

CLEAN_EXTRA = $(foreach source,$(SOURCES),$(basename $(notdir $(source))).o)

include $(TESTS_DIR)/base.make
include $(TESTS_DIR)/clang-base.make

Expand Down
1 change: 1 addition & 0 deletions infer/tests/clang.make
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
ROOT_DIR = $(TESTS_DIR)/../..

CLEAN_EXTRA += duplicates.txt
CLEAN_EXTRA += $(foreach source,$(filter %.c %.cpp %.m %.mm,$(SOURCES)),$(basename $(source)).o)

include $(TESTS_DIR)/infer.make
include $(TESTS_DIR)/clang-base.make
Expand Down
2 changes: 1 addition & 1 deletion infer/tests/codetoanalyze/java/dependencies/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ TESTS_DIR = ../../..
INFER_OPTIONS = --dependencies
INFERPRINT_OPTIONS = --issues-tests-fields "file,procedure,line_offset,bug_type,bucket,severity,bug_trace" --issues-tests
SOURCES = my/Application.java
CLEAN_EXTRA += $(wildcard my/*.class)
CLEAN_EXTRA += $(wildcard my/*.class) $(wildcard lib/*.class)

include $(TESTS_DIR)/infer.make

Expand Down
2 changes: 1 addition & 1 deletion infer/tests/codetoanalyze/sil/java-and-doli/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ replace: issues.exp.test

clean:
$(REMOVE) issues.exp.test
$(REMOVE_DIR) infer-out
$(REMOVE_DIR) infer-out codetoanalyze
2 changes: 1 addition & 1 deletion infer/tests/codetoanalyze/sil/sil-and-doli/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,4 @@ replace: issues.exp.test
cp $< issues.exp

clean:
$(QUIET)$(REMOVE) issues.exp.test
$(QUIET)$(REMOVE_DIR) infer-out issues.exp.test
2 changes: 2 additions & 0 deletions infer/tests/javac.make
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
include $(TESTS_DIR)/java.make
include $(TESTS_DIR)/infer.make

CLEAN_EXTRA = *.class META-INF

PROJECT_ROOT ?= $(TESTS_DIR)

JAVAC_FLAGS = -g -source 8 -target 8
Expand Down
2 changes: 2 additions & 0 deletions infer/tests/kotlinc.make
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
include $(TESTS_DIR)/infer.make
include $(TESTS_DIR)/java.make

CLEAN_EXTRA = *.class META-INF

KOTLINC_FLAGS = -nowarn

infer-out$(TEST_SUFFIX)/report.json: $(SOURCES) $(MAKEFILE_LIST)
Expand Down
2 changes: 2 additions & 0 deletions infer/tests/kotlinc_with_java.make
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
include $(TESTS_DIR)/infer.make
include $(TESTS_DIR)/java.make

CLEAN_EXTRA = *.class META-INF

PROJECT_ROOT ?= $(TESTS_DIR)

JAVAC_FLAGS = -g -source 8 -target 8
Expand Down

0 comments on commit d2cd6b1

Please sign in to comment.