From 55ceb64ba618eb7c630bb0b4cc20a44c72579a42 Mon Sep 17 00:00:00 2001 From: Jules Villard Date: Fri, 10 Feb 2017 04:13:49 -0800 Subject: [PATCH] [make] only build inferunit for bytecode mode Summary: Native compilation seems to take a couple of seconds to build the unit test binary, but we don't need it to be native (and neither do users building infer to install it on their machines). In fact, the test mode rebuilds it in bytecode mode. For the sake of being able to run the unit tests when developing on infer (and thus possibly while having some fatal warnings showing up in the code, preventing us from building the test target), also build InferUnit in bytecode mode. Reviewed By: sblackshear, martinoluca Differential Revision: D4537455 fbshipit-source-id: 374c84c --- infer/src/Makefile | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/infer/src/Makefile b/infer/src/Makefile index 90acc88a1..95900040a 100644 --- a/infer/src/Makefile +++ b/infer/src/Makefile @@ -133,8 +133,7 @@ OCAMLBUILD_ALL = $(OCAMLBUILD_BASE) $(JAVA_OCAMLBUILD_OPTIONS) INFER_BASE_TARGETS = \ $(INFER_MAIN).native \ $(INFERANALYZE_MAIN).native \ - $(INFERPRINT_MAIN).native \ - $(INFERUNIT_MAIN).native + $(INFERPRINT_MAIN).native INFER_ALL_TARGETS = $(INFER_BASE_TARGETS) \ $(INFERCLANG_MAIN).native \ @@ -184,7 +183,6 @@ $(BIN_DIR): Makefile $(INFER_BIN).native: $(INFER_BUILD_DIR)/$(INFER_MAIN).native $(BIN_DIR) $(INSTALL_PROGRAM) $(INFER_BUILD_DIR)/$(INFERANALYZE_MAIN).native $(INFERANALYZE_BIN) $(INSTALL_PROGRAM) $(INFER_BUILD_DIR)/$(INFERPRINT_MAIN).native $(INFERPRINT_BIN) - $(INSTALL_PROGRAM) $(INFER_BUILD_DIR)/$(INFERUNIT_MAIN).native $(INFERUNIT_BIN) ifeq ($(BUILD_C_ANALYZERS),yes) $(INSTALL_PROGRAM) $(INFER_BUILD_DIR)/$(INFERCLANG_MAIN).native $(INFERCLANG_BIN) endif @@ -199,7 +197,8 @@ infer: $(CLANG_BINIOU_DICT) endif $(INFER_BUILD_DIR)/$(INFER_MAIN).byte: base/Version.ml $(BUILD_DIR) $(OCAML_ALL_SOURCES) - $(OCAMLBUILD_ALL) -build-dir $(INFER_BUILD_DIR) $(INFER_ALL_TARGETS:.native=.byte) + $(OCAMLBUILD_ALL) -build-dir $(INFER_BUILD_DIR) \ + $(INFER_ALL_TARGETS:.native=.byte) $(INFERUNIT_MAIN).byte @touch $@ $(INFER_BIN).byte: $(INFER_BUILD_DIR)/$(INFER_MAIN).byte $(BIN_DIR) @@ -231,7 +230,7 @@ module: base/Version.ml $(BUILD_DIR) $(OCAML_ALL_SOURCES) $(TEST_BUILD_DIR)/$(INFER_MAIN).byte: base/Version.ml $(BUILD_DIR) $(OCAML_ALL_SOURCES) toplevel.mlpack $(OCAMLBUILD_ALL) -build-dir $(TEST_BUILD_DIR) \ -cflags -warn-error,$(OCAML_FATAL_WARNINGS) \ - $(INFER_ALL_TARGETS:.native=.byte) toplevel.cmo + $(INFER_ALL_TARGETS:.native=.byte) $(INFERUNIT_MAIN).byte toplevel.cmo @touch $@ .PHONY: test_build