github.com/platonnetwork/platon-go@v0.7.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 all 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 = $(shell pwd)/build/bin
    12  GO ?= latest
    13  
    14  platon:
    15  	build/build_deps.sh
    16  	build/env.sh go run build/ci.go install ./cmd/platon
    17  	@echo "Done building."
    18  	@echo "Run \"$(GOBIN)/platon\" to launch platon."
    19  
    20  platon-with-mpc:
    21  	build/build_deps.sh
    22  	build/env.sh go run build/ci.go install -mpc on ./cmd/platon
    23  	@echo "Done building platon with mpc."
    24  	@echo "Run \"$(GOBIN)/platon\" to launch platon."
    25  
    26  platon-with-vc:
    27  	build/build_deps.sh
    28  	build/build_snark.sh
    29  	build/env.sh go run build/ci.go install -vc on ./cmd/platon
    30  	@echo "Done building platon with vc."
    31  	@echo "Run \"$(GOBIN)/platon\" to launch platon."
    32  
    33  platon-with-mv:
    34  	build/build_deps.sh
    35  	build/build_snark.sh
    36  	build/env.sh go run build/ci.go install -mv on ./cmd/platon
    37  	@echo "Done building platon with vc."
    38  	@echo "Run \"$(GOBIN)/platon\" to launch platon."
    39  
    40  all:
    41  	build/build_deps.sh
    42  	build/env.sh go run build/ci.go install
    43  
    44  all-debug:
    45  	build/build_deps.sh
    46  	build/env.sh go run build/ci.go install -gcflags on
    47  
    48  all-with-mpc:
    49  	build/build_deps.sh
    50  	build/env.sh go run build/ci.go install -mpc on
    51  
    52  all-with-vc:
    53  	build/build_deps.sh
    54  	build/build_snark.sh
    55  	build/env.sh go run build/ci.go install -vc on
    56  
    57  all-with-mv:
    58  	build/build_deps.sh
    59  	build/build_snark.sh
    60  	build/env.sh go run build/ci.go install -mv on
    61  
    62  android:
    63  	build/env.sh go run build/ci.go aar --local
    64  	@echo "Done building."
    65  	@echo "Import \"$(GOBIN)/geth.aar\" to use the library."
    66  
    67  ios:
    68  	build/env.sh go run build/ci.go xcode --local
    69  	@echo "Done building."
    70  	@echo "Import \"$(GOBIN)/Geth.framework\" to use the library."
    71  
    72  test: all
    73  	build/env.sh go run build/ci.go test
    74  
    75  lint: ## Run linters.
    76  	build/env.sh go run build/ci.go lint
    77  
    78  clean:
    79  	./build/clean_deps.sh
    80  	./build/clean_go_build_cache.sh
    81  	rm -fr build/_workspace/pkg/ $(GOBIN)/*
    82  
    83  # The devtools target installs tools required for 'go generate'.
    84  # You need to put $GOBIN (or $GOPATH/bin) in your PATH to use 'go generate'.
    85  
    86  devtools:
    87  	env GOBIN= go get -u golang.org/x/tools/cmd/stringer
    88  	env GOBIN= go get -u github.com/kevinburke/go-bindata/go-bindata
    89  	env GOBIN= go get -u github.com/fjl/gencodec
    90  	env GOBIN= go get -u github.com/golang/protobuf/protoc-gen-go
    91  	env GOBIN= go install ./cmd/abigen
    92  	@type "npm" 2> /dev/null || echo 'Please install node.js and npm'
    93  	@type "solc" 2> /dev/null || echo 'Please install solc'
    94  	@type "protoc" 2> /dev/null || echo 'Please install protoc'
    95  
    96  # Cross Compilation Targets (xgo)
    97  
    98  geth-cross: geth-linux geth-darwin geth-windows geth-android geth-ios
    99  	@echo "Full cross compilation done:"
   100  	@ls -ld $(GOBIN)/geth-*
   101  
   102  geth-linux: geth-linux-386 geth-linux-amd64 geth-linux-arm geth-linux-mips64 geth-linux-mips64le
   103  	@echo "Linux cross compilation done:"
   104  	@ls -ld $(GOBIN)/geth-linux-*
   105  
   106  geth-linux-386:
   107  	build/env.sh go run build/ci.go xgo -- --go=$(GO) --targets=linux/386 -v ./cmd/geth
   108  	@echo "Linux 386 cross compilation done:"
   109  	@ls -ld $(GOBIN)/geth-linux-* | grep 386
   110  
   111  geth-linux-amd64:
   112  	build/env.sh go run build/ci.go xgo -- --go=$(GO) --targets=linux/amd64 -v ./cmd/geth
   113  	@echo "Linux amd64 cross compilation done:"
   114  	@ls -ld $(GOBIN)/geth-linux-* | grep amd64
   115  
   116  geth-linux-arm: geth-linux-arm-5 geth-linux-arm-6 geth-linux-arm-7 geth-linux-arm64
   117  	@echo "Linux ARM cross compilation done:"
   118  	@ls -ld $(GOBIN)/geth-linux-* | grep arm
   119  
   120  geth-linux-arm-5:
   121  	build/env.sh go run build/ci.go xgo -- --go=$(GO) --targets=linux/arm-5 -v ./cmd/geth
   122  	@echo "Linux ARMv5 cross compilation done:"
   123  	@ls -ld $(GOBIN)/geth-linux-* | grep arm-5
   124  
   125  geth-linux-arm-6:
   126  	build/env.sh go run build/ci.go xgo -- --go=$(GO) --targets=linux/arm-6 -v ./cmd/geth
   127  	@echo "Linux ARMv6 cross compilation done:"
   128  	@ls -ld $(GOBIN)/geth-linux-* | grep arm-6
   129  
   130  geth-linux-arm-7:
   131  	build/env.sh go run build/ci.go xgo -- --go=$(GO) --targets=linux/arm-7 -v ./cmd/geth
   132  	@echo "Linux ARMv7 cross compilation done:"
   133  	@ls -ld $(GOBIN)/geth-linux-* | grep arm-7
   134  
   135  geth-linux-arm64:
   136  	build/env.sh go run build/ci.go xgo -- --go=$(GO) --targets=linux/arm64 -v ./cmd/geth
   137  	@echo "Linux ARM64 cross compilation done:"
   138  	@ls -ld $(GOBIN)/geth-linux-* | grep arm64
   139  
   140  geth-linux-mips:
   141  	build/env.sh go run build/ci.go xgo -- --go=$(GO) --targets=linux/mips --ldflags '-extldflags "-static"' -v ./cmd/geth
   142  	@echo "Linux MIPS cross compilation done:"
   143  	@ls -ld $(GOBIN)/geth-linux-* | grep mips
   144  
   145  geth-linux-mipsle:
   146  	build/env.sh go run build/ci.go xgo -- --go=$(GO) --targets=linux/mipsle --ldflags '-extldflags "-static"' -v ./cmd/geth
   147  	@echo "Linux MIPSle cross compilation done:"
   148  	@ls -ld $(GOBIN)/geth-linux-* | grep mipsle
   149  
   150  geth-linux-mips64:
   151  	build/env.sh go run build/ci.go xgo -- --go=$(GO) --targets=linux/mips64 --ldflags '-extldflags "-static"' -v ./cmd/geth
   152  	@echo "Linux MIPS64 cross compilation done:"
   153  	@ls -ld $(GOBIN)/geth-linux-* | grep mips64
   154  
   155  geth-linux-mips64le:
   156  	build/env.sh go run build/ci.go xgo -- --go=$(GO) --targets=linux/mips64le --ldflags '-extldflags "-static"' -v ./cmd/geth
   157  	@echo "Linux MIPS64le cross compilation done:"
   158  	@ls -ld $(GOBIN)/geth-linux-* | grep mips64le
   159  
   160  geth-darwin: geth-darwin-386 geth-darwin-amd64
   161  	@echo "Darwin cross compilation done:"
   162  	@ls -ld $(GOBIN)/geth-darwin-*
   163  
   164  geth-darwin-386:
   165  	build/env.sh go run build/ci.go xgo -- --go=$(GO) --targets=darwin/386 -v ./cmd/geth
   166  	@echo "Darwin 386 cross compilation done:"
   167  	@ls -ld $(GOBIN)/geth-darwin-* | grep 386
   168  
   169  geth-darwin-amd64:
   170  	build/env.sh go run build/ci.go xgo -- --go=$(GO) --targets=darwin/amd64 -v ./cmd/geth
   171  	@echo "Darwin amd64 cross compilation done:"
   172  	@ls -ld $(GOBIN)/geth-darwin-* | grep amd64
   173  
   174  geth-windows: geth-windows-386 geth-windows-amd64
   175  	@echo "Windows cross compilation done:"
   176  	@ls -ld $(GOBIN)/geth-windows-*
   177  
   178  geth-windows-386:
   179  	build/env.sh go run build/ci.go xgo -- --go=$(GO) --targets=windows/386 -v ./cmd/geth
   180  	@echo "Windows 386 cross compilation done:"
   181  	@ls -ld $(GOBIN)/geth-windows-* | grep 386
   182  
   183  geth-windows-amd64:
   184  	build/env.sh go run build/ci.go xgo -- --go=$(GO) --targets=windows/amd64 -v ./cmd/geth
   185  	@echo "Windows amd64 cross compilation done:"
   186  	@ls -ld $(GOBIN)/geth-windows-* | grep amd64