github.com/gnolang/gno@v0.0.0-20240520182011-228e9d0192ce/tm2/Makefile (about) 1 .PHONY: help 2 help: 3 @echo "Available make commands:" 4 @cat Makefile | grep '^[a-z][^:]*:' | cut -d: -f1 | sort | sed 's/^/ /' 5 6 # command to run dependency utilities, like goimports. 7 rundep=go run -modfile ../misc/devdeps/go.mod 8 9 ######################################## 10 # Environment variables 11 # You can overwrite any of the following by passing a different value on the 12 # command line, ie. `CGO_ENABLED=1 make test`. 13 14 # disable cgo by default. cgo requires some additional dependencies in some 15 # cases, and is not strictly required by any tm2 code. 16 CGO_ENABLED ?= 0 17 export CGO_ENABLED 18 # flags for `make fmt`. -w will write the result to the destination files. 19 GOFMT_FLAGS ?= -w 20 # flags for `make imports`. 21 GOIMPORTS_FLAGS ?= $(GOFMT_FLAGS) 22 # test suite flags. 23 GOTEST_FLAGS ?= -v -p 1 -timeout=30m -tags='ledger_suite' 24 25 ######################################## 26 # Dev tools 27 .PHONY: build 28 _build.tools: _build.aminoscan _build.goscan _build.logjack _build.iaviewer 29 30 _build.aminoscan:; go build -o build/aminoscan ./pkg/amino/cmd/aminoscan 31 _build.goscan:; go build -o build/goscan ./pkg/amino/cmd/goscan 32 _build.logjack:; go build -o build/logjack ./pkg/autofile/cmd 33 _build.iaviewer:; go build -o build/iaviewer ./pkg/iavl/cmd/iaviewer 34 35 .PHONY: clean 36 clean: 37 rm -rf ./build/ 38 39 .PHONY: fmt 40 fmt: 41 $(rundep) mvdan.cc/gofumpt $(GOFMT_FLAGS) . 42 43 .PHONY: imports 44 imports: 45 $(rundep) golang.org/x/tools/cmd/goimports $(GOIMPORTS_FLAGS) . 46 47 .PHONY: lint 48 lint: 49 $(rundep) github.com/golangci/golangci-lint/cmd/golangci-lint run --config ../.github/golangci.yml ./... 50 51 ######################################## 52 # Test suite 53 .PHONY: test 54 test: _test.pkg.amino _test.pkg.bft _test.pkg.db _test.pkg.others _test.flappy 55 56 _test.flappy: 57 # flappy tests should work "sometimes" (at least once). 58 # TODO: support coverage for flappy tests. 59 TEST_STABILITY=flappy $(rundep) moul.io/testman test -test.v -timeout=20m -retry=10 -run ^TestFlappy \ 60 ./pkg/bft/consensus ./pkg/bft/blockchain ./pkg/bft/mempool ./pkg/p2p ./pkg/bft/privval 61 62 _test.pkg.others:; go test $(GOTEST_FLAGS) `go list ./pkg/... | grep -Ev 'pkg/(amino|bft|db|iavl/benchmarks)(/|$$)'` 63 _test.pkg.amino:; go test $(GOTEST_FLAGS) ./pkg/amino/... 64 _test.pkg.bft:; go test $(GOTEST_FLAGS) ./pkg/bft/... 65 _test.pkg.db:; go test $(GOTEST_FLAGS) ./pkg/db/... ./pkg/iavl/benchmarks/...