Mark Slee | e854063 | 2006-05-30 09:24:40 +0000 | [diff] [blame] | 1 | # Makefile for Thrift test project. |
| 2 | # |
| 3 | # Author: |
| 4 | # Mark Slee <mcslee@facebook.com> |
| 5 | |
| 6 | # Default target is everything |
Marc Slemko | 6be374b | 2006-08-04 03:16:25 +0000 | [diff] [blame] | 7 | |
| 8 | ifndef thrift_home |
| 9 | thrift_home=../../build |
| 10 | endif #thrift_home |
Marc Slemko | e6889de | 2006-08-12 00:32:53 +0000 | [diff] [blame] | 11 | |
Mark Slee | e854063 | 2006-05-30 09:24:40 +0000 | [diff] [blame] | 12 | target: all |
| 13 | |
Marc Slemko | e6889de | 2006-08-12 00:32:53 +0000 | [diff] [blame] | 14 | ifndef boost_home |
| 15 | boost_home=../../../../../thirdparty/boost_1_33_1 |
| 16 | endif #thrift_home |
| 17 | target: all |
| 18 | |
| 19 | include_paths = $(thrift_home)/include/thrift \ |
| 20 | $(boost_home) |
| 21 | |
| 22 | include_flags = $(patsubst %,-I%, $(include_paths)) |
| 23 | |
Mark Slee | e854063 | 2006-05-30 09:24:40 +0000 | [diff] [blame] | 24 | # Tools |
Marc Slemko | bf4fd19 | 2006-08-15 21:29:39 +0000 | [diff] [blame] | 25 | THRIFT = python ../../compiler/src/thrift.py ~/ws/thrift/dev/test/ThriftTest.thrift |
Mark Slee | e854063 | 2006-05-30 09:24:40 +0000 | [diff] [blame] | 26 | CC = g++ |
| 27 | LD = g++ |
| 28 | |
| 29 | # Compiler flags |
Marc Slemko | bf4fd19 | 2006-08-15 21:29:39 +0000 | [diff] [blame] | 30 | DCFL = -Wall -O3 -g -I../cpp-gen $(include_flags) -L$(thrift_home)/lib -lthrift |
Marc Slemko | e6889de | 2006-08-12 00:32:53 +0000 | [diff] [blame] | 31 | CFL = -Wall -O3 -I../cpp-gen $(include_flags) -L$(thrift_home)/lib -lthrift |
Mark Slee | e854063 | 2006-05-30 09:24:40 +0000 | [diff] [blame] | 32 | |
| 33 | all: server client |
| 34 | |
Mark Slee | 6e53644 | 2006-06-30 18:28:50 +0000 | [diff] [blame] | 35 | debug: server-debug client-debug |
| 36 | |
Mark Slee | e854063 | 2006-05-30 09:24:40 +0000 | [diff] [blame] | 37 | stubs: ../ThriftTest.thrift |
Marc Slemko | bf4fd19 | 2006-08-15 21:29:39 +0000 | [diff] [blame] | 38 | $(THRIFT) --cpp ../ThriftTest.thrift |
Mark Slee | e854063 | 2006-05-30 09:24:40 +0000 | [diff] [blame] | 39 | |
Mark Slee | 6e53644 | 2006-06-30 18:28:50 +0000 | [diff] [blame] | 40 | server-debug: stubs |
Marc Slemko | e6889de | 2006-08-12 00:32:53 +0000 | [diff] [blame] | 41 | g++ -o TestServer $(DCFL) src/TestServer.cc ../cpp-gen/ThriftTest.cc |
Mark Slee | 6e53644 | 2006-06-30 18:28:50 +0000 | [diff] [blame] | 42 | |
| 43 | client-debug: stubs |
Marc Slemko | e6889de | 2006-08-12 00:32:53 +0000 | [diff] [blame] | 44 | g++ -o TestClient $(DCFL) src/TestClient.cc ../cpp-gen/ThriftTest.cc |
Mark Slee | 6e53644 | 2006-06-30 18:28:50 +0000 | [diff] [blame] | 45 | |
Mark Slee | e854063 | 2006-05-30 09:24:40 +0000 | [diff] [blame] | 46 | server: stubs |
Marc Slemko | e6889de | 2006-08-12 00:32:53 +0000 | [diff] [blame] | 47 | g++ -o TestServer $(CFL) src/TestServer.cc ../cpp-gen/ThriftTest.cc |
Mark Slee | e854063 | 2006-05-30 09:24:40 +0000 | [diff] [blame] | 48 | |
| 49 | client: stubs |
Marc Slemko | e6889de | 2006-08-12 00:32:53 +0000 | [diff] [blame] | 50 | g++ -o TestClient $(CFL) src/TestClient.cc ../cpp-gen/ThriftTest.cc |
Mark Slee | e854063 | 2006-05-30 09:24:40 +0000 | [diff] [blame] | 51 | |
| 52 | clean: |
Marc Slemko | e6889de | 2006-08-12 00:32:53 +0000 | [diff] [blame] | 53 | rm -fr TestServer TestClient ../cpp-gen |