@ -99,16 +99,16 @@ Makefile.autoconf: configure Makefile.autoconf.in
.PHONY : src_build
src_build : $( MAKEFILE_LIST )
i f e q ( $( IS_FACEBOOK_TREE ) , y e s )
@ $( MAKE) -C facebook setup
$( QUIET) $( MAKE) -C facebook setup
e n d i f
@ $( MAKE) -C $( SRC_DIR) infer
$( QUIET) $( MAKE) -C $( SRC_DIR) infer
.PHONY : byte
byte :
i f e q ( $( IS_FACEBOOK_TREE ) , y e s )
@ $( MAKE) -C facebook setup
$( QUIET) $( MAKE) -C facebook setup
e n d i f
@ $( MAKE) -C $( SRC_DIR) byte
$( QUIET) $( MAKE) -C $( SRC_DIR) byte
i f e q ( $( BUILD_C_ANALYZERS ) , y e s )
src_build : clang_plugin
@ -118,16 +118,16 @@ endif
.PHONY : infer
infer : src_build
i f e q ( $( BUILD_JAVA_ANALYZERS ) , y e s )
@ $( MAKE) -C $( ANNOTATIONS_DIR)
$( QUIET) $( MAKE) -C $( ANNOTATIONS_DIR)
e n d i f
# Delete existing specs so that they are not used during the analysis of models. Infer may
# segfault in some cases otherwise.
@ $( MAKE) -C $( MODELS_DIR) clean_specs
@ $( MAKE) -C $( MODELS_DIR) all
$( QUIET) $( MAKE) -C $( MODELS_DIR) clean_specs
$( QUIET) $( MAKE) -C $( MODELS_DIR) all
.PHONY : clang_setup
clang_setup :
@export CC = " $( CC) " CFLAGS = " $( CFLAGS) " ; \
$( QUIET) export CC = " $( CC) " CFLAGS = " $( CFLAGS) " ; \
export CXX = " $( CXX) " CXXFLAGS = " $( CXXFLAGS) " ; \
export CPP = " $( CPP) " LDFLAGS = " $( LDFLAGS) " LIBS = " $( LIBS) " ; \
$( FCP_DIR) /clang/setup.sh --only-check-install || \
@ -136,14 +136,14 @@ clang_setup:
.PHONY : clang_plugin
clang_plugin : clang_setup
i f e q ( $( IS_RELEASE_TREE ) , n o )
@ $( MAKE) -C $( FCP_DIR) /libtooling all \
$( QUIET) $( 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 \
$( QUIET) $( 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) " \
@ -156,10 +156,10 @@ endif
.PHONY : test_build
test_build : clang_plugin
i f e q ( $( IS_FACEBOOK_TREE ) , y e s )
@ $( MAKE) -C facebook setup
$( QUIET) $( MAKE) -C facebook setup
e n d i f
@ $( MAKE) -C $( SRC_DIR) TEST = 1 byte
@ $( MAKE) -C $( SRC_DIR) TEST = 1 toplevel
$( QUIET) $( MAKE) -C $( SRC_DIR) TEST = 1 byte
$( QUIET) $( MAKE) -C $( SRC_DIR) TEST = 1 toplevel
.PHONY : ocaml_unit_test
ocaml_unit_test : test_build
@ -172,28 +172,28 @@ endef
.PHONY : $( DIRECT_TESTS :%=direct_ %_test )
$(DIRECT_TESTS : %=direct_ %_test ): infer
@ $( call silence_make,\
$( QUIET) $( call silence_make,\
$( MAKE) -C \
$( INFER_DIR) /tests/codetoanalyze/$( shell printf $@ | cut -f 2 -d _) /$( shell printf $@ | cut -f 3 -d _) \
test )
.PHONY : $( DIRECT_TESTS :%=direct_ %_print )
$(DIRECT_TESTS : %=direct_ %_print ): infer
@ $( call silence_make,\
$( QUIET) $( call silence_make,\
$( MAKE) -C \
$( INFER_DIR) /tests/codetoanalyze/$( shell printf $@ | cut -f 2 -d _) /$( shell printf $@ | cut -f 3 -d _) \
print)
.PHONY : $( DIRECT_TESTS :%=direct_ %_clean )
$(DIRECT_TESTS : %=direct_ %_clean ):
@ $( call silence_make,\
$( QUIET) $( call silence_make,\
$( MAKE) -C \
$( INFER_DIR) /tests/codetoanalyze/$( shell printf $@ | cut -f 2 -d _) /$( shell printf $@ | cut -f 3 -d _) \
clean)
.PHONY : $( DIRECT_TESTS :%=direct_ %_replace )
$(DIRECT_TESTS : %=direct_ %_replace ): infer
@ $( call silence_make,\
$( QUIET) $( call silence_make,\
$( MAKE) -C \
$( INFER_DIR) /tests/codetoanalyze/$( shell printf $@ | cut -f 2 -d _) /$( shell printf $@ | cut -f 3 -d _) \
replace)
@ -211,22 +211,22 @@ build_waf_print: build_make_print
.PHONY : $( BUILD_SYSTEMS_TESTS :%=build_ %_test )
$(BUILD_SYSTEMS_TESTS : %=build_ %_test ): infer
@ $( call silence_make,\
$( QUIET) $( call silence_make,\
$( MAKE) -C $( INFER_DIR) /tests/build_systems/$( patsubst build_%_test,%,$@ ) test )
.PHONY : $( BUILD_SYSTEMS_TESTS :%=build_ %_print )
$(BUILD_SYSTEMS_TESTS : %=build_ %_print ): infer
@ $( call silence_make,\
$( QUIET) $( call silence_make,\
$( MAKE) -C $( INFER_DIR) /tests/build_systems/$( patsubst build_%_print,%,$@ ) print)
.PHONY : $( BUILD_SYSTEMS_TESTS :%=build_ %_clean )
$(BUILD_SYSTEMS_TESTS : %=build_ %_clean ):
@ $( call silence_make,\
$( QUIET) $( call silence_make,\
$( MAKE) -C $( INFER_DIR) /tests/build_systems/$( patsubst build_%_clean,%,$@ ) clean)
.PHONY : $( BUILD_SYSTEMS_TESTS :%=build_ %_replace )
$(BUILD_SYSTEMS_TESTS : %=build_ %_replace ): infer
@ $( call silence_make,\
$( QUIET) $( call silence_make,\
$( MAKE) -C $( INFER_DIR) /tests/build_systems/$( patsubst build_%_replace,%,$@ ) replace)
.PHONY : build_systems_tests
@ -248,7 +248,7 @@ else
clang -c $( EXAMPLES_DIR) /hello.c \
> /dev/null
e n d i f
@ rm -f Hello.class
$( QUIET) 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__ \
@ -257,16 +257,16 @@ endif
--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__
$( QUIET) rm -fr __test-infer-out__
.PHONY : check_missing_mli
check_missing_mli :
@for x in $$ ( find $( INFER_DIR) /src -name "*.ml" -or -name "*.re" ) ; do \
$( QUIET) for x in $$ ( find $( INFER_DIR) /src -name "*.ml" -or -name "*.re" ) ; do \
test -f " $$ x " i || echo Missing " $$ x " i; done
.PHONY : toplevel
toplevel : clang_plugin
@ $( MAKE) -C $( SRC_DIR) toplevel
$( QUIET) $( MAKE) -C $( SRC_DIR) toplevel
.PHONY : inferScriptMode_test
inferScriptMode_test : test_build
@ -275,21 +275,21 @@ inferScriptMode_test: test_build
.PHONY : checkCopyright
checkCopyright :
@ $( MAKE) -C $( SRC_DIR) checkCopyright
$( QUIET) $( MAKE) -C $( SRC_DIR) checkCopyright
.PHONY : validate -skel
validate-skel :
i f e q ( $( IS_FACEBOOK_TREE ) , y e s )
@ $( MAKE) -C facebook validate
$( QUIET) $( MAKE) -C facebook validate
e n d i f
.PHONY : test
test : test_build ocaml_unit_test endtoend_test inferTraceBugs_test inferScriptMode_test \
checkCopyright validate-skel
@ $( MAKE) -C $( SRC_DIR) mod_dep.dot
$( QUIET) $( MAKE) -C $( SRC_DIR) mod_dep.dot
i f e q ( , $( findstring s ,$ ( MAKEFLAGS ) ) )
@echo "ALL TESTS PASSED"
$( QUIET) echo "ALL TESTS PASSED"
e n d i f
.PHONY : quick -test
@ -316,13 +316,13 @@ install: infer
i f e q ( $( BUILD_C_ANALYZERS ) , y e s )
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/install -type d) ; do \
$( QUIET) for i in $$ ( find facebook-clang-plugins/clang/install -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/
@for i in $$ ( find infer/models/cpp/include/ -type d) ; do \
$( QUIET) for i in $$ ( find infer/models/cpp/include/ -type d) ; do \
test -d $( DESTDIR) $( libdir) /infer/$$ i || \
$( MKDIR_P) $( DESTDIR) $( libdir) /infer/$$ i; \
done
@ -356,10 +356,10 @@ endif
i f e q ( $( BUILD_C_ANALYZERS ) , y e s )
$( 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/install -not -type d) ; do \
$( QUIET) for i in $$ ( find facebook-clang-plugins/clang/install -not -type d) ; do \
$( INSTALL_PROGRAM) -C $$ i $( DESTDIR) $( libdir) /infer/$$ i; \
done
@for i in $$ ( find infer/lib/clang_wrappers/*) ; do \
$( QUIET) for i in $$ ( find infer/lib/clang_wrappers/*) ; do \
$( INSTALL_PROGRAM) -C $$ i $( DESTDIR) $( libdir) /infer/$$ i; \
done
# only for files that point to InferClang
@ -368,10 +368,10 @@ ifeq ($(BUILD_C_ANALYZERS),yes)
[ $( cc) -ef $( INFERCLANG_BIN) ] && \
$( REMOVE) $( notdir $( cc) ) && \
$( LN_S) ../../bin/InferClang $( notdir $( cc) ) ; ) )
@for i in $$ ( find infer/lib/specs/*) ; do \
$( QUIET) for i in $$ ( find infer/lib/specs/*) ; do \
$( INSTALL_DATA) -C $$ i $( DESTDIR) $( libdir) /infer/$$ i; \
done
@for i in $$ ( find infer/models/cpp/include/ -not -type d) ; do \
$( QUIET) for i in $$ ( find infer/models/cpp/include/ -not -type d) ; do \
$( INSTALL_DATA) -C $$ i $( DESTDIR) $( libdir) /infer/$$ i; \
done
$( INSTALL_DATA) -C infer/lib/linter_rules/linters.al \
@ -381,20 +381,20 @@ ifeq ($(BUILD_C_ANALYZERS),yes)
$( LN_S) -f InferClang InferClang++)
e n d i f
i f n e q ( $( XCODE_SELECT ) , n o )
@for i in $$ ( find infer/lib/xcode_wrappers/*) ; do \
$( QUIET) for i in $$ ( find infer/lib/xcode_wrappers/*) ; do \
$( INSTALL_PROGRAM) -C $$ i $( DESTDIR) $( libdir) /infer/$$ i; \
done
e n d i f
i f e q ( $( BUILD_JAVA_ANALYZERS ) , y e s )
$( INSTALL_DATA) -C infer/annotations/annotations.jar \
$( DESTDIR) $( libdir) /infer/infer/annotations/annotations.jar
@for i in infer/lib/java/*.jar; do \
$( QUIET) for i in infer/lib/java/*.jar; do \
$( INSTALL_DATA) -C $$ i $( DESTDIR) $( libdir) /infer/$$ i; \
done
$( INSTALL_PROGRAM) -C $( LIB_DIR) /wrappers/javac \
$( DESTDIR) $( libdir) /infer/infer/lib/wrappers/
e n d i f
@for i in $$ ( find infer/lib/python/inferlib/* -type f) ; do \
$( QUIET) 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.py \
@ -414,24 +414,24 @@ endif
$( LN_S) $( libdir_relative_to_bindir) /infer/infer/lib/python/inferTraceBugs inferTraceBugs)
i f e q ( $( IS_FACEBOOK_TREE ) , y e s )
@ $( MAKE) -C facebook install
$( QUIET) $( MAKE) -C facebook install
e n d i f
.PHONY : clean
clean : test_clean
i f e q ( $( IS_RELEASE_TREE ) , n o )
i f e q ( $( BUILD_C_ANALYZERS ) , y e s )
@ $( MAKE) -C $( FCP_DIR) clean
@ $( MAKE) -C $( FCP_DIR) /clang-ocaml clean
$( QUIET) $( MAKE) -C $( FCP_DIR) clean
$( QUIET) $( MAKE) -C $( FCP_DIR) /clang-ocaml clean
e n d i f
e n d i f
@ $( MAKE) -C $( SRC_DIR) clean
@ $( MAKE) -C $( ANNOTATIONS_DIR) clean
@ $( MAKE) -C $( MODELS_DIR) clean
$( QUIET) $( MAKE) -C $( SRC_DIR) clean
$( QUIET) $( MAKE) -C $( ANNOTATIONS_DIR) clean
$( QUIET) $( MAKE) -C $( MODELS_DIR) clean
i f e q ( $( IS_FACEBOOK_TREE ) , y e s )
@ $( MAKE) -C facebook clean
$( QUIET) $( MAKE) -C facebook clean
e n d i f
@ $( MAKE) -C $( DEPENDENCIES_DIR) /ocamldot clean
$( QUIET) $( MAKE) -C $( DEPENDENCIES_DIR) /ocamldot clean
find $( INFER_DIR) /tests -name '*.o' -or -name '*.o.sh' -delete
.PHONY : conf -clean
@ -453,9 +453,9 @@ conf-clean: clean
# print any variable for Makefile debugging
print-% :
@echo '$*=$($*)'
$( QUIET) echo '$*=$($*)'
# print list of targets
.PHONY : show -targets
show-targets :
@ $( MAKE) -pqrR . | grep --only-matching -e '^[a-zA-Z0-9][^ ]*:' | cut -d ':' -f 1 | sort
$( QUIET) $( MAKE) -pqrR . | grep --only-matching -e '^[a-zA-Z0-9][^ ]*:' | cut -d ':' -f 1 | sort