Update makefile

This commit is contained in:
Uthman Fatih 2026-11-02 22:33:28 +00:00
parent f448db099d
commit 8a3e62366b

View File

@ -1,8 +1,8 @@
VERSION ?= $(shell git describe --tags --always --dirty)
LDFLAGS := -s -w -X main.version=$(VERSION)
VERSION ?= $(shell git describe --tags --always --dirty)
LDFLAGS := -s -w -X main.version=$(VERSION)
PLATFORMS := linux/amd64 linux/arm64 windows/amd64
.PHONY: all cross darwin clean
.PHONY: all cross darwin package clean
all:
# Release build for the host platform
@ -10,7 +10,7 @@ all:
CGO_ENABLED=0 go build -trimpath -ldflags="$(LDFLAGS)" -o build/anical
cross:
# Pure-Go targets only; darwin is built separately on macOS
# Pure-Go targets; darwin is built separately on macOS
mkdir -p build
@for p in $(PLATFORMS); do \
os=$${p%/*}; arch=$${p#*/}; \
@ -25,7 +25,8 @@ darwin:
# Must run on macOS: systray needs cgo (Cocoa/Objective-C)
@test "$$(uname -s)" = "Darwin" || { echo "darwin target must run on macOS"; exit 1; }
mkdir -p build
go build -trimpath -ldflags="$(LDFLAGS)" -o build/anical-$(VERSION)-darwin-$$(uname -m)
go build -trimpath -ldflags="$(LDFLAGS)" \
-o build/anical-$(VERSION)-darwin-$$(go env GOARCH)
clean:
rm -rf build