-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
48 lines (26 loc) · 986 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
48
CC = gcc
THIRD_PATH=./third
LIBMEMCACHED_HOME = $(THIRD_PATH)/memcached
COMMON_HOME = $(THIRD_PATH)/common
SUTILS_CXX_HOME = $(THIRD_PATH)/memq
LIBEVENT_HOME = $(THIRD_PATH)/libevent
SRC_DIR=src
BIN_DIR=bin
TARGET = agora
SRCC = ${SRC_DIR}/tcp_server.c ${SRC_DIR}/config.c ${SRC_DIR}/daemon.c ${SRC_DIR}/mkdirs.c ${SRC_DIR}/squeue.c ${SRC_DIR}/slog.c ${SRC_DIR}/profile.c
BIN = ${BIN_DIR}/agora
OBJS = $(SRCC:.c=.o)
INCLUDE = -I ./src -I $(LIBMEMCACHED_HOME)/include -I $(SUTILS_CXX_HOME)/include -I $(LIBEVENT_HOME)/include
LIBPATH = -L lib -L $(LIBMEMCACHED_HOME)/lib/ -L $(SUTILS_CXX_HOME)/lib -lmemq -L$(LIBEVENT_HOME)/lib/ -levent
LIBFILE = -lmemcached -lpthread -ldl
#CFLAGS = -ggdb -Wall $(INCLUDE) $(LIBPATH)
#CFLAGS = -DDEBUG_TIME -O2 -ggdb -w $(INCLUDE) $(LIBPATH)
CFLAGS += -DMAIN
.c.o:
$(CC) $(CFLAGS) -c $*.c -o $@ $(LIBFILE)
all:$(BIN)
$(BIN): $(OBJS)
gcc -o $(BIN) $(OBJS) $(CFLAGS) $(LIBFILE)
clean:
-rm -f $(OBJS)
-rm -f $(BIN)