blob: d8ef54dbadf8397ab9dc72d93c0efcd904797da3 [file] [log] [blame]
# Makefile for Thrift test project.
#
# Author:
# Mark Slee <mcslee@facebook.com>
# Default target is everything
ifndef thrift_home
thrift_home=../..
endif #thrift_home
target: all
ifndef boost_home
#boost_home=../../../../../thirdparty/boost_1_33_1
boost_home=/usr/local/include/boost-1_33_1
endif #boost_home
target: all
include_paths = $(thrift_home)/lib/cpp/src \
$(boost_home)
include_flags = $(patsubst %,-I%, $(include_paths))
# Tools
ifndef THRIFT
THRIFT = ../../compiler/cpp/bin/thrift
endif # THRIFT
CC = g++
LD = g++
# Compiler flags
DCFL = -Wall -O3 -g -I./gen-cpp $(include_flags) -L$(thrift_home)/lib/cpp/.libs -lthrift -levent
CFL = -Wall -O3 -I./gen-cpp $(include_flags) -L$(thrift_home)/lib/cpp/.libs -lthrift -levent
all: server client
debug: server-debug client-debug
stubs: ../ThriftTest.thrift
$(THRIFT) --cpp ../ThriftTest.thrift
server-debug: stubs
g++ -o TestServer $(DCFL) src/TestServer.cpp ./gen-cpp/ThriftTest.cpp ./gen-cpp/ThriftTest_types.cpp
client-debug: stubs
g++ -o TestClient $(DCFL) src/TestClient.cpp ./gen-cpp/ThriftTest.cpp ./gen-cpp/ThriftTest_types.cpp
server: stubs
g++ -o TestServer $(CFL) src/TestServer.cpp ./gen-cpp/ThriftTest.cpp ./gen-cpp/ThriftTest_types.cpp
client: stubs
g++ -o TestClient $(CFL) src/TestClient.cpp ./gen-cpp/ThriftTest.cpp ./gen-cpp/ThriftTest_types.cpp
clean:
rm -fr TestServer TestClient gen-cpp