forked from dominant-strategies/quai-cpu-miner
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
44 lines (37 loc) · 1.32 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
# This Makefile is meant to be used by people that do not usually work
# with Go source code. If you know what GOPATH is then you probably
# don't need to bother with make.
GOBIN = ./build/bin
GO ?= latest
GORUN = env GO111MODULE=on go run
clean:
env GO111MODULE=on go clean -cache
rm -fr build/_workspace/pkg/ $(GOBIN)/*
debug:
go build -gcflags="all=-N -l" -o ./build/bin/quai-cpu-miner main.go
@echo "Done building."
@echo "Run \"$(GOBIN)\" to launch quai-cpu-miner"
quai-cpu-miner:
go build -o ./build/bin/quai-cpu-miner main.go
@echo "Done building."
@echo "Run \"$(GOBIN)\" to launch quai-cpu-miner"
# to manually select a location to mine
run-mine:
./build/bin/quai-cpu-miner $(region) $(zone)
# to run in the background (manually set location)
run-mine-background:
ifeq (,$(wildcard logs))
mkdir logs
endif
@nohup ./build/bin/quai-cpu-miner $(region) $(zone) 1 >> logs/slice-$(region)-$(zone).log 2>&1 &
stop:
ifeq ($(shell uname -s),Darwin)
@if pgrep quai-cpu-miner; then pkill -f ./build/bin/quai-cpu-miner; fi
@while pgrep quai-cpu-miner >/dev/null; do \
echo "Stopping all Quai Network CPU Miners, please wait until terminated."; \
sleep 3; \
done;
else
@echo "Stopping all Quai Network CPU Miners, please wait until terminated.";
@if pgrep quai-cpu-miner; then killall -w ./build/bin/quai-cpu-miner; fi
endif