blob: ddd6b2e9afe7241d344355bd3f9eb84727a77c29 [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
Mark Sleed3d733a2006-09-01 22:19:06 +00009thrift_home=/usr/local
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
15boost_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
20include_paths = $(thrift_home)/include/thrift \
21 $(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
27THRIFT = thrift
28endif # THRIFT
29
Mark Sleee8540632006-05-30 09:24:40 +000030CC = g++
31LD = g++
32
33# Compiler flags
Mark Sleed3d733a2006-09-01 22:19:06 +000034DCFL = -Wall -O3 -g -I./gen-cpp $(include_flags) -L$(thrift_home)/lib -lthrift
35CFL = -Wall -O3 -I./gen-cpp $(include_flags) -L$(thrift_home)/lib -lthrift
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 Sleed3d733a2006-09-01 22:19:06 +000045 g++ -o TestServer $(DCFL) src/TestServer.cc ./gen-cpp/ThriftTest.cc
Mark Slee6e536442006-06-30 18:28:50 +000046
47client-debug: stubs
Mark Sleed3d733a2006-09-01 22:19:06 +000048 g++ -o TestClient $(DCFL) src/TestClient.cc ./gen-cpp/ThriftTest.cc
Mark Slee6e536442006-06-30 18:28:50 +000049
Mark Sleee8540632006-05-30 09:24:40 +000050server: stubs
Mark Sleed3d733a2006-09-01 22:19:06 +000051 g++ -o TestServer $(CFL) src/TestServer.cc ./gen-cpp/ThriftTest.cc
Mark Sleee8540632006-05-30 09:24:40 +000052
53client: stubs
Mark Sleed3d733a2006-09-01 22:19:06 +000054 g++ -o TestClient $(CFL) src/TestClient.cc ./gen-cpp/ThriftTest.cc
Mark Sleee8540632006-05-30 09:24:40 +000055
56clean:
Marc Slemkoe6889de2006-08-12 00:32:53 +000057 rm -fr TestServer TestClient ../cpp-gen