forked from wtyelec/ChatRoom
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
32 lines (24 loc) · 874 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
OBJS = main.o chat_manager.o socket_manager.o log.o util.o
LIBEVENT = -Wl,-rpath,/usr/lib/ -L/usr/lib/ -levent -I/usr/include/
CC = g++
SRC_DIR = ./server/
INC_DIR = ./server/
OBJ_DIR = ./objs/
INCLUDE = -I $(SRC_DIR) -I $(INC_DIR) -I $(OBJ_DIR)
vpath %.h $(INC_DIR)
vpath %.cpp $(SRC_DIR)
vpath %.o $(OBJ_DIR)
server : main.o $(OBJS)
$(CC) $(addprefix $(OBJ_DIR), $(OBJS)) $(LIBEVENT) -o server.o
main.o : main.cpp socket_manager.h chat_manager.h
$(CC) -c $< $(INCLUDE) -o $(OBJ_DIR)$@
socket_manager.o : socket_manager.cpp socket_manager.h global.h
$(CC) -c $< $(INCLUDE) -o $(OBJ_DIR)$@
chat_manager.o : chat_manager.cpp chat_manager.h global.h util.h
$(CC) -c $< $(INCLUDE) -o $(OBJ_DIR)$@
log.o : log.cpp log.h
$(CC) -c $< $(INCLUDE) -o $(OBJ_DIR)$@
util.o : util.cpp util.h
$(CC) -c $< $(INCLUDE) -o $(OBJ_DIR)$@
clean:
-rm $(OBJ_DIR)*.o server.o