-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
37 lines (29 loc) · 1.04 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
ARCH := amd64
BINARY_NAME := invalidator
linux:
GOOS=linux GOARCH=$(ARCH) CGO_ENABLED=0 go build -v -o ./bin/$(BINARY_NAME)_$(ARCH)_linux ./...
zip-linux:
cp ./bin/$(BINARY_NAME)_$(ARCH)_linux ./bin/$(BINARY_NAME)
zip ./bin/$(BINARY_NAME)_$(ARCH)_linux.zip ./bin/$(BINARY_NAME)
rm -rf ./bin/$(BINARY_NAME)
windows:
GOOS=windows GOARCH=$(ARCH) CGO_ENABLED=0 go build -v -o ./bin/$(BINARY_NAME)_$(ARCH)_windows ./...
zip-windows:
cp ./bin/$(BINARY_NAME)_$(ARCH)_windows ./bin/$(BINARY_NAME).exe
zip ./bin/$(BINARY_NAME)_$(ARCH)_windows.zip ./bin/$(BINARY_NAME).exe
rm -rf ./bin/$(BINARY_NAME).exe
macos:
GOOS=darwin GOARCH=$(ARCH) CGO_ENABLED=0 go build -v -o ./bin/$(BINARY_NAME)_$(ARCH)_macos ./...
zip-macos:
cp ./bin/$(BINARY_NAME)_$(ARCH)_macos ./bin/$(BINARY_NAME)
zip ./bin/$(BINARY_NAME)_$(ARCH)_macos.zip ./bin/$(BINARY_NAME)
rm -rf ./bin/$(BINARY_NAME)
.PHONY: all
all: clean linux windows macos
.PHONY: zip-all
zip-all: zip-linux zip-windows zip-macos
.PHONY: release
release: clean all zip-all
clean:
go mod tidy
rm -rf ./bin/*