Skip to content

Commit

Permalink
Refactor Makefile, update build and install targets, and fix Node.js …
Browse files Browse the repository at this point in the history
…conflict (backport #4847) (#4890)

* Refactor Makefile, update build and install targets, and fix Node.js conflict (#4847)

* Update targets in Makefile

* Restore go 1.20

* Update CHANGELOG.md

(cherry picked from commit 353933a)

# Conflicts:
#	CHANGELOG.md
#	Makefile

* Update CHANGELOG.md

* Update Makefile

---------

Co-authored-by: Niccolo Raspa <6024049+niccoloraspa@users.noreply.github.com>
  • Loading branch information
mergify[bot] and niccoloraspa committed Apr 11, 2023
1 parent 8616917 commit 8eab695
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@ COMMIT := $(shell git log -1 --format='%H')
LEDGER_ENABLED ?= true
SDK_PACK := $(shell go list -m github.com/cosmos/cosmos-sdk | sed 's/ /\@/g')
GO_VERSION := $(shell cat go.mod | grep -E 'go [0-9].[0-9]+' | cut -d ' ' -f 2)
DOCKER := $(shell which docker)
GO_MODULE := $(shell cat go.mod | grep module | cut -d ' ' -f 2)
BUILDDIR ?= $(CURDIR)/build
DOCKER := $(shell which docker)
E2E_UPGRADE_VERSION := "v15"


Expand Down Expand Up @@ -94,14 +95,16 @@ endif

all: install lint test

BUILD_TARGETS := build install

build: BUILD_ARGS=-o $(BUILDDIR)/
build: check_version go.sum
mkdir -p $(BUILDDIR)/
GOWORK=off go build -mod=readonly $(BUILD_FLAGS) -o $(BUILDDIR)/ $(GO_MODULE)/cmd/osmosisd

$(BUILD_TARGETS): check_version go.sum $(BUILDDIR)/
GOWORK=off go $@ -mod=readonly $(BUILD_FLAGS) $(BUILD_ARGS) ./...
$(BUILDDIR)/:
build-all: check_version go.sum
mkdir -p $(BUILDDIR)/
GOWORK=off go build -mod=readonly $(BUILD_FLAGS) -o $(BUILDDIR)/ ./...

install: check_version go.sum
GOWORK=off go install -mod=readonly $(BUILD_FLAGS) $(GO_MODULE)/cmd/osmosisd

# Cross-building for arm64 from amd64 (or viceversa) takes
# a lot of time due to QEMU virtualization but it's the only way (afaik)
Expand Down

0 comments on commit 8eab695

Please sign in to comment.