|
1
2
|
CFLAGS += -Isrc/include
LDFLAGS += -lpthread
|
|
3
4
|
TARGETS = bin/client bin/server bin/socket.conf
|
|
5
6
7
8
9
10
11
12
|
ifndef $(CXX)
CXX = g++
endif
STRIP = strip
ifeq ($(DEBUG_BUILD),1)
CFLAGS += -g
STRIP =\#
endif
|
|
13
14
15
|
.PHONY: all clean
|
|
16
17
18
|
bin/client: bin/client.o bin/Socket.o
$(CXX) -o bin/client bin/client.o bin/Socket.o $(LDFLAGS) $(CFLAGS)
$(STRIP) bin/client
|
|
19
20
|
bin/client.o: src/client.cpp
|
|
21
|
$(CXX) -o bin/client.o -c src/client.cpp $(CFLAGS)
|
|
22
23
|
bin/server.o: src/server.cpp src/include/server.h
|
|
24
|
$(CXX) -o bin/server.o -c src/server.cpp $(CFLAGS)
|
|
25
26
|
bin/main_server.o: src/main_server.cpp
|
|
27
|
$(CXX) -o bin/main_server.o -c src/main_server.cpp $(CFLAGS)
|
|
28
|
|
|
29
30
31
|
bin/server: bin/server.o bin/Socket.o bin/main_server.o src/include/server.h
$(CXX) -o bin/server bin/server.o bin/Socket.o bin/main_server.o $(LDFLAGS) $(CFLAGS)
$(STRIP) bin/server
|
|
32
33
|
bin/Socket.o: src/Socket.cpp src/include/Socket.h src/include/SocketException.h
|
|
34
|
$(CXX) -o bin/Socket.o -c src/Socket.cpp $(CFLAGS)
|
|
35
36
37
38
39
40
41
42
43
44
45
46
47
|
bin/socket.conf:
cp socket.conf bin/socket.conf
clean:
rm -rf bin/*
docs:
cd doc/doxygen;doxygen Doxyfile
cd doc/latex; make
all: $(TARGETS)
|