-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
64 lines (48 loc) · 1.97 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
PACKAGES=$(shell go list ./... | grep -v '/simulation')
VERSION := $(shell echo $(shell git describe --tags) | sed 's/^v//')
COMMIT := $(shell git log -1 --format='%H')
# TODO: Update the ldflags with the app, client & server names
ldflags = -X github.com/cosmos/cosmos-sdk/version.Name=NewApp \
-X github.com/cosmos/cosmos-sdk/version.ServerName=pxbd \
-X github.com/cosmos/cosmos-sdk/version.ClientName=pxbcli \
-X github.com/cosmos/cosmos-sdk/version.Version=$(VERSION) \
-X github.com/cosmos/cosmos-sdk/version.Commit=$(COMMIT)
BUILD_FLAGS := -ldflags '$(ldflags)'
all: install
install: go.sum
go install $(BUILD_FLAGS) ./cmd/pxbcli
go install $(BUILD_FLAGS) ./cmd/pxbd
go install $(BUILD_FLAGS) ./cmd/pxbrelayer
go.sum: go.mod
@echo "--> Ensure dependencies have not been modified"
GO111MODULE=on go mod verify
# Build
build: go.sum
ifeq ($(OS),Windows_NT)
go build -mod=readonly $(BUILD_FLAGS) -o build/pxbcli.exe ./cmd/pxbcli
go build -mod=readonly $(BUILD_FLAGS) -o build/pxbd.exe ./cmd/pxbd
go build -mod=readonly $(BUILD_FLAGS) -o build/pxbrelayer.exe ./cmd/pxbrelayer
else
go build -mod=readonly $(BUILD_FLAGS) -o build/pxbcli ./cmd/pxbcli
go build -mod=readonly $(BUILD_FLAGS) -o build/pxbd ./cmd/pxbd
go build -mod=readonly $(BUILD_FLAGS) -o build/pxbrelayer ./cmd/pxbrelayer
endif
build-linux: go.sum
LEDGER_ENABLED=false GOOS=linux GOARCH=amd64 $(MAKE) build
# Uncomment when you have some tests
# test:
# @go test -mod=readonly $(PACKAGES)
# look into .golangci.yml for enabling / disabling linters
lint:
@echo "--> Running linter"
@golangci-lint run
@go mod verify
# Local environment
build-docker-pxbdnode:
$(MAKE) -C networks/local
localnet-start: build-linux localnet-stop
@if ! [ -f build/node0/pxbd/config/genesis.json ]; then docker run --rm -v $(CURDIR)/build:/pxbd:Z lcnem/proximax-pegzone testnet --v 4 -o . --starting-ip-address 192.168.10.2 --keyring-backend=test ; fi
docker-compose up -d
# Stop testnet
localnet-stop:
docker-compose down