-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmakefile
25 lines (21 loc) · 921 Bytes
/
makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# This how we want to name the binary output
BINARY=radioboat
# values to pass for BinVersion, GitCommitLog, GitStatus, BuildTime and BuildGoVersion"
# Version=`git describe --tags` # git tag 1.0.1 # require tag tagged before
Version=testversion
BuildDate=$(shell date +%FT%T%z)
VendorInfo=$(shell echo $(USER))
Commit=$(shell git log --format="%H" -n 1)
# Setup the -ldflags option for build info here, interpolate the variable values
# notice: replace the path with your versionInfo module path
LDFLAGS=-ldflags "-w -s \
-X github.com/slashformotion/radioboat/cmd.Version=${Version} \
-X github.com/slashformotion/radioboat/cmd.Commit=${Commit} \
-X github.com/slashformotion/radioboat/cmd.BuildDate=${BuildDate} \
-X github.com/slashformotion/radioboat/cmd.VendorInfo=${VendorInfo} \
-X main.VendorInfo=${VendorInfo} \
"
all:
go build -o ${BINARY} ${LDFLAGS}
clean:
if [ -f ${BINARY} ] ; then rm ${BINARY} ; fi