blob: cec9699bd3d091db7fb3909e0d272ccf78ff1634 [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 Slemkobf4fd192006-08-15 21:29:39 +000025THRIFT = python ../../compiler/src/thrift.py ~/ws/thrift/dev/test/ThriftTest.thrift
Mark Sleee8540632006-05-30 09:24:40 +000026CC = g++
27LD = g++
28
29# Compiler flags
Marc Slemkobf4fd192006-08-15 21:29:39 +000030DCFL = -Wall -O3 -g -I../cpp-gen $(include_flags) -L$(thrift_home)/lib -lthrift
Marc Slemkoe6889de2006-08-12 00:32:53 +000031CFL = -Wall -O3 -I../cpp-gen $(include_flags) -L$(thrift_home)/lib -lthrift
Mark Sleee8540632006-05-30 09:24:40 +000032
33all: server client
34
Mark Slee6e536442006-06-30 18:28:50 +000035debug: server-debug client-debug
36
Mark Sleee8540632006-05-30 09:24:40 +000037stubs: ../ThriftTest.thrift
Marc Slemkobf4fd192006-08-15 21:29:39 +000038 $(THRIFT) --cpp ../ThriftTest.thrift
Mark Sleee8540632006-05-30 09:24:40 +000039
Mark Slee6e536442006-06-30 18:28:50 +000040server-debug: stubs
Marc Slemkoe6889de2006-08-12 00:32:53 +000041 g++ -o TestServer $(DCFL) src/TestServer.cc ../cpp-gen/ThriftTest.cc
Mark Slee6e536442006-06-30 18:28:50 +000042
43client-debug: stubs
Marc Slemkoe6889de2006-08-12 00:32:53 +000044 g++ -o TestClient $(DCFL) src/TestClient.cc ../cpp-gen/ThriftTest.cc
Mark Slee6e536442006-06-30 18:28:50 +000045
Mark Sleee8540632006-05-30 09:24:40 +000046server: stubs
Marc Slemkoe6889de2006-08-12 00:32:53 +000047 g++ -o TestServer $(CFL) src/TestServer.cc ../cpp-gen/ThriftTest.cc
Mark Sleee8540632006-05-30 09:24:40 +000048
49client: stubs
Marc Slemkoe6889de2006-08-12 00:32:53 +000050 g++ -o TestClient $(CFL) src/TestClient.cc ../cpp-gen/ThriftTest.cc
Mark Sleee8540632006-05-30 09:24:40 +000051
52clean:
Marc Slemkoe6889de2006-08-12 00:32:53 +000053 rm -fr TestServer TestClient ../cpp-gen