-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmakefile
More file actions
45 lines (28 loc) · 1.04 KB
/
makefile
File metadata and controls
45 lines (28 loc) · 1.04 KB
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
clientName = Client
serverName = Server
flags = -Wall -O3
objects = $(patsubst %.cpp, %.o, $(wildcard exceptions/**/*.cpp))
objects += $(patsubst %.cpp, %.o, $(wildcard src/**/*.cpp))
enums = $(wildcard enums/*.hpp)
libs = -lboost_program_options
.PHONY: all client server clean purge
# ----------------------------------------------------------------------
all: $(clientName) $(serverName)
client: $(clientName)
server: $(serverName)
# ----------------------------------------------------------------------
$(clientName): client.o $(objects)
g++ -o $(clientName) client.o $(objects) $(enums) $(flags) $(libs)
$(serverName): server.o $(objects)
g++ -o $(serverName) server.o $(objects) $(enums) $(flags) $(libs)
client.o: client.cpp
g++ -c client.cpp $(flags)
server.o: server.cpp
g++ -c server.cpp $(flags)
%.o : %.cpp
g++ -c $< -o $@ $(flags)
# ----------------------------------------------------------------------
clean:
rm -f *.o exceptions/**/*.o src/**/*.o
purge:
rm -f *.o exceptions/**/*.o src/**/*.o $(clientName) $(serverName)