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