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 | ||||
Mark Slee | d3d733a | 2006-09-01 22:19:06 +0000 | [diff] [blame^] | 9 | thrift_home=/usr/local |
Marc Slemko | 6be374b | 2006-08-04 03:16:25 +0000 | [diff] [blame] | 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 | ||||
Mark Slee | d3d733a | 2006-09-01 22:19:06 +0000 | [diff] [blame^] | 16 | boost_home=/usr/local/include/boost-1_33_1 |
17 | endif #boost_home | ||||
Marc Slemko | e6889de | 2006-08-12 00:32:53 +0000 | [diff] [blame] | 18 | target: all |
19 | |||||
20 | include_paths = $(thrift_home)/include/thrift \ | ||||
21 | $(boost_home) | ||||
22 | |||||
23 | include_flags = $(patsubst %,-I%, $(include_paths)) | ||||
24 | |||||
Mark Slee | e854063 | 2006-05-30 09:24:40 +0000 | [diff] [blame] | 25 | # Tools |
Marc Slemko | b09f588 | 2006-08-23 22:03:34 +0000 | [diff] [blame] | 26 | ifndef THRIFT |
27 | THRIFT = thrift | ||||
28 | endif # THRIFT | ||||
29 | |||||
Mark Slee | e854063 | 2006-05-30 09:24:40 +0000 | [diff] [blame] | 30 | CC = g++ |
31 | LD = g++ | ||||
32 | |||||
33 | # Compiler flags | ||||
Mark Slee | d3d733a | 2006-09-01 22:19:06 +0000 | [diff] [blame^] | 34 | DCFL = -Wall -O3 -g -I./gen-cpp $(include_flags) -L$(thrift_home)/lib -lthrift |
35 | CFL = -Wall -O3 -I./gen-cpp $(include_flags) -L$(thrift_home)/lib -lthrift | ||||
Mark Slee | e854063 | 2006-05-30 09:24:40 +0000 | [diff] [blame] | 36 | |
37 | all: server client | ||||
38 | |||||
Mark Slee | 6e53644 | 2006-06-30 18:28:50 +0000 | [diff] [blame] | 39 | debug: server-debug client-debug |
40 | |||||
Mark Slee | e854063 | 2006-05-30 09:24:40 +0000 | [diff] [blame] | 41 | stubs: ../ThriftTest.thrift |
Marc Slemko | bf4fd19 | 2006-08-15 21:29:39 +0000 | [diff] [blame] | 42 | $(THRIFT) --cpp ../ThriftTest.thrift |
Mark Slee | e854063 | 2006-05-30 09:24:40 +0000 | [diff] [blame] | 43 | |
Mark Slee | 6e53644 | 2006-06-30 18:28:50 +0000 | [diff] [blame] | 44 | server-debug: stubs |
Mark Slee | d3d733a | 2006-09-01 22:19:06 +0000 | [diff] [blame^] | 45 | g++ -o TestServer $(DCFL) src/TestServer.cc ./gen-cpp/ThriftTest.cc |
Mark Slee | 6e53644 | 2006-06-30 18:28:50 +0000 | [diff] [blame] | 46 | |
47 | client-debug: stubs | ||||
Mark Slee | d3d733a | 2006-09-01 22:19:06 +0000 | [diff] [blame^] | 48 | g++ -o TestClient $(DCFL) src/TestClient.cc ./gen-cpp/ThriftTest.cc |
Mark Slee | 6e53644 | 2006-06-30 18:28:50 +0000 | [diff] [blame] | 49 | |
Mark Slee | e854063 | 2006-05-30 09:24:40 +0000 | [diff] [blame] | 50 | server: stubs |
Mark Slee | d3d733a | 2006-09-01 22:19:06 +0000 | [diff] [blame^] | 51 | g++ -o TestServer $(CFL) src/TestServer.cc ./gen-cpp/ThriftTest.cc |
Mark Slee | e854063 | 2006-05-30 09:24:40 +0000 | [diff] [blame] | 52 | |
53 | client: stubs | ||||
Mark Slee | d3d733a | 2006-09-01 22:19:06 +0000 | [diff] [blame^] | 54 | g++ -o TestClient $(CFL) src/TestClient.cc ./gen-cpp/ThriftTest.cc |
Mark Slee | e854063 | 2006-05-30 09:24:40 +0000 | [diff] [blame] | 55 | |
56 | clean: | ||||
Marc Slemko | e6889de | 2006-08-12 00:32:53 +0000 | [diff] [blame] | 57 | rm -fr TestServer TestClient ../cpp-gen |