-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
46 lines (31 loc) · 1.41 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
CC=g++
CFLAGS=-c -Wall -DASIO_STANDALONE -Ilib/asio-1.10.6/include -Ilib
CPFLAGS=-pthread -std=c++11
all: chat
chat: chkdir ChordChat
test: chkdir TestChord
TestChord: UnitTests.o ID.o FingerTable.o sha1.o LocalNode.o RemoteNode.o ChatClient.o
$(CC) obj/UnitTests.o obj/ID.o obj/FingerTable.o obj/sha1.o obj/LocalNode.o obj/RemoteNode.o obj/ChatClient.o -o bin/TestChord $(CPFLAGS) $(LDFLAGS_TEST)
UnitTests.o: src/UnitTests.cpp
$(CC) $(CFLAGS) src/UnitTests.cpp -o obj/UnitTests.o $(CPFLAGS)
ChordChat: ChordChat.o ID.o FingerTable.o sha1.o LocalNode.o RemoteNode.o ChatClient.o
$(CC) obj/ChordChat.o obj/ID.o obj/FingerTable.o obj/sha1.o obj/LocalNode.o obj/RemoteNode.o obj/ChatClient.o -o bin/ChordChat $(CPFLAGS) $(LDFLAGS)
ChordChat.o: src/ChordChat.cpp
$(CC) $(CFLAGS) src/ChordChat.cpp -o obj/ChordChat.o $(CPFLAGS)
ChatClient.o: src/ChatClient.cpp
$(CC) $(CFLAGS) src/ChatClient.cpp -o obj/ChatClient.o $(CPFLAGS)
ID.o: src/ID.cpp
$(CC) $(CFLAGS) src/ID.cpp -o obj/ID.o $(CPFLAGS)
FingerTable.o: src/FingerTable.cpp
$(CC) $(CFLAGS) src/FingerTable.cpp -o obj/FingerTable.o $(CPFLAGS)
sha1.o: src/sha1.cpp
$(CC) $(CFLAGS) src/sha1.cpp -o obj/sha1.o $(CPFLAGS)
LocalNode.o: src/LocalNode.cpp
$(CC) $(CFLAGS) src/LocalNode.cpp -o obj/LocalNode.o $(CPFLAGS)
RemoteNode.o: src/RemoteNode.cpp
$(CC) $(CFLAGS) src/RemoteNode.cpp -o obj/RemoteNode.o $(CPFLAGS)
clean:
rm -rf bin obj
chkdir:
mkdir -p bin
mkdir -p obj