From 911c932ec426ee45c9380bd26714c4bb505a3a88 Mon Sep 17 00:00:00 2001 From: Runxi Yu Date: Sun, 23 Mar 2025 12:47:10 +0800 Subject: Use a global struct with version and source info --- Makefile | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 1810daf..a75b758 100644 --- a/Makefile +++ b/Makefile @@ -1,2 +1,7 @@ -powxy: *.go +powxy: *.go version.go go build -o powxy + +version.go: + printf 'package main\n\nfunc init() {\n\tglobal.Version = "%s"\n}\n' $(shell git describe --tags --always --dirty) > $@ + +.PHONY: version.go -- cgit v1.2.3