blob: daaa15ea465ee1f2ccf37423de48a93fb25e4ca9 [file] [log] [blame]
Mark Sleee8540632006-05-30 09:24:40 +00001# Makefile for Thrift test project.
2#
3# Author:
4# Mark Slee <mcslee@facebook.com>
5
6# Default target is everything
Marc Slemko6be374b2006-08-04 03:16:25 +00007
8ifndef thrift_home
9thrift_home=../../build
10endif #thrift_home
Marc Slemkoe6889de2006-08-12 00:32:53 +000011
Mark Sleee8540632006-05-30 09:24:40 +000012target: all
13
Marc Slemkoe6889de2006-08-12 00:32:53 +000014ifndef boost_home
15boost_home=../../../../../thirdparty/boost_1_33_1
16endif #thrift_home
17target: all
18
19include_paths = $(thrift_home)/include/thrift \
20 $(boost_home)
21
22include_flags = $(patsubst %,-I%, $(include_paths))
23
Mark Sleee8540632006-05-30 09:24:40 +000024# Tools
Marc Slemkoe6889de2006-08-12 00:32:53 +000025THRIFT = python ../../compiler/src/thrift.py ~/ws/thrift/dev/test/ThriftTest.thrift --cpp
Mark Sleee8540632006-05-30 09:24:40 +000026CC = g++
27LD = g++
28
29# Compiler flags
Mark Slee6e536442006-06-30 18:28:50 +000030LIBS = ../../lib/cpp/src/server/TSimpleServer.cc \
31 ../../lib/cpp/src/protocol/TBinaryProtocol.cc \
32 ../../lib/cpp/src/transport/TBufferedTransport.cc \
33 ../../lib/cpp/src/transport/TChunkedTransport.cc \
34 ../../lib/cpp/src/transport/TServerSocket.cc \
35 ../../lib/cpp/src/transport/TSocket.cc
Marc Slemkoe6889de2006-08-12 00:32:53 +000036DCFL = -Wall -O3 -g -I../cpp-gen $(include_flags) $(LIBS)
37CFL = -Wall -O3 -I../cpp-gen $(include_flags) -L$(thrift_home)/lib -lthrift
Mark Sleee8540632006-05-30 09:24:40 +000038
39all: server client
40
Mark Slee6e536442006-06-30 18:28:50 +000041debug: server-debug client-debug
42
Mark Sleee8540632006-05-30 09:24:40 +000043stubs: ../ThriftTest.thrift
Mark Slee95771002006-06-07 06:53:25 +000044 $(THRIFT) -cpp ../ThriftTest.thrift
Mark Sleee8540632006-05-30 09:24:40 +000045
Mark Slee6e536442006-06-30 18:28:50 +000046server-debug: stubs
Marc Slemkoe6889de2006-08-12 00:32:53 +000047 g++ -o TestServer $(DCFL) src/TestServer.cc ../cpp-gen/ThriftTest.cc
Mark Slee6e536442006-06-30 18:28:50 +000048
49client-debug: stubs
Marc Slemkoe6889de2006-08-12 00:32:53 +000050 g++ -o TestClient $(DCFL) src/TestClient.cc ../cpp-gen/ThriftTest.cc
Mark Slee6e536442006-06-30 18:28:50 +000051
Mark Sleee8540632006-05-30 09:24:40 +000052server: stubs
Marc Slemkoe6889de2006-08-12 00:32:53 +000053 g++ -o TestServer $(CFL) src/TestServer.cc ../cpp-gen/ThriftTest.cc
Mark Sleee8540632006-05-30 09:24:40 +000054
55client: stubs
Marc Slemkoe6889de2006-08-12 00:32:53 +000056 g++ -o TestClient $(CFL) src/TestClient.cc ../cpp-gen/ThriftTest.cc
Mark Sleee8540632006-05-30 09:24:40 +000057
58clean:
Marc Slemkoe6889de2006-08-12 00:32:53 +000059 rm -fr TestServer TestClient ../cpp-gen