-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
40 changed files
with
163 additions
and
4,321 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
ROOT_DIR:=$(shell dirname $(realpath $(lastword $(MAKEFILE_LIST)))) | ||
|
||
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 | ||
include _util/herumi.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 --modcache | ||
|
||
gosdk-clean: | ||
go clean -i -r -x -modcache ./... | ||
|
||
gosdk-build: gomod-download | ||
go build -x -v -tags bn256 ./... | ||
|
||
gosdk-test: | ||
go test -tags bn256 ./... | ||
|
||
gosdk-all: | gosdk-build gosdk-test | ||
|
||
getrev: | ||
$(eval VERSION_STR=$(MAJOR_VERSION).$(shell git rev-list --count HEAD)) | ||
$(eval VERSION_STR=$(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-all: herumi-all gosdk-all | ||
|
||
clean: | ||
@rm -rf $(OUTDIR) | ||
|
||
show: | ||
@echo "GOPATH=$(GOPATH)" | ||
@echo "GOROOT=$(GOROOT)" | ||
@echo "BLS git branch=$(bls_branch)" | ||
@echo "MCL git branch=$(mcl_branch)" | ||
|
||
help: | ||
@echo "Supported commands:" | ||
@ecgo "\tmake show - Display environment and make variables" | ||
@echo "\tmake install-all - Install all build and project dependencies" | ||
@echo "\tmake gosdk-all - Install GO modules and packages" | ||
@echo "\tmake herumi-all - Download, build and install HERUMI packages" | ||
@echo "\tmake clean - Deletes all the built output files" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
HERUMI_TARGETS:=herumi-clone herumi-checkout herumi-build herumi-install show | ||
|
||
#Master having build issues | ||
#$(HERUMI_TARGETS): mcl_branch=master | ||
#$(HERUMI_TARGETS): bls_branch=master | ||
|
||
#Success Branch: | ||
$(HERUMI_TARGETS): bls_branch?=b1733a744a2e53a828806b121c4a5cb681c5f94b | ||
$(HERUMI_TARGETS): mcl_branch?=master | ||
|
||
HERUMI_DIR?=$(ROOT_DIR)/_herumi | ||
BLS_DIR?=$(HERUMI_DIR)/bls | ||
MCL_DIR?=$(HERUMI_DIR)/mcl | ||
NPROC:=8 | ||
|
||
herumi-deps: openssl-install gmp-install | ||
|
||
openssl-install: | ||
@echo "Installing openssl ..." | ||
brew install openssl | ||
$(shell sudo ln -sf /usr/local/opt/openssl/lib/libcrypto.dylib /usr/local/lib/) | ||
|
||
openssl-upgrade: | ||
@echo "Upgrading openssl ..." | ||
brew upgrade openssl | ||
$(shell sudo ln -sf /usr/local/opt/openssl/lib/libcrypto.dylib /usr/local/lib/) | ||
|
||
gmp-install: | ||
@echo "Installing gmp ..." | ||
brew install gmp | ||
$(shell sudo ln -sf /usr/local/Cellar/gmp/*/lib /usr/local/lib) | ||
|
||
gmp-upgrade: | ||
@echo "Upgrading gmp ..." | ||
brew upgrade gmp | ||
$(shell sudo ln -sf /usr/local/Cellar/gmp/*/lib /usr/local/lib) | ||
|
||
.PHONY: herumi-clone herumi-build herumi-install | ||
|
||
herumi-clone: | ||
@echo Deleting directories: [$(BLS_DIR) $(MCL_DIR)] | ||
@rm -rf $(BLS_DIR) $(MCL_DIR) | ||
git clone http://github.com/herumi/mcl.git $(MCL_DIR) | ||
git clone http://github.com/herumi/bls.git $(BLS_DIR) | ||
|
||
herumi-checkout: | ||
@echo Checking out BLS: branch=$(bls_branch) | ||
cd $(BLS_DIR); git checkout $(bls_branch) | ||
@echo Checking out MCL: branch=$(mcl_branch) | ||
cd $(MCL_DIR); git checkout $(mcl_branch) | ||
|
||
herumi-build: | ||
@$(PRINT_MAG) | ||
@echo "Building BLS: branch=$(bls_branch)" | ||
@$(PRINT_NON) | ||
$(MAKE) -C $(BLS_DIR) -j $(NPROC) lib/libbls256.a | ||
@$(PRINT_MAG) | ||
@echo "Building MCL: branch=$(mcl_branch)" | ||
@$(PRINT_NON) | ||
$(MAKE) -C $(MCL_DIR) -j $(NPROC) lib/libmclbn256.a | ||
|
||
herumi-install: | ||
@$(PRINT_MAG) | ||
@echo "Installing BLS: branch=$(bls_branch)" | ||
@$(PRINT_NON) | ||
@sudo $(MAKE) -C $(MCL_DIR) install | ||
@$(PRINT_MAG) | ||
@echo "Installing BLS: branch=$(bls_branch)" | ||
@$(PRINT_NON) | ||
@sudo $(MAKE) -C $(BLS_DIR) install | ||
|
||
herumi-all: | herumi-clone herumi-checkout herumi-deps herumi-build herumi-install |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
COL_RED := "\033[1;31m" | ||
COL_GRN := "\033[1;32m" | ||
COL_YEL := "\033[1;33m" | ||
COL_BLU := "\033[1;34m" | ||
COL_MAG := "\033[1;35m" | ||
COL_CYN := "\033[1;36m" | ||
COL_NON := "\033[0m" | ||
PRINT_RED := printf $(COL_RED) | ||
PRINT_GRN := printf $(COL_GRN) | ||
PRINT_YEL := printf $(COL_YEL) | ||
PRINT_BLU := printf $(COL_BLU) | ||
PRINT_MAG := printf $(COL_MAG) | ||
PRINT_CYN := printf $(COL_CYN) | ||
PRINT_NON := printf $(COL_NON) |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.