diff --git a/Makefile b/Makefile index bfd13adec0..86fc054848 100755 --- a/Makefile +++ b/Makefile @@ -1,14 +1,14 @@ #!/usr/bin/make -f -include build/scripts/build.mk +include build/scripts/build.mk include build/scripts/codegen.mk include build/scripts/constants.mk -include build/scripts/devtools.mk +include build/scripts/devtools.mk include build/scripts/linting.mk include build/scripts/protobuf.mk include build/scripts/release.mk include build/scripts/testing.mk -include contracts/Makefile +include contracts/Makefile include kurtosis/Makefile include build/scripts/help.mk include testing/forge-script/Makefile diff --git a/build/scripts/build.mk b/build/scripts/build.mk index 7222868db7..8a60e9d7f5 100644 --- a/build/scripts/build.mk +++ b/build/scripts/build.mk @@ -7,9 +7,10 @@ COMMIT = $(shell git log -1 --format='%H') CURRENT_DIR = $(shell pwd) OUT_DIR ?= $(CURDIR)/build/bin BINDIR ?= $(GOPATH)/build/bin -TESTAPP_DIR = beacond +TESTNAME = beacon +TESTAPP = beacond TESTAPP_FILES_DIR = testing/files -TESTAPP_CMD_DIR = $(TESTAPP_DIR)/cmd +TESTAPP_CMD_DIR = $(TESTAPP)/cmd PROJECT_NAME = $(shell git remote get-url origin | xargs basename -s .git) # process build tags @@ -53,8 +54,8 @@ comma := , build_tags_comma_sep := $(subst $(whitespace),$(comma),$(build_tags)) # process linker flags -ldflags = -X github.com/cosmos/cosmos-sdk/version.Name=beacon \ - -X github.com/cosmos/cosmos-sdk/version.AppName=beacond \ +ldflags = -X github.com/cosmos/cosmos-sdk/version.Name=$(TESTNAME) \ + -X github.com/cosmos/cosmos-sdk/version.AppName=$(TESTAPP) \ -X github.com/cosmos/cosmos-sdk/version.Version=$(VERSION) \ -X github.com/cosmos/cosmos-sdk/version.Commit=$(COMMIT) \ -X "github.com/cosmos/cosmos-sdk/version.BuildTags=$(build_tags_comma_sep)" @@ -70,7 +71,7 @@ build_tags += $(BUILD_TAGS) BUILD_FLAGS := -tags "$(build_tags)" -ldflags '$(ldflags)' # check for nostrip option ifeq (,$(findstring nostrip,$(COSMOS_BUILD_OPTIONS))) - BUILD_FLAGS += -trimpath + BUILD_FLAGS += -trimpath endif # Check for debug option @@ -82,7 +83,7 @@ endif BUILD_TARGETS := build install ## Build: -build: BUILD_ARGS=-o $(OUT_DIR)/beacond ## build `beacond` +build: BUILD_ARGS=-o $(OUT_DIR)/$(TESTAPP) ## build `beacond` $(BUILD_TARGETS): $(OUT_DIR)/ @echo "Building ${TESTAPP_CMD_DIR}" @@ -91,12 +92,12 @@ $(BUILD_TARGETS): $(OUT_DIR)/ $(OUT_DIR)/: mkdir -p $(OUT_DIR)/ - # Variables +# Variables ARCH ?= $(shell uname -m) ifeq ($(ARCH),) ARCH = arm64 endif -IMAGE_NAME ?= beacond +IMAGE_NAME ?= $(TESTAPP) # Docker Paths DOCKERFILE = ./Dockerfile diff --git a/build/scripts/testing.mk b/build/scripts/testing.mk index f8e1e38c05..4606bcb27e 100644 --- a/build/scripts/testing.mk +++ b/build/scripts/testing.mk @@ -260,7 +260,7 @@ test-unit: ## run golang unit tests test-unit-cover: ## run golang unit tests with coverage @echo "Running unit tests with coverage..." @go list -f '{{.Dir}}/...' -m | xargs \ - go test -race -coverprofile=test-unit-cover.txt + go test -race -coverprofile=test-unit-cover.txt test-unit-bench: ## run golang unit benchmarks @echo "Running unit tests with benchmarks..."