-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathMakefile
More file actions
24 lines (18 loc) · 720 Bytes
/
Copy pathMakefile
File metadata and controls
24 lines (18 loc) · 720 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# Use these to override the VERSION and REVISION constants with git tags
VERSION := $(shell git describe --tags)
REVISION := $(shell git rev-parse --short HEAD)
LDFLAGS := -X github.com/ArtRand/PoaGo/VERSION=$(VERSION) -X github.com/ArtRand/PoaGo/REVISION=$(REVISION)
BINARY_NAME := poago
# Only build your project, and not libraries you vendor using govendor
FILES := $(shell go list ./... | grep -v vendor)
all: test install
test:
@echo "+$@"
go test $(FILES) -v -cover
# Assumes GOOS is set in the calling environment or defaults to base arch
build:
@echo "+$@"
go build -v -o '$(BINARY_NAME)_$(REVISION)' -ldflags '$(LDFLAGS)' PoaGo.go
install:
@echo "+$@"
go install -v -ldflags '$(LDFLAGS)' $(FILES)