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 |
Mark Slee | e854063 | 2006-05-30 09:24:40 +0000 | [diff] [blame] | 11 | target: all |
| 12 | |
| 13 | # Tools |
Mark Slee | 9577100 | 2006-06-07 06:53:25 +0000 | [diff] [blame] | 14 | THRIFT = thrift |
Mark Slee | e854063 | 2006-05-30 09:24:40 +0000 | [diff] [blame] | 15 | CC = g++ |
| 16 | LD = g++ |
| 17 | |
Marc Slemko | 6be374b | 2006-08-04 03:16:25 +0000 | [diff] [blame^] | 18 | include_flags = $(patsubst %,-I$(thrift_home)/include/%, thrift boost-1_33_1) |
| 19 | |
Mark Slee | e854063 | 2006-05-30 09:24:40 +0000 | [diff] [blame] | 20 | # Compiler flags |
Mark Slee | 6e53644 | 2006-06-30 18:28:50 +0000 | [diff] [blame] | 21 | LIBS = ../../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 Slemko | 6be374b | 2006-08-04 03:16:25 +0000 | [diff] [blame^] | 27 | DCFL = -Wall -O3 -g -Igen-cpp $(include_flags) $(LIBS) |
| 28 | CFL = -Wall -O3 -Igen-cpp $(include_flags) -L$(thrift_home)/lib -lthrift |
Mark Slee | e854063 | 2006-05-30 09:24:40 +0000 | [diff] [blame] | 29 | |
| 30 | all: server client |
| 31 | |
Mark Slee | 6e53644 | 2006-06-30 18:28:50 +0000 | [diff] [blame] | 32 | debug: server-debug client-debug |
| 33 | |
Mark Slee | e854063 | 2006-05-30 09:24:40 +0000 | [diff] [blame] | 34 | stubs: ../ThriftTest.thrift |
Mark Slee | 9577100 | 2006-06-07 06:53:25 +0000 | [diff] [blame] | 35 | $(THRIFT) -cpp ../ThriftTest.thrift |
Mark Slee | e854063 | 2006-05-30 09:24:40 +0000 | [diff] [blame] | 36 | |
Mark Slee | 6e53644 | 2006-06-30 18:28:50 +0000 | [diff] [blame] | 37 | server-debug: stubs |
| 38 | g++ -o TestServer $(DCFL) src/TestServer.cc gen-cpp/ThriftTest.cc |
| 39 | |
| 40 | client-debug: stubs |
| 41 | g++ -o TestClient $(DCFL) src/TestClient.cc gen-cpp/ThriftTest.cc |
| 42 | |
Mark Slee | e854063 | 2006-05-30 09:24:40 +0000 | [diff] [blame] | 43 | server: stubs |
Mark Slee | 9577100 | 2006-06-07 06:53:25 +0000 | [diff] [blame] | 44 | g++ -o TestServer $(CFL) src/TestServer.cc gen-cpp/ThriftTest.cc |
Mark Slee | e854063 | 2006-05-30 09:24:40 +0000 | [diff] [blame] | 45 | |
| 46 | client: stubs |
Mark Slee | 9577100 | 2006-06-07 06:53:25 +0000 | [diff] [blame] | 47 | g++ -o TestClient $(CFL) src/TestClient.cc gen-cpp/ThriftTest.cc |
Mark Slee | e854063 | 2006-05-30 09:24:40 +0000 | [diff] [blame] | 48 | |
| 49 | clean: |
| 50 | rm -fr TestServer TestClient gen-cpp |