[make] add `make byte` toplevel target

Summary:
`make byte` will populate infer/bin/ with bytecode version of each executable,
plus infer/bin/infer.byte (used to remember which of the native or byte
executables have been built most recently). `make infer` now also creates
infer/bin/infer.native, so that we're sure to replace the executables with
native/byte versions as appropriate.

This is to make debugging a tad easier:

  make byte
  ledit ocamldebug $(which infer) <infer args>

Whereas previously one had to:

  make -C infer/src byte
  ledit ocamldebug infer/_build/infer/backend/infer.byte <infer args>

Reviewed By: jberdine

Differential Revision: D4409476

fbshipit-source-id: ab5f57d
master
Jules Villard 8 years ago committed by Facebook Github Bot
parent 8b57278c70
commit cece221ab7

10
.gitignore vendored

@ -75,14 +75,8 @@ buck-out/
.buckd/ .buckd/
#other #other
/infer/bin/InferAnalyze /infer/bin
/infer/bin/InferClang
/infer/bin/InferClang++
/infer/bin/InferPrint
/infer/bin/InferUnit
/infer/bin/Typeprop
/infer/bin/infer
/infer/src/base/Version.ml /infer/src/base/Version.ml
/infer/models/java/models/ /infer/models/java/models/
/infer/models/java/models.jar /infer/models/java/models.jar

@ -55,8 +55,17 @@ ifeq ($(IS_FACEBOOK_TREE),yes)
@$(MAKE) -C facebook setup @$(MAKE) -C facebook setup
endif endif
@$(MAKE) -C $(SRC_DIR) infer @$(MAKE) -C $(SRC_DIR) infer
.PHONY: byte
byte:
ifeq ($(IS_FACEBOOK_TREE),yes)
@$(MAKE) -C facebook setup
endif
@$(MAKE) -C $(SRC_DIR) byte
ifeq ($(BUILD_C_ANALYZERS),yes) ifeq ($(BUILD_C_ANALYZERS),yes)
src_build: clang_plugin src_build: clang_plugin
byte: clang_plugin
endif endif
.PHONY: infer .PHONY: infer

@ -181,7 +181,7 @@ $(BIN_DIR): Makefile
$(MKDIR_P) $@ $(MKDIR_P) $@
@touch $@ @touch $@
$(INFER_BIN): $(INFER_BUILD_DIR)/$(INFER_MAIN).native $(BIN_DIR) $(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)/$(INFERANALYZE_MAIN).native $(INFERANALYZE_BIN)
$(INSTALL_PROGRAM) $(INFER_BUILD_DIR)/$(INFERPRINT_MAIN).native $(INFERPRINT_BIN) $(INSTALL_PROGRAM) $(INFER_BUILD_DIR)/$(INFERPRINT_MAIN).native $(INFERPRINT_BIN)
$(INSTALL_PROGRAM) $(INFER_BUILD_DIR)/$(INFERUNIT_MAIN).native $(INFERUNIT_BIN) $(INSTALL_PROGRAM) $(INFER_BUILD_DIR)/$(INFERUNIT_MAIN).native $(INFERUNIT_BIN)
@ -189,9 +189,10 @@ ifeq ($(BUILD_C_ANALYZERS),yes)
$(INSTALL_PROGRAM) $(INFER_BUILD_DIR)/$(INFERCLANG_MAIN).native $(INFERCLANG_BIN) $(INSTALL_PROGRAM) $(INFER_BUILD_DIR)/$(INFERCLANG_MAIN).native $(INFERCLANG_BIN)
endif endif
$(INSTALL_PROGRAM) $(INFER_BUILD_DIR)/$(INFER_MAIN).native $(INFER_BIN) $(INSTALL_PROGRAM) $(INFER_BUILD_DIR)/$(INFER_MAIN).native $(INFER_BIN)
$(INSTALL_PROGRAM) $(INFER_BUILD_DIR)/$(INFER_MAIN).native $(INFER_BIN).native
.PHONY: infer .PHONY: infer
infer: $(INFER_BIN) infer: $(INFER_BIN).native
ifeq ($(BUILD_C_ANALYZERS),yes) ifeq ($(BUILD_C_ANALYZERS),yes)
infer: $(CLANG_BINIOU_DICT) infer: $(CLANG_BINIOU_DICT)
@ -201,8 +202,18 @@ $(INFER_BUILD_DIR)/$(INFER_MAIN).byte: base/Version.ml $(BUILD_DIR) $(OCAML_ALL_
$(OCAMLBUILD_ALL) -build-dir $(INFER_BUILD_DIR) $(INFER_ALL_TARGETS:.native=.byte) $(OCAMLBUILD_ALL) -build-dir $(INFER_BUILD_DIR) $(INFER_ALL_TARGETS:.native=.byte)
@touch $@ @touch $@
$(INFER_BIN).byte: $(INFER_BUILD_DIR)/$(INFER_MAIN).byte $(BIN_DIR)
$(INSTALL_PROGRAM) $(INFER_BUILD_DIR)/$(INFERANALYZE_MAIN).byte $(INFERANALYZE_BIN)
$(INSTALL_PROGRAM) $(INFER_BUILD_DIR)/$(INFERPRINT_MAIN).byte $(INFERPRINT_BIN)
$(INSTALL_PROGRAM) $(INFER_BUILD_DIR)/$(INFERUNIT_MAIN).byte $(INFERUNIT_BIN)
ifeq ($(BUILD_C_ANALYZERS),yes)
$(INSTALL_PROGRAM) $(INFER_BUILD_DIR)/$(INFERCLANG_MAIN).byte $(INFERCLANG_BIN)
endif
$(INSTALL_PROGRAM) $(INFER_BUILD_DIR)/$(INFER_MAIN).byte $(INFER_BIN)
$(INSTALL_PROGRAM) $(INFER_BUILD_DIR)/$(INFER_MAIN).byte $(INFER_BIN).byte
.PHONY: byte .PHONY: byte
byte: $(INFER_BUILD_DIR)/$(INFER_MAIN).byte byte: $(INFER_BIN).byte
# to build only the single module <Module> (and its dependencies) with extra flags execute: # to build only the single module <Module> (and its dependencies) with extra flags execute:
# make MFLAGS=<flags> M=<Module>.cm{o,x} module # make MFLAGS=<flags> M=<Module>.cm{o,x} module

Loading…
Cancel
Save