-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathMakefile
More file actions
33 lines (25 loc) · 710 Bytes
/
Makefile
File metadata and controls
33 lines (25 loc) · 710 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
25
26
27
28
29
30
31
32
VERSION=$(shell cat ./VERSION)
PKG=github.com/cmingxu/wallet-keeper
GOBUILD=GO111MODULE=on CGO_ENABLED=1 go build -a -ldflags "-X main.Version=${VERSION}"
CROSS_GOBUILD=CGO_ENABLED=1 GOARCH=amd64 GOOS=linux go build -a -ldflags "-X main.Version=${VERSION}"
CMDS = $(shell go list ${PKG}/cmd )
PKG_ALL = $(shell go list ${PKG}/...)
DOCKER=$(shell which docker)
BUILD_DIR=./bin
all: build
build:
${GOBUILD} -o ${BUILD_DIR}/wallet-keeper ./cmd/*.go
install: binaries
test:
go test ./... -v
.PHONY: clean
clean:
@rm bin/*
.PHONY: coverage
coverage:
go test -cover -coverprofile=test.coverage
go tool cover -html=test.coverage -o coverage.html
rm -f test.coverage
.PHONY: fmt
fmt:
go fmt ${PKG_ALL}