forked from projecteru2/pistage
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
36 lines (27 loc) · 929 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
36
.PHONY: phistage phistagecli test grpc
PKG = github.com/projecteru2/phistage
VERSIONPKG = $(PKG)/cmd/phistage/version
REVISION := $(shell git rev-parse HEAD)
BUILTAT := $(shell date +%Y-%m-%dT%H:%M:%S)
TAGCOMMIT := $(git rev-list --tags --max-count=1)
ifeq ($(TAGCOMMIT),)
VERSION := cesium
else
VERSION := $(shell git describe --tags $(TAGCOMMIT))
endif
GO_LDFLAGS ?= -s -X $(VERSIONPKG).REVISION=$(REVISION) \
-X $(VERSIONPKG).BUILTAT=$(BUILTAT) \
-X $(VERSIONPKG).VERSION=$(VERSION)
all: phistage phistagecli
phistage:
mkdir -p bin
go build -ldflags "$(GO_LDFLAGS)" -o bin/phistage ./cmd/phistage
phistagecli:
mkdir -p bin
go build -ldflags "$(GO_LDFLAGS)" -o bin/phistagecli ./cmd/phistagecli
test:
go test -v -cover -count=1 ./...
grpc:
protoc --go_out=plugins=grpc:./apiserver/grpc/proto \
--go_opt=paths=source_relative \
--proto_path=./apiserver/grpc/proto phistage.proto