-
Notifications
You must be signed in to change notification settings - Fork 45
/
Makefile
35 lines (28 loc) · 852 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
include project.mk
# Include shared Makefiles
include boilerplate/generated-includes.mk
GOFLAGS=-mod=mod
VERSION:=`git describe --tags --abbrev=0`
COMMIT:=`git rev-parse HEAD`
SHORTCOMMIT:=`git rev-parse --short HEAD`
PREFIX=github.com/openshift/osd-network-verifier/version
LDFLAGS=-ldflags="-X '$(PREFIX).Version=$(VERSION)' -X '$(PREFIX).CommitHash=$(COMMIT)' -X '$(PREFIX).ShortCommitHash=$(SHORTCOMMIT)'"
.PHONY: build
build:
go fmt ./...
go mod tidy
go build $(LDFLAGS) $(GOFLAGS) .
.PHONY: fmt
fmt:
go fmt ./...
go mod tidy
.PHONY: check-fmt
check-fmt: fmt
git status --porcelain
@(test 0 -eq $$(git status --porcelain | wc -l)) || (echo "Local git checkout is not clean, commit changes and try again." >&2 && exit 1)
.PHONY: test
test:
go test $(GOFLAGS) ./...
.PHONY: boilerplate-update
boilerplate-update:
@boilerplate/update