blob: 693dbadbc2804b4739f25b6340954f4f27b1c2e5 [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
Mark Sleee8540632006-05-30 09:24:40 +000011target: all
12
13# Tools
Mark Slee95771002006-06-07 06:53:25 +000014THRIFT = thrift
Mark Sleee8540632006-05-30 09:24:40 +000015CC = g++
16LD = g++
17
Marc Slemko6be374b2006-08-04 03:16:25 +000018include_flags = $(patsubst %,-I$(thrift_home)/include/%, thrift boost-1_33_1)
19
Mark Sleee8540632006-05-30 09:24:40 +000020# Compiler flags
Mark Slee6e536442006-06-30 18:28:50 +000021LIBS = ../../lib/cpp/src/server/TSimpleServer.cc \
22 ../../lib/cpp/src/protocol/TBinaryProtocol.cc \
23 ../../lib/cpp/src/transport/TBufferedTransport.cc \
24 ../../lib/cpp/src/transport/TChunkedTransport.cc \
25 ../../lib/cpp/src/transport/TServerSocket.cc \
26 ../../lib/cpp/src/transport/TSocket.cc
Marc Slemko6be374b2006-08-04 03:16:25 +000027DCFL = -Wall -O3 -g -Igen-cpp $(include_flags) $(LIBS)
28CFL = -Wall -O3 -Igen-cpp $(include_flags) -L$(thrift_home)/lib -lthrift
Mark Sleee8540632006-05-30 09:24:40 +000029
30all: server client
31
Mark Slee6e536442006-06-30 18:28:50 +000032debug: server-debug client-debug
33
Mark Sleee8540632006-05-30 09:24:40 +000034stubs: ../ThriftTest.thrift
Mark Slee95771002006-06-07 06:53:25 +000035 $(THRIFT) -cpp ../ThriftTest.thrift
Mark Sleee8540632006-05-30 09:24:40 +000036
Mark Slee6e536442006-06-30 18:28:50 +000037server-debug: stubs
38 g++ -o TestServer $(DCFL) src/TestServer.cc gen-cpp/ThriftTest.cc
39
40client-debug: stubs
41 g++ -o TestClient $(DCFL) src/TestClient.cc gen-cpp/ThriftTest.cc
42
Mark Sleee8540632006-05-30 09:24:40 +000043server: stubs
Mark Slee95771002006-06-07 06:53:25 +000044 g++ -o TestServer $(CFL) src/TestServer.cc gen-cpp/ThriftTest.cc
Mark Sleee8540632006-05-30 09:24:40 +000045
46client: stubs
Mark Slee95771002006-06-07 06:53:25 +000047 g++ -o TestClient $(CFL) src/TestClient.cc gen-cpp/ThriftTest.cc
Mark Sleee8540632006-05-30 09:24:40 +000048
49clean:
50 rm -fr TestServer TestClient gen-cpp