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
master
Josh Berdine 9 years ago committed by facebook-github-bot-4
parent 4e8008baf2
commit 3a7f4b9d3f

@ -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)/

Loading…
Cancel
Save