fix(mk): Add version number in -V

awk(1) magic saves the day
This commit is contained in:
Sam Therapy 2023-08-11 20:22:16 +02:00
parent 43e53a4055
commit 824a60aef1
Signed by: sam
GPG Key ID: 4D8B07C18F31ACBD
1 changed files with 4 additions and 2 deletions

6
mkfile
View File

@ -1,10 +1,12 @@
# SPDX-License-Identifier: BSD-3-Clause
# Plan 9 mkfile
</$objtype/mkfile
GO = go
PROG = awl
GOFLAGS = -ldflags=-s -ldflags=-w -ldflags=-X=main.version=PLAN9 -trimpath
VERSION = `{awk '{print substr($0,0,8)}' .git/refs/heads/master}
GOFLAGS = -ldflags=-s -ldflags=-w -ldflags=-X=main.version=$VERSION -trimpath
CGO_ENABLED = 0