From 3a7f4b9d3f7f5a7eca7922ba12922c4dc25e2468 Mon Sep 17 00:00:00 2001 From: Josh Berdine Date: Fri, 19 Feb 2016 06:56:38 -0800 Subject: [PATCH] Add byte target Summary:public This is intended as a target to build during development when quick compilation and no duplicate compilation warnings are desired. This builds byte code for InferAnalyze, InferPrint, InferJava, and InferClang. This is one ocamlbuild invocation, so builds (and reports warnings on) each source file once. Building bytecode is currently about twice as fast as native code. The llvm frontend is currently not built by this since it requires menhir and standard ocamlyacc is required by the backend, and ocamlbuild can only use one at a time. Reviewed By: jvillard Differential Revision: D2953050 fb-gh-sync-id: 2e90fcd shipit-source-id: 2e90fcd --- infer/src/Makefile.in | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/infer/src/Makefile.in b/infer/src/Makefile.in index 5a5ff3b4d..3be7ff2f9 100644 --- a/infer/src/Makefile.in +++ b/infer/src/Makefile.in @@ -33,6 +33,7 @@ JAVA_BUILD_DIR = $(BUILD_DIR)/java CLANG_BUILD_DIR = $(BUILD_DIR)/clang LLVM_BUILD_DIR = $(BUILD_DIR)/llvm SCRIPTS_BUILD_DIR = $(BUILD_DIR)/scripts +TEST_BUILD_DIR = $(BUILD_DIR)/test ANNOT_DIR = $(SRC_DIR)/_build ETC_DIR = $(INFER_DIR)/etc @@ -160,6 +161,8 @@ OCAMLBUILD = ocamlbuild $(OCAMLBUILD_OPTIONS) -j 0 $(addprefix -I , $(DEPENDENCI java_annotations clang_annotations llvm_annotations scripts_annotations \ init version sanitize clean +default: $(INFER_ANALYZERS) + all: java clang llvm checkCopyright java: $(INFERJAVA_BIN) @@ -189,6 +192,13 @@ build_checkCopyright: $(OCAMLBUILD) -build-dir $(SCRIPTS_BUILD_DIR) -I $(SCRIPT_SOURCES) \ $(CHECKCOPYRIGHT_MAIN).native +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 + ifeq (@ENABLE_OCAML_ANNOT@,yes) java_annotations: build_java rsync -a --include '*/' --include '*.annot' --exclude '*' $(JAVA_BUILD_DIR)/ $(ANNOT_DIR)/