# 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 $(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@ clang: clang_plugin endif buck_test: $(INFER_ANALYZERS) NO_BUCKD=1 buck clean NO_BUCKD=1 buck test $(TARGETS_TO_TEST) buck_test_xml: $(INFER_ANALYZERS) NO_BUCKD=1 buck clean NO_BUCKD=1 buck test --xml test.xml $(TARGETS_TO_TEST) build_integration_tests: $(INFER_ANALYZERS) ./scripts/build_integration_tests.py test: buck_test test_xml: buck_test_xml ifeq (@BUILD_JAVA_ANALYZERS@,yes) test: build_integration_tests test_xml: build_integration_tests endif clean: @rm -fv test.xml ifneq (@BUILD_C_ANALYZERS@,yes) $(MAKE) -C $(FCP_DIR) clean $(MAKE) -C $(FCP_DIR)/clang-ocaml clean endif $(MAKE) -C $(INFER_DIR) clean .PHONY: all build_integration_tests clean clang clang_plugin clang_setup java test test_xml