[tests] include clang.make a bit later to fix compile target

Summary:
`make` doesn't delay variable evaluation in targets' dependencies, so
`$(OBJECTS)` was always empty. Including clang.make after having defined
`OBJECTS` fixes it.

Reviewed By: jberdine

Differential Revision: D4159522

fbshipit-source-id: 6925f8a
master
Jules Villard 8 years ago committed by Facebook Github Bot
parent 83f236451d
commit ac47d115f5

@ -6,12 +6,14 @@
# of patent rights can be found in the PATENTS file in the same directory. # of patent rights can be found in the PATENTS file in the same directory.
TESTS_DIR = ../.. TESTS_DIR = ../..
include $(TESTS_DIR)/clang.make
ANALYZER = infer ANALYZER = infer
CLANG_OPTIONS = -c CLANG_OPTIONS = -c
INFER_OPTIONS = --report-custom-error --developer-mode --project-root ../codetoanalyze INFER_OPTIONS = --report-custom-error --developer-mode --project-root ../codetoanalyze
INFERPRINT_OPTIONS = --issues-tests
SOURCES = \ SOURCES = \
../codetoanalyze/example.S \ ../codetoanalyze/example.S \
../codetoanalyze/hello.c \ ../codetoanalyze/hello.c \
include $(TESTS_DIR)/clang.make

@ -6,11 +6,13 @@
# of patent rights can be found in the PATENTS file in the same directory. # of patent rights can be found in the PATENTS file in the same directory.
TESTS_DIR = ../.. TESTS_DIR = ../..
include $(TESTS_DIR)/clang.make
ANALYZER = infer ANALYZER = infer
CLANG_OPTIONS = -c CLANG_OPTIONS = -c
INFER_OPTIONS = --report-custom-error --developer-mode --project-root ../../../tests INFER_OPTIONS = --report-custom-error --developer-mode --project-root ../../../tests
INFERPRINT_OPTIONS = --issues-tests
SOURCES = \ SOURCES = \
../codetoanalyze/hello.c \ ../codetoanalyze/hello.c \
include $(TESTS_DIR)/clang.make

@ -5,7 +5,8 @@
# LICENSE file in the root directory of this source tree. An additional grant # LICENSE file in the root directory of this source tree. An additional grant
# of patent rights can be found in the PATENTS file in the same directory. # of patent rights can be found in the PATENTS file in the same directory.
INFERPRINT_OPTIONS = --issues-tests ROOT_DIR = $(TESTS_DIR)/../..
OBJECTS = $(foreach source,$(SOURCES),$(basename $(source)).o) OBJECTS = $(foreach source,$(SOURCES),$(basename $(source)).o)
include $(TESTS_DIR)/base.make include $(TESTS_DIR)/base.make
@ -15,5 +16,17 @@ infer-out/report.json: $(CLANG_DEPS) $(SOURCES)
$(INFER_BIN) --check-duplicate-symbols $(INFER_OPTIONS) -a $(ANALYZER) -- clang $(CLANG_OPTIONS) $(SOURCES) 2>duplicates.txt) $(INFER_BIN) --check-duplicate-symbols $(INFER_OPTIONS) -a $(ANALYZER) -- clang $(CLANG_OPTIONS) $(SOURCES) 2>duplicates.txt)
grep "DUPLICATE_SYMBOLS" duplicates.txt; test $$? -ne 0 grep "DUPLICATE_SYMBOLS" duplicates.txt; test $$? -ne 0
$(OBJECTS): $(SOURCES) %.o: %.c
clang $(CLANG_OPTIONS) $(SOURCES) clang $(CLANG_OPTIONS) -o $@ $<
%.o: %.cpp
clang++ $(CLANG_OPTIONS) -o $@ $<
%.o: %.m
clang $(CLANG_OPTIONS) -o $@ $<
%.o: %.mm
clang++ $(CLANG_OPTIONS) -o $@ $<
clean:
$(REMOVE) duplicates.txt

@ -6,11 +6,13 @@
# of patent rights can be found in the PATENTS file in the same directory. # of patent rights can be found in the PATENTS file in the same directory.
TESTS_DIR = ../../.. TESTS_DIR = ../../..
include $(TESTS_DIR)/clang.make
ANALYZER = infer ANALYZER = infer
CLANG_OPTIONS = -c CLANG_OPTIONS = -c
INFER_OPTIONS = --report-custom-error --developer-mode --no-filtering --debug-exceptions INFER_OPTIONS = --report-custom-error --developer-mode --no-filtering --debug-exceptions
INFERPRINT_OPTIONS = --issues-tests
SOURCES = \ SOURCES = \
$(wildcard */*.c) \ $(wildcard */*.c) \
include $(TESTS_DIR)/clang.make

@ -6,7 +6,6 @@
# of patent rights can be found in the PATENTS file in the same directory. # of patent rights can be found in the PATENTS file in the same directory.
TESTS_DIR = ../../.. TESTS_DIR = ../../..
include $(TESTS_DIR)/clang.make
ANALYZER = checkers ANALYZER = checkers
# see explanations in cpp/errors/Makefile for the custom isystem # see explanations in cpp/errors/Makefile for the custom isystem
@ -22,3 +21,5 @@ SOURCES = \
siof/pod_same_translation_unit.cpp \ siof/pod_same_translation_unit.cpp \
siof/siof_across_translation_units-1.cpp \ siof/siof_across_translation_units-1.cpp \
siof/siof_across_translation_units-2.cpp \ siof/siof_across_translation_units-2.cpp \
include $(TESTS_DIR)/clang.make

@ -7,8 +7,6 @@
* of patent rights can be found in the PATENTS file in the same directory. * of patent rights can be found in the PATENTS file in the same directory.
*/ */
#include <iostream>
int same_tu_foo(); int same_tu_foo();
int same_tu_goo(); int same_tu_goo();

@ -6,7 +6,6 @@
# of patent rights can be found in the PATENTS file in the same directory. # of patent rights can be found in the PATENTS file in the same directory.
TESTS_DIR = ../../.. TESTS_DIR = ../../..
include $(TESTS_DIR)/clang.make
ANALYZER = infer ANALYZER = infer
@ -14,6 +13,7 @@ ANALYZER = infer
# regardless of the libraries installed on the machine. # regardless of the libraries installed on the machine.
CLANG_OPTIONS = -x c++ -std=c++11 -nostdinc++ -isystem$(ROOT_DIR) -isystem$(CLANG_INCLUDES)/c++/v1/ -c CLANG_OPTIONS = -x c++ -std=c++11 -nostdinc++ -isystem$(ROOT_DIR) -isystem$(CLANG_INCLUDES)/c++/v1/ -c
INFER_OPTIONS = --cxx --ml-buckets cpp --no-filtering --debug-exceptions INFER_OPTIONS = --cxx --ml-buckets cpp --no-filtering --debug-exceptions
INFERPRINT_OPTIONS = --issues-tests
SOURCES = \ SOURCES = \
$(wildcard c_tests/*.cpp) \ $(wildcard c_tests/*.cpp) \
@ -58,3 +58,5 @@ SOURCES = \
$(wildcard smart_ptr/*.cpp) \ $(wildcard smart_ptr/*.cpp) \
$(wildcard subtyping/*.cpp) \ $(wildcard subtyping/*.cpp) \
$(wildcard vector/*.cpp) \ $(wildcard vector/*.cpp) \
include $(TESTS_DIR)/clang.make

@ -6,15 +6,15 @@
# of patent rights can be found in the PATENTS file in the same directory. # of patent rights can be found in the PATENTS file in the same directory.
TESTS_DIR = ../../.. TESTS_DIR = ../../..
include $(TESTS_DIR)/clang.make
ANALYZER = quandary ANALYZER = quandary
# see explanations in cpp/errors/Makefile for the custom isystem # see explanations in cpp/errors/Makefile for the custom isystem
CLANG_OPTIONS = -x c++ -std=c++11 -nostdinc++ -isystem$(ROOT_DIR) -isystem$(CLANG_INCLUDES)/c++/v1/ -c CLANG_OPTIONS = -x c++ -std=c++11 -nostdinc++ -isystem$(ROOT_DIR) -isystem$(CLANG_INCLUDES)/c++/v1/ -c
INFER_OPTIONS = --cxx --ml-buckets cpp --no-filtering --debug-exceptions INFER_OPTIONS = --cxx --ml-buckets cpp --no-filtering --debug-exceptions
INFERPRINT_OPTIONS = --issues-txt INFERPRINT_OPTIONS = --issues-txt
SOURCES = \ SOURCES = \
basics.cpp \ basics.cpp \
execs.cpp \ execs.cpp \
include $(TESTS_DIR)/clang.make

@ -6,7 +6,6 @@
# of patent rights can be found in the PATENTS file in the same directory. # of patent rights can be found in the PATENTS file in the same directory.
TESTS_DIR = ../../.. TESTS_DIR = ../../..
include $(TESTS_DIR)/clang.make
IPHONESIMULATOR_ISYSROOT_SUFFIX = /Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk IPHONESIMULATOR_ISYSROOT_SUFFIX = /Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk
@ -19,6 +18,7 @@ CLANG_OPTIONS = -x objective-c \
CLEAN_EXTRA = infer-out-arc infer-out-all CLEAN_EXTRA = infer-out-arc infer-out-all
INFER_OPTIONS = --cxx --check-duplicate-symbols --no-filtering --debug-exceptions INFER_OPTIONS = --cxx --check-duplicate-symbols --no-filtering --debug-exceptions
INFERPRINT_OPTIONS = --issues-tests
SOURCES_DEFAULT = \ SOURCES_DEFAULT = \
field_superclass/B.m \ field_superclass/B.m \
@ -96,6 +96,8 @@ SOURCES_ARC = \
subtyping/KindOfClassExample.m \ subtyping/KindOfClassExample.m \
variadic_methods/premature_nil_termination.m \ variadic_methods/premature_nil_termination.m \
include $(TESTS_DIR)/clang.make
OBJECTS_ARC = $(foreach source,$(SOURCES_ARC),$(basename $(source)).o) OBJECTS_ARC = $(foreach source,$(SOURCES_ARC),$(basename $(source)).o)
OBJECTS_BUCKET_ALL = $(foreach source,$(SOURCES_BUCKET_ALL),$(basename $(source)).o) OBJECTS_BUCKET_ALL = $(foreach source,$(SOURCES_BUCKET_ALL),$(basename $(source)).o)
OBJECTS_DEFAULT = $(foreach source,$(SOURCES_DEFAULT),$(basename $(source)).o) OBJECTS_DEFAULT = $(foreach source,$(SOURCES_DEFAULT),$(basename $(source)).o)

@ -6,12 +6,14 @@
# of patent rights can be found in the PATENTS file in the same directory. # of patent rights can be found in the PATENTS file in the same directory.
TESTS_DIR = ../../.. TESTS_DIR = ../../..
include $(TESTS_DIR)/clang.make
ANALYZER = linters ANALYZER = linters
CLANG_OPTIONS = -x objective-c -fobjc-arc -c CLANG_OPTIONS = -x objective-c -fobjc-arc -c
INFER_OPTIONS = --no-filtering --debug-exceptions INFER_OPTIONS = --no-filtering --debug-exceptions
INFERPRINT_OPTIONS = --issues-tests
SOURCES = \ SOURCES = \
$(wildcard *.m) \ $(wildcard *.m) \
$(wildcard */*.m) \ $(wildcard */*.m) \
include $(TESTS_DIR)/clang.make

@ -6,11 +6,13 @@
# of patent rights can be found in the PATENTS file in the same directory. # of patent rights can be found in the PATENTS file in the same directory.
TESTS_DIR = ../../.. TESTS_DIR = ../../..
include $(TESTS_DIR)/clang.make
ANALYZER = linters ANALYZER = linters
CLANG_OPTIONS = -x objective-c++ -std=c++11 -fobjc-arc -c CLANG_OPTIONS = -x objective-c++ -std=c++11 -fobjc-arc -c
INFER_OPTIONS = --no-filtering --debug-exceptions INFER_OPTIONS = --no-filtering --debug-exceptions
INFERPRINT_OPTIONS = --issues-tests
SOURCES = \ SOURCES = \
$(wildcard */*.mm) \ $(wildcard */*.mm) \
include $(TESTS_DIR)/clang.make

Loading…
Cancel
Save