-
Notifications
You must be signed in to change notification settings - Fork 3
/
makefile
46 lines (35 loc) · 931 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
os := $(shell uname)
server = server
client = client
compiler = g++
flags = -W -Wall -pedantic
dflags = -g -DDEBUG -DUSE_DEBUG
lib = -lboost_program_options-mt -lpthread
cmp = $(compiler) $(flags) $(inc) -c
lnk = $(compiler) $(flags) $(lib) -o $(bin)
objects = server.o eventbase.o network.o tpool.o
ifeq ($(os), Darwin)
flags += -j8
endif
all : $(server) $(client)
debug : flags += $(dflags)
debug : $(server) $(client)
$(client) : bin = $(client)
$(client) : client.o
$(lnk) client.o network.o
client.o : client.cpp network.hpp
$(cmp) client.cpp
network.o : network.cpp network.hpp
$(cmp) network.cpp
tpool.o : tpool.c tpool.h
$(cmp) tpool.c
$(server) : bin = $(server)
$(server) : lib += -levent -levent_pthreads
$(server) : $(objects)
$(lnk) $(objects)
server.o : server.cpp
$(cmp) server.cpp
eventbase.o : eventbase.cpp eventbase.hpp network.hpp
$(cmp) eventbase.cpp
clean :
rm $(server) $(client) *.o