-
Notifications
You must be signed in to change notification settings - Fork 24
/
Makefile
60 lines (49 loc) · 1.2 KB
/
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# Binary name
BINARY=gscript
GOBUILD=go build -ldflags "-s -w" cmd/gscript.go
GOCLEAN=go clean
RMTARGZ=rm -rf *.gz && rm -rf main
VERSION=v0.0.12
# Build
build:
make bindata
$(GOCLEAN)
$(GOBUILD)
build-code:
$(GOCLEAN)
$(GOBUILD)
clean:
$(GOCLEAN)
$(RMTARGZ)
git-tag:
git tag $(VERSION); \
git push origin $(VERSION); \
release:
# Clean
$(GOCLEAN)
$(RMTARGZ)
# Build for mac
CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 $(GOBUILD)
tar czvf ${BINARY}-mac64-${VERSION}.tar.gz ./${BINARY}
# Build for arm
$(GOCLEAN)
CGO_ENABLED=0 GOOS=linux GOARCH=arm64 $(GOBUILD)
tar czvf ${BINARY}-arm64-${VERSION}.tar.gz ./${BINARY}
# Build for linux
$(GOCLEAN)
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 $(GOBUILD)
tar czvf ${BINARY}-linux64-${VERSION}.tar.gz ./${BINARY}
# Build for win
$(GOCLEAN)
CGO_ENABLED=0 GOOS=windows GOARCH=amd64 $(GOBUILD).exe
tar czvf ${BINARY}-win64-${VERSION}.tar.gz ./${BINARY}.exe
$(GOCLEAN)
# ANTLR Parser Generator Version 4.9.2
antlr:
antlr -Dlanguage=Go -o parser -visitor -listener GScript.g4
bindata:
go-bindata -pkg internal -o internal/internal.go internal/
docker:
docker build -t crossoverjie/gscript .
docker-version:
docker build -t crossoverjie/gscript:$(VERSION) .