-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
59 lines (44 loc) · 1.43 KB
/
Makefile
File metadata and controls
59 lines (44 loc) · 1.43 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
STARTING-IP-ADDR := 172.20.0.2
NODES := 4
SCALERIZED_BINARY_PATH := /go/src/github.com/aerius-labs/scalerize/build/scalerized
BUILDDIR ?= $(CURDIR)/build
include scripts/execution-client.mk
BRANCH := $(shell git rev-parse --abbrev-ref HEAD)
COMMIT := $(shell git log -1 --format='%H')
ifeq (,$(VERSION))
VERSION := $(shell git describe --exact-match 2>/dev/null)
ifeq (,$(VERSION))
VERSION := $(BRANCH)-$(COMMIT)
endif
endif
ldflags = -X github.com/cosmos/cosmos-sdk/version.Name=scalerize \
-X github.com/cosmos/cosmos-sdk/version.AppName=scalerized \
-X github.com/cosmos/cosmos-sdk/version.Version=$(VERSION) \
-X github.com/cosmos/cosmos-sdk/version.Commit=$(COMMIT)
BUILD_FLAGS := -ldflags '$(ldflags)'
###########
# Install #
###########
.PHONY: build install
install:
@echo "--> ensure dependencies have not been modified"
@go mod verify
@echo "--> installing scalerized"
@go install $(BUILD_FLAGS) -mod=readonly ./cmd/scalerized
###########
# Build #
###########
build: BUILD_ARGS=-o $(BUILDDIR)/
build-linux:
GOOS=linux GOARCH=amd64 LEDGER_ENABLED=false $(MAKE) build
build: go.sum $(BUILDDIR)/
go build $(BUILD_FLAGS) $(BUILD_ARGS) ./...
$(BUILDDIR)/:
mkdir -p $(BUILDDIR)/
###########
# Misc #
###########
init:
./scripts/init.sh
localtestnet-example-config:
$(SCALERIZED_BINARY_PATH) testnet init-files --output-dir example-testnet --v $(NODES) --starting-ip-address $(STARTING-IP-ADDR) --keyring-backend test