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
|
2006-09-05 22:38:13 +00:00
|
|
|
thrift_home=../..
|
2006-08-04 03:16:25 +00:00
|
|
|
endif #thrift_home
|
2006-08-12 00:32:53 +00:00
|
|
|
|
|
|
|
target: all
|
|
|
|
|
|
|
|
ifndef boost_home
|
2006-09-05 22:38:13 +00:00
|
|
|
#boost_home=../../../../../thirdparty/boost_1_33_1
|
2006-09-01 22:19:06 +00:00
|
|
|
boost_home=/usr/local/include/boost-1_33_1
|
|
|
|
endif #boost_home
|
2006-05-30 09:24:40 +00:00
|
|
|
target: all
|
|
|
|
|
2006-09-05 22:38:13 +00:00
|
|
|
include_paths = $(thrift_home)/lib/cpp/src \
|
2006-08-12 00:32:53 +00:00
|
|
|
$(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
|
2007-01-25 08:01:28 +00:00
|
|
|
THRIFT = ../../compiler/cpp/thrift
|
2006-08-23 22:03:34 +00:00
|
|
|
endif # THRIFT
|
|
|
|
|
2006-05-30 09:24:40 +00:00
|
|
|
CC = g++
|
|
|
|
LD = g++
|
|
|
|
|
|
|
|
# Compiler flags
|
2007-01-25 08:14:50 +00:00
|
|
|
DCFL = -Wall -O3 -g -I./gen-cpp $(include_flags) -L$(thrift_home)/lib/cpp/.libs -lthrift -lthriftnb -levent
|
|
|
|
LFL = -L$(thrift_home)/lib/cpp/.libs -lthrift -lthriftnb -levent
|
2007-01-24 23:42:12 +00:00
|
|
|
CCFL = -Wall -O3 -I./gen-cpp $(include_flags)
|
|
|
|
CFL = $(CCFL) $(LFL)
|
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-10-12 04:04:11 +00:00
|
|
|
g++ -o TestServer $(DCFL) src/TestServer.cpp ./gen-cpp/ThriftTest.cpp ./gen-cpp/ThriftTest_types.cpp
|
2006-06-30 18:28:50 +00:00
|
|
|
|
|
|
|
client-debug: stubs
|
2006-10-12 04:04:11 +00:00
|
|
|
g++ -o TestClient $(DCFL) src/TestClient.cpp ./gen-cpp/ThriftTest.cpp ./gen-cpp/ThriftTest_types.cpp
|
2006-06-30 18:28:50 +00:00
|
|
|
|
2006-05-30 09:24:40 +00:00
|
|
|
server: stubs
|
2006-10-12 04:04:11 +00:00
|
|
|
g++ -o TestServer $(CFL) src/TestServer.cpp ./gen-cpp/ThriftTest.cpp ./gen-cpp/ThriftTest_types.cpp
|
2006-05-30 09:24:40 +00:00
|
|
|
|
|
|
|
client: stubs
|
2006-10-12 04:04:11 +00:00
|
|
|
g++ -o TestClient $(CFL) src/TestClient.cpp ./gen-cpp/ThriftTest.cpp ./gen-cpp/ThriftTest_types.cpp
|
2006-05-30 09:24:40 +00:00
|
|
|
|
2007-01-24 23:42:12 +00:00
|
|
|
small:
|
|
|
|
$(THRIFT) -cpp ../SmallTest.thrift
|
|
|
|
g++ -c $(CCFL) ./gen-cpp/SmallService.cpp ./gen-cpp/SmallTest_types.cpp
|
|
|
|
|
2006-05-30 09:24:40 +00:00
|
|
|
clean:
|
2007-01-25 08:14:50 +00:00
|
|
|
rm -fr *.o TestServer TestClient gen-cpp
|