-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
54 lines (42 loc) · 1.1 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
PACKAGES=$(shell go list ./...)
OUTDIR=bin
GOBUILD=GOOS=$(1) GOARCH=$(2) go build -o $(OUTDIR)/instx-$(1)-$(2)
.PHONY: build
build:
go build -o $(OUTDIR)/instx
.PHONY: build-linux-amd64
build-linux-amd64:
$(call GOBUILD,linux,amd64)
.PHONY: build-linux-386
build-linux-386:
$(call GOBUILD,linux,386)
.PHONY: build-windows-amd64
build-windows-amd64:
$(call GOBUILD,windows,amd64)
mv $(OUTDIR)/instx-windows-amd64 $(OUTDIR)/instx-windows-amd64.exe
.PHONY: build-windows-386
build-windows-386:
$(call GOBUILD,windows,386)
mv $(OUTDIR)/instx-windows-386 $(OUTDIR)/instx-windows-386.exe
.PHONY: build-darwin-amd64
build-darwin-amd64:
$(call GOBUILD,darwin,amd64)
.PHONY: build-darwin-arm64
build-darwin-arm64:
$(call GOBUILD,darwin,arm64)
.PHONY: build-macos-amd64
build-macos-amd64: build-darwin-amd64
.PHONY: build-macos-arm64
build-macos-arm64: build-darwin-arm64
.PHONY: test
test:
go test -v -race $(PACKAGES)
.PHONY: all
all: test \
build-linux-amd64 build-linux-386 \
build-windows-amd64 build-windows-386 \
build-darwin-amd64 build-darwin-arm64
.PHONY: clean
clean:
go clean
default: build