-
Notifications
You must be signed in to change notification settings - Fork 16
/
Makefile
46 lines (35 loc) · 1.2 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
ROOT_DIR:=$(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
SAMPLE_DIR:=$(ROOT_DIR)/sample
ZWALLET=zwallet
ZWALLETCLI=zwalletcli
.PHONY: $(ZWALLET)
default: help
zwallet-test:
CGO_ENABLED=1 go test -v -tags bn256 ./...
gomod-download:
go mod download
build:
CGO_ENABLED=1 go build -v -tags bn256 -o $(ZWALLET) main.go
$(ZWALLET): gomod-download
$(eval VERSION=$(shell git describe --tags --dirty --always))
CGO_ENABLED=1 go build -x -v -tags bn256 -ldflags "-X main.VersionStr=$(VERSION)" -o $(ZWALLET) main.go
install: $(ZWALLET) zwallet-test
clean: gomod-clean
@rm -rf $(ROOT_DIR)/$(ZWALLET)
help:
@echo "Environment: "
@echo "\tGOPATH=$(GOPATH)"
@echo "\tGOROOT=$(GOROOT)"
@echo ""
@echo "Supported commands:"
@echo "\tmake help - display environment and make targets"
@echo ""
@echo "Install"
@echo "\tmake install - build, test and install the wallet cli"
@echo "\tmake zwallet - build wallet cli"
@echo "\tmake zwallet-test - run zwallet test"
@echo ""
@echo "Clean:"
@echo "\tmake clean - deletes all build output files"
@echo "\tmake gomod-download - download the go modules"
@echo "\tmake gomod-clean - clean the go modules"