-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
49 lines (36 loc) · 1.68 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
GO_FILES = $(shell find . -name "*.go")
PKG_VERSION = $(shell jq -r .version package.json)
.PHONY: build
build: build-darwin-arm64 build-darwin-x64 build-linux-arm64 build-linux-x64 build-windows-arm64 build-windows-x64
.PHONY: build-darwin-arm64
build-darwin-arm64:
GOOS=darwin GOARCH=arm64 go build -o ./dist/moldable-darwin-arm64 -ldflags "-X github.com/CyberAgent/moldable/src/cmd.pkgVersion=$(PKG_VERSION)"
.PHONY: build-linux-arm64
build-linux-arm64:
GOOS=linux GOARCH=arm64 go build -o ./dist/moldable-linux-arm64 -ldflags "-X github.com/CyberAgent/moldable/src/cmd.pkgVersion=$(PKG_VERSION)"
.PHONY: build-windows-arm64
build-windows-arm64:
GOOS=windows GOARCH=arm64 go build -o ./dist/moldable-windows-arm64.exe -ldflags "-X github.com/CyberAgent/moldable/src/cmd.pkgVersion=$(PKG_VERSION)"
.PHONY: build-darwin-x64
build-darwin-x64:
GOOS=darwin GOARCH=amd64 go build -o ./dist/moldable-darwin-x64 -ldflags "-X github.com/CyberAgent/moldable/src/cmd.pkgVersion=$(PKG_VERSION)"
.PHONY: build-linux-x64
build-linux-x64:
GOOS=linux GOARCH=amd64 go build -o ./dist/moldable-linux-x64 -ldflags "-X github.com/CyberAgent/moldable/src/cmd.pkgVersion=$(PKG_VERSION)"
.PHONY: build-windows-x64
build-windows-x64:
GOOS=windows GOARCH=amd64 go build -o ./dist/moldable-windows-x64.exe -ldflags "-X github.com/CyberAgent/moldable/src/cmd.pkgVersion=$(PKG_VERSION)"
test: $(GO_FILES) go.mod go.sum
go test -v ./...
lint: $(GO_FILES) go.mod go.sum
staticcheck ./...
.PHONY: clean
clean:
go clean -testcache -r
format: $(GO_FILES) go.mod go.sum
go fmt ./...
dev: $(GO_FILES) go.mod go.sum
MOCKDIR=__mocks__ PKG_VERSION=$(PKG_VERSION) go run ./main.go
.PHONY: go-install
go-install:
go mod download