Skip to content
This repository was archived by the owner on Oct 4, 2019. It is now read-only.

Commit a97a13a

Browse files
austinabellsoc1c
authored andcommitted
Makefile and README updates (#49)
* wip makefile updates * Fixed makefile and updated README * Fixed readme changes * Added go module documentation and fixed wiki links to EP * Added go modules on for makefile commands and documentation
1 parent 6c6454e commit a97a13a

File tree

2 files changed

+56
-100
lines changed

2 files changed

+56
-100
lines changed

Makefile

+16-36
Original file line numberDiff line numberDiff line change
@@ -5,86 +5,66 @@ SOURCE_FILES?=$$(go list ./... | grep -v /vendor/)
55
TEST_PATTERN?=.
66
TEST_OPTIONS?=-race
77

8+
GO_MOD=GO111MODULE=on
9+
810
BINARY=bin
911
BUILD_TIME=`date +%FT%T%z`
1012
COMMIT=`git log --pretty=format:'%h' -n 1`
1113

12-
# Choose to install geth with or without SputnikVM.
13-
WITH_SVM?=1
14-
1514
# Provide default value of GOPATH, if it's not set in environment
1615
export GOPATH?=${HOME}/go
1716

18-
LDFLAGS=-ldflags "-X main.Version="`git describe --tags`
19-
20-
setup: ## Install all the build and lint dependencies
21-
go get -u github.com/alecthomas/gometalinter
22-
go get -u github.com/golang/dep/...
23-
go get -u github.com/pierrre/gotestcover
24-
go get -u golang.org/x/tools/cmd/cover
25-
go get -u github.com/omeid/go-resources/cmd/resources
26-
dep ensure
27-
gometalinter --install
28-
2917
build: cmd/abigen cmd/bootnode cmd/disasm cmd/ethtest cmd/evm cmd/gethrpctest cmd/rlpdump cmd/geth ## Build a local snapshot binary version of all commands
3018
@ls -ld $(BINARY)/*
3119

32-
cmd/geth: chainconfig ## Build a local snapshot binary version of geth. Use WITH_SVM=0 to disable building with SputnikVM (default: WITH_SVM=1)
33-
ifeq (${WITH_SVM}, 1)
34-
./scripts/build_sputnikvm.sh build
35-
else
20+
cmd/geth: chainconfig ## Build a local snapshot binary version of geth.
3621
mkdir -p ./${BINARY}
37-
go build ${LDFLAGS} -o ${BINARY}/geth -tags="netgo" ./cmd/geth
38-
endif
22+
${GO_MOD} go build -o ${BINARY}/geth -tags="netgo" ./cmd/geth
3923
@echo "Done building geth."
4024
@echo "Run \"$(BINARY)/geth\" to launch geth."
4125

4226
cmd/abigen: ## Build a local snapshot binary version of abigen.
43-
mkdir -p ./${BINARY} && go build ${LDFLAGS} -o ${BINARY}/abigen ./cmd/abigen
27+
mkdir -p ./${BINARY} && ${GO_MOD} go build -o ${BINARY}/abigen ./cmd/abigen
4428
@echo "Done building abigen."
4529
@echo "Run \"$(BINARY)/abigen\" to launch abigen."
4630

4731
cmd/bootnode: ## Build a local snapshot of bootnode.
48-
mkdir -p ./${BINARY} && go build ${LDFLAGS} -o ${BINARY}/bootnode ./cmd/bootnode
32+
mkdir -p ./${BINARY} && ${GO_MOD} go build -o ${BINARY}/bootnode ./cmd/bootnode
4933
@echo "Done building bootnode."
5034
@echo "Run \"$(BINARY)/bootnode\" to launch bootnode."
5135

5236
cmd/disasm: ## Build a local snapshot of disasm.
53-
mkdir -p ./${BINARY} && go build ${LDFLAGS} -o ${BINARY}/disasm ./cmd/disasm
37+
mkdir -p ./${BINARY} && ${GO_MOD} go build -o ${BINARY}/disasm ./cmd/disasm
5438
@echo "Done building disasm."
5539
@echo "Run \"$(BINARY)/disasm\" to launch disasm."
5640

5741
cmd/ethtest: ## Build a local snapshot of ethtest.
58-
mkdir -p ./${BINARY} && go build ${LDFLAGS} -o ${BINARY}/ethtest ./cmd/ethtest
42+
mkdir -p ./${BINARY} && ${GO_MOD} go build -o ${BINARY}/ethtest ./cmd/ethtest
5943
@echo "Done building ethtest."
6044
@echo "Run \"$(BINARY)/ethtest\" to launch ethtest."
6145

6246
cmd/evm: ## Build a local snapshot of evm.
63-
mkdir -p ./${BINARY} && go build ${LDFLAGS} -o ${BINARY}/evm ./cmd/evm
47+
mkdir -p ./${BINARY} && ${GO_MOD} go build -o ${BINARY}/evm ./cmd/evm
6448
@echo "Done building evm."
6549
@echo "Run \"$(BINARY)/evm\" to launch evm."
6650

6751
cmd/gethrpctest: ## Build a local snapshot of gethrpctest.
68-
mkdir -p ./${BINARY} && go build ${LDFLAGS} -o ${BINARY}/gethrpctest ./cmd/gethrpctest
52+
mkdir -p ./${BINARY} && ${GO_MOD} go build -o ${BINARY}/gethrpctest ./cmd/gethrpctest
6953
@echo "Done building gethrpctest."
7054
@echo "Run \"$(BINARY)/gethrpctest\" to launch gethrpctest."
7155

7256
cmd/rlpdump: ## Build a local snapshot of rlpdump.
73-
mkdir -p ./${BINARY} && go build ${LDFLAGS} -o ${BINARY}/rlpdump ./cmd/rlpdump
57+
mkdir -p ./${BINARY} && ${GO_MOD} go build -o ${BINARY}/rlpdump ./cmd/rlpdump
7458
@echo "Done building rlpdump."
7559
@echo "Run \"$(BINARY)/rlpdump\" to launch rlpdump."
7660

7761
install: ## Install all packages to $GOPATH/bin
78-
go install ./cmd/{abigen,bootnode,disasm,ethtest,evm,gethrpctest,rlpdump}
62+
${GO_MOD} go install ./cmd/{abigen,bootnode,disasm,ethtest,evm,gethrpctest,rlpdump}
7963
$(MAKE) install_geth
8064

81-
install_geth: chainconfig ## Install geth to $GOPATH/bin. Use WITH_SVM=0 to disable building with SputnikVM (default: WITH_SVM=1)
65+
install_geth: chainconfig ## Install geth to $GOPATH/bin
8266
$(info Installing $$GOPATH/bin/geth)
83-
ifeq (${WITH_SVM}, 1)
84-
./scripts/build_sputnikvm.sh install
85-
else
86-
go install ${LDFLAGS} -tags="netgo" ./cmd/geth ; fi
87-
endif
67+
${GO_MOD} go install -tags="netgo" ./cmd/geth
8868

8969
fmt: ## gofmt and goimports all go files
9070
find . -name '*.go' -not -wholename './vendor/*' -not -wholename './_vendor*' | while read -r file; do gofmt -w -s "$$file"; goimports -w "$$file"; done
@@ -112,7 +92,7 @@ lint: ## Run all the linters
11292

11393
test: ## Run all the tests
11494
echo 'mode: atomic' > coverage.txt && \
115-
go list ./... | xargs -n1 -I{} sh -c 'go test -covermode=atomic -coverprofile=coverage.tmp {} && \
95+
${GO_MOD} go list ./... | xargs -n1 -I{} sh -c 'go test -covermode=atomic -coverprofile=coverage.tmp {} && \
11696
tail -n +2 coverage.tmp >> coverage.txt' && \
11797
rm coverage.tmp
11898

@@ -125,7 +105,7 @@ core/assets/assets.go: ${GOPATH}/bin/resources core/config/*.json core/config/*.
125105
${GOPATH}/bin/resources -fmt -declare -var=DEFAULTS -package=assets -output=core/assets/assets.go core/config/*.json core/config/*.csv
126106

127107
${GOPATH}/bin/resources:
128-
go get -u github.com/omeid/go-resources/cmd/resources
108+
${GO_MOD} go get -u github.com/omeid/go-resources/cmd/resources
129109

130110
clean: ## Remove local snapshot binary directory
131111
if [ -d ${BINARY} ] ; then rm -rf ${BINARY} ; fi

0 commit comments

Comments
 (0)