-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
45 lines (33 loc) · 703 Bytes
/
Makefile
File metadata and controls
45 lines (33 loc) · 703 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
33
34
35
36
37
38
39
40
41
42
43
PACKAGES := ./...
.DEFAULT_GOAL:=all
VERSION=1.0
COMMIT=$(shell git rev-parse HEAD)
BINARY=inam
TEST_REPORT=tests.xml
# LDFLAGS=-ldflags "-X main.Version=${VERSION} -X main.Build=${COMMIT}"
.PHONY: run
run: build
./cli/cli
.PHONY: all
all: clean format vet build test
.PHONY: build
build: format vet
@echo "Running go build"
go build -i ${LDFLAGS} $(PACKAGES)
go build -i ${LDFLAGS} .
.PHONY: test
test: build
@echo "Running all tests"
go test -cover -race $(PACKAGES)
.PHONY: format
format:
@echo "Running go fmt"
go fmt $(PACKAGES)
.PHONY: vet
vet:
@echo "Running go vet"
go vet $(PACKAGES)
.PHONY: clean
clean:
@echo "Running clean"
if [ -f ${BINARY} ]; then rm ${BINARY}; fi