-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
33 lines (27 loc) · 1.11 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
CC := g++
CFLAGS := -std=c++11 -pthread -Wall -g
all: server client
server: server.o src/Epoll.o src/Socket.o src/Channel.o src/util.o src/EventLoop.o src/Server.o src/Acceptor.o src/Connection.o src/Buffer.o src/ThreadPool.o
@echo "Linking server executable..."
$(CC) $(CFLAGS) $^ -o $@
@echo "Server executable linked successfully!"
client: client.o src/Socket.o src/util.o src/Buffer.o
@echo "Linking client executable..."
$(CC) $(CFLAGS) $^ -o $@
@echo "Client executable linked successfully!"
thread_test: ThreadPoolTest.o src/ThreadPool.o
@echo "Linking thread_test executable..."
$(CC) $(CFLAGS) $^ -o $@
@echo "thread_test executable linked successfully!"
test: test.o src/Epoll.o src/Socket.o src/Channel.o src/util.o src/EventLoop.o src/Server.o src/Acceptor.o src/Connection.o src/Buffer.o src/ThreadPool.o
@echo "Linking test executable..."
$(CC) $(CFLAGS) $^ -o $@
@echo "test executable linked successfully!"
%.o: %.cpp
@echo "Compiling $<..."
$(CC) $(CFLAGS) -c $< -o $@
@echo "$< compiled successfully!"
clean:
@echo "Cleaning up..."
rm -f *.o src/*.o server client
@echo "Clean up complete!"