|
@ -1,5 +1,7 @@ |
|
|
|
|
|
#!/usr/bin/make -f
|
|
|
|
|
|
|
|
|
PACKAGES=$(shell go list ./...) |
|
|
PACKAGES=$(shell go list ./...) |
|
|
OUTPUT?=build/tendermint |
|
|
|
|
|
|
|
|
BUILDDIR ?= $(CURDIR)/build |
|
|
|
|
|
|
|
|
BUILD_TAGS?=tendermint |
|
|
BUILD_TAGS?=tendermint |
|
|
LD_FLAGS = -X github.com/tendermint/tendermint/version.GitCommit=`git rev-parse --short=8 HEAD` |
|
|
LD_FLAGS = -X github.com/tendermint/tendermint/version.GitCommit=`git rev-parse --short=8 HEAD` |
|
@ -56,14 +58,17 @@ include tests.mk |
|
|
### Build Tendermint ###
|
|
|
### Build Tendermint ###
|
|
|
###############################################################################
|
|
|
###############################################################################
|
|
|
|
|
|
|
|
|
build: |
|
|
|
|
|
CGO_ENABLED=$(CGO_ENABLED) go build $(BUILD_FLAGS) -tags '$(BUILD_TAGS)' -o $(OUTPUT) ./cmd/tendermint/ |
|
|
|
|
|
|
|
|
build: $(BUILDDIR)/ |
|
|
|
|
|
CGO_ENABLED=$(CGO_ENABLED) go build $(BUILD_FLAGS) -tags '$(BUILD_TAGS)' -o $(BUILDDIR)/ ./cmd/tendermint/ |
|
|
.PHONY: build |
|
|
.PHONY: build |
|
|
|
|
|
|
|
|
install: |
|
|
install: |
|
|
CGO_ENABLED=$(CGO_ENABLED) go install $(BUILD_FLAGS) -tags $(BUILD_TAGS) ./cmd/tendermint |
|
|
CGO_ENABLED=$(CGO_ENABLED) go install $(BUILD_FLAGS) -tags $(BUILD_TAGS) ./cmd/tendermint |
|
|
.PHONY: install |
|
|
.PHONY: install |
|
|
|
|
|
|
|
|
|
|
|
$(BUILDDIR)/: |
|
|
|
|
|
mkdir -p $@ |
|
|
|
|
|
|
|
|
###############################################################################
|
|
|
###############################################################################
|
|
|
### Protobuf ###
|
|
|
### Protobuf ###
|
|
|
###############################################################################
|
|
|
###############################################################################
|
|
@ -142,7 +147,7 @@ draw_deps: |
|
|
|
|
|
|
|
|
get_deps_bin_size: |
|
|
get_deps_bin_size: |
|
|
@# Copy of build recipe with additional flags to perform binary size analysis |
|
|
@# Copy of build recipe with additional flags to perform binary size analysis |
|
|
$(eval $(shell go build -work -a $(BUILD_FLAGS) -tags $(BUILD_TAGS) -o $(OUTPUT) ./cmd/tendermint/ 2>&1)) |
|
|
|
|
|
|
|
|
$(eval $(shell go build -work -a $(BUILD_FLAGS) -tags $(BUILD_TAGS) -o $(BUILDDIR)/ ./cmd/tendermint/ 2>&1)) |
|
|
@find $(WORK) -type f -name "*.a" | xargs -I{} du -hxs "{}" | sort -rh | sed -e s:${WORK}/::g > deps_bin_size.log |
|
|
@find $(WORK) -type f -name "*.a" | xargs -I{} du -hxs "{}" | sort -rh | sed -e s:${WORK}/::g > deps_bin_size.log |
|
|
@echo "Results can be found here: $(CURDIR)/deps_bin_size.log" |
|
|
@echo "Results can be found here: $(CURDIR)/deps_bin_size.log" |
|
|
.PHONY: get_deps_bin_size |
|
|
.PHONY: get_deps_bin_size |
|
@ -210,7 +215,7 @@ sync-docs: |
|
|
###############################################################################
|
|
|
###############################################################################
|
|
|
|
|
|
|
|
|
build-docker: build-linux |
|
|
build-docker: build-linux |
|
|
cp $(OUTPUT) DOCKER/tendermint |
|
|
|
|
|
|
|
|
cp $(BUILDDIR)/tendermint DOCKER/tendermint |
|
|
docker build --label=tendermint --tag="tendermint/tendermint" DOCKER |
|
|
docker build --label=tendermint --tag="tendermint/tendermint" DOCKER |
|
|
rm -rf DOCKER/tendermint |
|
|
rm -rf DOCKER/tendermint |
|
|
.PHONY: build-docker |
|
|
.PHONY: build-docker |
|
@ -264,3 +269,17 @@ endif |
|
|
contract-tests: |
|
|
contract-tests: |
|
|
dredd |
|
|
dredd |
|
|
.PHONY: contract-tests |
|
|
.PHONY: contract-tests |
|
|
|
|
|
|
|
|
|
|
|
clean: |
|
|
|
|
|
rm -rf $(CURDIR)/artifacts/ $(BUILDDIR)/ |
|
|
|
|
|
|
|
|
|
|
|
build-reproducible: |
|
|
|
|
|
docker rm latest-build || true |
|
|
|
|
|
docker run --volume=$(CURDIR):/sources:ro \
|
|
|
|
|
|
--env TARGET_PLATFORMS='linux/amd64 linux/arm64 darwin/amd64 windows/amd64' \
|
|
|
|
|
|
--env APP=tendermint \
|
|
|
|
|
|
--env COMMIT=$(shell git rev-parse --short=8 HEAD) \
|
|
|
|
|
|
--env VERSION=$(shell git describe --tags) \
|
|
|
|
|
|
--name latest-build cosmossdk/rbuilder:latest |
|
|
|
|
|
docker cp -a latest-build:/home/builder/artifacts/ $(CURDIR)/ |
|
|
|
|
|
.PHONY: build-reproducible |