improved building

This commit is contained in:
2023-04-15 13:33:09 -04:00
parent e65633a85a
commit aa955c3b4f
4 changed files with 11 additions and 8 deletions

View File

@@ -26,6 +26,7 @@ endif
progName = scaffold
arch = amd64
winbinName = $(progName).exe
releaseTag = $(shell git describe --abbrev=0)
#----------------------------------------------------------------
# Helpers
@@ -58,6 +59,7 @@ linkerflags = '-s'
prep: clean
> date +"%F %a %T %Z" > buildTime.txt
> git describe --always --tags --dirty --long > buildVersion.txt
> mkdir -p build
build: prep linux windows
@@ -65,7 +67,7 @@ linux:
> @GOOS=$@ GOARCH=$(arch) go build -o build/$@/$(progName) . && echo $@ "Build success" || echo $@ "[FAILED] go build"
windows:
> @GOOS=$@ GOARCH=$(arch) go build -o build/$@/$(winbinName) . && echo $@ "Build success" || echo $@ "[FAILED] go build"
> @GOOS=$@ GOARCH=$(arch) go build -o build/$@/$(progName)-$(arch)-$(releaseTag).exe . && echo $@ "Build success" || echo $@ "[FAILED] go build"
build-production: prep linx-production