File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ BINARY_NAME=im-switch
22BUILD_DIR =build
33INSTALL_DIR =/usr/local/bin
44WSL_WIN_OUT ?= /mnt/c/Tools/im-switch.exe
5- VERSION ?= dev
5+ VERSION ?= $( shell git describe --tags --always --dirty 2>/ dev/null || echo dev)
66GO_LDFLAGS := -X main.version=$(VERSION )
77
88# Detect operating system
4646endif
4747
4848# Alias for the binary target
49- build : $( BINARY_NAME )
49+ build : force-build
5050
5151# Force rebuild regardless of timestamps
5252force-build :
Original file line number Diff line number Diff line change @@ -256,6 +256,10 @@ If you need to build the binary manually:
256256# Build for development
257257make build
258258
259+ # By default, the binary version is derived from git metadata.
260+ # You can override it when building from a source archive without .git.
261+ make build VERSION=v1.2.3
262+
259263# Build optimized release version
260264make build-release VERSION=v1.2.3
261265
You can’t perform that action at this time.
0 commit comments