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