-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
43 lines (34 loc) · 1.09 KB
/
Makefile
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
BRANCH := $(shell git rev-parse --abbrev-ref HEAD)
COMMIT := $(shell git log -1 --format='%H')
# don't override user values
ifeq (,$(VERSION))
VERSION := $(shell git describe --exact-match 2>/dev/null)
# if VERSION is empty, then populate it with branch's name and raw commit hash
ifeq (,$(VERSION))
VERSION := $(BRANCH)-$(COMMIT)
endif
endif
# Update the ldflags with the app, client & server names
ldflags = -X github.com/cosmos/cosmos-sdk/version.Name=hyle \
-X github.com/cosmos/cosmos-sdk/version.AppName=hyled \
-X github.com/cosmos/cosmos-sdk/version.Version=$(VERSION) \
-X github.com/cosmos/cosmos-sdk/version.Commit=$(COMMIT)
BUILD_FLAGS := -ldflags '$(ldflags)'
###########
# Install #
###########
all: build
build:
@echo "--> ensure dependencies have not been modified"
@go mod verify
@echo "--> building hyled"
@go build $(BUILD_FLAGS) -mod=readonly ./cmd/hyled
install:
@echo "--> ensure dependencies have not been modified"
@go mod verify
@echo "--> installing hyled"
@go install $(BUILD_FLAGS) -mod=readonly ./cmd/hyled
init:
./scripts/init.sh
start:
./hyled start