-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
49 lines (35 loc) · 1.34 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
# -*-Makefile -*-
ENABLE_DEBUGGING = y
CC=gcc
LIBS=-lpthread
MYSQL_LIBS=`mysql_config --cflags --libs`
DEFS=-D_REENTRANT #-DTRY_CON
OPTS=-g -std=gnu99 -Wall #-Werror
OBJS=addr_table.o packets.o queue.o thread_info_block.o \
server.o errno_logs.o connect_handler.o \
generic_linked_list.o
ifeq ($(ENABLE_DEBUGGING), y)
DEFS += -DSERVER_DEBUG
endif
main: ./main.c $(OBJS)
$(CC) $(DEFS) $(OPTS) -o main main.c $(OBJS) $(LIBS) $(MYSQL_LIBS)
server.o: ./server.c
$(CC) $(DEFS) $(OPTS) -c ./server.c $(MYSQL_LIBS)
queue.o: ./libs/queue.c
$(CC) $(DEFS) $(OPTS) -c ./libs/queue.c $(MYSQL_LIBS)
generic_linked_list.o: ./libs/generic_linked_list.c
$(CC) $(DEFS) $(OPTS) -c ./libs/generic_linked_list.c $(MYSQL_LIBS)
iterator.o: ./libs/iterator.c
$(CC) $(DEFS) $(OPTS) -c ./libs/iterator.c
thread_info_block.o: ./data_structs/thread_info_block.c
$(CC) $(DEFS) $(OPTS) -c ./data_structs/thread_info_block.c $(MYSQL_LIBS)
packets.o: ./data_structs/packets.c
$(CC) $(DEFS) $(OPTS) -c ./data_structs/packets.c $(MYSQL_LIBS)
addr_table.o: ./data_structs/addr_table.c
$(CC) $(DEFS) $(OPTS) -c ./data_structs/addr_table.c $(MYSQL_LIBS)
connect_handler.o: ./connect_handler.c
$(CC) $(DEFS) $(OPTS) -c ./connect_handler.c $(MYSQL_LIBS)
errno_logs.o: ./error_logs/errno_logs.c
$(CC) $(DEFS) $(OPTS) -c ./error_logs/errno_logs.c $(MYSQL_LIBS)
clean:
rm -rf *.o