-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
54 lines (43 loc) · 1.29 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
ifeq ($(OS),Windows_NT)
SHELL=CMD.EXE
SET=set
DEL=del
NUL=nul
else
SET=export
DEL=rm
NUL=/dev/null
endif
NAME:=$(notdir $(CURDIR))
VERSION:=$(shell git describe --tags 2>$(NUL) || echo v0.0.0)
GOOPT:=-ldflags "-s -w -X main.version=$(VERSION)"
EXE:=$(shell go env GOEXE)
all:
go fmt ./...
$(SET) "CGO_ENABLED=0" && go build $(GOOPT)
$(SET) "CGO_ENABLED=0" && pushd "cmd/csvi" && go build -o "$(CURDIR)" $(GOOPT) && popd
_dist:
$(MAKE) all
zip -9 $(NAME)-$(VERSION)-$(GOOS)-$(GOARCH).zip $(NAME)$(EXE)
dist:
$(SET) "GOOS=linux" && $(SET) "GOARCH=386" && $(MAKE) _dist
$(SET) "GOOS=linux" && $(SET) "GOARCH=amd64" && $(MAKE) _dist
$(SET) "GOOS=windows" && $(SET) "GOARCH=386" && $(MAKE) _dist
$(SET) "GOOS=windows" && $(SET) "GOARCH=amd64" && $(MAKE) _dist
clean:
$(DEL) *.zip $(NAME)$(EXE)
release:
gh release create -d --notes "" -t $(VERSION) $(VERSION) $(wildcard $(NAME)-$(VERSION)-*.zip)
manifest:
make-scoop-manifest *-windows-*.zip > $(NAME).json
test:
pwsh test/case0.ps1
pwsh test/case1.ps1
pwsh test/case2.ps1
pwsh test/case3.ps1
benchmark:
pwsh test/benchmark.ps1
readme:
example-into-readme
example-into-readme -target README_ja.md
.PHONY: all test dist _dist clean release manifest readme