-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
33 lines (21 loc) · 829 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
#!/bin/sh
OPT=-O3
DEBUG=-g
CFLAGS=-std=c++11 -Wall -Wno-format -fPIC $(OPT) $(DEBUG) -D_LOG_DEBUG
CC=g++
LIBS=-levent
LIB_PATH=-L./
INCLUDE_PATH=-I./
COMMONOBJS=common/Log.o common/Protocol.o common/TrafficMeter.o
INSIDEOBJS=$(COMMONOBJS) inside/main.o inside/UserConn.o inside/RemoteConn.o inside/Common.o
OUTSIDEOBJS=$(COMMONOBJS) outside/main.o outside/UserConn.o outside/RemoteConn.o outside/Scheduler.o outside/Common.o
all: inside_server outside_server
inside_server: $(INSIDEOBJS) $(COMMONOBJS)
$(CC) -o $@ $^ $(CFLAGS) $(LIBS) $(LIB_PATH)
outside_server: $(OUTSIDEOBJS) $(COMMONOBJS)
$(CC) -o $@ $^ $(CFLAGS) $(LIBS) $(LIB_PATH)
%.o: %.cpp
$(CC) $(INCLUDE_PATH) -c $(CFLAGS) $(INCLUDE_PATH) -o $@ $^
clean:
rm -f $(COMMONOBJS) $(INSIDEOBJS) $(OUTSIDEOBJS) inside_server outside_server
rebuild: clean all