-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
43 lines (32 loc) · 957 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
39
40
41
42
43
## The lines below can be uncommented for debugging the make rules
#
# OLD_SHELL := $(SHELL)
# SHELL = $(warning Building $@$(if $<, (from $<))$(if $?, ($? newer)))$(OLD_SHELL)
#
# print-%:
# @echo $* = $($*)
.PHONY: build fmt test vet clean generate
SRC = $(shell find . -type f -name '*.go' -not -path "./grafeas/grafeas/*")
CLEAN := *~
.EXPORT_ALL_VARIABLES:
GO111MODULE=on
build: vet fmt generate
go build -v ./...
# http://golang.org/cmd/go/#hdr-Run_gofmt_on_package_sources
fmt:
@gofmt -l -w $(SRC)
test: generate
@go test -v ./...
post-test:
bash -c "kill $$(cat test/dynamo.pid)"
rm -f test/dynamo.pid
vet: generate
@go vet ./...
generate:
mkdir -p grafeas
bash -c "if [ ! -f grafeas/grafeas.tgz ]; then curl https://github.com/grafeas/grafeas/releases/download/v0.1.4/grafeas-0.1.4.tar.gz -o grafeas/grafeas.tgz -L; fi"
tar xf grafeas/grafeas.tgz -C grafeas
clean: generate
go clean ./...
rm -rf $(CLEAN)
rm -rf test grafeas