|
|
|
# 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.
|
|
|
|
|
|
|
|
PLATFORM = $(shell uname)
|
|
|
|
|
|
|
|
NCPU = @NCPU@
|
|
|
|
|
|
|
|
ABSOLUTE_ROOT_DIR = $(shell cd $(ROOT_DIR) && pwd)
|
|
|
|
|
|
|
|
EXAMPLES_DIR = $(ABSOLUTE_ROOT_DIR)/examples
|
|
|
|
FCP_DIR = $(ABSOLUTE_ROOT_DIR)/facebook-clang-plugins
|
|
|
|
INFER_DIR = $(ABSOLUTE_ROOT_DIR)/infer
|
|
|
|
DEPENDENCIES_DIR = $(ABSOLUTE_ROOT_DIR)/dependencies
|
|
|
|
FCP_DIR = $(ABSOLUTE_ROOT_DIR)/facebook-clang-plugins
|
|
|
|
SCRIPT_DIR = $(ABSOLUTE_ROOT_DIR)/scripts
|
|
|
|
|
|
|
|
FCP_CLANG_OCAML_DIR = $(FCP_DIR)/clang-ocaml
|
|
|
|
|
|
|
|
ANNOTATIONS_DIR = $(INFER_DIR)/annotations
|
|
|
|
BIN_DIR = $(INFER_DIR)/bin
|
|
|
|
LIB_DIR = $(INFER_DIR)/lib
|
|
|
|
MODELS_DIR = $(INFER_DIR)/models
|
|
|
|
SRC_DIR = $(INFER_DIR)/src
|
|
|
|
|
|
|
|
JAVA_LIB_DIR = $(LIB_DIR)/java
|
|
|
|
SPECS_LIB_DIR = $(LIB_DIR)/specs
|
|
|
|
|
|
|
|
PYTHON_DIR = $(LIB_DIR)/python
|
|
|
|
PYTHON_LIB_DIR = $(PYTHON_DIR)/inferlib
|
|
|
|
CAPTURE_LIB_DIR = $(PYTHON_LIB_DIR)/capture
|
|
|
|
|
|
|
|
INFERANALYZE_BIN = $(BIN_DIR)/InferAnalyze
|
|
|
|
INFERCLANG_BIN = $(BIN_DIR)/InferClang
|
|
|
|
INFERJAVA_BIN = $(BIN_DIR)/InferJava
|
|
|
|
INFERPRINT_BIN = $(BIN_DIR)/InferPrint
|
|
|
|
INFERUNIT_BIN = $(BIN_DIR)/InferUnit
|
|
|
|
INFER_BIN = $(BIN_DIR)/infer
|
|
|
|
INFERTRACEBUGS_BIN = $(BIN_DIR)/inferTraceBugs
|
|
|
|
# paths relative to $(INFER_DIR)
|
|
|
|
INFER_BIN_RELPATH = bin/infer
|
|
|
|
INFERTRACEBUGS_BIN_RELPATH = bin/inferTraceBugs
|
|
|
|
|
|
|
|
INFER_ANALYZERS=
|
|
|
|
ifeq (@BUILD_C_ANALYZERS@,yes)
|
|
|
|
INFER_ANALYZERS+=clang
|
|
|
|
endif
|
|
|
|
ifeq (@BUILD_JAVA_ANALYZERS@,yes)
|
|
|
|
INFER_ANALYZERS+=java
|
|
|
|
JAVA_HOME=@USER_JAVA_HOME@
|
|
|
|
endif
|
|
|
|
|
|
|
|
|
|
|
|
JAVA_DEPS = $(addprefix $(PYTHON_LIB_DIR)/, \
|
|
|
|
analyze.py config.py issues.py jwlib.py source.py utils.py) \
|
|
|
|
$(addprefix $(CAPTURE_LIB_DIR)/, javac.py util.py) \
|
|
|
|
$(INFER_BIN) \
|
|
|
|
$(INFERANALYZE_BIN) \
|
|
|
|
$(INFERJAVA_BIN) \
|
|
|
|
$(INFERPRINT_BIN)
|
|
|
|
|
|
|
|
CLANG_DEPS = $(addprefix $(PYTHON_LIB_DIR)/, \
|
|
|
|
analyze.py config.py issues.py source.py utils.py) \
|
|
|
|
$(addprefix $(CAPTURE_LIB_DIR)/, make.py util.py) \
|
|
|
|
$(INFER_BIN) \
|
|
|
|
$(INFERANALYZE_BIN) \
|
|
|
|
$(INFERCLANG_BIN) \
|
|
|
|
$(INFERPRINT_BIN)
|
|
|
|
|
|
|
|
JAVA_MODELS_JAR = $(LIB_DIR)/java/models.jar
|
|
|
|
|
|
|
|
ifneq (,$(findstring s,$(MAKEFLAGS)))
|
|
|
|
REMOVE = rm -f
|
|
|
|
REMOVE_DIR = rm -rf
|
|
|
|
else
|
|
|
|
REMOVE = rm -vf
|
|
|
|
REMOVE_DIR = rm -rvf
|
|
|
|
endif
|
|
|
|
COPY = cp -f -p
|
|
|
|
COPY_DIR = cp -Rf
|
|
|
|
MKDIR_P_CMD = case "@MKDIR_P@" in \
|
|
|
|
./*) printf "$(ROOT_DIR)/@MKDIR_P@\n";; \
|
|
|
|
*) printf "@MKDIR_P@\n";; \
|
|
|
|
esac
|
|
|
|
MKDIR_P = $(shell $(MKDIR_P_CMD))
|
|
|
|
LN_S = @LN_S@
|