This repository has been archived by the owner on Jun 13, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 18
/
Makefile
75 lines (53 loc) · 1.89 KB
/
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
CC=go
CFLAGS?=-i
GOOS=linux
CGO_ENABLED?=0
# Used to populate variables in version package.
VERSION=$(shell git describe --tags --match 'v[0-9]*' --dirty='+dirty' --always)
REVISION=$(shell git rev-parse HEAD)$(shell if ! git diff --no-ext-diff --quiet --exit-code; then echo +dirty; fi)
PROJECT=github.com/DataDog/pupernetes
VERSION_FLAGS=-ldflags '-s -w -X $(PROJECT)/version.Version=$(VERSION) -X $(PROJECT)/version.Revision=$(REVISION) -X $(PROJECT)/version.Package=$(PROJECT)'
pupernetes: go-constraint
CGO_ENABLED=$(CGO_ENABLED) GOOS=$(GOOS) $(CC) build $(CFLAGS) $(VERSION_FLAGS) -o $@ cmd/main.go
go-constraint:
go version | grep -E "go version go1.1[[:digit:]]"
clean:
$(RM) pupernetes pupernetes.sha512sum
re: clean pupernetes
gofmt:
./scripts/update/gofmt.sh
docs:
$(CC) run ./scripts/update/docs.go
license:
./scripts/install-wwhrd.sh
./scripts/update/license.sh
goget:
@which ineffassign || go get github.com/gordonklaus/ineffassign
@which golint || go get golang.org/x/lint/golint
@which misspell || go get github.com/client9/misspell/cmd/misspell
# Private targets
PKG=.cmd .pkg .docs
$(PKG): %:
@# remove the leading '.'
ineffassign $(subst .,,$@)
golint -set_exit_status $(subst .,,$@)/...
misspell -error $(subst .,,$@)
check:
$(CC) test -v ./pkg/...
verify-misc: goget $(PKG)
verify-gofmt:
./scripts/verify/gofmt.sh
verify-docs:
./scripts/verify/docs.sh
verify-license: goget
./scripts/verify/license.sh
verify: verify-misc verify-gofmt verify-docs verify-license
sha512sum: pupernetes
$@ ./$^ > $^.$@
pupernetes-docker:
docker run --rm --net=host -v $(PWD):/go/src/github.com/DataDog/pupernetes -w /go/src/github.com/DataDog/pupernetes golang:1.13 make
ci-validation:
./.ci/pupernetes-validation.sh
ci-sonobuoy:
./.ci/sonobuoy.sh
.PHONY: clean re gofmt docs license check verify-gofmt verify-docs verify-license verify sha512sum ci-validation ci-sonobuoy go-constraint