-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
71 lines (55 loc) · 1.47 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
TEST_FILES=$(go list ./...)
BIN = $(GOPATH)/bin
GOLINT = $(BIN)/golint
$(BIN)/golint: | $(BASE)
default: vet lintall testall coverstat build package
build:
@go get
@go build
# test runs the unit tests
# make testall
testall:
@sh -c "'$(CURDIR)/scripts/gounittest.sh'"
# test run component
# make test TEST=arc-api
test:
@sh -c "'$(CURDIR)/scripts/gounittest.sh' $(TEST)"
cover:
@go tool cover 2>/dev/null; if [ $$? -eq 3 ]; then \
go get -u golang.org/x/tools/cmd/cover; \
fi
go test $(TEST) -coverprofile=coverage.out
go tool cover -html=coverage.out
rm coverage.out
coverstat:
@sh -c "'$(CURDIR)/scripts/gocover.sh'"
vet:
@echo '[ CMD ]=> go vet $$(go list ./... | grep -v /terraform/vendor/)'
@go vet $$(go list ./... | grep -v /terraform/vendor/) ; if [ $$? -eq 1 ]; then \
echo ""; \
echo "Vet found suspicious constructs. Please check the reported constructs"; \
echo "and fix them if necessary before submitting the code for review."; \
exit 1; \
fi
# make lint PKG=arc-api
lint:
@golint 2>/dev/null; if [ $$? -eq 3 ]; then \
go get -u github.com/golang/lint/golint; \
fi
golint -set_exit_status $(PKG)
lintall:
@sh -c "'$(CURDIR)/scripts/golint.sh'"
clean:
rm -f arc-api
dependencies:
go get
run:
go run main.go
tests:
go test ./...
debug_tools:
go get github.com/derekparker/delve/cmd/dlv
package:
@echo "Packaging portchecker into a single binary file..."
@CGO_ENABLED=0 GOOS=linux go build -a -ldflags '-w' .
@echo "Packaging done !"