forked from xuperchain/xuperchain
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
executable file
·45 lines (37 loc) · 903 Bytes
/
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
# init project PATH
HOMEDIR := $(shell pwd)
OUTDIR := $(HOMEDIR)/output
COMPILECACHEDIR := $(HOMEDIR)/.compile_cache
XVMDIR := $(COMPILECACHEDIR)/xvm
TESTNETDIR := $(HOMEDIR)/testnet
# init command params
export GO111MODULE=on
X_ROOT_PATH := $(HOMEDIR)
export X_ROOT_PATH
export PATH := $(OUTDIR)/bin:$(XVMDIR):$(PATH)
# make, make all
all: clean compile
# make compile, go build
compile: xvm xchain
xchain:
bash $(HOMEDIR)/auto/build.sh
# make xvm
xvm:
bash $(HOMEDIR)/auto/build_xvm.sh
# make test, test your code
test: xvm unit
unit:
go test -coverprofile=coverage.txt -covermode=atomic ./...
# make clean
cleanall: clean cleantest cleancache
clean:
rm -rf $(OUTDIR)
cleantest:
rm -rf $(TESTNETDIR)
cleancache:
rm -rf $(COMPILECACHEDIR)
# deploy test network
testnet:
bash $(HOMEDIR)/auto/deploy_testnet.sh
# avoid filename conflict and speed up build
.PHONY: all compile test clean