-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
38 lines (28 loc) · 979 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
37
38
CMD_VERSION := 1.2.0
DATETIME := $(shell date -u +%Y-%m-%dT%T.%2NZ)
ROOT := $(shell dirname $(realpath $(firstword $(MAKEFILE_LIST))))
.PHONY : all
all:
@echo Run 'make help' to see a list of available targets
.PHONY: test
test:
go test $(ROOT)/pkg/imgpull $(ROOT)/internal/... -v --cover
.PHONY: coverprof
coverprof:
go test $(ROOT)/pkg/imgpull $(ROOT)/internal/... -coverprofile=$(ROOT)/prof.out
go tool cover -html=$(ROOT)/prof.out
.PHONY: imgpull
imgpull:
CGO_ENABLED=0 go build -ldflags "-X 'main.buildVer=$(CMD_VERSION)' -X 'main.buildDtm=$(DATETIME)'"\
-a -o $(ROOT)/bin/imgpull $(ROOT)/cmd/imgpull/*.go
.PHONY : help
help:
@echo "$$HELPTEXT"
export HELPTEXT
define HELPTEXT
This make file provides the following targets:
test Runs the unit tests
coverprof Runs the test coverage profile report and displays it in a local
browser window.
imgpull Builds the CLI. After building then: 'bin/imgpull --help'.
endef