-
Notifications
You must be signed in to change notification settings - Fork 34
/
Makefile
executable file
·71 lines (49 loc) · 1.62 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
65
66
67
68
69
70
CC=gcc
CFLAGS= -g -march=native
SQLFLAGS= `mysql_config --cflags --libs`
# Comment this line to disable address check on login,
# if you use the auto exchange feature...
# if NO_EXCHANGE flag exists, user will be able to choose coin (look job_send_last in job_send.cpp)
CFLAGS += -DNO_EXCHANGE
# NO_MYSQL flag used to operate in solo mode without DB installed
CFLAGS += -DNO_MYSQL
#CFLAGS=-c -O2 -I /usr/include/mysql
LDFLAGS=-O2 `mysql_config --libs`
LDLIBS=iniparser/libiniparser.a algos/libalgos.a sha3/libhash.a -lsodium -lpthread -lgmp -lm -lstdc++
LDLIBS+=-lmysqlclient
SOURCES=stratum.cpp db.cpp coind.cpp coind_aux.cpp coind_template.cpp coind_submit.cpp util.cpp list.cpp \
rpc.cpp job.cpp job_send.cpp job_core.cpp merkle.cpp share.cpp socket.cpp coinbase.cpp \
client.cpp client_submit.cpp client_core.cpp client_difficulty.cpp remote.cpp remote_template.cpp \
user.cpp object.cpp json.cpp base58.cpp
CFLAGS += -DHAVE_CURL
SOURCES += rpc_curl.cpp
LDCURL = $(shell /usr/bin/pkg-config --static --libs libcurl)
LDFLAGS += $(LDCURL)
OBJECTS=$(SOURCES:.cpp=.o)
OUTPUT=stratum
CODEDIR1=algos
CODEDIR2=sha3
.PHONY: projectcode1 projectcode2
all: projectcode1 projectcode2 $(SOURCES) $(OUTPUT)
projectcode1:
$(MAKE) -C $(CODEDIR1)
projectcode2:
$(MAKE) -C $(CODEDIR2)
$(SOURCES): stratum.h util.h
$(OUTPUT): $(OBJECTS)
$(CC) $(OBJECTS) $(LDLIBS) $(LDFLAGS) -o $@
.cpp.o:
$(CC) $(CFLAGS) $(SQLFLAGS) -c $<
.c.o:
$(CC) $(CFLAGS) -c $<
clean:
rm -f *.o
rm -f algos/*.o
rm -f algos/*.a
rm -f sha3/*.o
rm -f sha3/*.a
rm -f algos/ar2/*.o
install: clean all
strip -s stratum
cp stratum /usr/local/bin/
cp stratum ../bin/