-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
41 lines (30 loc) · 898 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
## 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
.PHONY: build fmt 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 ./...
vet: generate
@go vet ./...
generate:
mkdir -p grafeas
bash -c "if [ ! -f grafeas/grafeas.tgz ]; then curl https://github.com/grafeas/grafeas/archive/v0.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