github.com/phillinzzz/newBsc@v1.1.6/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 geth-cross evm all test truffle-test clean
     6  .PHONY: geth-linux geth-linux-386 geth-linux-amd64 geth-linux-mips64 geth-linux-mips64le
     7  .PHONY: geth-linux-arm geth-linux-arm-5 geth-linux-arm-6 geth-linux-arm-7 geth-linux-arm64
     8  .PHONY: geth-darwin geth-darwin-386 geth-darwin-amd64
     9  .PHONY: geth-windows geth-windows-386 geth-windows-amd64
    10  
    11  GOBIN = ./build/bin
    12  GO ?= latest
    13  GORUN = env GO111MODULE=on go run
    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  all:
    21  	$(GORUN) build/ci.go install
    22  
    23  android:
    24  	$(GORUN) build/ci.go aar --local
    25  	@echo "Done building."
    26  	@echo "Import \"$(GOBIN)/geth.aar\" to use the library."
    27  	@echo "Import \"$(GOBIN)/geth-sources.jar\" to add javadocs"
    28  	@echo "For more info see https://stackoverflow.com/questions/20994336/android-studio-how-to-attach-javadoc"
    29  
    30  ios:
    31  	$(GORUN) build/ci.go xcode --local
    32  	@echo "Done building."
    33  	@echo "Import \"$(GOBIN)/Geth.framework\" to use the library."
    34  
    35  test: all
    36  	$(GORUN) build/ci.go test -timeout 1h
    37  
    38  truffle-test:
    39  	docker build . -f ./docker/Dockerfile --target bsc-genesis -t bsc-genesis
    40  	docker build . -f ./docker/Dockerfile --target bsc -t bsc
    41  	docker build . -f ./docker/Dockerfile.truffle -t truffle-test
    42  	docker-compose -f ./tests/truffle/docker-compose.yml up genesis
    43  	docker-compose -f ./tests/truffle/docker-compose.yml up -d bsc-rpc bsc-validator1
    44  	sleep 30
    45  	docker-compose -f ./tests/truffle/docker-compose.yml up --exit-code-from truffle-test truffle-test
    46  	docker-compose -f ./tests/truffle/docker-compose.yml down
    47  
    48  lint: ## Run linters.
    49  	$(GORUN) build/ci.go lint
    50  
    51  clean:
    52  	env GO111MODULE=on go clean -cache
    53  	rm -fr build/_workspace/pkg/ $(GOBIN)/*
    54  
    55  # The devtools target installs tools required for 'go generate'.
    56  # You need to put $GOBIN (or $GOPATH/bin) in your PATH to use 'go generate'.
    57  
    58  devtools:
    59  	env GOBIN= go install golang.org/x/tools/cmd/stringer@latest
    60  	env GOBIN= go install github.com/kevinburke/go-bindata/go-bindata@latest
    61  	env GOBIN= go install github.com/fjl/gencodec@latest
    62  	env GOBIN= go install github.com/golang/protobuf/protoc-gen-go@latest
    63  	env GOBIN= go install ./cmd/abigen
    64  	@type "solc" 2> /dev/null || echo 'Please install solc'
    65  	@type "protoc" 2> /dev/null || echo 'Please install protoc'
    66  
    67  # Cross Compilation Targets (xgo)
    68  
    69  geth-cross: geth-linux geth-darwin geth-windows geth-android geth-ios
    70  	@echo "Full cross compilation done:"
    71  	@ls -ld $(GOBIN)/geth-*
    72  
    73  geth-linux: geth-linux-386 geth-linux-amd64 geth-linux-arm geth-linux-mips64 geth-linux-mips64le
    74  	@echo "Linux cross compilation done:"
    75  	@ls -ld $(GOBIN)/geth-linux-*
    76  
    77  geth-linux-386:
    78  	$(GORUN) build/ci.go xgo -- --go=$(GO) --targets=linux/386 -v ./cmd/geth
    79  	@echo "Linux 386 cross compilation done:"
    80  	@ls -ld $(GOBIN)/geth-linux-* | grep 386
    81  
    82  geth-linux-amd64:
    83  	$(GORUN) build/ci.go xgo -- --go=$(GO) --targets=linux/amd64 -v ./cmd/geth
    84  	@echo "Linux amd64 cross compilation done:"
    85  	@ls -ld $(GOBIN)/geth-linux-* | grep amd64
    86  
    87  geth-linux-arm: geth-linux-arm-5 geth-linux-arm-6 geth-linux-arm-7 geth-linux-arm64
    88  	@echo "Linux ARM cross compilation done:"
    89  	@ls -ld $(GOBIN)/geth-linux-* | grep arm
    90  
    91  geth-linux-arm-5:
    92  	$(GORUN) build/ci.go xgo -- --go=$(GO) --targets=linux/arm-5 -v ./cmd/geth
    93  	@echo "Linux ARMv5 cross compilation done:"
    94  	@ls -ld $(GOBIN)/geth-linux-* | grep arm-5
    95  
    96  geth-linux-arm-6:
    97  	$(GORUN) build/ci.go xgo -- --go=$(GO) --targets=linux/arm-6 -v ./cmd/geth
    98  	@echo "Linux ARMv6 cross compilation done:"
    99  	@ls -ld $(GOBIN)/geth-linux-* | grep arm-6
   100  
   101  geth-linux-arm-7:
   102  	$(GORUN) build/ci.go xgo -- --go=$(GO) --targets=linux/arm-7 -v ./cmd/geth
   103  	@echo "Linux ARMv7 cross compilation done:"
   104  	@ls -ld $(GOBIN)/geth-linux-* | grep arm-7
   105  
   106  geth-linux-arm64:
   107  	$(GORUN) build/ci.go xgo -- --go=$(GO) --targets=linux/arm64 -v ./cmd/geth
   108  	@echo "Linux ARM64 cross compilation done:"
   109  	@ls -ld $(GOBIN)/geth-linux-* | grep arm64
   110  
   111  geth-linux-mips:
   112  	$(GORUN) build/ci.go xgo -- --go=$(GO) --targets=linux/mips --ldflags '-extldflags "-static"' -v ./cmd/geth
   113  	@echo "Linux MIPS cross compilation done:"
   114  	@ls -ld $(GOBIN)/geth-linux-* | grep mips
   115  
   116  geth-linux-mipsle:
   117  	$(GORUN) build/ci.go xgo -- --go=$(GO) --targets=linux/mipsle --ldflags '-extldflags "-static"' -v ./cmd/geth
   118  	@echo "Linux MIPSle cross compilation done:"
   119  	@ls -ld $(GOBIN)/geth-linux-* | grep mipsle
   120  
   121  geth-linux-mips64:
   122  	$(GORUN) build/ci.go xgo -- --go=$(GO) --targets=linux/mips64 --ldflags '-extldflags "-static"' -v ./cmd/geth
   123  	@echo "Linux MIPS64 cross compilation done:"
   124  	@ls -ld $(GOBIN)/geth-linux-* | grep mips64
   125  
   126  geth-linux-mips64le:
   127  	$(GORUN) build/ci.go xgo -- --go=$(GO) --targets=linux/mips64le --ldflags '-extldflags "-static"' -v ./cmd/geth
   128  	@echo "Linux MIPS64le cross compilation done:"
   129  	@ls -ld $(GOBIN)/geth-linux-* | grep mips64le
   130  
   131  geth-darwin: geth-darwin-386 geth-darwin-amd64
   132  	@echo "Darwin cross compilation done:"
   133  	@ls -ld $(GOBIN)/geth-darwin-*
   134  
   135  geth-darwin-386:
   136  	$(GORUN) build/ci.go xgo -- --go=$(GO) --targets=darwin/386 -v ./cmd/geth
   137  	@echo "Darwin 386 cross compilation done:"
   138  	@ls -ld $(GOBIN)/geth-darwin-* | grep 386
   139  
   140  geth-darwin-amd64:
   141  	$(GORUN) build/ci.go xgo -- --go=$(GO) --targets=darwin/amd64 -v ./cmd/geth
   142  	@echo "Darwin amd64 cross compilation done:"
   143  	@ls -ld $(GOBIN)/geth-darwin-* | grep amd64
   144  
   145  geth-windows: geth-windows-386 geth-windows-amd64
   146  	@echo "Windows cross compilation done:"
   147  	@ls -ld $(GOBIN)/geth-windows-*
   148  
   149  geth-windows-386:
   150  	$(GORUN) build/ci.go xgo -- --go=$(GO) --targets=windows/386 -v ./cmd/geth
   151  	@echo "Windows 386 cross compilation done:"
   152  	@ls -ld $(GOBIN)/geth-windows-* | grep 386
   153  
   154  geth-windows-amd64:
   155  	$(GORUN) build/ci.go xgo -- --go=$(GO) --targets=windows/amd64 -v ./cmd/geth
   156  	@echo "Windows amd64 cross compilation done:"
   157  	@ls -ld $(GOBIN)/geth-windows-* | grep amd64