diff --git a/.gitignore b/.gitignore index 89682b7c4..62827a2de 100644 --- a/.gitignore +++ b/.gitignore @@ -103,8 +103,6 @@ buck-out/ /infer/src/backend/.projectSettings /infer/models/out/ -/infer/_build-infer/ - /infer/src/clang/clang_ast_b.ml /infer/src/clang/clang_ast_b.mli /infer/src/clang/clang_ast_j.ml @@ -118,6 +116,9 @@ buck-out/ /infer/src/clang/clang_ast_visit.ml /infer/src/clang/clang_ast_main.ml +/infer/src/llvm/lLexer.ml +/infer/src/llvm/lParser.ml + /infer/annotations/annot_classes/ /infer/annotations/annotations.jar /infer/annotations/processor_classes/ diff --git a/Makefile.config.in b/Makefile.config.in index 2bd2c3ed9..7c88ae21d 100644 --- a/Makefile.config.in +++ b/Makefile.config.in @@ -44,16 +44,10 @@ INFERTRACEBUGS_BIN = $(BIN_DIR)/inferTraceBugs 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) \ diff --git a/Makefile.in b/Makefile.in index efa14dcf0..d4e0f83db 100644 --- a/Makefile.in +++ b/Makefile.in @@ -29,35 +29,15 @@ TARGETS_TO_TEST += objc objcpp endif TARGETS_TO_TEST := $(shell echo $(TARGETS_TO_TEST)) -all: $(INFER_ANALYZERS) +all: infer inferTraceBugs -java: inferTraceBugs -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 +infer: + $(MAKE) -C $(INFER_DIR) infer -clang: inferTraceBugs -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 +ifeq (@BUILD_C_ANALYZERS@,yes) +infer: clang_plugin endif -ifeq (@BUILD_C_ANALYZERS@,yes) clang_setup: export CC="@CC@" CFLAGS="@CFLAGS@"; \ export CXX="@CXX@" CXXFLAGS="@CXXFLAGS@"; \ @@ -83,31 +63,10 @@ ifeq (@IS_RELEASE_TREE@,no) CLANG_INCLUDES=@CLANG_INCLUDES@ endif -clang: clang_plugin -endif - -test_build_src: - $(MAKE) -C $(SRC_DIR) test_build - -test_build_clang: clang_plugin - $(MAKE) -C $(INFER_DIR) clang - -test_build_java: - $(MAKE) -C $(INFER_DIR) java - -test_build_llvm: - $(MAKE) -C $(INFER_DIR) llvm - -test_build: test_build_src test_build_clang test_build_java test_build_llvm - -unit: - $(MAKE) -C $(SRC_DIR) unit - -ifeq (@BUILD_C_ANALYZERS@,yes) test_build: clang_plugin -endif + $(MAKE) -C $(SRC_DIR) test_build -ocaml_unit_test: test_build unit +ocaml_unit_test: test_build $(INFERUNIT_BIN) buck_test: test_build @@ -117,7 +76,7 @@ ifeq (@BUILD_JAVA_ANALYZERS@,yes) NO_BUCKD=1 ./infer/tests/build_systems/build_integration_tests.py endif -buck_test_xml: $(INFER_ANALYZERS) +buck_test_xml: test_build NO_BUCKD=1 buck clean NO_BUCKD=1 buck test --xml test.xml $(TARGETS_TO_TEST) ifeq (@BUILD_JAVA_ANALYZERS@,yes) @@ -128,17 +87,10 @@ inferTraceBugs: $(MAKE) -C $(INFER_DIR) $(INFERTRACEBUGS_BIN_RELPATH) inferTraceBugs_test: test_build -ifeq (@BUILD_JAVA_ANALYZERS@,yes) $(INFER_BIN) -o __test-infer-out__ -- \ javac $(EXAMPLES_DIR)/Hello.java \ > /dev/null @rm -f Hello.class -else - $(INFER_BIN) -o __test-infer-out__ \ - -- clang -c $(EXAMPLES_DIR)/hello.c \ - > /dev/null - @rm -f hello.o -endif $(PYTHON_DIR)/inferTraceBugs -o __test-infer-out__ \ --select 0 --max-level max > /dev/null $(PYTHON_DIR)/inferTraceBugs -o __test-infer-out__ \ @@ -154,12 +106,8 @@ check_missing_mli: for x in `find infer/src -name "*.ml"`; do \ test -f "$$x"i || echo Missing "$$x"i; done' -test: - $(MAKE) -C $(INFER_DIR) $(INFER_BIN_RELPATH) - $(MAKE) -C $(SRC_DIR) init - $(MAKE) -j$(NCPU) test_build +test: test_build ocaml_unit_test buck_test inferTraceBugs_test $(MAKE) -C $(SRC_DIR) mod_dep.dot - $(MAKE) ocaml_unit_test buck_test inferTraceBugs_test test_xml: buck_test_xml @@ -168,7 +116,7 @@ uninstall: $(REMOVE) $(DESTDIR)$(bindir)/inferTraceBugs $(REMOVE) $(DESTDIR)$(bindir)/infer -install: $(INFER_ANALYZERS) inferTraceBugs +install: infer inferTraceBugs # create directory structure test -d $(DESTDIR)$(bindir) || \ $(MKDIR_P) $(DESTDIR)$(bindir) @@ -291,7 +239,7 @@ conf-clean: clean $(REMOVE_DIR) infer/models/objc/out/ $(REMOVE) infer/src/Makefile -.PHONY: all buck_test buck_test_xml clean clang -.PHONY: clang_plugin clang_setup inferTraceBugs inferTraceBugs_test java -.PHONY: ocaml_unit_test check_missing_mli test test_xml test_build unit +.PHONY: all buck_test buck_test_xml clean +.PHONY: clang_plugin clang_setup infer inferTraceBugs inferTraceBugs_test +.PHONY: ocaml_unit_test check_missing_mli test test_xml test_build .PHONY: install uninstall diff --git a/build-infer.sh b/build-infer.sh index daf65b758..c46a6d8b4 100755 --- a/build-infer.sh +++ b/build-infer.sh @@ -113,14 +113,6 @@ if [ ! -f .release ]; then ./autogen.sh > /dev/null fi -TARGETS="" -if [ "$BUILD_JAVA" = "yes" ]; then - TARGETS+=" java" -fi -if [ "$BUILD_CLANG" = "yes" ]; then - TARGETS+=" clang" -fi - CONFIGURE_ARGS= if [ "$BUILD_CLANG" = "no" ]; then CONFIGURE_ARGS+=" --disable-c-analyzers" @@ -162,7 +154,7 @@ if [ "$BUILD_CLANG" = "yes" ] && ! facebook-clang-plugins/clang/setup.sh --only- fi fi -make -j $NCPU $TARGETS || ( +make -j $NCPU all || ( echo echo ' compilation failure; you can try running' echo diff --git a/configure.ac b/configure.ac index ab40a78a0..5c687abbf 100644 --- a/configure.ac +++ b/configure.ac @@ -67,6 +67,14 @@ AC_ARG_ENABLE(java-analyzers, BUILD_JAVA_ANALYZERS=$enable_java_analyzers AC_SUBST([BUILD_JAVA_ANALYZERS]) +AC_ARG_ENABLE(llvm-analyzers, + AS_HELP_STRING([--enable-llvm-analyzers], + [build the LLVM experimental analyzers (default is not to build them)]), + , + enable_llvm_analyzers=no) +BUILD_LLVM_ANALYZERS=$enable_llvm_analyzers +AC_SUBST([BUILD_LLVM_ANALYZERS]) + AC_ARG_WITH(fcp-clang, AS_HELP_STRING([--without-fcp-clang], [do not use $CLANG_PREFIX/bin/clang to override the default compiler (default is to override if in an infer release)]), diff --git a/infer/.merlin b/infer/.merlin index c12ac584e..46e27193d 100644 --- a/infer/.merlin +++ b/infer/.merlin @@ -1,5 +1,5 @@ S src/** -B _build-infer/** +B _build/infer/** PKG atdgen PKG extlib PKG javalib diff --git a/infer/Makefile.in b/infer/Makefile.in index 1009da1db..4890ec7d1 100644 --- a/infer/Makefile.in +++ b/infer/Makefile.in @@ -10,28 +10,19 @@ ROOT_DIR = .. include $(ROOT_DIR)/Makefile.config -all: clang java llvm $(INFER_BIN_RELPATH) $(INFERTRACEBUGS_BIN_RELPATH) -all: checkCopyright +all: infer $(INFER_BIN_RELPATH) $(INFERTRACEBUGS_BIN_RELPATH) $(INFER_BIN_RELPATH) $(INFERTRACEBUGS_BIN_RELPATH): ($(REMOVE) $@ && \ cd $(@D) && \ $(LN_S) ../lib/python/$(@F) $(@F)) -java: $(INFER_BIN_RELPATH) - $(MAKE) -C $(SRC_DIR) java +infer: $(INFER_BIN_RELPATH) + $(MAKE) -C $(SRC_DIR) infer +ifeq (@BUILD_JAVA_ANALYZERS@,yes) $(MAKE) -C $(ANNOTATIONS_DIR) - $(MAKE) -C $(MODELS_DIR) java - -clang: $(INFER_BIN_RELPATH) - $(MAKE) -C $(SRC_DIR) clang - $(MAKE) -C $(MODELS_DIR) clang - -llvm: $(INFER_BIN_RELPATH) - $(MAKE) -C $(SRC_DIR) llvm - -checkCopyright: - $(MAKE) -C $(SRC_DIR) checkCopyright +endif + $(MAKE) -C $(MODELS_DIR) all clean: $(MAKE) -C $(SRC_DIR) clean @@ -39,4 +30,4 @@ clean: $(MAKE) -C $(MODELS_DIR) clean $(REMOVE) $(INFER_BIN_RELPATH) $(INFERTRACEBUGS_BIN_RELPATH) -.PHONY: all checkCopyright clang clean java llvm models +.PHONY: all clean infer diff --git a/infer/models/Makefile.in b/infer/models/Makefile.in index fda0782c9..802c204dd 100644 --- a/infer/models/Makefile.in +++ b/infer/models/Makefile.in @@ -19,6 +19,14 @@ ifneq (no, @XCODE_SELECT@) CLANG_SUBDIRS += $(OBJC_MODELS_DIR) endif +all: +ifeq (@BUILD_C_ANALYZERS@,yes) +all: clang +endif +ifeq (@BUILD_JAVA_ANALYZERS@,yes) +all: java +endif + .PHONY: java clang clean $(CLANG_SUBDIRS) clang: $(CLANG_SUBDIRS) diff --git a/infer/src/Makefile.in b/infer/src/Makefile.in index 15907fb17..3c227ae6d 100644 --- a/infer/src/Makefile.in +++ b/infer/src/Makefile.in @@ -17,13 +17,9 @@ ATDGEN = @ATDGEN@ #### Global declarations #### -BUILD_DIR = $(INFER_DIR)/_build-infer -JAVA_BUILD_DIR = $(BUILD_DIR)/java -CLANG_BUILD_DIR = $(BUILD_DIR)/clang +BUILD_DIR = $(INFER_DIR)/_build +INFER_BUILD_DIR = $(BUILD_DIR)/infer LLVM_BUILD_DIR = $(BUILD_DIR)/llvm -SCRIPTS_BUILD_DIR = $(BUILD_DIR)/scripts -TEST_BUILD_DIR = $(BUILD_DIR)/test -UNIT_BUILD_DIR = $(BUILD_DIR)/unit ANNOT_DIR = $(SRC_DIR)/_build ETC_DIR = $(INFER_DIR)/etc @@ -111,6 +107,7 @@ CLANG_BINIOU_DICT = $(ETC_DIR)/clang_ast.dict #### LLVM declarations #### LLVM_SOURCES = llvm +MENHIR_SOURCES = menhir INFERLLVM_MAIN = $(LLVM_SOURCES)/lMain INFERLLVM_BIN = $(BIN_DIR)/InferLLVM @@ -132,78 +129,107 @@ endif DEPENDENCIES = IR backend checkers eradicate harness \ facebook/checkers facebook/checkers/graphql facebook/scripts $(EXTRA_DEPS) -OCAMLBUILD = rebuild $(OCAMLBUILD_OPTIONS) -j $(NCPU) $(addprefix -I , $(DEPENDENCIES)) +# ocamlbuild command with options common to all build targets +OCAMLBUILD_BASE = rebuild $(OCAMLBUILD_OPTIONS) -j $(NCPU) $(addprefix -I , $(DEPENDENCIES)) -.PHONY: all java clang llvm unit checkCopyright build_java build_clang build_llvm build_unit \ - build_checkCopyright java_annotations clang_annotations llvm_annotations \ - scripts_annotations init version sanitize clean +# ocamlbuild with options necessary to build all targets at once, regardless of configure flags +OCAMLBUILD_ALL = $(OCAMLBUILD_BASE) $(JAVA_OCAMLBUILD_OPTIONS) -default: $(INFER_ANALYZERS) +# list of ocamlbuild targets common to all build targets -- native version +INFER_BASE_TARGETS = \ + $(INFERANALYZE_MAIN).native \ + $(INFERPRINT_MAIN).native \ + $(INFERUNIT_MAIN).native \ + $(CHECKCOPYRIGHT_MAIN).native \ + $(INFERUNIT_MAIN).native -all: java clang llvm checkCopyright unit +INFER_ALL_TARGETS = $(INFER_BASE_TARGETS) \ + $(INFERJAVA_MAIN).native \ + $(INFERCLANG_MAIN).native \ + $(INFERLLVM_MAIN).native -java: $(INFERJAVA_BIN) +# configure-aware ocamlbuild commands and targets +OCAMLBUILD_CONFIG = $(OCAMLBUILD_BASE) +INFER_CONFIG_TARGETS = $(INFER_BASE_TARGETS) -clang: $(INFERCLANG_BIN) $(CLANG_BINIOU_DICT) - -llvm: $(INFERLLVM_BIN) - -unit: $(INFERUNIT_BIN) +ifeq (@BUILD_JAVA_ANALYZERS@,yes) +OCAMLBUILD_CONFIG += $(JAVA_OCAMLBUILD_OPTIONS) +INFER_CONFIG_TARGETS += $(INFERJAVA_MAIN).native +endif +ifeq (@BUILD_C_ANALYZERS@,yes) +INFER_CONFIG_TARGETS += $(INFERCLANG_MAIN).native +endif +ifeq (@BUILD_LLVM_ANALYZERS@,yes) +INFER_CONFIG_TARGETS += $(INFERLLVM_MAIN).native +endif -checkCopyright: $(CHECKCOPYRIGHT_BIN) +.PHONY: all infer init version sanitize clean -build_java: init $(INFERPRINT_ATDGEN_STUBS) - $(OCAMLBUILD) -build-dir $(JAVA_BUILD_DIR) $(JAVA_OCAMLBUILD_OPTIONS) \ - $(INFERANALYZE_MAIN).native \ - $(INFERPRINT_MAIN).native \ - $(INFERJAVA_MAIN).native +all: infer -build_clang: init $(INFERPRINT_ATDGEN_STUBS) $(CLANG_ATDGEN_STUBS) $(INFER_CLANG_FCP_MIRRORED_FILES) - $(OCAMLBUILD) -build-dir $(CLANG_BUILD_DIR) \ - $(INFERANALYZE_MAIN).native \ - $(INFERPRINT_MAIN).native \ - $(INFERCLANG_MAIN).native +infer: init $(INFERPRINT_ATDGEN_STUBS) + $(OCAMLBUILD_CONFIG) -build-dir $(INFER_BUILD_DIR) $(INFER_CONFIG_TARGETS) + $(COPY) $(INFER_BUILD_DIR)/$(INFERANALYZE_MAIN).native $(INFERANALYZE_BIN) + $(COPY) $(INFER_BUILD_DIR)/$(INFERPRINT_MAIN).native $(INFERPRINT_BIN) + $(COPY) $(INFER_BUILD_DIR)/$(CHECKCOPYRIGHT_MAIN).native $(CHECKCOPYRIGHT_BIN) + $(COPY) $(INFER_BUILD_DIR)/$(INFERUNIT_MAIN).native $(INFERUNIT_BIN) +ifeq (@BUILD_LLVM_ANALYZERS@,yes) + $(COPY) $(INFER_BUILD_DIR)/$(INFERLLVM_MAIN).native $(INFERLLVM_BIN) +endif +ifeq (@BUILD_JAVA_ANALYZERS@,yes) + $(COPY) $(INFER_BUILD_DIR)/$(INFERJAVA_MAIN).native $(INFERJAVA_BIN) +endif +ifeq (@BUILD_C_ANALYZERS@,yes) + $(COPY) $(INFER_BUILD_DIR)/$(INFERCLANG_MAIN).native $(INFERCLANG_BIN) +endif +ifeq (@ENABLE_OCAML_ANNOT@,yes) + rsync -a --include '*/' --include '*.annot' --exclude '*' $(INFER_BUILD_DIR)/ $(ANNOT_DIR)/ +endif -build_llvm: - $(OCAMLBUILD) -build-dir $(LLVM_BUILD_DIR) -use-menhir $(INFERLLVM_MAIN).native +ifeq (@BUILD_C_ANALYZERS@,yes) +infer: $(CLANG_ATDGEN_STUBS) $(INFER_CLANG_FCP_MIRRORED_FILES) +endif +ifeq (@BUILD_LLVM_ANALYZERS@,yes) +infer: $(LLVM_SOURCES)/lLexer.ml $(LLVM_SOURCES)/lParser.ml +endif -build_checkCopyright: - $(OCAMLBUILD) -build-dir $(SCRIPTS_BUILD_DIR) -I $(SCRIPT_SOURCES) \ - $(CHECKCOPYRIGHT_MAIN).native +$(LLVM_SOURCES)/lLexer.ml $(LLVM_SOURCES)/lParser.ml: init + $(OCAMLBUILD_BASE) -build-dir $(LLVM_BUILD_DIR) -I $(LLVM_SOURCES) -use-menhir $(MENHIR_SOURCES)/$(@F) + $(COPY) $(LLVM_BUILD_DIR)/$(MENHIR_SOURCES)/$(@F) $@ -build_unit: - $(OCAMLBUILD) -build-dir $(UNIT_BUILD_DIR) -I $(UNIT_SOURCES) \ - $(INFERUNIT_MAIN).native +$(LLVM_SOURCES)/lLexer.ml: $(MENHIR_SOURCES)/lLexer.mll +# avoid race condition between concurrently running ocamlbuild instances by making the parser depend +# on the lexer +$(LLVM_SOURCES)/lParser.ml: $(MENHIR_SOURCES)/lParser.mly $(LLVM_SOURCES)/lLexer.ml -byte: init $(INFERPRINT_ATDGEN_STUBS) $(CLANG_ATDGEN_STUBS) $(INFER_CLANG_FCP_MIRRORED_FILES) - $(OCAMLBUILD) -build-dir $(TEST_BUILD_DIR) $(JAVA_OCAMLBUILD_OPTIONS) \ - $(INFERANALYZE_MAIN).byte \ - $(INFERPRINT_MAIN).byte \ - $(INFERJAVA_MAIN).byte \ - $(INFERCLANG_MAIN).byte \ - $(INFERUNIT_MAIN).byte \ - $(CHECKCOPYRIGHT_MAIN).byte +byte: init $(INFERPRINT_ATDGEN_STUBS) $(CLANG_ATDGEN_STUBS) $(INFER_CLANG_FCP_MIRRORED_FILES) \ + $(LLVM_SOURCES)/lLexer.ml $(LLVM_SOURCES)/lParser.ml + $(OCAMLBUILD_ALL) -build-dir $(INFER_BUILD_DIR) $(INFER_ALL_TARGETS:.native=.byte) # to build only the single module (and its dependencies) with extra flags execute: # make INFER_CFLAGS= M=.cm{o,x} module M= INFER_CFLAGS= -module: init $(INFERPRINT_ATDGEN_STUBS) $(CLANG_ATDGEN_STUBS) $(INFER_CLANG_FCP_MIRRORED_FILES) - $(OCAMLBUILD) -build-dir $(TEST_BUILD_DIR) $(JAVA_OCAMLBUILD_OPTIONS) \ +module: init $(INFERPRINT_ATDGEN_STUBS) $(CLANG_ATDGEN_STUBS) $(INFER_CLANG_FCP_MIRRORED_FILES) \ + $(LLVM_SOURCES)/lLexer.ml $(LLVM_SOURCES)/lParser.ml + $(OCAMLBUILD_ALL) -build-dir $(INFER_BUILD_DIR) \ -cflags -warn-error,$(OCAML_FATAL_WARNINGS) \ -cflags $(INFER_CFLAGS) \ $(M) -test_build: init $(INFERPRINT_ATDGEN_STUBS) $(CLANG_ATDGEN_STUBS) $(INFER_CLANG_FCP_MIRRORED_FILES) - $(OCAMLBUILD) -build-dir $(TEST_BUILD_DIR) $(JAVA_OCAMLBUILD_OPTIONS) \ +test_build: init $(INFERPRINT_ATDGEN_STUBS) $(CLANG_ATDGEN_STUBS) $(INFER_CLANG_FCP_MIRRORED_FILES) \ + $(LLVM_SOURCES)/lLexer.ml $(LLVM_SOURCES)/lParser.ml + $(OCAMLBUILD_ALL) -build-dir $(INFER_BUILD_DIR) \ -cflags -warn-error,$(OCAML_FATAL_WARNINGS) \ - $(INFERANALYZE_MAIN).byte \ - $(INFERPRINT_MAIN).byte \ - $(INFERJAVA_MAIN).byte \ - $(INFERCLANG_MAIN).byte \ - $(INFERUNIT_MAIN).byte \ - $(CHECKCOPYRIGHT_MAIN).byte + $(INFER_ALL_TARGETS) + $(COPY) $(INFER_BUILD_DIR)/$(INFERANALYZE_MAIN).native $(INFERANALYZE_BIN) + $(COPY) $(INFER_BUILD_DIR)/$(INFERPRINT_MAIN).native $(INFERPRINT_BIN) + $(COPY) $(INFER_BUILD_DIR)/$(CHECKCOPYRIGHT_MAIN).native $(CHECKCOPYRIGHT_BIN) + $(COPY) $(INFER_BUILD_DIR)/$(INFERUNIT_MAIN).native $(INFERUNIT_BIN) + $(COPY) $(INFER_BUILD_DIR)/$(INFERLLVM_MAIN).native $(INFERLLVM_BIN) + $(COPY) $(INFER_BUILD_DIR)/$(INFERJAVA_MAIN).native $(INFERJAVA_BIN) + $(COPY) $(INFER_BUILD_DIR)/$(INFERCLANG_MAIN).native $(INFERCLANG_BIN) $(DEPENDENCIES_DIR)/ocamldot/ocamldot: $(MAKE) -C $(DEPENDENCIES_DIR)/ocamldot @@ -218,25 +244,6 @@ mod_dep.dot: $(DEPENDENCIES_DIR)/ocamldot/ocamldot $(src_files) | $(DEPENDENCIES_DIR)/ocamldot/ocamldot -lr $(root_flags) \ > mod_dep.dot -ifeq (@ENABLE_OCAML_ANNOT@,yes) -java_annotations: build_java - rsync -a --include '*/' --include '*.annot' --exclude '*' $(JAVA_BUILD_DIR)/ $(ANNOT_DIR)/ - -clang_annotations: build_clang - rsync -a --include '*/' --include '*.annot' --exclude '*' $(CLANG_BUILD_DIR)/ $(ANNOT_DIR)/ - -llvm_annotations: build_llvm - rsync -a --include '*/' --include '*.annot' --exclude '*' $(LLVM_BUILD_DIR)/ $(ANNOT_DIR)/ - -scripts_annotations: build_checkCopyright - rsync -a --include '*/' --include '*.annot' --exclude '*' $(SCRIPTS_BUILD_DIR)/ $(ANNOT_DIR)/ - -java: java_annotations -clang: clang_annotations -llvm: llvm_annotations -checkCopyright: scripts_annotations -endif - define gen_atdgen_rules # generate files using atdgen # parameters: @@ -303,33 +310,17 @@ version: backend/version.ml.in Makefile $(BUILD_DIR): $(MKDIR_P) $(BUILD_DIR) -$(INFERJAVA_BIN): build_java - $(COPY) $(JAVA_BUILD_DIR)/$(INFERANALYZE_MAIN).native $(INFERANALYZE_BIN) - $(COPY) $(JAVA_BUILD_DIR)/$(INFERPRINT_MAIN).native $(INFERPRINT_BIN) - $(COPY) $(JAVA_BUILD_DIR)/$(INFERJAVA_MAIN).native $(INFERJAVA_BIN) - -$(INFERCLANG_BIN): build_clang - $(COPY) $(CLANG_BUILD_DIR)/$(INFERANALYZE_MAIN).native $(INFERANALYZE_BIN) - $(COPY) $(CLANG_BUILD_DIR)/$(INFERPRINT_MAIN).native $(INFERPRINT_BIN) - $(COPY) $(CLANG_BUILD_DIR)/$(INFERCLANG_MAIN).native $(INFERCLANG_BIN) - -$(INFERLLVM_BIN): build_llvm - $(COPY) $(LLVM_BUILD_DIR)/$(INFERLLVM_MAIN).native $(INFERLLVM_BIN) - -$(INFERUNIT_BIN): build_unit - $(COPY) $(UNIT_BUILD_DIR)/$(INFERUNIT_MAIN).native $(INFERUNIT_BIN) - -$(CHECKCOPYRIGHT_BIN): build_checkCopyright - $(COPY) $(SCRIPTS_BUILD_DIR)/$(CHECKCOPYRIGHT_MAIN).native $(CHECKCOPYRIGHT_BIN) - test_clean: - $(REMOVE_DIR) $(TEST_BUILD_DIR) + $(REMOVE_DIR) $(INFER_BUILD_DIR) clean: $(REMOVE_DIR) $(BUILD_DIR) $(REMOVE) $(ETC_DIR)/clang_ast.dict ifeq (@ENABLE_OCAML_ANNOT@,yes) $(REMOVE_DIR) $(ANNOT_DIR) +endif +ifeq (@BUILD_LLVM_ANALYZERS@,yes) + $(REMOVE) $(LLVM_SOURCES)/lLexer.ml $(LLVM_SOURCES)/lParser.ml endif $(REMOVE) backend/version.ml $(REMOVE) backend/version.ml.tmp.* diff --git a/infer/src/llvm/.merlin b/infer/src/llvm/.merlin new file mode 100644 index 000000000..6fc7b1fda --- /dev/null +++ b/infer/src/llvm/.merlin @@ -0,0 +1,3 @@ +REC +S * +B ../../_build/llvm/** diff --git a/infer/src/llvm/lLexer.mll b/infer/src/menhir/lLexer.mll similarity index 100% rename from infer/src/llvm/lLexer.mll rename to infer/src/menhir/lLexer.mll diff --git a/infer/src/llvm/lParser.mly b/infer/src/menhir/lParser.mly similarity index 100% rename from infer/src/llvm/lParser.mly rename to infer/src/menhir/lParser.mly