-
Notifications
You must be signed in to change notification settings - Fork 0
/
makefile
31 lines (21 loc) · 876 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
CXX = g++
CXXFLAGS += -std=c++11
LDFLAGS += -L/usr/local/lib -lgrpc++_unsecure -lgrpc -lgpr -lprotobuf -lpthread -ldl
LDFLAGS += -lsfml-graphics -lsfml-window -lsfml-system -Wall
SOURCES = adn_exchange.pb.o adn_exchange.grpc.pb.o callRpc.o Genome.o Map.o Person.o Point.o Village.o
PROTOC = protoc
GRPC_CPP_PLUGIN = grpc_cpp_plugin
GRPC_CPP_PLUGIN_PATH ?= `which $(GRPC_CPP_PLUGIN)`
PROTOS_PATH = .
vpath %.proto $(PROTOS_PATH)
all: Server Client
Server: adn_exchange.pb.o adn_exchange.grpc.pb.o $(SOURCES) Server.o
$(CXX) $^ $(LDFLAGS) -o $@
Client: adn_exchange.pb.o adn_exchange.grpc.pb.o $(SOURCES) Client.o
$(CXX) $^ $(LDFLAGS) -o $@
%.grpc.pb.cc: %.proto
$(PROTOC) -I $(PROTOS_PATH) --grpc_out=. --plugin=protoc-gen-grpc=$(GRPC_CPP_PLUGIN_PATH) $<
%.pb.cc: %.proto
$(PROTOC) -I $(PROTOS_PATH) --cpp_out=. $<
clean :
rm -f *.o *.pb.cc *.pb.h Server Client