github.com/FusionFoundation/efsn/v4@v4.2.0/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 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  GORUN = env GO111MODULE=on go run
    14  
    15  # to prevent mistakely run 'bash Makefile',
    16  # which will execute dangerous command 'rm /*'
    17  ifneq ($(GOBIN),)
    18  endif
    19  
    20  efsn:
    21  	$(GORUN) build/ci.go install ./cmd/efsn
    22  	@echo "Done building."
    23  	@echo "Run \"$(GOBIN)/efsn\" to launch efsn."
    24  
    25  debug:
    26  	# https://ethereum.stackexchange.com/questions/41489/how-to-debug-geth-with-delve?rq=1
    27  	@echo building debug version
    28  	build/env.sh go build -o ./build/bin/efsn   -gcflags=all='-N -l' -v ./cmd/efsn
    29  	@echo end building debug version
    30  	@echo "Run \"$(GOBIN)/efsn\" to launch efsn."
    31  
    32  bootnode:
    33  	$(GORUN) build/ci.go install ./cmd/bootnode
    34  
    35  all:
    36  	$(GORUN) build/ci.go install
    37  	@echo "Done building."
    38  
    39  android:
    40  	$(GORUN) build/ci.go aar --local
    41  	@echo "Done building."
    42  	@echo "Import \"$(GOBIN)/geth.aar\" to use the library."
    43  
    44  ios:
    45  	$(GORUN) build/ci.go xcode --local
    46  	@echo "Done building."
    47  	@echo "Import \"$(GOBIN)/Geth.framework\" to use the library."
    48  
    49  test: all
    50  	$(GORUN) build/ci.go test
    51  
    52  lint: ## Run linters.
    53  	$(GORUN) build/ci.go lint
    54  
    55  clean:
    56  	env GO111MODULE=on go clean -cache
    57  	rm -fr build/_workspace/pkg/ $(GOBIN)/*
    58  
    59  # The devtools target installs tools required for 'go generate'.
    60  # You need to put $GOBIN (or $GOPATH/bin) in your PATH to use 'go generate'.
    61  
    62  devtools:
    63  	env GOBIN= go get -u golang.org/x/tools/cmd/stringer
    64  	env GOBIN= go get -u github.com/fjl/gencodec
    65  	env GOBIN= go get -u github.com/golang/protobuf/protoc-gen-go
    66  	env GOBIN= go install ./cmd/abigen
    67  	@type "npm" 2> /dev/null || echo 'Please install node.js and npm'
    68  	@type "solc" 2> /dev/null || echo 'Please install solc'
    69  	@type "protoc" 2> /dev/null || echo 'Please install protoc'
    70  
    71  # Cross Compilation Targets (xgo)
    72  
    73  geth-cross: geth-linux geth-darwin geth-windows geth-android geth-ios
    74  	@echo "Full cross compilation done:"
    75  	@ls -ld $(GOBIN)/geth-*
    76  
    77  geth-linux: geth-linux-386 geth-linux-amd64 geth-linux-arm geth-linux-mips64 geth-linux-mips64le
    78  	@echo "Linux cross compilation done:"
    79  	@ls -ld $(GOBIN)/geth-linux-*
    80  
    81  geth-linux-386:
    82  	$(GORUN) build/ci.go xgo -- --go=$(GO) --targets=linux/386 -v ./cmd/geth
    83  	@echo "Linux 386 cross compilation done:"
    84  	@ls -ld $(GOBIN)/geth-linux-* | grep 386
    85  
    86  geth-linux-amd64:
    87  	$(GORUN) build/ci.go xgo -- --go=$(GO) --targets=linux/amd64 -v ./cmd/geth
    88  	@echo "Linux amd64 cross compilation done:"
    89  	@ls -ld $(GOBIN)/geth-linux-* | grep amd64
    90  
    91  geth-linux-arm: geth-linux-arm-5 geth-linux-arm-6 geth-linux-arm-7 geth-linux-arm64
    92  	@echo "Linux ARM cross compilation done:"
    93  	@ls -ld $(GOBIN)/geth-linux-* | grep arm
    94  
    95  geth-linux-arm-5:
    96  	$(GORUN) build/ci.go xgo -- --go=$(GO) --targets=linux/arm-5 -v ./cmd/geth
    97  	@echo "Linux ARMv5 cross compilation done:"
    98  	@ls -ld $(GOBIN)/geth-linux-* | grep arm-5
    99  
   100  geth-linux-arm-6:
   101  	$(GORUN) build/ci.go xgo -- --go=$(GO) --targets=linux/arm-6 -v ./cmd/geth
   102  	@echo "Linux ARMv6 cross compilation done:"
   103  	@ls -ld $(GOBIN)/geth-linux-* | grep arm-6
   104  
   105  geth-linux-arm-7:
   106  	$(GORUN) build/ci.go xgo -- --go=$(GO) --targets=linux/arm-7 -v ./cmd/geth
   107  	@echo "Linux ARMv7 cross compilation done:"
   108  	@ls -ld $(GOBIN)/geth-linux-* | grep arm-7
   109  
   110  geth-linux-arm64:
   111  	$(GORUN) build/ci.go xgo -- --go=$(GO) --targets=linux/arm64 -v ./cmd/geth
   112  	@echo "Linux ARM64 cross compilation done:"
   113  	@ls -ld $(GOBIN)/geth-linux-* | grep arm64
   114  
   115  geth-linux-mips:
   116  	$(GORUN) build/ci.go xgo -- --go=$(GO) --targets=linux/mips --ldflags '-extldflags "-static"' -v ./cmd/geth
   117  	@echo "Linux MIPS cross compilation done:"
   118  	@ls -ld $(GOBIN)/geth-linux-* | grep mips
   119  
   120  geth-linux-mipsle:
   121  	$(GORUN) build/ci.go xgo -- --go=$(GO) --targets=linux/mipsle --ldflags '-extldflags "-static"' -v ./cmd/geth
   122  	@echo "Linux MIPSle cross compilation done:"
   123  	@ls -ld $(GOBIN)/geth-linux-* | grep mipsle
   124  
   125  geth-linux-mips64:
   126  	$(GORUN) build/ci.go xgo -- --go=$(GO) --targets=linux/mips64 --ldflags '-extldflags "-static"' -v ./cmd/geth
   127  	@echo "Linux MIPS64 cross compilation done:"
   128  	@ls -ld $(GOBIN)/geth-linux-* | grep mips64
   129  
   130  geth-linux-mips64le:
   131  	$(GORUN) build/ci.go xgo -- --go=$(GO) --targets=linux/mips64le --ldflags '-extldflags "-static"' -v ./cmd/geth
   132  	@echo "Linux MIPS64le cross compilation done:"
   133  	@ls -ld $(GOBIN)/geth-linux-* | grep mips64le
   134  
   135  geth-darwin: geth-darwin-386 geth-darwin-amd64
   136  	@echo "Darwin cross compilation done:"
   137  	@ls -ld $(GOBIN)/geth-darwin-*
   138  
   139  geth-darwin-386:
   140  	$(GORUN) build/ci.go xgo -- --go=$(GO) --targets=darwin/386 -v ./cmd/geth
   141  	@echo "Darwin 386 cross compilation done:"
   142  	@ls -ld $(GOBIN)/geth-darwin-* | grep 386
   143  
   144  geth-darwin-amd64:
   145  	$(GORUN) build/ci.go xgo -- --go=$(GO) --targets=darwin/amd64 -v ./cmd/geth
   146  	@echo "Darwin amd64 cross compilation done:"
   147  	@ls -ld $(GOBIN)/geth-darwin-* | grep amd64
   148  
   149  geth-windows: geth-windows-386 geth-windows-amd64
   150  	@echo "Windows cross compilation done:"
   151  	@ls -ld $(GOBIN)/geth-windows-*
   152  
   153  geth-windows-386:
   154  	$(GORUN) build/ci.go xgo -- --go=$(GO) --targets=windows/386 -v ./cmd/geth
   155  	@echo "Windows 386 cross compilation done:"
   156  	@ls -ld $(GOBIN)/geth-windows-* | grep 386
   157  
   158  geth-windows-amd64:
   159  	$(GORUN) build/ci.go xgo -- --go=$(GO) --targets=windows/amd64 -v ./cmd/geth
   160  	@echo "Windows amd64 cross compilation done:"
   161  	@ls -ld $(GOBIN)/geth-windows-* | grep amd64