-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile
35 lines (26 loc) · 943 Bytes
/
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
BIN=hookah
HEAD=$(shell git describe --tags 2> /dev/null || git rev-parse --short HEAD)
default: setup test install
setup:
ifeq ($(shell echo $$CI),true)
cd cmd/hookah && go get -u -v
endif
test:
go test ./...
install:
go install ./cmd/hookah
.PHONY: clean
clean:
-rm -rf release
mkdir release
.PHONY: release
release: clean release/darwin_amd64 release/darwin_arm64 release/linux_amd64
cd release/darwin_amd64 && zip -9 ../$(BIN).darwin_amd64.$(HEAD).zip $(BIN)
cd release/darwin_arm64 && zip -9 ../$(BIN).darwin_arm64.$(HEAD).zip $(BIN)
cd release/linux_amd64 && zip -9 ../$(BIN).linux_amd64.$(HEAD).zip $(BIN)
release/darwin_amd64:
env GOOS=darwin GOARCH=amd64 go build -o release/darwin_amd64/$(BIN) ./cmd/hookah
release/darwin_arm64:
env GOOS=darwin GOARCH=arm64 go build -o release/darwin_arm64/$(BIN) ./cmd/hookah
release/linux_amd64:
env GOOS=linux GOARCH=amd64 go build -o release/linux_amd64/$(BIN) ./cmd/hookah