| 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 | b09f588 | 2006-08-23 22:03:34 +0000 | [diff] [blame] | 25 | ifndef THRIFT | 
|  | 26 | THRIFT = thrift | 
|  | 27 | endif # THRIFT | 
|  | 28 |  | 
| Mark Slee | e854063 | 2006-05-30 09:24:40 +0000 | [diff] [blame] | 29 | CC     = g++ | 
|  | 30 | LD     = g++ | 
|  | 31 |  | 
|  | 32 | # Compiler flags | 
| Marc Slemko | bf4fd19 | 2006-08-15 21:29:39 +0000 | [diff] [blame] | 33 | 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] | 34 | 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] | 35 |  | 
|  | 36 | all: server client | 
|  | 37 |  | 
| Mark Slee | 6e53644 | 2006-06-30 18:28:50 +0000 | [diff] [blame] | 38 | debug: server-debug client-debug | 
|  | 39 |  | 
| Mark Slee | e854063 | 2006-05-30 09:24:40 +0000 | [diff] [blame] | 40 | stubs: ../ThriftTest.thrift | 
| Marc Slemko | bf4fd19 | 2006-08-15 21:29:39 +0000 | [diff] [blame] | 41 | $(THRIFT) --cpp ../ThriftTest.thrift | 
| Mark Slee | e854063 | 2006-05-30 09:24:40 +0000 | [diff] [blame] | 42 |  | 
| Mark Slee | 6e53644 | 2006-06-30 18:28:50 +0000 | [diff] [blame] | 43 | server-debug: stubs | 
| Marc Slemko | e6889de | 2006-08-12 00:32:53 +0000 | [diff] [blame] | 44 | g++ -o TestServer $(DCFL) src/TestServer.cc ../cpp-gen/ThriftTest.cc | 
| Mark Slee | 6e53644 | 2006-06-30 18:28:50 +0000 | [diff] [blame] | 45 |  | 
|  | 46 | client-debug: stubs | 
| Marc Slemko | e6889de | 2006-08-12 00:32:53 +0000 | [diff] [blame] | 47 | g++ -o TestClient $(DCFL) src/TestClient.cc ../cpp-gen/ThriftTest.cc | 
| Mark Slee | 6e53644 | 2006-06-30 18:28:50 +0000 | [diff] [blame] | 48 |  | 
| Mark Slee | e854063 | 2006-05-30 09:24:40 +0000 | [diff] [blame] | 49 | server: stubs | 
| Marc Slemko | e6889de | 2006-08-12 00:32:53 +0000 | [diff] [blame] | 50 | g++ -o TestServer $(CFL) src/TestServer.cc ../cpp-gen/ThriftTest.cc | 
| Mark Slee | e854063 | 2006-05-30 09:24:40 +0000 | [diff] [blame] | 51 |  | 
|  | 52 | client: stubs | 
| Marc Slemko | e6889de | 2006-08-12 00:32:53 +0000 | [diff] [blame] | 53 | g++ -o TestClient $(CFL) src/TestClient.cc ../cpp-gen/ThriftTest.cc | 
| Mark Slee | e854063 | 2006-05-30 09:24:40 +0000 | [diff] [blame] | 54 |  | 
|  | 55 | clean: | 
| Marc Slemko | e6889de | 2006-08-12 00:32:53 +0000 | [diff] [blame] | 56 | rm -fr TestServer TestClient ../cpp-gen |