diff --git a/.gitignore b/.gitignore index 460a711bc9..5c29ccd9b5 100644 --- a/.gitignore +++ b/.gitignore @@ -43,3 +43,10 @@ btcutil/psbt/coverage.txt # vim *.swp + +# Binaries produced by "make build" +/addblock +/btcctl +/btcd +/findcheckpoint +/gencerts diff --git a/Dockerfile b/Dockerfile index e5e349a820..5ed3e63c10 100644 --- a/Dockerfile +++ b/Dockerfile @@ -24,7 +24,6 @@ ARG ARCH=amd64 FROM golang@sha256:c80567372be0d486766593cc722d3401038e2f150a0f6c5c719caa63afb4026a AS build-container ARG ARCH -ENV GO111MODULE=on ADD . /app WORKDIR /app diff --git a/Makefile b/Makefile index 2e967ba0f6..5bfb1aa6a5 100644 --- a/Makefile +++ b/Makefile @@ -11,12 +11,12 @@ GOACC_BIN := $(GO_BIN)/go-acc LINT_COMMIT := v1.18.0 GOACC_COMMIT := 80342ae2e0fcf265e99e76bcc4efd022c7c3811b -DEPGET := cd /tmp && GO111MODULE=on go get -v -GOBUILD := GO111MODULE=on go build -v -GOINSTALL := GO111MODULE=on go install -v +DEPGET := cd /tmp && go get -v +GOBUILD := go build -v +GOINSTALL := go install -v DEV_TAGS := rpctest -GOTEST_DEV = GO111MODULE=on go test -v -tags=$(DEV_TAGS) -GOTEST := GO111MODULE=on go test -v +GOTEST_DEV = go test -v -tags=$(DEV_TAGS) +GOTEST := go test -v GOFILES_NOVENDOR = $(shell find . -type f -name '*.go' -not -path "./vendor/*") @@ -71,6 +71,19 @@ build: $(GOBUILD) $(PKG)/cmd/findcheckpoint $(GOBUILD) $(PKG)/cmd/addblock +install: + @$(call print, "Installing all binaries") + $(GOINSTALL) $(PKG) + $(GOINSTALL) $(PKG)/cmd/btcctl + $(GOINSTALL) $(PKG)/cmd/gencerts + $(GOINSTALL) $(PKG)/cmd/findcheckpoint + $(GOINSTALL) $(PKG)/cmd/addblock + +release-install: + @$(call print, "Installing btcd and btcctl release binaries") + env CGO_ENABLED=0 $(GOINSTALL) -trimpath -ldflags="-s -w -buildid=" $(PKG) + env CGO_ENABLED=0 $(GOINSTALL) -trimpath -ldflags="-s -w -buildid=" $(PKG)/cmd/btcctl + # ======= # TESTING # ======= diff --git a/README.md b/README.md index fabf07698e..f70f3f9145 100644 --- a/README.md +++ b/README.md @@ -63,7 +63,7 @@ recommended that `GOPATH` is set to a directory in your home directory such as ```bash $ cd $GOPATH/src/github.com/btcsuite/btcd -$ GO111MODULE=on go install -v . ./cmd/... +$ go install -v . ./cmd/... ``` - btcd (and utilities) will now be installed in ```$GOPATH/bin```. If you did @@ -79,7 +79,7 @@ $ GO111MODULE=on go install -v . ./cmd/... ```bash $ cd $GOPATH/src/github.com/btcsuite/btcd $ git pull -$ GO111MODULE=on go install -v . ./cmd/... +$ go install -v . ./cmd/... ``` ## Getting Started diff --git a/docs/installation.md b/docs/installation.md index b340c2f620..f6670bd50a 100644 --- a/docs/installation.md +++ b/docs/installation.md @@ -54,7 +54,7 @@ recommended that `GOPATH` is set to a directory in your home directory such as ```bash git clone https://github.com/btcsuite/btcd $GOPATH/src/github.com/btcsuite/btcd cd $GOPATH/src/github.com/btcsuite/btcd -GO111MODULE=on go install -v . ./cmd/... +go install -v . ./cmd/... ``` * btcd (and utilities) will now be installed in ```$GOPATH/bin```. If you did diff --git a/docs/update.md b/docs/update.md index 1fb847cf9f..3e411a628b 100644 --- a/docs/update.md +++ b/docs/update.md @@ -4,5 +4,5 @@ ```bash cd $GOPATH/src/github.com/btcsuite/btcd -git pull && GO111MODULE=on go install -v . ./cmd/... +git pull && go install -v . ./cmd/... ```