-
Notifications
You must be signed in to change notification settings - Fork 25
/
Makefile
81 lines (64 loc) · 2.07 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
76
77
78
79
80
81
## Copyright 2018 The go-bindata Authors. All rights reserved.
## Use of this source code is governed by a CC0 1.0 Universal (CC0 1.0)
## Public Domain Dedication license that can be found in the LICENSE file.
.PHONY: all build test clean distclean
CMD_DIR :=./cmd/go-bindata
SRC :=$(shell GO111MODULE=off go list -f '{{ $$dir := .Dir }}{{ range .GoFiles }} {{ $$dir }}/{{.}} {{end}}' . ./internal/...)
SRC_TEST :=$(shell GO111MODULE=off go list -f '{{ $$dir := .Dir }}{{ range .TestGoFiles }} {{ $$dir }}/{{.}} {{end}}' . ./internal/...)
TEST_COVER_OUT :=cover.out
TEST_COVER_HTML :=cover.html
TEST_LIB := \
internal/tests/inputDir/bindata.go \
internal/tests/inputDirRecursive/bindata.go \
internal/tests/inputDuplicateDir/bindata.go \
internal/tests/inputDuplicateFile/bindata.go \
internal/tests/inputFile/bindata.go \
internal/tests/inputSymlinkRecursive/bindata.go \
internal/tests/inputSymlinkToDir/bindata.go \
internal/tests/inputSymlinkToFile/bindata.go \
internal/tests/withDebug/bindata.go \
internal/tests/withNoCompress/bindata.go \
internal/tests/withNoCompressNoMemCopy/bindata.go \
internal/tests/withNoMemCopy/bindata.go \
internal/tests/withSplit/bindata.go \
internal/tests/withoutOutputFlag/bindata.go
##
## MAIN TARGET
##
all: build
##
## CLEAN
##
clean:
@echo ">>> Clean ..."
rm -rf $(TEST_COVER_OUT) $(TEST_COVER_HTML) $(TEST_LIB)
@echo ">>> Clean v4 ..."
$(MAKE) -C v4 clean
distclean: GO111MODULE=off
distclean: clean
go clean -i ./...
$(MAKE) -C v4 distclean
##
## TEST
##
%/bindata.go: GO111MODULE=off
%/bindata.go: %/main.go %/bindata_test.go $(LIB_SRC)
go generate $<
$(TEST_COVER_OUT): GO111MODULE=off
$(TEST_COVER_OUT): $(SRC) $(SRC_TEST) $(TEST_LIB)
@echo ">>> Testing ..."
go test -coverprofile=$@ . ./internal/...
$(TEST_COVER_HTML): GO111MODULE=off
$(TEST_COVER_HTML): $(TEST_COVER_OUT)
@echo ">>> Generate HTML coverage '$@' ..."
go tool cover -html=$< -o $@
test: GO111MODULE=off
test: $(TEST_COVER_HTML)
$(MAKE) -C v4 test
##
## BUILD
##
build: GO111MODULE=off
build: test
go build ./...
$(MAKE) -C v4 build