[make] make sure makefile uses config-time values

Summary:
This makes sure that one can run `./build-infer.sh` then `make`. Otherwise it's
not always clear what one should do to recompile infer, eg when `make` will
work and when `./build-infer.sh` should be used instead, in particular when the
user doesn't have opam configured for her terminal.

Reviewed By: jberdine

Differential Revision: D4698159

fbshipit-source-id: 5df8059
master
Jules Villard 8 years ago committed by Facebook Github Bot
parent 8d5be14e9c
commit dac8906d86

@ -89,7 +89,7 @@ all: infer
configure: configure.ac $(wildcard m4/*.m4) configure: configure.ac $(wildcard m4/*.m4)
./autogen.sh ./autogen.sh
Makefile.autoconf: configure Makefile.autoconf: configure Makefile.autoconf.in
# rerun ./configure with the flags that were used last time it was run (if available) # rerun ./configure with the flags that were used last time it was run (if available)
./configure $(shell ./config.status --config || true) ./configure $(shell ./config.status --config || true)
@ -233,7 +233,7 @@ endtoend_test: print_direct_tests print_build_systems_tests
inferTraceBugs_test: infer inferTraceBugs_test: infer
ifeq ($(BUILD_JAVA_ANALYZERS),yes) ifeq ($(BUILD_JAVA_ANALYZERS),yes)
$(INFER_BIN) -o __test-infer-out__ -- \ $(INFER_BIN) -o __test-infer-out__ -- \
javac $(EXAMPLES_DIR)/Hello.java \ $(JAVAC) $(EXAMPLES_DIR)/Hello.java \
> /dev/null > /dev/null
else else
$(INFER_BIN) -o __test-infer-out__ -- \ $(INFER_BIN) -o __test-infer-out__ -- \

@ -13,6 +13,7 @@ bindir = @bindir@
BUCK = @BUCK@ BUCK = @BUCK@
BUILD_C_ANALYZERS = @BUILD_C_ANALYZERS@ BUILD_C_ANALYZERS = @BUILD_C_ANALYZERS@
BUILD_JAVA_ANALYZERS = @BUILD_JAVA_ANALYZERS@ BUILD_JAVA_ANALYZERS = @BUILD_JAVA_ANALYZERS@
CAML_LD_LIBRARY_PATH = @CAML_LD_LIBRARY_PATH@
CC = @CC@ CC = @CC@
CFLAGS = @CFLAGS@ CFLAGS = @CFLAGS@
CLANG_INCLUDES = @CLANG_INCLUDES@ CLANG_INCLUDES = @CLANG_INCLUDES@
@ -32,9 +33,11 @@ INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
IS_FACEBOOK_TREE = @IS_FACEBOOK_TREE@ IS_FACEBOOK_TREE = @IS_FACEBOOK_TREE@
IS_RELEASE_TREE = @IS_RELEASE_TREE@ IS_RELEASE_TREE = @IS_RELEASE_TREE@
JAVAC = @JAVAC@
LDFLAGS = @LDFLAGS@ LDFLAGS = @LDFLAGS@
libdir = @libdir@ libdir = @libdir@
LIBS = @LIBS@ LIBS = @LIBS@
MENHIR = @MENHIR@
MKDIR_P_CMD = case "@MKDIR_P@" in \ MKDIR_P_CMD = case "@MKDIR_P@" in \
./*) printf "$(ROOT_DIR)/@MKDIR_P@\n";; \ ./*) printf "$(ROOT_DIR)/@MKDIR_P@\n";; \
*) printf "@MKDIR_P@\n";; \ *) printf "@MKDIR_P@\n";; \
@ -43,8 +46,12 @@ MKDIR_P = $(shell $(MKDIR_P_CMD))
MVN = @MVN@ MVN = @MVN@
NCPU = @NCPU@ NCPU = @NCPU@
NDKBUILD = @NDKBUILD@ NDKBUILD = @NDKBUILD@
OCAMLC = @OCAMLC@
OCAMLLEX = @OCAMLLEX@
OCAMLOPT = @OCAMLOPT@
prefix = @prefix@ prefix = @prefix@
PYTHON_lxml = @PYTHON_lxml@ PYTHON_lxml = @PYTHON_lxml@
REBUILD = @REBUILD@
USER_JAVA_HOME = @USER_JAVA_HOME@ USER_JAVA_HOME = @USER_JAVA_HOME@
XCODE_SELECT = @XCODE_SELECT@ XCODE_SELECT = @XCODE_SELECT@
XCPRETTY = @XCPRETTY@ XCPRETTY = @XCPRETTY@
@ -55,3 +62,10 @@ LN_S = @LN_S@
else else
LN_S = @LN_S@ -v LN_S = @LN_S@ -v
endif endif
# Export parts of the config relevant to the compilation (taken from `opam config env`) in case the
# user runs `./configure` in some configuration but `make` in another.
export PATH := $(shell cd "$(dir $(REBUILD))" && pwd):$(PATH)
ifneq ($(CAML_LD_LIBRARY_PATH),)
export CAML_LD_LIBRARY_PATH := $(CAML_LD_LIBRARY_PATH)
endif

@ -94,7 +94,7 @@ AS_IF([test "x$enable_c_analyzers" = "xyes"], [
AC_CHECK_TOOL([SHASUM], [shasum], [no]) AC_CHECK_TOOL([SHASUM], [shasum], [no])
AC_ASSERT_PROG([shasum], [$SHASUM]) AC_ASSERT_PROG([shasum], [$SHASUM])
# cmake is required to build llvm+clang # cmake is required to build llvm+clang
AC_CHECK_TOOL([CMAKE], [cmake], [no]) AC_PATH_TOOL([CMAKE], [cmake], [no])
AS_IF([test "x$is_release_tree" = "xno"], [ AS_IF([test "x$is_release_tree" = "xno"], [
AC_ASSERT_PROG([cmake], [$CMAKE]) AC_ASSERT_PROG([cmake], [$CMAKE])
]) ])
@ -111,7 +111,7 @@ AS_IF([test "x$enable_c_analyzers" = "xyes"], [
AC_CHECK_TOOL([PYTHON27], [python2.7], [no]) AC_CHECK_TOOL([PYTHON27], [python2.7], [no])
AC_ASSERT_PROG([python2.7], [$PYTHON27]) AC_ASSERT_PROG([python2.7], [$PYTHON27])
AC_CHECK_TOOL([XCODE_SELECT], [xcode-select], [no]) AC_PATH_TOOL([XCODE_SELECT], [xcode-select], [no])
# prefer clang over gcc because the plugins makes use of # prefer clang over gcc because the plugins makes use of
@ -174,8 +174,8 @@ AC_ASSERT_PROG([ocamlbuild], [$OCAMLBUILD])
AC_PROG_FINDLIB AC_PROG_FINDLIB
AC_PROG_OCAMLLEX AC_PROG_OCAMLLEX
AC_ASSERT_PROG([ocamllex], [$OCAMLLEX]) AC_ASSERT_PROG([ocamllex], [$OCAMLLEX])
AC_PROG_OCAMLYACC AC_PATH_TOOL([MENHIR], [menhir], [no])
AC_ASSERT_PROG([ocamlyacc], [$OCAMLYACC]) AC_ASSERT_PROG([menhir], [$MENHIR])
AC_ASSERT_OCAML_PKG([atdgen], [], [1.6.0]) AC_ASSERT_OCAML_PKG([atdgen], [], [1.6.0])
AC_ASSERT_OCAML_PKG([biniou]) AC_ASSERT_OCAML_PKG([biniou])
AC_ASSERT_OCAML_PKG([camlzip], [zip]) AC_ASSERT_OCAML_PKG([camlzip], [zip])
@ -185,12 +185,15 @@ AC_ASSERT_OCAML_PKG([reason])
AC_ASSERT_OCAML_PKG([yojson]) AC_ASSERT_OCAML_PKG([yojson])
# check for rebuild after checking for Reason since `rebuild` is normally provided by Reason. This # check for rebuild after checking for Reason since `rebuild` is normally provided by Reason. This
# way if Reason is missing we get a more helpful error message and not "rebuild not found". # way if Reason is missing we get a more helpful error message and not "rebuild not found".
AC_CHECK_TOOL([REBUILD], [rebuild], [no]) AC_PATH_TOOL([REBUILD], [rebuild], [no])
AC_ASSERT_PROG([rebuild], [$REBUILD]) AC_ASSERT_PROG([rebuild], [$REBUILD])
AC_ARG_VAR([CAML_LD_LIBRARY_PATH],
[Additional directories to search for dynamically-loaded libraries.])
if test "x$enable_java_analyzers" = "xyes"; then if test "x$enable_java_analyzers" = "xyes"; then
AC_CHECK_TOOL([JAVA], [java], [no]) AC_CHECK_TOOL([JAVA], [java], [no])
AC_CHECK_TOOL([JAVAC], [javac], [no]) AC_PATH_TOOL([JAVAC], [javac], [no])
AC_ASSERT_PROG([javac], [$JAVAC]) AC_ASSERT_PROG([javac], [$JAVAC])
AC_ASSERT_PROG([java], [$JAVA]) AC_ASSERT_PROG([java], [$JAVA])
AC_ASSERT_OCAML_PKG([javalib], [], [2.3.3]) AC_ASSERT_OCAML_PKG([javalib], [], [2.3.3])
@ -224,7 +227,7 @@ _ACEOF
fi fi
AC_CHECK_TOOL([ATDGEN], [atdgen], [no]) AC_PATH_TOOL([ATDGEN], [atdgen], [no])
AC_ASSERT_PROG([atdgen], [$ATDGEN]) AC_ASSERT_PROG([atdgen], [$ATDGEN])
AC_ARG_ENABLE(ocaml-bin-annot, AC_ARG_ENABLE(ocaml-bin-annot,
@ -247,11 +250,11 @@ echo $buck_version > "$buckversion_file"
AC_MSG_RESULT([$buck_version]) AC_MSG_RESULT([$buck_version])
AC_CHECK_TOOL([GETCONF], [getconf], [no]) AC_PATH_TOOL([GETCONF], [getconf], [no])
AC_MSG_CHECKING([the number of cpus the build host has]) AC_MSG_CHECKING([the number of cpus the build host has])
if test "$GETCONF" != "no"; then if test "$GETCONF" != "no"; then
if test $(getconf _NPROCESSORS_ONLN); then if test $("$GETCONF" _NPROCESSORS_ONLN); then
NCPU=$(getconf _NPROCESSORS_ONLN) NCPU=$("$GETCONF" _NPROCESSORS_ONLN)
AC_MSG_RESULT([$NCPU]) AC_MSG_RESULT([$NCPU])
fi fi
else else
@ -262,20 +265,20 @@ AC_SUBST([NCPU])
# optional progs and libraries that, eg build systems to be run in integration tests # optional progs and libraries that, eg build systems to be run in integration tests
AC_CHECK_TOOL([ANT], [ant], [no]) AC_PATH_TOOL([ANT], [ant], [no])
if test ! -z "$SANDCASTLE"; then if test ! -z "$SANDCASTLE"; then
BUCK=buck BUCK=buck
AC_SUBST([BUCK]) AC_SUBST([BUCK])
else else
AC_CHECK_TOOL([BUCK], [buck], [no]) AC_PATH_TOOL([BUCK], [buck], [no])
fi fi
AC_ARG_VAR([MVN], [command to execute Maven when running tests]) AC_ARG_VAR([MVN], [command to execute Maven when running tests])
AS_IF([test "x$MVN" = "x"], [ AS_IF([test "x$MVN" = "x"], [
AC_CHECK_TOOL([MVN], [mvn], [no]) AC_PATH_TOOL([MVN], [mvn], [no])
], [ ], [
AC_MSG_RESULT([checking for mvn... $MVN]) AC_MSG_RESULT([checking for mvn... $MVN])
]) ])
AC_CHECK_TOOL([NDKBUILD], [ndk-build], [no]) AC_PATH_TOOL([NDKBUILD], [ndk-build], [no])
if test x"$NDKBUILD" = x"no"; then if test x"$NDKBUILD" = x"no"; then
# ndk-build not in $PATH, look into potential android NDK install paths and record the absolute path # ndk-build not in $PATH, look into potential android NDK install paths and record the absolute path
# to ndk-build # to ndk-build
@ -285,7 +288,7 @@ fi
AC_CHECK_PYTHON_MODULE([$PYTHON27], [lxml]) AC_CHECK_PYTHON_MODULE([$PYTHON27], [lxml])
AC_CHECK_TOOL([XCPRETTY], [xcpretty], [no]) AC_PATH_TOOL([XCPRETTY], [xcpretty], [no])
BREW=no BREW=no
if which brew > /dev/null; then if which brew > /dev/null; then

@ -20,14 +20,14 @@ SOURCES_JAR = $(CWD)/annotations-src.jar
all: $(ANNOTATIONS_JAR) $(SOURCES_JAR) all: $(ANNOTATIONS_JAR) $(SOURCES_JAR)
$(ANNOTATIONS_JAR): $(ANNOT_SOURCES) $(ANNOTATIONS_JAR): $(ANNOT_SOURCES)
mkdir -p $(ANNOT_CLASSES) $(MKDIR_P) $(ANNOT_CLASSES)
javac -source 7 -target 7 -cp $(JSR_JAR) $(ANNOT_SOURCES) -d $(ANNOT_CLASSES) $(JAVAC) -source 7 -target 7 -cp $(JSR_JAR) $(ANNOT_SOURCES) -d $(ANNOT_CLASSES)
cd $(ANNOT_CLASSES) && jar cvf $(ANNOTATIONS_JAR) com cd $(ANNOT_CLASSES) && jar cvf $(ANNOTATIONS_JAR) com
$(SOURCES_JAR): $(ANNOT_SOURCES) $(SOURCES_JAR): $(ANNOT_SOURCES)
jar cvf $(SOURCES_JAR) $(SOURCES_DIR)/com jar cvf $(SOURCES_JAR) $(SOURCES_DIR)/com
clean: clean:
@rm -rf $(ANNOT_CLASSES) @$(REMOVE_DIR) $(ANNOT_CLASSES)
@rm -f $(ANNOTATIONS_JAR) @$(REMOVE) $(ANNOTATIONS_JAR)
@rm -f $(SOURCES_JAR) @$(REMOVE) $(SOURCES_JAR)

@ -25,7 +25,7 @@ clean:
@rm -f $(JAVA_MODELS_JAR) @rm -f $(JAVA_MODELS_JAR)
compile: compile:
javac -bootclasspath $(ANDROID_JAR) -d $(MODELS_OUT) -classpath $(MODELS_CLASSPATH) $(JAVA_SOURCES) $(JAVAC) -bootclasspath $(ANDROID_JAR) -d $(MODELS_OUT) -classpath $(MODELS_CLASSPATH) $(JAVA_SOURCES)
$(INFER_REPORT): $(JAVA_DEPS_NO_MODELS) $(JAVA_SOURCES) $(INFER_REPORT): $(JAVA_DEPS_NO_MODELS) $(JAVA_SOURCES)
@rm -fr $(MODELS_OUT) @rm -fr $(MODELS_OUT)
@ -33,7 +33,7 @@ $(INFER_REPORT): $(JAVA_DEPS_NO_MODELS) $(JAVA_SOURCES)
@rm -f $(JAVA_MODELS_JAR) @rm -f $(JAVA_MODELS_JAR)
$(call silent_on_success,\ $(call silent_on_success,\
$(INFER_BIN) --jobs 1 --results-dir $(INFER_RESULTS_DIR) --models-mode -- \ $(INFER_BIN) --jobs 1 --results-dir $(INFER_RESULTS_DIR) --models-mode -- \
javac -bootclasspath $(ANDROID_JAR) -d $(MODELS_OUT) -classpath $(MODELS_CLASSPATH) \ $(JAVAC) -bootclasspath $(ANDROID_JAR) -d $(MODELS_OUT) -classpath $(MODELS_CLASSPATH) \
$(JAVA_SOURCES)) $(JAVA_SOURCES))
$(MODELS_JAR): $(INFER_REPORT) $(MODELS_JAR): $(INFER_REPORT)

@ -1,8 +1,18 @@
# Copyright (c) 2017 - 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.
ROOT_DIR = ../../../..
include $(ROOT_DIR)/Makefile.config
M_SOURCES=$(shell find . -name "*.m") M_SOURCES=$(shell find . -name "*.m")
C_SOURCES=$(shell find . -name "*.c") C_SOURCES=$(shell find . -name "*.c")
OBJECTS=$(M_SOURCES:.m=.o) $(C_SOURCES:.c=.o) OBJECTS=$(M_SOURCES:.m=.o) $(C_SOURCES:.c=.o)
CC=clang CC=clang
XCODE_PATH=$(shell xcode-select -p) XCODE_PATH=$(shell $(XCODE_SELECT) -p)
IPHONE_SIMULATOR_PATH=$(XCODE_PATH)/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk IPHONE_SIMULATOR_PATH=$(XCODE_PATH)/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk
CFLAGS=--target=x86_64-apple-darwin14 -x objective-c -c -mios-simulator-version-min=8.2 -isysroot $(IPHONE_SIMULATOR_PATH) CFLAGS=--target=x86_64-apple-darwin14 -x objective-c -c -mios-simulator-version-min=8.2 -isysroot $(IPHONE_SIMULATOR_PATH)

@ -22,7 +22,7 @@ OCAML_FATAL_WARNINGS = +3+5+6+8+10+11+12+18+19+20+23+26+29+27+33+34+35+37+38+39+
# Notice that use-ocamlfind is used here to avoid a linker bug in ocamlbuild when using -tag thread # Notice that use-ocamlfind is used here to avoid a linker bug in ocamlbuild when using -tag thread
OCAMLBUILD_OPTIONS = \ OCAMLBUILD_OPTIONS = \
-r \ -r \
-use-menhir -menhir 'menhir --explain --strict'\ -use-menhir -menhir '$(MENHIR) --explain --strict'\
-use-ocamlfind \ -use-ocamlfind \
-lflags -cclib,-lffi \ -lflags -cclib,-lffi \
-cflags -g -lflags -g \ -cflags -g -lflags -g \
@ -124,7 +124,7 @@ endif
DEPENDENCIES = IR backend base checkers eradicate harness integration tp/fts quandary bufferoverrun $(EXTRA_DEPS) DEPENDENCIES = IR backend base checkers eradicate harness integration tp/fts quandary bufferoverrun $(EXTRA_DEPS)
# ocamlbuild command with options common to all build targets # ocamlbuild command with options common to all build targets
OCAMLBUILD_BASE = rebuild $(OCAMLBUILD_OPTIONS) -j $(NCPU) $(addprefix -I , $(DEPENDENCIES)) OCAMLBUILD_BASE = $(REBUILD) $(OCAMLBUILD_OPTIONS) -j $(NCPU) $(addprefix -I , $(DEPENDENCIES))
# ocamlbuild with options necessary to build all targets at once, regardless of configure flags # ocamlbuild with options necessary to build all targets at once, regardless of configure flags
OCAMLBUILD_ALL = $(OCAMLBUILD_BASE) $(JAVA_OCAMLBUILD_OPTIONS) OCAMLBUILD_ALL = $(OCAMLBUILD_BASE) $(JAVA_OCAMLBUILD_OPTIONS)
@ -166,7 +166,7 @@ OCAML_CONFIG_SOURCES += $(CLANG_ATDGEN_STUBS) $(INFER_CLANG_FCP_MIRRORED_FILES)
endif endif
OCAML_ALL_SOURCES = $(OCAML_BASE_SOURCES) $(CLANG_ATDGEN_STUBS) $(INFER_CLANG_FCP_MIRRORED_FILES) OCAML_ALL_SOURCES = $(OCAML_BASE_SOURCES) $(CLANG_ATDGEN_STUBS) $(INFER_CLANG_FCP_MIRRORED_FILES)
export OCAMLFIND_IGNORE_DUPS_IN=$(shell ocamlc -where)/compiler-libs export OCAMLFIND_IGNORE_DUPS_IN=$(shell $(OCAMLC) -where)/compiler-libs
.PHONY: all .PHONY: all
all: infer all: infer
@ -243,10 +243,10 @@ test_build: $(TEST_BUILD_DIR)/$(INFER_MAIN).byte
# to generate interface file.mli from implementation file.ml execute: # to generate interface file.mli from implementation file.ml execute:
# make M=file mli # make M=file mli
mli: mli:
ocamlfind ocamlc -package atdgen,oUnit,str,unix,yojson,zip $(addprefix -I $(INFER_BUILD_DIR),$(DEPENDENCIES)) -i $(M).ml > $(M).mli $(OCAMLFIND) ocamlc -package atdgen,oUnit,str,unix,yojson,zip $(addprefix -I $(INFER_BUILD_DIR),$(DEPENDENCIES)) -i $(M).ml > $(M).mli
rei: rei:
ocamlfind ocamlc -package atdgen,oUnit,str,unix,yojson,zip $(addprefix -I $(INFER_BUILD_DIR),$(DEPENDENCIES)) -i -pp refmt -impl $(M).re > $(M).rei $(OCAMLFIND) ocamlc -package atdgen,oUnit,str,unix,yojson,zip $(addprefix -I $(INFER_BUILD_DIR),$(DEPENDENCIES)) -i -pp refmt -impl $(M).re > $(M).rei
# convert to reason # convert to reason
%.re : %.ml %.re : %.ml
@ -313,7 +313,7 @@ toplevel: $(INFER_BUILD_DIR)/toplevel.cmo
checkCopyright: $(CHECKCOPYRIGHT_BIN) checkCopyright: $(CHECKCOPYRIGHT_BIN)
$(CHECKCOPYRIGHT_BIN): $(BUILD_DIR) $(CHECKCOPYRIGHT_MAIN).ml Makefile $(CHECKCOPYRIGHT_BIN): $(BUILD_DIR) $(CHECKCOPYRIGHT_MAIN).ml Makefile
rebuild -quiet -r -j $(NCPU) -build-dir $(BUILD_DIR)/checkCopyright \ $(REBUILD) -quiet -r -j $(NCPU) -build-dir $(BUILD_DIR)/checkCopyright \
-cflags -g,-safe-string -lflags -g \ -cflags -g,-safe-string -lflags -g \
-pkgs core,str -tag thread -use-ocamlfind $(CHECKCOPYRIGHT_MAIN).native -pkgs core,str -tag thread -use-ocamlfind $(CHECKCOPYRIGHT_MAIN).native
$(INSTALL_PROGRAM) \ $(INSTALL_PROGRAM) \

@ -16,11 +16,11 @@ include $(TESTS_DIR)/java.make
include $(TESTS_DIR)/base.make include $(TESTS_DIR)/base.make
$(OBJECTS): $(SOURCES) $(OBJECTS): $(SOURCES)
ant $(ANT)
infer-out/report.json: $(JAVA_DEPS) $(SOURCES) infer-out/report.json: $(JAVA_DEPS) $(SOURCES)
$(call silent_on_success,\ $(call silent_on_success,\
$(INFER_BIN) -a $(ANALYZER) --project-root $(TESTS_DIR) --inferconfig-home . -- ant) $(INFER_BIN) -a $(ANALYZER) --project-root $(TESTS_DIR) --inferconfig-home . -- $(ANT))
clean: clean:
ant clean $(ANT) clean

@ -22,7 +22,7 @@ $(OBJECTS): $(JAVA_SOURCE_FILES)
cd $(ROOT_DIR) && \ cd $(ROOT_DIR) && \
$(call silent_on_success,\ $(call silent_on_success,\
INFER_BIN=$(INFER_BIN) NO_BUCKD=1 \ INFER_BIN=$(INFER_BIN) NO_BUCKD=1 \
buck build --no-cache $(BUCK_TARGET)) $(BUCK) build --no-cache $(BUCK_TARGET))
infer-out/report.json: $(JAVA_DEPS) $(JAVA_SOURCE_FILES) infer-out/report.json: $(JAVA_DEPS) $(JAVA_SOURCE_FILES)
cd $(ROOT_DIR) && \ cd $(ROOT_DIR) && \
@ -30,4 +30,4 @@ infer-out/report.json: $(JAVA_DEPS) $(JAVA_SOURCE_FILES)
$(call silent_on_success,\ $(call silent_on_success,\
INFER_BIN=$(INFER_BIN) NO_BUCKD=1 \ INFER_BIN=$(INFER_BIN) NO_BUCKD=1 \
$(INFER_BIN) -a $(ANALYZER) --results-dir $(CURDIR)/infer-out -- \ $(INFER_BIN) -a $(ANALYZER) --results-dir $(CURDIR)/infer-out -- \
buck build --no-cache $(BUCK_TARGET)) $(BUCK) build --no-cache $(BUCK_TARGET))

@ -18,9 +18,9 @@ $(CURRENT_REPORT): .inferconfig
cp src/DiffExampleTwo.java.current src/DiffExampleTwo.java cp src/DiffExampleTwo.java.current src/DiffExampleTwo.java
$(call silent_on_success,\ $(call silent_on_success,\
$(INFER_BIN) \ $(INFER_BIN) \
-o $(CURRENT_DIR) -- javac src/com/example/DiffExample.java src/DiffExampleTwo.java) -o $(CURRENT_DIR) -- $(JAVAC) src/com/example/DiffExample.java src/DiffExampleTwo.java)
$(PREVIOUS_REPORT): .inferconfig $(PREVIOUS_REPORT): .inferconfig
cp src/com/example/DiffExample.java.previous src/com/example/DiffExample.java cp src/com/example/DiffExample.java.previous src/com/example/DiffExample.java
$(call silent_on_success,\ $(call silent_on_success,\
$(INFER_BIN) -o $(PREVIOUS_DIR) -- javac src/com/example/DiffExample.java) $(INFER_BIN) -o $(PREVIOUS_DIR) -- $(JAVAC) src/com/example/DiffExample.java)

@ -14,8 +14,8 @@ include ../../differential.make
$(CURRENT_REPORT): $(CURRENT_REPORT):
cp src/DiffExample.java.current src/DiffExample.java cp src/DiffExample.java.current src/DiffExample.java
$(call silent_on_success, $(INFER_BIN) -o $(CURRENT_DIR) -- javac src/*.java) $(call silent_on_success, $(INFER_BIN) -o $(CURRENT_DIR) -- $(JAVAC) src/*.java)
$(PREVIOUS_REPORT): $(PREVIOUS_REPORT):
cp src/DiffExample.java.previous src/DiffExample.java cp src/DiffExample.java.previous src/DiffExample.java
$(call silent_on_success, $(INFER_BIN) -o $(PREVIOUS_DIR) -- javac src/*.java) $(call silent_on_success, $(INFER_BIN) -o $(PREVIOUS_DIR) -- $(JAVAC) src/*.java)

@ -16,9 +16,9 @@ $(CURRENT_REPORT):
cp src/DiffExample.java.current src/DiffExample.java cp src/DiffExample.java.current src/DiffExample.java
cp src/DiffExampleTwo.java.current src/DiffExampleTwo.java cp src/DiffExampleTwo.java.current src/DiffExampleTwo.java
$(call silent_on_success,\ $(call silent_on_success,\
$(INFER_BIN) -o $(CURRENT_DIR) -- javac src/DiffExample.java src/DiffExampleTwo.java) $(INFER_BIN) -o $(CURRENT_DIR) -- $(JAVAC) src/DiffExample.java src/DiffExampleTwo.java)
$(PREVIOUS_REPORT): $(PREVIOUS_REPORT):
cp src/DiffExample.java.previous src/DiffExample.java cp src/DiffExample.java.previous src/DiffExample.java
$(call silent_on_success,\ $(call silent_on_success,\
$(INFER_BIN) -o $(PREVIOUS_DIR) -- javac src/DiffExample.java) $(INFER_BIN) -o $(PREVIOUS_DIR) -- $(JAVAC) src/DiffExample.java)

@ -16,9 +16,9 @@ include ../../differential.make
$(CURRENT_REPORT): $(CURRENT_REPORT):
cp src/DiffExampleRenamed.java.current src/DiffExampleRenamed.java cp src/DiffExampleRenamed.java.current src/DiffExampleRenamed.java
$(call silent_on_success,\ $(call silent_on_success,\
$(INFER_BIN) -o $(CURRENT_DIR) -- javac src/DiffExampleRenamed.java) $(INFER_BIN) -o $(CURRENT_DIR) -- $(JAVAC) src/DiffExampleRenamed.java)
$(PREVIOUS_REPORT): $(PREVIOUS_REPORT):
cp src/DiffExample.java.previous src/DiffExample.java cp src/DiffExample.java.previous src/DiffExample.java
$(call silent_on_success,\ $(call silent_on_success,\
$(INFER_BIN) -o $(PREVIOUS_DIR) -- javac src/DiffExample.java) $(INFER_BIN) -o $(PREVIOUS_DIR) -- $(JAVAC) src/DiffExample.java)

@ -24,7 +24,7 @@ include $(TESTS_DIR)/base.make
$(OBJECTS): $(JAVA_SOURCE_FILES) $(OBJECTS): $(JAVA_SOURCE_FILES)
cd $(ROOT_DIR) && \ cd $(ROOT_DIR) && \
$(call silent_on_success,\ $(call silent_on_success,\
NO_BUCKD=1 buck build --no-cache $(BUCK_TARGET)) NO_BUCKD=1 $(BUCK) build --no-cache $(BUCK_TARGET))
.PHONY: genrule .PHONY: genrule
genrule: $(JSON_REPORT) genrule: $(JSON_REPORT)
@ -35,7 +35,7 @@ $(JSON_REPORT): $(JAVA_DEPS) $(JAVA_SOURCE_FILES)
$(REMOVE_DIR) buck-out && \ $(REMOVE_DIR) buck-out && \
$(call silent_on_success,\ $(call silent_on_success,\
INFER_BIN="$(INFER_BIN)" NO_BUCKD=1 GENERATE_INFER_GENRULES=1 \ INFER_BIN="$(INFER_BIN)" NO_BUCKD=1 GENERATE_INFER_GENRULES=1 \
buck build --no-cache $(INFER_TARGET)) $(BUCK) build --no-cache $(INFER_TARGET))
touch $@ touch $@
infer-out/report.json: $(JSON_REPORT) infer-out/report.json: $(JSON_REPORT)

@ -85,7 +85,7 @@ infer-out-javac/report.json: $(JAVA_DEPS) $(JAVAC_DIR)
cd $(JAVAC_DIR) && \ cd $(JAVAC_DIR) && \
$(call silent_on_success,\ $(call silent_on_success,\
$(INFER_BIN) -a $(ANALYZER) --results-dir $(CURDIR)/$(@D) -- \ $(INFER_BIN) -a $(ANALYZER) --results-dir $(CURDIR)/$(@D) -- \
javac -cp $(CLASSPATH) $(foreach source,$(JAVAC_SOURCES),$(notdir $(source)))) $(JAVAC) -cp $(CLASSPATH) $(foreach source,$(JAVAC_SOURCES),$(notdir $(source))))
infer-out-make/report.json: $(CLANG_DEPS) $(MAKE_DIR) infer-out-make/report.json: $(CLANG_DEPS) $(MAKE_DIR)
cd $(MAKE_DIR) && \ cd $(MAKE_DIR) && \

@ -19,13 +19,13 @@ EXP_TESTs = $(sort $(patsubst %.java,%.exp.test.noreplace,$(SOURCES)))
INFER_OUTs = $(patsubst %.java,infer-out-%,$(SOURCES)) INFER_OUTs = $(patsubst %.java,infer-out-%,$(SOURCES))
$(OBJECTS): $(SOURCES) $(OBJECTS): $(SOURCES)
javac -cp $(CLASSPATH) $(SOURCES) $(JAVAC) -cp $(CLASSPATH) $(SOURCES)
# analyze a single source file and generate the test results for it # analyze a single source file and generate the test results for it
%.exp.test.noreplace: $(JAVA_DEPS) %.stacktrace.json %.java %.exp.test.noreplace: $(JAVA_DEPS) %.stacktrace.json %.java
$(call silent_on_success,\ $(call silent_on_success,\
$(INFER_BIN) -a $(ANALYZER) -o infer-out-$* --stacktrace $*.stacktrace.json \ $(INFER_BIN) -a $(ANALYZER) -o infer-out-$* --stacktrace $*.stacktrace.json \
-- javac -cp $(CLASSPATH) $*.java) -- $(JAVAC) -cp $(CLASSPATH) $*.java)
# add a newline at the end of the json when creating the exp.test # add a newline at the end of the json when creating the exp.test
$(COPY) infer-out-$*/crashcontext/crashcontext.json $@ && echo >> $@ $(COPY) infer-out-$*/crashcontext/crashcontext.json $@ && echo >> $@

@ -9,7 +9,7 @@ TESTS_DIR = ../../..
IPHONESIMULATOR_ISYSROOT_SUFFIX = /Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk IPHONESIMULATOR_ISYSROOT_SUFFIX = /Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk
XCODEROOT = $(shell xcode-select -p) XCODEROOT = $(shell $(XCODE_SELECT) -p)
ANALYZER = infer ANALYZER = infer
CLANG_OPTIONS = -x objective-c \ CLANG_OPTIONS = -x objective-c \

@ -10,7 +10,7 @@ TESTS_DIR = ../../../..
IPHONESIMULATOR_ISYSROOT_SUFFIX = \ IPHONESIMULATOR_ISYSROOT_SUFFIX = \
/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk /Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk
XCODEROOT = $(shell xcode-select -p) XCODEROOT = $(shell $(XCODE_SELECT) -p)
CLANG_OPTIONS = -x objective-c \ CLANG_OPTIONS = -x objective-c \
-isysroot $(XCODEROOT)$(IPHONESIMULATOR_ISYSROOT_SUFFIX) \ -isysroot $(XCODEROOT)$(IPHONESIMULATOR_ISYSROOT_SUFFIX) \

@ -10,7 +10,7 @@ TESTS_DIR = ../../../..
IPHONESIMULATOR_ISYSROOT_SUFFIX = \ IPHONESIMULATOR_ISYSROOT_SUFFIX = \
/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk /Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk
XCODEROOT = $(shell xcode-select -p) XCODEROOT = $(shell $(XCODE_SELECT) -p)
CLANG_OPTIONS = -x objective-c \ CLANG_OPTIONS = -x objective-c \
-isysroot $(XCODEROOT)$(IPHONESIMULATOR_ISYSROOT_SUFFIX) \ -isysroot $(XCODEROOT)$(IPHONESIMULATOR_ISYSROOT_SUFFIX) \

@ -9,7 +9,7 @@ TESTS_DIR = ../../..
IPHONESIMULATOR_ISYSROOT_SUFFIX = /Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk IPHONESIMULATOR_ISYSROOT_SUFFIX = /Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk
XCODEROOT = $(shell xcode-select -p) XCODEROOT = $(shell $(XCODE_SELECT) -p)
CLANG_OPTIONS = -x objective-c \ CLANG_OPTIONS = -x objective-c \
-isysroot $(XCODEROOT)$(IPHONESIMULATOR_ISYSROOT_SUFFIX) \ -isysroot $(XCODEROOT)$(IPHONESIMULATOR_ISYSROOT_SUFFIX) \

@ -9,7 +9,7 @@ TESTS_DIR = ../../..
IPHONESIMULATOR_ISYSROOT_SUFFIX = /Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk IPHONESIMULATOR_ISYSROOT_SUFFIX = /Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk
XCODEROOT = $(shell xcode-select -p) XCODEROOT = $(shell $(XCODE_SELECT) -p)
CLANG_OPTIONS = -x objective-c \ CLANG_OPTIONS = -x objective-c \
-isysroot $(XCODEROOT)$(IPHONESIMULATOR_ISYSROOT_SUFFIX) \ -isysroot $(XCODEROOT)$(IPHONESIMULATOR_ISYSROOT_SUFFIX) \

@ -9,7 +9,7 @@ TESTS_DIR=../../..
IPHONESIMULATOR_ISYSROOT_SUFFIX = /Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk IPHONESIMULATOR_ISYSROOT_SUFFIX = /Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk
XCODEROOT = $(shell xcode-select -p) XCODEROOT = $(shell $(XCODE_SELECT) -p)
CLANG_OPTIONS = -x objective-c++ -std=c++11 \ CLANG_OPTIONS = -x objective-c++ -std=c++11 \
-isysroot $(XCODEROOT)$(IPHONESIMULATOR_ISYSROOT_SUFFIX) \ -isysroot $(XCODEROOT)$(IPHONESIMULATOR_ISYSROOT_SUFFIX) \

@ -20,9 +20,9 @@ include $(TESTS_DIR)/base.make
PROJECT_ROOT ?= $(TESTS_DIR) PROJECT_ROOT ?= $(TESTS_DIR)
$(OBJECTS): $(SOURCES) $(OBJECTS): $(SOURCES)
javac -cp $(CLASSPATH) $(SOURCES) $(JAVAC) -cp $(CLASSPATH) $(SOURCES)
infer-out/report.json: $(JAVA_DEPS) $(SOURCES) infer-out/report.json: $(JAVA_DEPS) $(SOURCES)
$(call silent_on_success,\ $(call silent_on_success,\
$(INFER_BIN) -a $(ANALYZER) --inferconfig-home . --project-root $(PROJECT_ROOT) $(INFER_OPTIONS) -- \ $(INFER_BIN) -a $(ANALYZER) --inferconfig-home . --project-root $(PROJECT_ROOT) $(INFER_OPTIONS) -- \
javac -cp $(CLASSPATH) $(SOURCES)) $(JAVAC) -cp $(CLASSPATH) $(SOURCES))

@ -37,7 +37,7 @@ dnl For documentation, please read the ocaml.m4 man page.
AC_DEFUN([AC_PROG_OCAML], AC_DEFUN([AC_PROG_OCAML],
[dnl [dnl
# checking for ocamlc # checking for ocamlc
AC_CHECK_TOOL([OCAMLC],[ocamlc],[no]) AC_PATH_TOOL([OCAMLC],[ocamlc],[no])
if test "$OCAMLC" != "no"; then if test "$OCAMLC" != "no"; then
OCAMLVERSION=`$OCAMLC -v | sed -n -e 's|.*version* *\(.*\)$|\1|p'` OCAMLVERSION=`$OCAMLC -v | sed -n -e 's|.*version* *\(.*\)$|\1|p'`
@ -54,7 +54,7 @@ AC_DEFUN([AC_PROG_OCAML],
AC_SUBST([OCAMLLIB]) AC_SUBST([OCAMLLIB])
# checking for ocamlopt # checking for ocamlopt
AC_CHECK_TOOL([OCAMLOPT],[ocamlopt],[no]) AC_PATH_TOOL([OCAMLOPT],[ocamlopt],[no])
OCAMLBEST=byte OCAMLBEST=byte
if test "$OCAMLOPT" = "no"; then if test "$OCAMLOPT" = "no"; then
AC_MSG_WARN([Cannot find ocamlopt; bytecode compilation only.]) AC_MSG_WARN([Cannot find ocamlopt; bytecode compilation only.])
@ -71,7 +71,7 @@ AC_DEFUN([AC_PROG_OCAML],
AC_SUBST([OCAMLBEST]) AC_SUBST([OCAMLBEST])
# checking for ocamlc.opt # checking for ocamlc.opt
AC_CHECK_TOOL([OCAMLCDOTOPT],[ocamlc.opt],[no]) AC_PATH_TOOL([OCAMLCDOTOPT],[ocamlc.opt],[no])
if test "$OCAMLCDOTOPT" != "no"; then if test "$OCAMLCDOTOPT" != "no"; then
TMPVERSION=`$OCAMLCDOTOPT -v | sed -n -e 's|.*version* *\(.*\)$|\1|p' ` TMPVERSION=`$OCAMLCDOTOPT -v | sed -n -e 's|.*version* *\(.*\)$|\1|p' `
if test "$TMPVERSION" != "$OCAMLVERSION" ; then if test "$TMPVERSION" != "$OCAMLVERSION" ; then
@ -83,7 +83,7 @@ AC_DEFUN([AC_PROG_OCAML],
# checking for ocamlopt.opt # checking for ocamlopt.opt
if test "$OCAMLOPT" != "no" ; then if test "$OCAMLOPT" != "no" ; then
AC_CHECK_TOOL([OCAMLOPTDOTOPT],[ocamlopt.opt],[no]) AC_PATH_TOOL([OCAMLOPTDOTOPT],[ocamlopt.opt],[no])
if test "$OCAMLOPTDOTOPT" != "no"; then if test "$OCAMLOPTDOTOPT" != "no"; then
TMPVERSION=`$OCAMLOPTDOTOPT -v | sed -n -e 's|.*version* *\(.*\)$|\1|p' ` TMPVERSION=`$OCAMLOPTDOTOPT -v | sed -n -e 's|.*version* *\(.*\)$|\1|p' `
if test "$TMPVERSION" != "$OCAMLVERSION" ; then if test "$TMPVERSION" != "$OCAMLVERSION" ; then
@ -112,31 +112,31 @@ AC_DEFUN([AC_PROG_OCAML],
AC_SUBST([OCAMLNATDYNLINK]) AC_SUBST([OCAMLNATDYNLINK])
# checking for ocaml toplevel # checking for ocaml toplevel
AC_CHECK_TOOL([OCAML],[ocaml],[no]) AC_PATH_TOOL([OCAML],[ocaml],[no])
# checking for ocamldep # checking for ocamldep
AC_CHECK_TOOL([OCAMLDEP],[ocamldep],[no]) AC_PATH_TOOL([OCAMLDEP],[ocamldep],[no])
# checking for ocamlmktop # checking for ocamlmktop
AC_CHECK_TOOL([OCAMLMKTOP],[ocamlmktop],[no]) AC_PATH_TOOL([OCAMLMKTOP],[ocamlmktop],[no])
# checking for ocamlmklib # checking for ocamlmklib
AC_CHECK_TOOL([OCAMLMKLIB],[ocamlmklib],[no]) AC_PATH_TOOL([OCAMLMKLIB],[ocamlmklib],[no])
# checking for ocamldoc # checking for ocamldoc
AC_CHECK_TOOL([OCAMLDOC],[ocamldoc],[no]) AC_PATH_TOOL([OCAMLDOC],[ocamldoc],[no])
# checking for ocamlbuild # checking for ocamlbuild
AC_CHECK_TOOL([OCAMLBUILD],[ocamlbuild],[no]) AC_PATH_TOOL([OCAMLBUILD],[ocamlbuild],[no])
]) ])
AC_DEFUN([AC_PROG_OCAMLLEX], AC_DEFUN([AC_PROG_OCAMLLEX],
[dnl [dnl
# checking for ocamllex # checking for ocamllex
AC_CHECK_TOOL([OCAMLLEX],[ocamllex],[no]) AC_PATH_TOOL([OCAMLLEX],[ocamllex],[no])
if test "$OCAMLLEX" != "no"; then if test "$OCAMLLEX" != "no"; then
AC_CHECK_TOOL([OCAMLLEXDOTOPT],[ocamllex.opt],[no]) AC_PATH_TOOL([OCAMLLEXDOTOPT],[ocamllex.opt],[no])
if test "$OCAMLLEXDOTOPT" != "no"; then if test "$OCAMLLEXDOTOPT" != "no"; then
OCAMLLEX=$OCAMLLEXDOTOPT OCAMLLEX=$OCAMLLEXDOTOPT
fi fi
@ -146,7 +146,7 @@ AC_DEFUN([AC_PROG_OCAMLLEX],
AC_DEFUN([AC_PROG_OCAMLYACC], AC_DEFUN([AC_PROG_OCAMLYACC],
[dnl [dnl
AC_CHECK_TOOL([OCAMLYACC],[ocamlyacc],[no]) AC_PATH_TOOL([OCAMLYACC],[ocamlyacc],[no])
AC_SUBST([OCAMLYACC]) AC_SUBST([OCAMLYACC])
]) ])
@ -156,7 +156,7 @@ AC_DEFUN([AC_PROG_CAMLP4],
AC_REQUIRE([AC_PROG_OCAML])dnl AC_REQUIRE([AC_PROG_OCAML])dnl
# checking for camlp4 # checking for camlp4
AC_CHECK_TOOL([CAMLP4],[camlp4],[no]) AC_PATH_TOOL([CAMLP4],[camlp4],[no])
if test "$CAMLP4" != "no"; then if test "$CAMLP4" != "no"; then
TMPVERSION=`$CAMLP4 -v 2>&1| sed -n -e 's|.*version *\(.*\)$|\1|p'` TMPVERSION=`$CAMLP4 -v 2>&1| sed -n -e 's|.*version *\(.*\)$|\1|p'`
if test "$TMPVERSION" != "$OCAMLVERSION" ; then if test "$TMPVERSION" != "$OCAMLVERSION" ; then
@ -167,14 +167,14 @@ AC_DEFUN([AC_PROG_CAMLP4],
AC_SUBST([CAMLP4]) AC_SUBST([CAMLP4])
# checking for companion tools # checking for companion tools
AC_CHECK_TOOL([CAMLP4BOOT],[camlp4boot],[no]) AC_PATH_TOOL([CAMLP4BOOT],[camlp4boot],[no])
AC_CHECK_TOOL([CAMLP4O],[camlp4o],[no]) AC_PATH_TOOL([CAMLP4O],[camlp4o],[no])
AC_CHECK_TOOL([CAMLP4OF],[camlp4of],[no]) AC_PATH_TOOL([CAMLP4OF],[camlp4of],[no])
AC_CHECK_TOOL([CAMLP4OOF],[camlp4oof],[no]) AC_PATH_TOOL([CAMLP4OOF],[camlp4oof],[no])
AC_CHECK_TOOL([CAMLP4ORF],[camlp4orf],[no]) AC_PATH_TOOL([CAMLP4ORF],[camlp4orf],[no])
AC_CHECK_TOOL([CAMLP4PROF],[camlp4prof],[no]) AC_PATH_TOOL([CAMLP4PROF],[camlp4prof],[no])
AC_CHECK_TOOL([CAMLP4R],[camlp4r],[no]) AC_PATH_TOOL([CAMLP4R],[camlp4r],[no])
AC_CHECK_TOOL([CAMLP4RF],[camlp4rf],[no]) AC_PATH_TOOL([CAMLP4RF],[camlp4rf],[no])
AC_SUBST([CAMLP4BOOT]) AC_SUBST([CAMLP4BOOT])
AC_SUBST([CAMLP4O]) AC_SUBST([CAMLP4O])
AC_SUBST([CAMLP4OF]) AC_SUBST([CAMLP4OF])
@ -191,7 +191,7 @@ AC_DEFUN([AC_PROG_FINDLIB],
AC_REQUIRE([AC_PROG_OCAML])dnl AC_REQUIRE([AC_PROG_OCAML])dnl
# checking for ocamlfind # checking for ocamlfind
AC_CHECK_TOOL([OCAMLFIND],[ocamlfind],[no]) AC_PATH_TOOL([OCAMLFIND],[ocamlfind],[no])
AC_SUBST([OCAMLFIND]) AC_SUBST([OCAMLFIND])
]) ])

Loading…
Cancel
Save