github.com/hyperion-hyn/go-ethereum@v2.4.0+incompatible/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 swarm 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  
    14  geth:
    15  	build/env.sh go run build/ci.go install ./cmd/geth
    16  	@echo "Done building."
    17  	@echo "Run \"$(GOBIN)/geth\" to launch geth."
    18  
    19  bootnode:
    20  	build/env.sh go run build/ci.go install ./cmd/bootnode
    21  	@echo "Done building bootnode."
    22  
    23  swarm:
    24  	build/env.sh go run build/ci.go install ./cmd/swarm
    25  	@echo "Done building."
    26  	@echo "Run \"$(GOBIN)/swarm\" to launch swarm."
    27  
    28  all:
    29  	build/env.sh go run build/ci.go install
    30  
    31  android:
    32  	build/env.sh go run build/ci.go aar --local
    33  	@echo "Done building."
    34  	@echo "Import \"$(GOBIN)/geth.aar\" to use the library."
    35  
    36  ios:
    37  	build/env.sh go run build/ci.go xcode --local
    38  	@echo "Done building."
    39  	@echo "Import \"$(GOBIN)/Geth.framework\" to use the library."
    40  
    41  test: all
    42  	build/env.sh go run build/ci.go test
    43  
    44  lint: ## Run linters.
    45  	build/env.sh go run build/ci.go lint
    46  
    47  clean:
    48  	./build/clean_go_build_cache.sh
    49  	rm -fr build/_workspace/pkg/ $(GOBIN)/*
    50  
    51  # The devtools target installs tools required for 'go generate'.
    52  # You need to put $GOBIN (or $GOPATH/bin) in your PATH to use 'go generate'.
    53  
    54  devtools:
    55  	env GOBIN= go get -u golang.org/x/tools/cmd/stringer
    56  	env GOBIN= go get -u github.com/kevinburke/go-bindata/go-bindata
    57  	env GOBIN= go get -u github.com/fjl/gencodec
    58  	env GOBIN= go get -u github.com/golang/protobuf/protoc-gen-go
    59  	env GOBIN= go install ./cmd/abigen
    60  	@type "npm" 2> /dev/null || echo 'Please install node.js and npm'
    61  	@type "solc" 2> /dev/null || echo 'Please install solc'
    62  	@type "protoc" 2> /dev/null || echo 'Please install protoc'
    63  
    64  swarm-devtools:
    65  	env GOBIN= go install ./cmd/swarm/mimegen
    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  	build/env.sh go run 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  	build/env.sh go run 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  	build/env.sh go run 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  	build/env.sh go run 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  	build/env.sh go run 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  	build/env.sh go run 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  	build/env.sh go run 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  	build/env.sh go run 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  	build/env.sh go run 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  	build/env.sh go run 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  	build/env.sh go run 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  	build/env.sh go run 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  	build/env.sh go run 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  	build/env.sh go run 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
   158  
   159  # QUORUM - BEGIN
   160  RELEASE_NOTES_FILE := generated-release-notes.md
   161  LAST_RELEASE_VERSION := $(shell git describe --tags --abbrev=0 @^)
   162  REQUIRED_ENV_VARS := QUORUM_RELEASE BINTRAY_USER BINTRAY_API_KEY GITHUB_TOKEN
   163  release-prepare: release-tools
   164  	@[ "${QUORUM_RELEASE}" ] || (echo "Please provide QUORUM_RELEASE env variable" ; exit 1)
   165  	@rm -f $(RELEASE_NOTES_FILE)
   166  	@echo "Last release: $(LAST_RELEASE_VERSION)"
   167  	@echo "This release: ${QUORUM_RELEASE}"
   168  	@echo "${QUORUM_RELEASE}\n\n" > $(RELEASE_NOTES_FILE)
   169  	@git log --pretty=format:%s $(LAST_RELEASE_VERSION)..@ >> $(RELEASE_NOTES_FILE)
   170  	@echo "$(RELEASE_NOTES_FILE) has been created"
   171  
   172  release: release-tools check-release-env
   173  	@jfrog bt version-show quorumengineering/quorum/geth/${QUORUM_RELEASE} --key ${BINTRAY_API_KEY} --user ${BINTRAY_USER}
   174  	@echo "\n\n| Filename | SHA256 Hash |" >> $(RELEASE_NOTES_FILE)
   175  	@echo "|:---------|:------------|" >> $(RELEASE_NOTES_FILE)
   176  	@curl -s -u ${BINTRAY_USER}:${BINTRAY_API_KEY} https://api.bintray.com/packages/quorumengineering/quorum/geth/versions/${QUORUM_RELEASE}/files \
   177  	| jq '.[] | select(.name | endswith(".asc") | not) | "|[\(.name)](https://bintray.com/quorumengineering/quorum/download_file?file_path=\(.path))|`\(.sha256)`|"' -r \
   178  	>> $(RELEASE_NOTES_FILE)
   179  	@hub release create -d -F $(RELEASE_NOTES_FILE) ${QUORUM_RELEASE}
   180  
   181  # make sure all API Keys are set
   182  check-release-env: $(REQUIRED_ENV_VARS)
   183  	@[ -f "$(RELEASE_NOTES_FILE)" ] || (echo "Please run 'make release-prepare' and edit the release notes"; exit 1)
   184  
   185  $(REQUIRED_ENV_VARS):
   186  	@[ "${$@}" ] || (echo "Please provide $@ env variable" ; exit 1)
   187  
   188  release-tools:
   189  ifeq (, $(shell which hub))
   190  	@echo "Please install Github CLI from https://hub.github.com"
   191  endif
   192  ifeq (, $(shell which jfrog))
   193  	@echo "Please install JFrog CLI from https://jfrog.com/getcli"
   194  endif
   195  ifeq (, $(shell which jq))
   196  	@echo "Please install jq from https://stedolan.github.io/jq/download"
   197  endif
   198  # QUORUM - END