-
Notifications
You must be signed in to change notification settings - Fork 24
/
Makefile
44 lines (35 loc) · 1.36 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
#!/bin/bash
COMMITID := $(shell git describe --always --long --dirty)
COMMIT := $(shell git rev-parse --short HEAD)
VERSION := $(shell git describe --tags --always)
GOOS := $(shell go env GOOS)
GOARCH := $(shell go env GOARCH)
all: build
build:
protoc --proto_path=./icd --micro_out=. --go_out=. ./icd/audio.proto
go build -v -ldflags="-X github.com/dh1tw/remoteAudio/cmd.commitHash=${COMMIT} \
-X github.com/dh1tw/remoteAudio/cmd.version=${VERSION}"
# strip off dwraf table - used for travis CI
dist:
protoc --proto_path=./icd --micro_out=. --go_out=. ./icd/audio.proto
go build -v -ldflags="-w -s -X github.com/dh1tw/remoteAudio/cmd.commitHash=${COMMIT} \
-X github.com/dh1tw/remoteAudio/cmd.version=${VERSION}"
if [ "${GOOS}" = "windows" ]; \
then upx remoteAudio.exe; \
else \
if [ "${GOOS}" = "darwin" ] && [ "${GOARCH}" = "arm64" ]; \
then true; \
else upx remoteAudio; \
fi \
fi
install:
protoc --proto_path=./icd --micro_out=. --go_out=. ./icd/audio.proto
go install -v -ldflags="-w -X github.com/dh1tw/remoteAudio/cmd.commitHash=${COMMIT} \
-X github.com/dh1tw/remoteAudio/cmd.version=${VERSION}"
install-deps:
go mod download
go install github.com/golang/protobuf/[email protected]
go install github.com/asim/go-micro/cmd/protoc-gen-micro/[email protected]
clean:
-@rm remoteAudio remoteAudio-v*
.PHONY: build install vet lint clean install-deps