-
Notifications
You must be signed in to change notification settings - Fork 239
/
Makefile
30 lines (22 loc) · 1.09 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
hash:=$(shell git rev-parse --short HEAD)
tag?=$(hash)
.PHONY: gohangout all clean check test docker
gohangout:
CGO_ENABLED=0 go build -ldflags "-X main.version=$(hash)" -o gohangout
docker:
docker build -t gohangout .
all: check
@echo $(hash)
mkdir -p build/
GOOS=windows GOARCH=amd64 CGO_ENABLED=0 go build -ldflags "-X main.version=$(hash)" -o build/gohangout-windows-x64-$(tag).exe
GOOS=windows GOARCH=386 CGO_ENABLED=0 go build -ldflags "-X main.version=$(hash)" -o build/gohangout-windows-386-$(tag).exe
GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -ldflags "-X main.version=$(hash)" -o build/gohangout-linux-x64-$(tag)
GOOS=linux GOARCH=386 CGO_ENABLED=0 go build -ldflags "-X main.version=$(hash)" -o build/gohangout-linux-386-$(tag)
GOOS=linux GOARCH=arm64 CGO_ENABLED=0 go build -ldflags "-X main.version=$(hash)" -o build/gohangout-linux-arm64-$(tag)
GOOS=darwin GOARCH=amd64 CGO_ENABLED=0 go build -ldflags "-X main.version=$(hash)" -o build/gohangout-darwin-x64-$(tag)
clean:
rm -rf gohangout
check:
git diff-index --quiet HEAD --
test:
go test -v -count=1 -gcflags="all=-N -l" ./...