-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
30 lines (22 loc) · 879 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
CXXFLAGS = -O0 -g3 -pthread
LDFLAGS = -lpthread -lmuduo_net -lmuduo_base -lz -lprotobuf
BASE_SRC =
LIB_SRC =
BINARIES = server mobile_client power_client
HEADERS=$(wildcard *.h)
all:cpp11
cpp11: CXXFLAGS += -I ../build/debug-install-cpp11/include/ -L ../build/debug-install-cpp11/lib
cpp11: protoc_middleman $(BINARIES)
$(BINARIES): $(HEADERS)
$(BINARIES):
g++ $(CXXFLAGS) -o $@ $(LIB_SRC) $(BASE_SRC) $(filter %.cc,$^) $(LDFLAGS)
clean:
rm -f $(BINARIES) core
rm -f protoc_middleman remote_power.pb.cc remote_power.pb.h
protoc_middleman: remote_power.proto
protoc --cpp_out=. remote_power.proto
@touch protoc_middleman
server: CXXFLAGS += -Wall
server: server.cc codec.cc remote_power.pb.cc protoc_middleman
mobile_client: mobile_client.cc codec.cc remote_power.pb.cc protoc_middleman
power_client: power_client.cc codec.cc remote_power.pb.cc protoc_middleman