-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
53 lines (40 loc) · 1.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
CARGO ?= cargo
SOLC ?= solc
DOCKER_COMPOSE ?= docker-compose
ifneq ($(VERBOSE),)
export V :=
else
export V := @
endif
BUILD ?= $(shell pwd)/build
export GIT_AUDIT_EXE ?= $(shell pwd)/git-audit
export ETHEREUM_RPC_PORT ?= 18545
export ETHEREUM_RPC_TARGET ?= http://localhost:$(ETHEREUM_RPC_PORT)
build: build-evm build-exe
build-exe: $(GIT_AUDIT_EXE)
.PHONY: $(GIT_AUDIT_EXE)
$(GIT_AUDIT_EXE):
$(V)mkdir -p "$(BUILD)"
$(V)$(CARGO) build --target-dir="$(BUILD)"
$(V)install "$(BUILD)/debug/git-audit" "$@"
build-evm:
$(V)mkdir -p "$(BUILD)/evm"
$(V)$(SOLC) --optimize --overwrite --abi --bin -o "$(BUILD)/evm" evm/GitAudit.sol
test:
$(V)$(MAKE) --no-print-directory -C tests
docs: build
$(V)./readme.sh > README.md
clean:
$(V)rm -rf "$(BUILD)"
$(V)$(MAKE) -C tests clean
SERVICES ?= ethereum
run-services:
$(V)$(DOCKER_COMPOSE) up --force-recreate $(SERVICES)
test-compose:
$(V)$(DOCKER_COMPOSE) build
$(V)$(DOCKER_COMPOSE) run tests
stop:
$(V)$(DOCKER_COMPOSE) stop
$(V)yes | $(DOCKER_COMPOSE) rm
.PHONY: build build-exe build-evm test docs clean
.PHONY: run-services stop