-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
31 lines (24 loc) · 837 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
26
27
28
29
30
31
GOBUILD=go build
ENV=env GOOS=linux
TIMESTAMP:=$(shell date -u +%Y-%m-%dT%H:%M:%S)
GITREV:=$(shell git rev-parse HEAD)
VERSION?=0.8.3
XGO_TARGETS?="linux/amd64"
all: clean build
build: prod
prod:
go build \
-ldflags "-X github.com/bsinou/vitrnx-goback/conf.Env=production \
-X github.com/bsinou/vitrnx-goback/conf.VitrnxVersion=${VERSION} \
-X github.com/bsinou/vitrnx-goback/conf.BuildTimestamp=${TIMESTAMP} \
-X github.com/bsinou/vitrnx-goback/conf.BuildRevision=${GITREV}" \
-o vitrnx-goback main.go
dev:
go build \
-ldflags "-X github.com/bsinou/vitrnx-goback/conf.VitrnxVersion=${VERSION} \
-X github.com/bsinou/vitrnx-goback/conf.BuildTimestamp=${TIMESTAMP} \
-X github.com/bsinou/vitrnx-goback/conf.BuildRevision=${GITREV}" \
-o vitrnx-goback main.go
cleanall: stop clean rm
clean:
rm -f vitrnx-goback