-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
47 lines (36 loc) · 823 Bytes
/
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
CFLAGS= -Wall -Iinclude -g
CC= g++
LIB_A= libchord.a
LIB_OBJS= $(addprefix src/, \
argparser.o \
node.o \
finger.o \
transport.o \
rpcserver.o \
rpcclient.o \
hash.o)
PROG_OBJS= $(addprefix src/, \
main.o)
OBJS= $(LIB_OBJS) $(PROG_OBJS)
HEADERS= $(addprefix include/chord/, \
argparser.hpp \
node.hpp \
finger.hpp \
transport.hpp \
rpcserver.hpp \
rpcclient.hpp \
hash.hpp)
all: chord
$(OBJS): src/%.o: src/%.cpp $(HEADERS)
$(CC) $(CFLAGS) -c -o $@ $<
$(LIB_A): $(LIB_OBJS)
ar cr $@ $^
ranlib $@
# build the auto generated protobuff source files
chord.pb-c.o: chord.pb-c.c chord.pb-c.h chord.proto
$(CC) -c -o $@ $<
# build the main chord p2p client
chord: src/main.o chord.pb-c.o $(LIB_A)
$(CC) -o $@ $^ -lprotobuf-c -lpthread -lcrypto -lgmp
clean:
rm -f $(OBJS) $(LIB_A) chord chord.pb-c.o