move all config variables to Makefile.config.in

Summary:
Hardcoding `variable@` in Makefiles is Bad™ because it prevents the users from
overwriting them easily with `make variable="my custom value"`. The right way
to do it is thus:

```
variable = variable@
# then use $(variable) everywhere
```

This diff puts all the `variable = variable@` lines in Makefile.config.in, and
changes every occurrence of a `variable@` to `$(variable)` everywhere else.

I mostly automated generating this diff. Here are the steps I did:

- find out which `variable@`s we use:

  find . -name 'Makefile*' -exec grep -e '@[^@ []\+@' -o -h \{\} \+ | sort | uniq > config_variables

- write this `replace.sh` script to replace every `variable@` with `$(variable)`:

```
#!/bin/sh

config_vars_file=$1
shift

for line in $(cat $config_vars_file); do
  var=$(echo $line | tr -d @)
  sed -i -e "s/$line/\$($var)/g" $@ > /dev/null
done
```

- run the script as such:

  find . -name 'Makefile.*in' \( -not -wholename './Makefile.config.in' \) -exec ./replace.sh config_variables \{\} \+

- put all the `VARIABLE = VARIABLE@` lines in Makefile.config.in

- move all `Makefile.in` to `Makefile`, since they don't need to be generated by `./configure` anymore:

```
for i in $(find . -name 'Makefile.*in' \( -not -wholename './Makefile.config.in' \)); do \
  rm $(dirname $i)/$(basename $i .in) && git mv $i $(dirname $i)/$(basename $i .in) ; \
done
```

- delete all Makefile except Makefile.config from configure.ac

- manually inspect and remove remaining instances of `VAR = $(VAR)` in makefiles, looking at the output of `git grep '^\(\w\+\) = $(\1)'`

Reviewed By: jberdine

Differential Revision: D3358379

fbshipit-source-id: 5d37f02
master
Jules Villard 9 years ago committed by Facebook Github Bot 4
parent 0f895b0684
commit 533831a206

7
.gitignore vendored

@ -26,13 +26,6 @@ _build
/config.status
/configure
/Makefile.config
/Makefile
/infer/models/Makefile
/infer/models/c/Makefile
/infer/models/cpp/Makefile
/infer/models/java/Makefile
/infer/models/objc/Makefile
/infer/src/Makefile
/.buckversion
# IntelliJ files

@ -5,9 +5,56 @@
# 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@
PLATFORM = $(shell uname)
ATDGEN = @ATDGEN@
bindir = @bindir@
BUILD_C_ANALYZERS = @BUILD_C_ANALYZERS@
BUILD_JAVA_ANALYZERS = @BUILD_JAVA_ANALYZERS@
BUILD_LLVM_ANALYZERS = @BUILD_LLVM_ANALYZERS@
CC = @CC@
CFLAGS = @CFLAGS@
CLANG_INCLUDES = @CLANG_INCLUDES@
CLANG_PREFIX = @CLANG_PREFIX@
CPP = @CPP@
CXX = @CXX@
CXXFLAGS = @CXXFLAGS@
ENABLE_OCAML_ANNOT = @ENABLE_OCAML_ANNOT@
ENABLE_OCAML_BINANNOT = @ENABLE_OCAML_BINANNOT@
exec_prefix = @exec_prefix@
INFER_MAJOR = @INFER_MAJOR@
INFER_MINOR = @INFER_MINOR@
INFER_PATCH = @INFER_PATCH@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
IS_FACEBOOK_TREE = @IS_FACEBOOK_TREE@
IS_RELEASE_TREE = @IS_RELEASE_TREE@
LDFLAGS = @LDFLAGS@
libdir = @libdir@
LIBS = @LIBS@
LN_S = @LN_S@
MKDIR_P_CMD = case "@MKDIR_P@" in \
./*) printf "$(ROOT_DIR)/@MKDIR_P@\n";; \
*) printf "@MKDIR_P@\n";; \
esac
MKDIR_P = $(shell $(MKDIR_P_CMD))
NCPU = @NCPU@
prefix = @prefix@
USER_JAVA_HOME = @USER_JAVA_HOME@
XCODE_SELECT = @XCODE_SELECT@
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
ABSOLUTE_ROOT_DIR = $(shell cd $(ROOT_DIR) && pwd)
@ -45,8 +92,8 @@ INFERTRACEBUGS_BIN = $(BIN_DIR)/inferTraceBugs
INFER_BIN_RELPATH = infer/bin/infer
INFERTRACEBUGS_BIN_RELPATH = infer/bin/inferTraceBugs
ifeq (@BUILD_JAVA_ANALYZERS@,yes)
JAVA_HOME=@USER_JAVA_HOME@
ifeq ($(BUILD_JAVA_ANALYZERS),yes)
JAVA_HOME=$(USER_JAVA_HOME)
endif
JAVA_DEPS = $(addprefix $(PYTHON_LIB_DIR)/, \
@ -66,19 +113,3 @@ CLANG_DEPS = $(addprefix $(PYTHON_LIB_DIR)/, \
$(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@

@ -1,260 +0,0 @@
# 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
prefix = @prefix@
exec_prefix = @exec_prefix@
bindir = @bindir@
libdir = @libdir@
INSTALL = @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_DATA = @INSTALL_DATA@
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 objcpp
endif
TARGETS_TO_TEST := $(shell echo $(TARGETS_TO_TEST))
all: infer inferTraceBugs
$(INFER_BIN_RELPATH) $(INFERTRACEBUGS_BIN_RELPATH):
($(REMOVE) $@ && \
cd $(@D) && \
$(LN_S) ../lib/python/$(@F) $(@F))
infer: $(INFER_BIN_RELPATH)
$(MAKE) -C $(SRC_DIR) infer
ifeq (@BUILD_JAVA_ANALYZERS@,yes)
$(MAKE) -C $(ANNOTATIONS_DIR)
endif
$(MAKE) -C $(MODELS_DIR) all
ifeq (@BUILD_C_ANALYZERS@,yes)
infer: clang_plugin
endif
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 (@IS_RELEASE_TREE@,no)
$(MAKE) -C $(FCP_DIR)/libtooling all \
CC=@CC@ CXX=@CXX@ \
CFLAGS="@CFLAGS@" 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@ \
CFLAGS="@CFLAGS@" CXXFLAGS="@CXXFLAGS@" \
CPP="@CPP@" LDFLAGS="@LDFLAGS@" LIBS="@LIBS@" \
LOCAL_CLANG=@CLANG_PREFIX@/bin/clang \
CLANG_PREFIX=@CLANG_PREFIX@ \
CLANG_INCLUDES=@CLANG_INCLUDES@
endif
inferTraceBugs: $(INFERTRACEBUGS_BIN_RELPATH)
test_this_build: clang_plugin
$(MAKE) -C $(SRC_DIR) test_build
test_oss_build: clang_plugin
# make sure we don't break the opensource build
$(MAKE) -C $(SRC_DIR) EXTRA_DEPS=opensource LLVM_BUILD_DIR=$(BUILD_DIR)/llvm_opensource TEST_BUILD_DIR=$(BUILD_DIR)/opensource test_build
test_build: test_this_build
ifeq (@IS_FACEBOOK_TREE@,yes)
test_build: test_oss_build
endif
ocaml_unit_test: infer
$(INFERUNIT_BIN)
buck_test: infer
NO_BUCKD=1 buck clean
NO_BUCKD=1 buck test $(TARGETS_TO_TEST)
NO_BUCKD=1 ./infer/tests/build_systems/build_integration_tests.py
buck_test_xml: infer
NO_BUCKD=1 buck clean
NO_BUCKD=1 buck test --xml test.xml $(TARGETS_TO_TEST)
NO_BUCKD=1 ./infer/tests/build_systems/build_integration_tests.py
inferTraceBugs_test: infer
$(INFER_BIN) -o __test-infer-out__ -- \
javac $(EXAMPLES_DIR)/Hello.java \
> /dev/null
@rm -f Hello.class
$(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__
check_missing_mli:
@bash -c '\
for x in `find infer/src -name "*.ml"`; do \
test -f "$$x"i || echo Missing "$$x"i; done'
test: test_build ocaml_unit_test buck_test inferTraceBugs_test
$(MAKE) -C $(SRC_DIR) mod_dep.dot
test_xml: test_build ocaml_unit_test buck_test_xml inferTraceBugs_test
$(MAKE) -C $(SRC_DIR) mod_dep.dot
uninstall:
$(REMOVE_DIR) $(DESTDIR)$(libdir)/infer/
$(REMOVE) $(DESTDIR)$(bindir)/inferTraceBugs
$(REMOVE) $(DESTDIR)$(bindir)/infer
install: infer inferTraceBugs
# create directory structure
test -d $(DESTDIR)$(bindir) || \
$(MKDIR_P) $(DESTDIR)$(bindir)
test -d $(DESTDIR)$(libdir)/infer/ || \
$(MKDIR_P) $(DESTDIR)$(libdir)/infer/
ifeq (@BUILD_C_ANALYZERS@,yes)
test -d $(DESTDIR)$(libdir)/infer/facebook-clang-plugins/libtooling/build/ || \
$(MKDIR_P) $(DESTDIR)$(libdir)/infer/facebook-clang-plugins/libtooling/build/
@for i in $$(find facebook-clang-plugins/clang/ -not -wholename 'src/*' -type d); do \
test -d $(DESTDIR)$(libdir)/infer/$$i || \
$(MKDIR_P) $(DESTDIR)$(libdir)/infer/$$i; \
done
test -d $(DESTDIR)$(libdir)/infer/infer/lib/clang_wrappers/ || \
$(MKDIR_P) $(DESTDIR)$(libdir)/infer/infer/lib/clang_wrappers/
endif
ifeq (@BUILD_JAVA_ANALYZERS@,yes)
test -d $(DESTDIR)$(libdir)/infer/infer/lib/java/ || \
$(MKDIR_P) $(DESTDIR)$(libdir)/infer/infer/lib/java/
endif
ifneq (@XCODE_SELECT@,no)
test -d $(DESTDIR)$(libdir)/infer/infer/lib/xcode_wrappers/ || \
$(MKDIR_P) $(DESTDIR)$(libdir)/infer/infer/lib/xcode_wrappers/
endif
test -d $(DESTDIR)$(libdir)/infer/infer/annotations/ || \
$(MKDIR_P) $(DESTDIR)$(libdir)/infer/infer/annotations/
test -d $(DESTDIR)$(libdir)/infer/infer/lib/wrappers/ || \
$(MKDIR_P) $(DESTDIR)$(libdir)/infer/infer/lib/wrappers/
test -d $(DESTDIR)$(libdir)/infer/infer/lib/specs/ || \
$(MKDIR_P) $(DESTDIR)$(libdir)/infer/infer/lib/specs/
test -d $(DESTDIR)$(libdir)/infer/infer/lib/python/ || \
$(MKDIR_P) $(DESTDIR)$(libdir)/infer/infer/lib/python/
test -d $(DESTDIR)$(libdir)/infer/infer/lib/python/inferlib/ || \
$(MKDIR_P) $(DESTDIR)$(libdir)/infer/infer/lib/python/inferlib/
test -d $(DESTDIR)$(libdir)/infer/infer/lib/python/inferlib/capture/ || \
$(MKDIR_P) $(DESTDIR)$(libdir)/infer/infer/lib/python/inferlib/capture/
test -d $(DESTDIR)$(libdir)/infer/infer/bin/ || \
$(MKDIR_P) $(DESTDIR)$(libdir)/infer/infer/bin/
# copy files
ifeq (@BUILD_C_ANALYZERS@,yes)
$(INSTALL_DATA) -C facebook-clang-plugins/libtooling/build/FacebookClangPlugin.dylib \
$(DESTDIR)$(libdir)/infer/facebook-clang-plugins/libtooling/build/FacebookClangPlugin.dylib
@for i in $$(find facebook-clang-plugins/clang/ -not -wholename 'src/*' -not -name setup.sh -not -name installed.version -not -type d); do \
$(INSTALL_PROGRAM) -C $$i $(DESTDIR)$(libdir)/infer/$$i; \
done
@for i in $$(find infer/lib/clang_wrappers/*); do \
$(INSTALL_PROGRAM) -C $$i $(DESTDIR)$(libdir)/infer/$$i; \
done
@for i in $$(find infer/lib/specs/*); do \
$(INSTALL_DATA) -C $$i $(DESTDIR)$(libdir)/infer/$$i; \
done
$(INSTALL_PROGRAM) -C $(INFERCLANG_BIN) $(DESTDIR)$(libdir)/infer/infer/bin/
endif
ifneq (@XCODE_SELECT@,no)
@for i in $$(find infer/lib/xcode_wrappers/*); do \
$(INSTALL_PROGRAM) -C $$i $(DESTDIR)$(libdir)/infer/$$i; \
done
endif
ifeq (@BUILD_JAVA_ANALYZERS@,yes)
$(INSTALL_DATA) -C infer/annotations/annotations.jar \
$(DESTDIR)$(libdir)/infer/infer/annotations/annotations.jar
@for i in infer/lib/java/*.jar; do \
$(INSTALL_DATA) -C $$i $(DESTDIR)$(libdir)/infer/$$i; \
done
$(INSTALL_PROGRAM) -C $(INFERJAVA_BIN) $(DESTDIR)$(libdir)/infer/infer/bin/
endif
@for i in $$(find infer/lib/wrappers/*); do \
$(INSTALL_PROGRAM) -C $$i $(DESTDIR)$(libdir)/infer/$$i; \
done
@for i in $$(find infer/lib/python/inferlib/* -type f); do \
$(INSTALL_DATA) -C $$i $(DESTDIR)$(libdir)/infer/$$i; \
done
$(INSTALL_PROGRAM) -C infer/lib/python/infer \
$(DESTDIR)$(libdir)/infer/infer/lib/python/infer
$(INSTALL_PROGRAM) -C infer/lib/python/inferTraceBugs \
$(DESTDIR)$(libdir)/infer/infer/lib/python/inferTraceBugs
$(INSTALL_PROGRAM) -C $(INFERANALYZE_BIN) $(DESTDIR)$(libdir)/infer/infer/bin/
$(INSTALL_PROGRAM) -C $(INFERPRINT_BIN) $(DESTDIR)$(libdir)/infer/infer/bin/
(cd $(DESTDIR)$(libdir)/infer/infer/bin/ && \
$(REMOVE) infer && \
$(LN_S) $(DESTDIR)$(libdir)/infer/infer/lib/python/infer infer)
(cd $(DESTDIR)$(bindir)/ && \
$(REMOVE) infer && \
$(LN_S) $(DESTDIR)$(libdir)/infer/infer/lib/python/infer infer)
(cd $(DESTDIR)$(bindir)/ && \
$(REMOVE) inferTraceBugs && \
$(LN_S) $(DESTDIR)$(libdir)/infer/infer/lib/python/inferTraceBugs inferTraceBugs)
clean:
$(REMOVE) test.xml
ifeq (@IS_RELEASE_TREE@,no)
ifeq (@BUILD_C_ANALYZERS@,yes)
$(MAKE) -C $(FCP_DIR) clean
$(MAKE) -C $(FCP_DIR)/clang-ocaml clean
endif
endif
$(MAKE) -C $(SRC_DIR) clean
$(MAKE) -C $(ANNOTATIONS_DIR) clean
$(MAKE) -C $(MODELS_DIR) clean
$(REMOVE) $(INFER_BIN_RELPATH) $(INFERTRACEBUGS_BIN_RELPATH)
conf-clean: clean
$(REMOVE) infer/lib/python/inferlib/*.pyc
$(REMOVE) infer/lib/python/inferlib/*/*.pyc
$(REMOVE) .buckversion
$(REMOVE) Makefile
$(REMOVE) Makefile.config
$(REMOVE) acinclude.m4
$(REMOVE) aclocal.m4
$(REMOVE_DIR) autom4te.cache/
$(REMOVE) config.log
$(REMOVE) config.status
$(REMOVE) configure
$(REMOVE) infer/models/Makefile
$(REMOVE) infer/models/c/Makefile
$(REMOVE_DIR) infer/models/c/out/
$(REMOVE) infer/models/cpp/Makefile
$(REMOVE_DIR) infer/models/cpp/out/
$(REMOVE) infer/models/java/Makefile
$(REMOVE_DIR) infer/models/java/infer-out/
$(REMOVE) infer/models/objc/Makefile
$(REMOVE_DIR) infer/models/objc/out/
$(REMOVE) infer/src/Makefile
.PHONY: all buck_test buck_test_xml clean clang_plugin clang_setup infer inferTraceBugs
.PHONY: inferTraceBugs_test ocaml_unit_test check_missing_mli test test_xml test_build install
.PHONY: uninstall

@ -267,13 +267,6 @@ AC_SUBST([NCPU])
AC_CONFIG_FILES([
Makefile.config
Makefile
infer/models/Makefile
infer/models/c/Makefile
infer/models/cpp/Makefile
infer/models/objc/Makefile
infer/models/java/Makefile
infer/src/Makefile
])
AC_OUTPUT

@ -5,7 +5,6 @@
# 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
@ -15,15 +14,15 @@ JAVA_MODELS_DIR = java
OBJC_MODELS_DIR = objc
CLANG_SUBDIRS = $(C_MODELS_DIR) $(CPP_MODELS_DIR)
ifneq (no, @XCODE_SELECT@)
ifneq (no, $(XCODE_SELECT))
CLANG_SUBDIRS += $(OBJC_MODELS_DIR)
endif
all:
ifeq (@BUILD_C_ANALYZERS@,yes)
ifeq ($(BUILD_C_ANALYZERS),yes)
all: clang
endif
ifeq (@BUILD_JAVA_ANALYZERS@,yes)
ifeq ($(BUILD_JAVA_ANALYZERS),yes)
all: java
endif
@ -39,6 +38,6 @@ clean:
$(MAKE) -C $(JAVA_MODELS_DIR) clean
$(MAKE) -C $(C_MODELS_DIR) clean
$(MAKE) -C $(CPP_MODELS_DIR) clean
ifneq (no, @XCODE_SELECT@)
ifneq (no, $(XCODE_SELECT))
$(MAKE) -C $(OBJC_MODELS_DIR) clean
endif

@ -5,7 +5,6 @@
# 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
@ -23,7 +22,7 @@ $(C_MODELS_FILE): $(C_MODELS_SOURCES) $(CLANG_DEPS)
touch $(C_MODELS_FILE)
install: $(C_MODELS_FILE)
@INSTALL@ -m 644 -C out/specs/*.specs $(SPECS_LIB_DIR)
$(INSTALL) -m 644 -C out/specs/*.specs $(SPECS_LIB_DIR)
clean:
@rm -f $(C_MODELS_FILE)

@ -5,7 +5,6 @@
# 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
@ -23,7 +22,7 @@ $(CPP_MODELS_FILE): $(CPP_MODELS_SOURCES) $(CLANG_DEPS)
touch $(CPP_MODELS_FILE)
install: $(CPP_MODELS_FILE)
@INSTALL@ -m 644 -C out/specs/*.specs $(SPECS_LIB_DIR)
$(INSTALL) -m 644 -C out/specs/*.specs $(SPECS_LIB_DIR)
clean:
@rm -f $(CPP_MODELS_FILE)

@ -5,7 +5,6 @@
# 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
@ -42,7 +41,7 @@ $(MODELS_JAR): $(INFER_REPORT)
cd $(MODELS_OUT); jar cf ../$(MODELS_JAR) *
$(DEPLOYED_MODELS_JAR): $(MODELS_JAR)
@INSTALL@ -m 644 -C $(MODELS_JAR) $(DEPLOYED_MODELS_JAR)
$(INSTALL) -m 644 -C $(MODELS_JAR) $(DEPLOYED_MODELS_JAR)
install: $(DEPLOYED_MODELS_JAR)

@ -5,7 +5,6 @@
# 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
@ -23,7 +22,7 @@ $(OBJC_MODELS_FILE): $(OBJC_MODELS_SOURCES) $(CLANG_DEPS)
touch $(OBJC_MODELS_FILE)
install: $(OBJC_MODELS_FILE)
@INSTALL@ -m 644 -C out/specs/*.specs $(SPECS_LIB_DIR)
$(INSTALL) -m 644 -C out/specs/*.specs $(SPECS_LIB_DIR)
clean:
@rm -f $(OBJC_MODELS_FILE)

@ -8,13 +8,6 @@
ROOT_DIR = ../..
include $(ROOT_DIR)/Makefile.config
INFER_MAJOR = @INFER_MAJOR@
INFER_MINOR = @INFER_MINOR@
INFER_PATCH = @INFER_PATCH@
IS_RELEASE_TREE = @IS_RELEASE_TREE@
ATDGEN = @ATDGEN@
#### Global declarations ####
INFER_BUILD_DIR = $(BUILD_DIR)/infer
@ -39,11 +32,11 @@ OCAMLBUILD_OPTIONS = \
-tag-line "<*{clang/clang_ast_*,backend/jsonbug_*}>: warn(-27-32-35-39)" \
-pkgs atdgen,extlib,oUnit,str,unix,yojson,zip
ifeq (@ENABLE_OCAML_ANNOT@,yes)
ifeq ($(ENABLE_OCAML_ANNOT),yes)
OCAMLBUILD_OPTIONS += -cflags -annot
endif
ifeq (@ENABLE_OCAML_BINANNOT@,yes)
ifeq ($(ENABLE_OCAML_BINANNOT),yes)
OCAMLBUILD_OPTIONS += -cflags -bin-annot
endif
@ -122,7 +115,7 @@ STATSAGGREGATOR_MAIN = $(SCRIPT_SOURCES)/StatsAggregator
#### End of declarations ####
ifeq (@IS_FACEBOOK_TREE@,yes)
ifeq ($(IS_FACEBOOK_TREE),yes)
EXTRA_DEPS = facebook facebook/checkers facebook/checkers/graphql facebook/scripts
else
EXTRA_DEPS = opensource
@ -154,16 +147,16 @@ INFER_ALL_TARGETS = $(INFER_BASE_TARGETS) \
OCAMLBUILD_CONFIG = $(OCAMLBUILD_BASE)
INFER_CONFIG_TARGETS = $(INFER_BASE_TARGETS)
ifeq (@BUILD_JAVA_ANALYZERS@,yes)
ifeq ($(BUILD_JAVA_ANALYZERS),yes)
OCAMLBUILD_CONFIG += $(JAVA_OCAMLBUILD_OPTIONS)
INFER_CONFIG_TARGETS += $(INFERJAVA_MAIN).native
DEPENDENCIES += java
endif
ifeq (@BUILD_C_ANALYZERS@,yes)
ifeq ($(BUILD_C_ANALYZERS),yes)
INFER_CONFIG_TARGETS += $(INFERCLANG_MAIN).native
DEPENDENCIES += clang
endif
ifeq (@BUILD_LLVM_ANALYZERS@,yes)
ifeq ($(BUILD_LLVM_ANALYZERS),yes)
INFER_CONFIG_TARGETS += $(INFERLLVM_MAIN).native
DEPENDENCIES += llvm
endif
@ -179,23 +172,23 @@ infer: init $(INFERPRINT_ATDGEN_STUBS) $(CLANG_BINIOU_DICT)
$(COPY) $(INFER_BUILD_DIR)/$(CHECKCOPYRIGHT_MAIN).native $(CHECKCOPYRIGHT_BIN)
$(COPY) $(INFER_BUILD_DIR)/$(STATSAGGREGATOR_MAIN).native $(STATSAGGREGATOR_BIN)
$(COPY) $(INFER_BUILD_DIR)/$(INFERUNIT_MAIN).native $(INFERUNIT_BIN)
ifeq (@BUILD_LLVM_ANALYZERS@,yes)
ifeq ($(BUILD_LLVM_ANALYZERS),yes)
$(COPY) $(INFER_BUILD_DIR)/$(INFERLLVM_MAIN).native $(INFERLLVM_BIN)
endif
ifeq (@BUILD_JAVA_ANALYZERS@,yes)
ifeq ($(BUILD_JAVA_ANALYZERS),yes)
$(COPY) $(INFER_BUILD_DIR)/$(INFERJAVA_MAIN).native $(INFERJAVA_BIN)
endif
ifeq (@BUILD_C_ANALYZERS@,yes)
ifeq ($(BUILD_C_ANALYZERS),yes)
$(COPY) $(INFER_BUILD_DIR)/$(INFERCLANG_MAIN).native $(INFERCLANG_BIN)
endif
ifeq (@ENABLE_OCAML_ANNOT@,yes)
ifeq ($(ENABLE_OCAML_ANNOT),yes)
rsync -a --include '*/' --include '*.annot' --exclude '*' $(INFER_BUILD_DIR)/ $(ANNOT_DIR)/
endif
ifeq (@BUILD_C_ANALYZERS@,yes)
ifeq ($(BUILD_C_ANALYZERS),yes)
infer: $(CLANG_ATDGEN_STUBS) $(INFER_CLANG_FCP_MIRRORED_FILES)
endif
ifeq (@BUILD_LLVM_ANALYZERS@,yes)
ifeq ($(BUILD_LLVM_ANALYZERS),yes)
infer: $(LLVM_SOURCES)/lLexer.ml $(LLVM_SOURCES)/lParser.ml
endif
@ -270,7 +263,7 @@ $(foreach atd_type,b j t v,\
define mirror_fcp_file
$(CLANG_SOURCES)/$(notdir $(1)): $(1)
@INSTALL@ -m 644 -C $$< $$@
$(INSTALL) -m 644 -C $$< $$@
endef
$(foreach file, $(FCP_FILES_TO_MIRROR), $(eval $(call mirror_fcp_file,$(file))))
@ -303,7 +296,7 @@ version: backend/version.ml.in Makefile
-e "s|@INFER_GIT_COMMIT[@]|$$INFER_GIT_COMMIT|g" \
-e "s|@INFER_GIT_BRANCH[@]|$$INFER_GIT_BRANCH|g" \
$< > "$$TMPFILE"; \
@INSTALL@ -m 644 -C "$$TMPFILE" backend/version.ml; \
$(INSTALL) -m 644 -C "$$TMPFILE" backend/version.ml; \
rm -f "$$TMPFILE"
$(BUILD_DIR):
@ -315,10 +308,10 @@ test_clean:
clean:
$(REMOVE_DIR) $(BUILD_DIR)
$(REMOVE) $(ETC_DIR)/clang_ast.dict
ifeq (@ENABLE_OCAML_ANNOT@,yes)
ifeq ($(ENABLE_OCAML_ANNOT),yes)
$(REMOVE_DIR) $(ANNOT_DIR)
endif
ifeq (@BUILD_LLVM_ANALYZERS@,yes)
ifeq ($(BUILD_LLVM_ANALYZERS),yes)
$(REMOVE) $(LLVM_SOURCES)/lLexer.ml $(LLVM_SOURCES)/lParser.ml
endif
$(REMOVE) backend/version.ml
Loading…
Cancel
Save