forked from askmediagroup/dnsbench
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
44 lines (36 loc) · 1.03 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
export PATH := $(abspath bin/):${PATH}
.PHONY: clean
clean:
rm -rf dist/
LD_FLAGS=-ldflags " \
-X github.com/askmediagroup/dnsbench/pkg/cmd.dnsbenchVersion=$(shell git describe --tags --dirty --broken) \
-X github.com/askmediagroup/dnsbench/pkg/cmd.gitCommit=$(shell git rev-parse HEAD) \
-X github.com/askmediagroup/dnsbench/pkg/cmd.buildDate=$(shell date -u +'%Y-%m-%dT%H:%M:%SZ') \
"
.PHONY: build
build: dist/dnsbench
dist/dnsbench:
go build $(LD_FLAGS) -o dist/dnsbench cmd/dnsbench/main.go
.PHONY: test
test:
go test -v ./...
.PHONY: e2e
e2e: dist/dnsbench
"$(CURDIR)/hack/functional-tests.sh"
.PHONY: check
checks: fmt test e2e license
.PHONY: license
license: bin/licensei
licensei cache
licensei check
licensei header
.PHONY: fmt
fmt:
"$(CURDIR)/hack/gofmt.sh"
LICENSEI_VERSION = 0.9.0
bin/licensei: bin/licensei-${LICENSEI_VERSION}
@ln -sf licensei-${LICENSEI_VERSION} bin/licensei
bin/licensei-${LICENSEI_VERSION}:
@mkdir -p bin
curl -sfL https://git.io/licensei | bash -s v${LICENSEI_VERSION}
@mv bin/licensei $@