github.com/chenyu1024/maize@v0.0.2/Makefile (about) 1 # This Makefile is meant to be used by people that do not usually work 2 # with Go source code. If you know what GOPATH is then you probably 3 # don't need to bother with make. 4 5 .PHONY: geth android ios evm all test truffle-test clean 6 .PHONY: docker 7 .PHONY: geth-linux-arm geth-linux-arm64 geth-linux-arm5 geth-linux-arm6 geth-linux-arm7 8 9 GOBIN = ./build/bin 10 GO ?= latest 11 GORUN = env GO111MODULE=on go run 12 GIT_COMMIT=$(shell git rev-parse HEAD) 13 GIT_COMMIT_DATE=$(shell git log -n1 --pretty='format:%cd' --date=format:'%Y%m%d') 14 15 geth: 16 $(GORUN) build/ci.go install ./cmd/geth 17 @echo "Done building." 18 @echo "Run \"$(GOBIN)/geth\" to launch geth." 19 20 ldflags = -X main.gitCommit=$(GIT_COMMIT) \ 21 -X main.gitDate=$(GIT_COMMIT_DATE) 22 23 geth-linux-arm: geth-linux-arm5 geth-linux-arm6 geth-linux-arm7 geth-linux-arm64 24 25 geth-linux-arm5: 26 env GO111MODULE=on GOARCH=arm GOARM=5 GOOS=linux go build -ldflags="$(ldflags)" -o build/bin/geth-linux-arm-5 ./cmd/geth 27 28 geth-linux-arm6: 29 env GO111MODULE=on GOARCH=arm GOARM=6 GOOS=linux go build -ldflags="$(ldflags)" -o build/bin/geth-linux-arm-6 ./cmd/geth 30 31 geth-linux-arm7: 32 env GO111MODULE=on GOARCH=arm GOARM=7 GOOS=linux go build -ldflags="$(ldflags)" -o build/bin/geth-linux-arm-7 ./cmd/geth 33 34 geth-linux-arm64: 35 env GO111MODULE=on GOARCH=arm64 GOOS=linux go build -ldflags="$(ldflags)" -o build/bin/geth-linux-arm64 ./cmd/geth 36 37 all: 38 $(GORUN) build/ci.go install 39 40 android: 41 $(GORUN) build/ci.go aar --local 42 @echo "Done building." 43 @echo "Import \"$(GOBIN)/geth.aar\" to use the library." 44 @echo "Import \"$(GOBIN)/geth-sources.jar\" to add javadocs" 45 @echo "For more info see https://stackoverflow.com/questions/20994336/android-studio-how-to-attach-javadoc" 46 47 ios: 48 $(GORUN) build/ci.go xcode --local 49 @echo "Done building." 50 @echo "Import \"$(GOBIN)/Geth.framework\" to use the library." 51 52 test: all 53 $(GORUN) build/ci.go test -timeout 1h 54 55 truffle-test: 56 docker build . -f ./docker/Dockerfile --target bsc-genesis -t bsc-genesis 57 docker build . -f ./docker/Dockerfile --target bsc -t bsc 58 docker build . -f ./docker/Dockerfile.truffle -t truffle-test 59 docker-compose -f ./tests/truffle/docker-compose.yml up genesis 60 docker-compose -f ./tests/truffle/docker-compose.yml up -d bsc-rpc bsc-validator1 61 sleep 30 62 docker-compose -f ./tests/truffle/docker-compose.yml up --exit-code-from truffle-test truffle-test 63 docker-compose -f ./tests/truffle/docker-compose.yml down 64 65 lint: ## Run linters. 66 $(GORUN) build/ci.go lint 67 68 clean: 69 env GO111MODULE=on go clean -cache 70 rm -fr build/_workspace/pkg/ $(GOBIN)/* 71 72 # The devtools target installs tools required for 'go generate'. 73 # You need to put $GOBIN (or $GOPATH/bin) in your PATH to use 'go generate'. 74 75 devtools: 76 env GOBIN= go install golang.org/x/tools/cmd/stringer@latest 77 env GOBIN= go install github.com/kevinburke/go-bindata/go-bindata@latest 78 env GOBIN= go install github.com/fjl/gencodec@latest 79 env GOBIN= go install github.com/golang/protobuf/protoc-gen-go@latest 80 env GOBIN= go install ./cmd/abigen 81 @type "solc" 2> /dev/null || echo 'Please install solc' 82 @type "protoc" 2> /dev/null || echo 'Please install protoc' 83 84 docker: 85 docker build --pull -t bnb-chain/bsc:latest -f Dockerfile .