forked from gnolang/gno
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
83 lines (68 loc) · 2.09 KB
/
Copy pathMakefile
File metadata and controls
83 lines (68 loc) · 2.09 KB
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
82
83
.PHONY: help
help:
@echo "Available make commands:"
@cat Makefile | grep '^[a-z][^:]*:' | cut -d: -f1 | sort | sed 's/^/ /'
# command to run dependency utilities, like goimports.
rundep=go run -modfile ../misc/devdeps/go.mod
########################################
# Environment variables
# You can overwrite any of the following by passing a different value on the
# command line, ie. `CGO_ENABLED=1 make test`.
# disable cgo by default. cgo requires some additional dependencies in some
# cases, and is not strictly required by any tm2 code.
CGO_ENABLED ?= 0
export CGO_ENABLED
# flags for `make fmt`. -w will write the result to the destination files.
GOFMT_FLAGS ?= -w
# flags for `make imports`.
GOIMPORTS_FLAGS ?= $(GOFMT_FLAGS)
# test suite flags.
GOTEST_FLAGS ?= -v -p 1 -timeout=30m
########################################
# Dev tools
.PHONY: transpile
transpile:
go run ../gnovm/cmd/gno tool transpile -v .
.PHONY: build
build:
go run ../gnovm/cmd/gno tool transpile -v --gobuild .
.PHONY: test
test:
go run ../gnovm/cmd/gno test -v ./... 2>&1 | tee /dev/stderr | grep -E '^(FAIL|--- FAIL)|\(type: \*[a-zA-Z._]*[Ee]rror' > /tmp/gno-test-failures; \
if [ -s /tmp/gno-test-failures ]; then \
echo ""; \
echo "========================================"; \
echo "FAILED TESTS / BUILD ERRORS:"; \
echo "========================================"; \
cat /tmp/gno-test-failures; \
exit 1; \
fi
.PHONY: test.fast
test.fast:
go run ../gnovm/cmd/gno test -failfast -v ./...
.PHONY: lint
lint:
go run ../gnovm/cmd/gno lint -v ./...
.PHONY: fix
fix:
go run ../gnovm/cmd/gno fix -v .
.PHONY: test.sync
test.sync:
go run ../gnovm/cmd/gno test -v --update-golden-tests ./...
.PHONY: clean
clean:
find . \( -name "*.gno.gen.go" -or -name ".*.gno.gen_test.go" \) -delete
.PHONY: fmt
GNOFMT_FLAGS ?= -w
fmt:
go run ../gnovm/cmd/gno fmt $(GNOFMT_FLAGS) ./...
.PHONY: tidy
tidy:
go run github.com/gnolang/gno/gnovm/cmd/gno mod tidy -v --recursive
.PHONY: generate
generate:
go generate ./...
$(MAKE) fmt
.PHONY: embed_markdown
embed_markdown:
$(rundep) github.com/campoy/embedmd -w `find . -name "*.md"`