forked from iotaledger/wasp-legacy
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
72 lines (54 loc) · 1.98 KB
/
Makefile
File metadata and controls
72 lines (54 loc) · 1.98 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
GIT_COMMIT_SHA := $(shell git rev-list -1 HEAD)
BUILD_TAGS = rocksdb
BUILD_LD_FLAGS = "-X github.com/iotaledger/wasp/packages/wasp.VersionHash=$(GIT_COMMIT_SHA)"
#
# You can override these e.g. as
# make test TEST_PKG=./packages/vm/core/testcore/ TEST_ARG="-v --run TestAccessNodes"
#
TEST_PKG=./...
TEST_ARG=
BUILD_PKGS=./ ./tools/wasp-cli/ ./tools/cluster/wasp-cluster/ ./tools/snap-cli/
BUILD_CMD=go build -o . -tags $(BUILD_TAGS) -ldflags $(BUILD_LD_FLAGS)
INSTALL_CMD=go install -tags $(BUILD_TAGS) -ldflags $(BUILD_LD_FLAGS)
all: build-lint
wasm:
go install ./tools/schema
bash contracts/wasm/scripts/generate_wasm.sh
compile-solidity:
ifdef SKIP_SOLIDITY
@echo "skipping compile-solidity rule"
else ifeq (, $(shell which solc))
@echo "no solc found in PATH, evm contracts won't be compiled"
else
cd packages/vm/core/evm/iscmagic && go generate
cd packages/evm/evmtest && go generate
endif
build-full: compile-solidity
$(BUILD_CMD) ./...
build: compile-solidity
$(BUILD_CMD) $(BUILD_PKGS)
build-lint: build lint
test-full: install
go test -tags $(BUILD_TAGS),runheavy ./... --timeout 60m --count 1 -failfast
test: install
go test -tags $(BUILD_TAGS) $(TEST_PKG) --timeout 90m --count 1 -failfast $(TEST_ARG)
test-short:
go test -tags $(BUILD_TAGS) --short --count 1 -failfast $(shell go list ./... | grep -v github.com/iotaledger/wasp/contracts/wasm)
install-full: compile-solidity
$(INSTALL_CMD) ./...
install: compile-solidity
$(INSTALL_CMD) $(BUILD_PKGS)
lint:
golangci-lint run --timeout 5m
gofumpt-list:
gofumpt -l ./
docker-build:
docker build \
--build-arg BUILD_TAGS=${BUILD_TAGS} \
--build-arg BUILD_LD_FLAGS='${BUILD_LD_FLAGS}' \
.
deps-versions:
@grep -n "====" packages/testutil/privtangle/privtangle.go | \
awk -F ":" '{ print $$1 }' | \
{ read from ; read to; awk -v s="$$from" -v e="$$to" 'NR>1*s&&NR<1*e' packages/testutil/privtangle/privtangle.go; }
.PHONY: all build build-lint test test-short test-full install lint gofumpt-list docker-build deps-versions