Skip to content

Commit

Permalink
Add a 'VERSION' file to the SDK build (#178)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jesper Lindstrøm Nielsen authored Dec 21, 2021
1 parent 746df36 commit c28d3d2
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ TOITPKG_BIN = $(BIN_DIR)/toitpkg$(EXE_SUFFIX)
TOITLSP_BIN = $(BIN_DIR)/toitlsp$(EXE_SUFFIX)
TOITVM_BIN = $(BIN_DIR)/toitvm$(EXE_SUFFIX)
TOITC_BIN = $(BIN_DIR)/toitc$(EXE_SUFFIX)
VERSION_FILE = $(BIN_DIR)/VERSION

# Note that the boot snapshot lives in the bin dir.
TOIT_BOOT_SNAPSHOT = $(BIN_DIR)/toitvm_boot.snapshot
Expand All @@ -50,7 +51,7 @@ SNAPSHOT_DIR = build/host/sdk/snapshots

prefix ?= /opt/toit-sdk

TOOLS = $(TOITPKG_BIN) $(TOITLSP_BIN) $(TOITVM_BIN) $(TOITC_BIN)
TOOLS = $(TOITPKG_BIN) $(TOITLSP_BIN) $(TOITVM_BIN) $(TOITC_BIN) $(VERSION_FILE)
SNAPSHOTS = $(SNAPSHOT_DIR)/system_message.snapshot $(SNAPSHOT_DIR)/snapshot_to_image.snapshot $(SNAPSHOT_DIR)/inject_config.snapshot

.PHONY: all
Expand Down Expand Up @@ -128,6 +129,10 @@ build/$(ESP32_CHIP)/lib/libtoit_image.a: build/$(ESP32_CHIP)/$(ESP32_CHIP).image
$(TOITVM_BIN) $(TOITC_BIN) $(TOIT_BOOT_SNAPSHOT): build/host/CMakeCache.txt
(cd build/host && ninja build_toitvm)

.PHONY: $(VERSION_FILE)
$(VERSION_FILE):
echo $(GIT_VERSION) > $@

build/host/CMakeCache.txt: build/host/
(cd build/host && cmake ../.. -G Ninja -DVM_GIT_VERSION="$(GIT_VERSION)" -DCMAKE_BUILD_TYPE=Release)

Expand Down

0 comments on commit c28d3d2

Please sign in to comment.