Browse Source

Extended install document with docker option. Added extra checks to developer's build target.

pull/1053/head
Greg Szabo 7 years ago
parent
commit
f67f99c227
2 changed files with 23 additions and 6 deletions
  1. +10
    -6
      Makefile
  2. +13
    -0
      docs/install.rst

+ 10
- 6
Makefile View File

@ -10,7 +10,7 @@ TMHOME ?= $(HOME)/.tendermint
GOPATH ?= $(shell go env GOPATH) GOPATH ?= $(shell go env GOPATH)
GOROOT ?= $(shell go env GOROOT) GOROOT ?= $(shell go env GOROOT)
GOGCCFLAGS ?= $(shell go env GOGCCFLAGS) GOGCCFLAGS ?= $(shell go env GOGCCFLAGS)
PROD_LDFLAGS ?= -w -s
#LDFLAGS_EXTRA ?= -w -s
XC_ARCH ?= 386 amd64 arm XC_ARCH ?= 386 amd64 arm
XC_OS ?= solaris darwin freebsd linux windows XC_OS ?= solaris darwin freebsd linux windows
XC_OSARCH ?= !darwin/arm !solaris/amd64 !freebsd/amd64 XC_OSARCH ?= !darwin/arm !solaris/amd64 !freebsd/amd64
@ -22,7 +22,7 @@ RACEFLAG=-race
else else
RACEFLAG= RACEFLAG=
endif endif
BUILD_FLAGS = -asmflags "-trimpath $(GOPATH)" -gcflags "-trimpath $(GOPATH)" -tags "$(BUILD_TAGS)" -ldflags "$(PROD_LDFLAGS) -X github.com/tendermint/tendermint/version.GitCommit=$(shell git rev-parse --short=7 HEAD)" $(RACEFLAG)
BUILD_FLAGS = -asmflags "-trimpath $(GOPATH)" -gcflags "-trimpath $(GOPATH)" -tags "$(BUILD_TAGS)" -ldflags "-X github.com/tendermint/tendermint/version.GitCommit=$(shell git rev-parse --short=7 HEAD) $(LDFLAGS_EXTRA)" $(RACEFLAG)
GO_VERSION:=$(shell go version | grep -o '[[:digit:]]\+.[[:digit:]]\+.[[:digit:]]\+') GO_VERSION:=$(shell go version | grep -o '[[:digit:]]\+.[[:digit:]]\+.[[:digit:]]\+')
all: check build test install metalinter all: check build test install metalinter
@ -33,16 +33,20 @@ check: check_tools get_vendor_deps
######################################## ########################################
### Build ### Build
build_cc:
build_cc: check_tools
$(shell which gox) $(BUILD_FLAGS) $(GOX_FLAGS) ./cmd/tendermint/ $(shell which gox) $(BUILD_FLAGS) $(GOX_FLAGS) ./cmd/tendermint/
build: build:
make build_cc PROD_LDFLAGS="" XC_ARCH=amd64 XC_OS="$(shell uname -s)" BUILD_OUTPUT=$(GOPATH)/bin/tendermint
ifeq ($(OS),Windows_NT)
make build_cc XC_ARCH=amd64 XC_OS=windows BUILD_OUTPUT=$(GOPATH)/bin/tendermint
else
make build_cc XC_ARCH=amd64 XC_OS="$(shell uname -s)" BUILD_OUTPUT=$(GOPATH)/bin/tendermint
endif
build_race: build_race:
#TODO: Wait for this to be merged: https://github.com/mitchellh/gox/pull/105 Then switch over to make build and remove the go build line.
# make build BUILD_FLAGS_RACE=YES
$(shell which go) build $(BUILD_FLAGS) -race -o "$(BUILD_OUTPUT)" ./cmd/tendermint/ $(shell which go) build $(BUILD_FLAGS) -race -o "$(BUILD_OUTPUT)" ./cmd/tendermint/
#For the future when this is merged: https://github.com/mitchellh/gox/pull/105
# make build_cc PROD_LDFLAGS="" XC_ARCH=amd64 XC_OS=$(shell uname -s) BUILD_FLAGS_RACE=YES BUILD_OUTPUT=build/tendermint
# dist builds binaries for all platforms and packages them for distribution # dist builds binaries for all platforms and packages them for distribution
dist: dist:


+ 13
- 0
docs/install.rst View File

@ -6,6 +6,19 @@ From Binary
To download pre-built binaries, see the `Download page <https://tendermint.com/download>`__. To download pre-built binaries, see the `Download page <https://tendermint.com/download>`__.
From Source using Docker
------------------------
If you have docker running, all you need is the ``golang`` image to build tendermint.
If you don't, you can get help setting it up `here <https://docs.docker.com/engine/installation/>`__.
::
mkdir $HOME/tendermintbin
docker run --rm -it -v $HOME/tendermintbin:/go/bin:Z golang:1.9.2 /bin/bash -c "go-wrapper download github.com/tendermint/tendermint/cmd/tendermint ; make -C /go/src/github.com/tendermint/tendermint get_tools get_vendor_deps build_cc"
You will find the ``tendermint`` binaries for different architectures and operating systems in your ``$HOME/tendermintbin`` folder.
From Source From Source
----------- -----------


Loading…
Cancel
Save