blob: d8ef54dbadf8397ab9dc72d93c0efcd904797da3 [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
Aditya Agarwal0cc0c0a2006-09-05 22:38:13 +00009thrift_home=../..
Marc Slemko6be374b2006-08-04 03:16:25 +000010endif #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
Aditya Agarwal0cc0c0a2006-09-05 22:38:13 +000015#boost_home=../../../../../thirdparty/boost_1_33_1
Mark Sleed3d733a2006-09-01 22:19:06 +000016boost_home=/usr/local/include/boost-1_33_1
17endif #boost_home
Marc Slemkoe6889de2006-08-12 00:32:53 +000018target: all
19
Aditya Agarwal0cc0c0a2006-09-05 22:38:13 +000020include_paths = $(thrift_home)/lib/cpp/src \
Marc Slemkoe6889de2006-08-12 00:32:53 +000021 $(boost_home)
22
23include_flags = $(patsubst %,-I%, $(include_paths))
24
Mark Sleee8540632006-05-30 09:24:40 +000025# Tools
Marc Slemkob09f5882006-08-23 22:03:34 +000026ifndef THRIFT
Aditya Agarwal0cc0c0a2006-09-05 22:38:13 +000027THRIFT = ../../compiler/cpp/bin/thrift
Marc Slemkob09f5882006-08-23 22:03:34 +000028endif # THRIFT
29
Mark Sleee8540632006-05-30 09:24:40 +000030CC = g++
31LD = g++
32
33# Compiler flags
Aditya Agarwal3950f472006-10-11 02:50:15 +000034DCFL = -Wall -O3 -g -I./gen-cpp $(include_flags) -L$(thrift_home)/lib/cpp/.libs -lthrift -levent
35CFL = -Wall -O3 -I./gen-cpp $(include_flags) -L$(thrift_home)/lib/cpp/.libs -lthrift -levent
Mark Sleee8540632006-05-30 09:24:40 +000036
37all: server client
38
Mark Slee6e536442006-06-30 18:28:50 +000039debug: server-debug client-debug
40
Mark Sleee8540632006-05-30 09:24:40 +000041stubs: ../ThriftTest.thrift
Marc Slemkobf4fd192006-08-15 21:29:39 +000042 $(THRIFT) --cpp ../ThriftTest.thrift
Mark Sleee8540632006-05-30 09:24:40 +000043
Mark Slee6e536442006-06-30 18:28:50 +000044server-debug: stubs
Mark Sleea6b48ea2006-10-12 04:04:11 +000045 g++ -o TestServer $(DCFL) src/TestServer.cpp ./gen-cpp/ThriftTest.cpp ./gen-cpp/ThriftTest_types.cpp
Mark Slee6e536442006-06-30 18:28:50 +000046
47client-debug: stubs
Mark Sleea6b48ea2006-10-12 04:04:11 +000048 g++ -o TestClient $(DCFL) src/TestClient.cpp ./gen-cpp/ThriftTest.cpp ./gen-cpp/ThriftTest_types.cpp
Mark Slee6e536442006-06-30 18:28:50 +000049
Mark Sleee8540632006-05-30 09:24:40 +000050server: stubs
Mark Sleea6b48ea2006-10-12 04:04:11 +000051 g++ -o TestServer $(CFL) src/TestServer.cpp ./gen-cpp/ThriftTest.cpp ./gen-cpp/ThriftTest_types.cpp
Mark Sleee8540632006-05-30 09:24:40 +000052
53client: stubs
Mark Sleea6b48ea2006-10-12 04:04:11 +000054 g++ -o TestClient $(CFL) src/TestClient.cpp ./gen-cpp/ThriftTest.cpp ./gen-cpp/ThriftTest_types.cpp
Mark Sleee8540632006-05-30 09:24:40 +000055
56clean:
Aditya Agarwal0cc0c0a2006-09-05 22:38:13 +000057 rm -fr TestServer TestClient gen-cpp