forked from 0chain/zboxcli
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
57 lines (42 loc) · 1.4 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
54
55
56
57
ROOT_DIR:=$(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
SAMPLE_DIR:=$(ROOT_DIR)/sample
ZBOX=zbox
ZBOXCLI=zboxcli
.PHONY:
GOMODCORE := $(GOMODBASE)/zcncore
VERSION_FILE := $(ROOT_DIR)/core/version/version.go
MAJOR_VERSION := "1.0"
PLATFORMOS := $(shell uname | tr "[:upper:]" "[:lower:]")
include _util/printer.mk
.PHONY: install-all herumi-all gosdk-all show
default: help show
#GO BUILD SDK
gomod-download:
go mod download -json
gomod-clean:
go clean -i -r -x -modcache ./...
$(ZBOX): gomod-download
$(eval VERSION=$(shell git describe --tags --dirty --always))
go build -x -v -tags bn256 -ldflags "-X main.VersionStr=$(VERSION)" -o $(ZBOX) main.go
zboxcli-test:
go test -tags bn256 ./...
install: $(ZBOX) zboxcli-test
clean: gomod-clean
@rm -rf $(ROOT_DIR)/$(ZBOX)
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 zboxcli"
@echo "\tmake zbox - installs the zboxcli"
@echo "\tmake zboxcli-test - run zboxcli 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"