-
Notifications
You must be signed in to change notification settings - Fork 13
/
Makefile
executable file
·58 lines (40 loc) · 1.54 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
NAME = multy
BRANCH = $(shell git rev-parse --abbrev-ref HEAD)
COMMIT = $(shell git rev-parse --short HEAD)
BUILDTIME = $(shell date +%Y-%m-%dT%T%z)
LASTTAG = $(shell git describe --tags --abbrev=0 --dirty)
GOPATH = $(shell echo "$$GOPATH")
LD_OPTS = -ldflags="-X main.branch=${BRANCH} -X main.commit=${COMMIT} -X main.lasttag=${LASTTAG} -X main.buildtime=${BUILDTIME} -w "
all: build run
all-with-deps: setup deps
cd cmd && GOOS=linux GOARCH=amd64 go build $(LD_OPTS) -o $(NAME) .
all-docker: setup deps
cd cmd && GOOS=linux GOARCH=amd64 go build $(LD_OPTS) -o $(NAME) .
run:
cd $(GOPATH)/src/github.com/Multy-io/Multy-back/cmd && rm -rf multy && cd .. && make build && cd cmd && ./$(NAME) && ../
# memprofiler:
# cd $(GOPATH)/src/github.com/Multy-io/Multy-back/cmd && rm -rf multy && cd .. && make build && cd cmd && ./$(NAME) -memprofile mem.prof && ../
setup:
go get -u github.com/kardianos/govendor
deps:
govendor sync
build:
cd cmd/ && go build $(LD_OPTS) -o $(NAME) . && cd -
race:
cd node-streamer/btc/ && protoc --go_out=plugins=grpc:. *.proto && cd ../../cmd/ && go build $(LD_OPTS) -o $(NAME) -race . && cd -
# Show to-do items per file.
todo:
@grep \
--exclude-dir=vendor \
--exclude-dir=node_modules \
--exclude=Makefile \
--text \
--color \
-nRo -E ' TODO:.*|SkipNow|nolint:.*' .
.PHONY: todo
dist:
cd ./cmd && GOOS=linux GOARCH=amd64 go build $(LD_OPTS) -o $(NAME) .
test: dist
cd cmd && scp multy multy@test.multy.io:/mnt/hdd/back && cd ..
stage:
cd cmd/ && GOOS=linux GOARCH=amd64 go build $(LD_OPTS) -o stage .