forked from 0chain/gosdk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
68 lines (50 loc) · 1.79 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
58
59
60
61
62
63
64
65
66
67
68
ROOT_DIR:=$(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
GOMODCORE := $(GOMODBASE)/zcncore
VERSION_FILE := $(ROOT_DIR)/core/version/version.go
MAJOR_VERSION := "1.0"
PLATFORM:=$(shell uname -s | tr "[:upper:]" "[:lower:]")
include _util/printer.mk
include _util/build_$(PLATFORM).mk
include _util/build_mobile.mk
.PHONY: build-tools install-all herumi-all gosdk-all sdkver help
default: help
#GO BUILD SDK
gomod-download:
go mod download -json
gomod-clean:
go clean -i -r -x -modcache ./...
clean-gosdk:
gosdk-build: gomod-download
go build -x -v -tags bn256 ./...
sdkver:
cd _sdkver; go build -o sdkver sdkver.go; ./sdkver
gosdk-test:
go test -tags bn256 ./...
install-gosdk: | gosdk-build gosdk-test
$(GOPATH)/bin/modvendor:
@go get -u github.com/goware/modvendor
vendor: $(GOPATH)/bin/modvendor
@GO111MODULE=on go mod vendor -v
@modvendor -copy="**/*.c **/*.h **/*.a" -v
getrev:
$(eval VERSION_STR=$(shell git describe --tags --dirty --always))
@echo "" > $(VERSION_FILE)
@echo "//====== THIS IS AUTOGENERATED FILE. DO NOT MODIFY ========" >> $(VERSION_FILE)
@echo "" >> $(VERSION_FILE)
@echo "package version" >> $(VERSION_FILE)
@echo const VERSIONSTR = \"$(VERSION_STR)\" >> $(VERSION_FILE)
@echo "" >> $(VERSION_FILE)
install: install-gosdk sdkver
clean: clean-gosdk clean-herumi
@rm -rf $(OUTDIR)
help:
@echo "Environment: "
@echo "\tPLATFORM.......: $(PLATFORM)"
@echo "\tGOPATH.........: $(GOPATH)"
@echo "\tGOROOT.........: $(GOROOT)"
@echo ""
@echo "Supported commands:"
@echo "\tmake help - Display environment and make targets"
@echo "\tmake build-tools - Install go, jq and supporting tools required for build"
@echo "\tmake install - Install gosdk"
@echo "\tmake clean - Deletes all build output files"