-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathMakefile
35 lines (28 loc) · 1.01 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
PROJECTNAME=$(shell basename "$(PWD)")
VERSION=-ldflags="-X main.Version=$(shell git describe --tags)"
SOL_DIR=./solidity
CENT_EMITTER_ADDR?=0x1
CENT_CHAIN_ID?=0x1
CENT_TO?=0x1234567890
CENT_TOKEN_ID?=0x5
CENT_METADATA?=0x0
.PHONY: help build install
all: help
help: Makefile
@echo
@echo "Choose a make command to run in "$(PROJECTNAME)":"
@echo
@$(MAKE) -pRrq -f $(lastword $(MAKEFILE_LIST)) : 2>/dev/null | awk -v RS= -F: '/^# File/,/^# Finished Make data base/ {if ($$1 !~ "^[#.]") {print $$1}}' | sort | egrep -v -e '^[^[:alnum:]]' -e '^$@$$'
@echo
get:
@echo " > \033[32mDownloading & Installing all the modules...\033[0m "
go mod tidy && go mod download
build:
@echo " > \033[32mBuilding compass...\033[0m "
cd cmd/compass && go build -o ../../build/compass
dev:
@echo " > \033[32mBuilding compass-dev...\033[0m "
cd cmd/compass && env GOARCH=amd64 CGO_ENABLED=0 go build -o ../../build/compass-dev
install:
@echo " > \033[32mInstalling compass...\033[0m "
cd cmd/compass && go install $(VERSION)