2006-05-30 09:24:40 +00:00
|
|
|
# Makefile for Thrift test project.
|
|
|
|
#
|
|
|
|
# Author:
|
|
|
|
# Mark Slee <mcslee@facebook.com>
|
|
|
|
|
|
|
|
# Default target is everything
|
2006-08-04 03:16:25 +00:00
|
|
|
|
|
|
|
ifndef thrift_home
|
|
|
|
thrift_home=../../build
|
|
|
|
endif #thrift_home
|
2006-08-12 00:32:53 +00:00
|
|
|
|
|
|
|
target: all
|
|
|
|
|
|
|
|
ifndef boost_home
|
|
|
|
boost_home=../../../../../thirdparty/boost_1_33_1
|
|
|
|
endif #thrift_home
|
2006-05-30 09:24:40 +00:00
|
|
|
target: all
|
|
|
|
|
2006-08-12 00:32:53 +00:00
|
|
|
include_paths = $(thrift_home)/include/thrift \
|
|
|
|
$(boost_home)
|
|
|
|
|
|
|
|
include_flags = $(patsubst %,-I%, $(include_paths))
|
|
|
|
|
2006-05-30 09:24:40 +00:00
|
|
|
# Tools
|
2006-08-23 22:03:34 +00:00
|
|
|
ifndef THRIFT
|
|
|
|
THRIFT = thrift
|
|
|
|
endif # THRIFT
|
|
|
|
|
2006-05-30 09:24:40 +00:00
|
|
|
CC = g++
|
|
|
|
LD = g++
|
|
|
|
|
|
|
|
# Compiler flags
|
2006-08-15 21:29:39 +00:00
|
|
|
DCFL = -Wall -O3 -g -I../cpp-gen $(include_flags) -L$(thrift_home)/lib -lthrift
|
2006-08-12 00:32:53 +00:00
|
|
|
CFL = -Wall -O3 -I../cpp-gen $(include_flags) -L$(thrift_home)/lib -lthrift
|
2006-05-30 09:24:40 +00:00
|
|
|
|
|
|
|
all: server client
|
|
|
|
|
2006-06-30 18:28:50 +00:00
|
|
|
debug: server-debug client-debug
|
|
|
|
|
2006-05-30 09:24:40 +00:00
|
|
|
stubs: ../ThriftTest.thrift
|
2006-08-15 21:29:39 +00:00
|
|
|
$(THRIFT) --cpp ../ThriftTest.thrift
|
2006-05-30 09:24:40 +00:00
|
|
|
|
2006-06-30 18:28:50 +00:00
|
|
|
server-debug: stubs
|
2006-08-12 00:32:53 +00:00
|
|
|
g++ -o TestServer $(DCFL) src/TestServer.cc ../cpp-gen/ThriftTest.cc
|
2006-06-30 18:28:50 +00:00
|
|
|
|
|
|
|
client-debug: stubs
|
2006-08-12 00:32:53 +00:00
|
|
|
g++ -o TestClient $(DCFL) src/TestClient.cc ../cpp-gen/ThriftTest.cc
|
2006-06-30 18:28:50 +00:00
|
|
|
|
2006-05-30 09:24:40 +00:00
|
|
|
server: stubs
|
2006-08-12 00:32:53 +00:00
|
|
|
g++ -o TestServer $(CFL) src/TestServer.cc ../cpp-gen/ThriftTest.cc
|
2006-05-30 09:24:40 +00:00
|
|
|
|
|
|
|
client: stubs
|
2006-08-12 00:32:53 +00:00
|
|
|
g++ -o TestClient $(CFL) src/TestClient.cc ../cpp-gen/ThriftTest.cc
|
2006-05-30 09:24:40 +00:00
|
|
|
|
|
|
|
clean:
|
2006-08-12 00:32:53 +00:00
|
|
|
rm -fr TestServer TestClient ../cpp-gen
|