|
|
|
# Copyright (c) 2015 - present Facebook, Inc.
|
|
|
|
# All rights reserved.
|
|
|
|
#
|
|
|
|
# This source code is licensed under the BSD style license found in the
|
|
|
|
# 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.
|
|
|
|
|
|
|
|
@SET_MAKE@
|
|
|
|
ROOT_DIR = .
|
|
|
|
include $(ROOT_DIR)/Makefile.config
|
|
|
|
|
|
|
|
TARGETS_TO_TEST=
|
|
|
|
ifeq (@BUILD_C_ANALYZERS@,yes)
|
|
|
|
TARGETS_TO_TEST += c cpp
|
|
|
|
endif
|
|
|
|
ifeq (@BUILD_JAVA_ANALYZERS@,yes)
|
|
|
|
TARGETS_TO_TEST += java
|
|
|
|
endif
|
|
|
|
ifneq (@XCODE_SELECT@,no)
|
|
|
|
TARGETS_TO_TEST += objc
|
|
|
|
endif
|
|
|
|
TARGETS_TO_TEST := $(shell echo $(TARGETS_TO_TEST))
|
|
|
|
|
|
|
|
all: $(INFER_ANALYZERS)
|
|
|
|
|
|
|
|
java:
|
|
|
|
ifneq (@BUILD_JAVA_ANALYZERS@,yes)
|
|
|
|
@echo
|
|
|
|
@echo " error: java analyzers disabled by ./configure"
|
|
|
|
@echo " to enable them again, see"
|
|
|
|
@echo
|
|
|
|
@echo " ./configure --help"
|
|
|
|
@echo
|
|
|
|
@exit 1
|
|
|
|
else
|
|
|
|
$(MAKE) -C $(INFER_DIR) java
|
|
|
|
endif
|
|
|
|
|
|
|
|
clang:
|
|
|
|
ifneq (@BUILD_C_ANALYZERS@,yes)
|
|
|
|
@echo
|
|
|
|
@echo " error: clang analyzers disabled by ./configure"
|
|
|
|
@echo " to enable them again, see"
|
|
|
|
@echo
|
|
|
|
@echo " ./configure --help"
|
|
|
|
@echo
|
|
|
|
@exit 1
|
|
|
|
else
|
|
|
|
$(MAKE) -C $(INFER_DIR) clang
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq (@BUILD_C_ANALYZERS@,yes)
|
|
|
|
clang_setup:
|
|
|
|
export CC="@CC@" CFLAGS="@CFLAGS@"; \
|
|
|
|
export CXX="@CXX@" CXXFLAGS="@CXXFLAGS@"; \
|
|
|
|
export CPP="@CPP@" LDFLAGS="@LDFLAGS@" LIBS="@LIBS@"; \
|
|
|
|
$(FCP_DIR)/clang/setup.sh
|
|
|
|
|
|
|
|
clang_plugin: clang_setup
|
|
|
|
ifeq (@INFER_IS_RELEASE@,no)
|
|
|
|
$(MAKE) -C $(FCP_DIR)/libtooling all \
|
|
|
|
CC=@CC@ CXX=@CXX@ \
|
|
|
|
CXX="@CXX@" CXXFLAGS="@CXXFLAGS@" \
|
|
|
|
CPP="@CPP@" LDFLAGS="@LDFLAGS@" LIBS="@LIBS@" \
|
|
|
|
LOCAL_CLANG=@CLANG_PREFIX@/bin/clang \
|
|
|
|
CLANG_PREFIX=@CLANG_PREFIX@ \
|
|
|
|
CLANG_INCLUDES=@CLANG_INCLUDES@
|
|
|
|
$(MAKE) -C $(FCP_DIR)/clang-ocaml all \
|
|
|
|
build/clang_ast_proj.ml build/clang_ast_proj.mli \
|
|
|
|
CC=@CC@ CXX=@CXX@ \
|
|
|
|
CXX="@CXX@" CXXFLAGS="@CXXFLAGS@" \
|
|
|
|
CPP="@CPP@" LDFLAGS="@LDFLAGS@" LIBS="@LIBS@" \
|
|
|
|
LOCAL_CLANG=@CLANG_PREFIX@/bin/clang \
|
|
|
|
CLANG_PREFIX=@CLANG_PREFIX@ \
|
|
|
|
CLANG_INCLUDES=@CLANG_INCLUDES@
|
|
|
|
endif
|
|
|
|
|
|
|
|
clang: clang_plugin
|
|
|
|
endif
|
|
|
|
|
|
|
|
test_build:
|
|
|
|
$(MAKE) -C $(SRC_DIR) test_clean
|
|
|
|
$(MAKE) -C $(SRC_DIR) test_build
|
|
|
|
|
|
|
|
buck_test: $(INFER_ANALYZERS)
|
|
|
|
NO_BUCKD=1 buck clean
|
|
|
|
NO_BUCKD=1 buck test $(TARGETS_TO_TEST)
|
|
|
|
ifeq (@BUILD_JAVA_ANALYZERS@,yes)
|
|
|
|
NO_BUCKD=1 ./scripts/build_integration_tests.py
|
|
|
|
endif
|
|
|
|
|
|
|
|
buck_test_xml: $(INFER_ANALYZERS)
|
|
|
|
NO_BUCKD=1 buck clean
|
|
|
|
NO_BUCKD=1 buck test --xml test.xml $(TARGETS_TO_TEST)
|
|
|
|
ifeq (@BUILD_JAVA_ANALYZERS@,yes)
|
|
|
|
NO_BUCKD=1 ./scripts/build_integration_tests.py
|
|
|
|
endif
|
|
|
|
|
|
|
|
inferTraceBugs_test: $(INFER_ANALYZERS)
|
|
|
|
ifeq (@BUILD_JAVA_ANALYZERS@,yes)
|
|
|
|
$(PYTHON_DIR)/infer -o __test-infer-out__ -- \
|
|
|
|
javac $(EXAMPLES_DIR)/Hello.java \
|
|
|
|
> /dev/null
|
|
|
|
@rm -f Hello.class
|
|
|
|
else
|
|
|
|
$(PYTHON_DIR)/infer -o __test-infer-out__ \
|
|
|
|
-- clang -c $(EXAMPLES_DIR)/hello.c \
|
|
|
|
> /dev/null
|
|
|
|
@rm -f hello.o
|
|
|
|
endif
|
|
|
|
$(PYTHON_DIR)/inferTraceBugs -o __test-infer-out__ \
|
|
|
|
--select 0 --max-level max > /dev/null
|
|
|
|
$(PYTHON_DIR)/inferTraceBugs -o __test-infer-out__ \
|
|
|
|
--select 0 --max-level 0 > /dev/null
|
|
|
|
$(PYTHON_DIR)/inferTraceBugs -o __test-infer-out__ \
|
|
|
|
--select 0 --max-level max --no-source > /dev/null
|
|
|
|
$(PYTHON_DIR)/inferTraceBugs -o __test-infer-out__ \
|
|
|
|
--only-show > /dev/null
|
|
|
|
@rm -fr __test-infer-out__
|
|
|
|
|
|
|
|
test: buck_test inferTraceBugs_test
|
|
|
|
|
|
|
|
test_xml: buck_test_xml
|
|
|
|
|
|
|
|
clean:
|
|
|
|
@rm -fv test.xml
|
|
|
|
ifeq (@BUILD_C_ANALYZERS@,yes)
|
|
|
|
$(MAKE) -C $(FCP_DIR) clean
|
|
|
|
$(MAKE) -C $(FCP_DIR)/clang-ocaml clean
|
|
|
|
endif
|
|
|
|
$(MAKE) -C $(INFER_DIR) clean
|
|
|
|
|
|
|
|
.PHONY: all buck_test buck_test_xml build_integration_tests clean clang
|
|
|
|
.PHONY: clang_plugin clang_setup inferTraceBugs_test java
|
|
|
|
.PHONY: test test_xml test_build
|