Skip to content

Commit

Permalink
Merge pull request #99 from osmosis-labs/anmol/makefile-flag-param
Browse files Browse the repository at this point in the history
chore: makefile build flag parametrization
  • Loading branch information
alpe authored Nov 8, 2023
2 parents cb5b472 + df28dff commit e5780ff
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions demo/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,14 @@ comma := ,
build_tags_comma_sep := $(subst $(empty),$(comma),$(build_tags))

# process linker flags

ldflags = -X github.com/cosmos/cosmos-sdk/version.Name=mesh \
-X github.com/cosmos/cosmos-sdk/version.AppName=meshd \
NAME := mesh
APPNAME := meshd
PREFIX := mesh
ldflags := -X github.com/cosmos/cosmos-sdk/version.Name=$(NAME) \
-X github.com/cosmos/cosmos-sdk/version.AppName=$(APPNAME) \
-X github.com/cosmos/cosmos-sdk/version.Version=$(VERSION) \
-X github.com/cosmos/cosmos-sdk/version.Commit=$(COMMIT) \
-X github.com/osmosis-labs/mesh-security-sdk/demo/app.Bech32Prefix=mesh \
-X github.com/osmosis-labs/mesh-security-sdk/demo/app.Bech32Prefix=$(PREFIX) \
-X "github.com/cosmos/cosmos-sdk/version.BuildTags=$(build_tags_comma_sep)"

ifeq ($(WITH_CLEVELDB),yes)
Expand All @@ -76,11 +78,11 @@ ifeq ($(OS),Windows_NT)
$(error mesh demo server not supported)
exit 1
else
go build -mod=readonly $(BUILD_FLAGS) -o $(BUILD_DIR)/meshd ./cmd/meshd
go build -mod=readonly $(BUILD_FLAGS) -o $(BUILD_DIR)/$(APPNAME) ./cmd/meshd
endif

build-vendored:
go build -mod=vendor $(BUILD_FLAGS) -o $(BUILD_DIR)/meshd ./cmd/meshd
go build -mod=vendor $(BUILD_FLAGS) -o $(BUILD_DIR)/$(APPNAME) ./cmd/meshd

build-linux-static:
go mod vendor # quick hack to make local dependencies work in Docker
Expand Down

0 comments on commit e5780ff

Please sign in to comment.