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 |
Aditya Agarwal | 0cc0c0a | 2006-09-05 22:38:13 +0000 | [diff] [blame] | 9 | thrift_home=../.. |
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 |
Aditya Agarwal | 0cc0c0a | 2006-09-05 22:38:13 +0000 | [diff] [blame] | 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 | |
Aditya Agarwal | 0cc0c0a | 2006-09-05 22:38:13 +0000 | [diff] [blame] | 20 | include_paths = $(thrift_home)/lib/cpp/src \ |
Marc Slemko | e6889de | 2006-08-12 00:32:53 +0000 | [diff] [blame] | 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 |
Mark Slee | 6f5e2cb | 2007-01-25 08:01:28 +0000 | [diff] [blame] | 27 | THRIFT = ../../compiler/cpp/thrift |
Marc Slemko | b09f588 | 2006-08-23 22:03:34 +0000 | [diff] [blame] | 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 | 0788a70 | 2007-01-25 08:14:50 +0000 | [diff] [blame^] | 34 | DCFL = -Wall -O3 -g -I./gen-cpp $(include_flags) -L$(thrift_home)/lib/cpp/.libs -lthrift -lthriftnb -levent |
| 35 | LFL = -L$(thrift_home)/lib/cpp/.libs -lthrift -lthriftnb -levent |
Mark Slee | 9e288d4 | 2007-01-24 23:42:12 +0000 | [diff] [blame] | 36 | CCFL = -Wall -O3 -I./gen-cpp $(include_flags) |
| 37 | CFL = $(CCFL) $(LFL) |
Mark Slee | e854063 | 2006-05-30 09:24:40 +0000 | [diff] [blame] | 38 | |
| 39 | all: server client |
| 40 | |
Mark Slee | 6e53644 | 2006-06-30 18:28:50 +0000 | [diff] [blame] | 41 | debug: server-debug client-debug |
| 42 | |
Mark Slee | e854063 | 2006-05-30 09:24:40 +0000 | [diff] [blame] | 43 | stubs: ../ThriftTest.thrift |
Marc Slemko | bf4fd19 | 2006-08-15 21:29:39 +0000 | [diff] [blame] | 44 | $(THRIFT) --cpp ../ThriftTest.thrift |
Mark Slee | e854063 | 2006-05-30 09:24:40 +0000 | [diff] [blame] | 45 | |
Mark Slee | 6e53644 | 2006-06-30 18:28:50 +0000 | [diff] [blame] | 46 | server-debug: stubs |
Mark Slee | a6b48ea | 2006-10-12 04:04:11 +0000 | [diff] [blame] | 47 | g++ -o TestServer $(DCFL) src/TestServer.cpp ./gen-cpp/ThriftTest.cpp ./gen-cpp/ThriftTest_types.cpp |
Mark Slee | 6e53644 | 2006-06-30 18:28:50 +0000 | [diff] [blame] | 48 | |
| 49 | client-debug: stubs |
Mark Slee | a6b48ea | 2006-10-12 04:04:11 +0000 | [diff] [blame] | 50 | g++ -o TestClient $(DCFL) src/TestClient.cpp ./gen-cpp/ThriftTest.cpp ./gen-cpp/ThriftTest_types.cpp |
Mark Slee | 6e53644 | 2006-06-30 18:28:50 +0000 | [diff] [blame] | 51 | |
Mark Slee | e854063 | 2006-05-30 09:24:40 +0000 | [diff] [blame] | 52 | server: stubs |
Mark Slee | a6b48ea | 2006-10-12 04:04:11 +0000 | [diff] [blame] | 53 | g++ -o TestServer $(CFL) src/TestServer.cpp ./gen-cpp/ThriftTest.cpp ./gen-cpp/ThriftTest_types.cpp |
Mark Slee | e854063 | 2006-05-30 09:24:40 +0000 | [diff] [blame] | 54 | |
| 55 | client: stubs |
Mark Slee | a6b48ea | 2006-10-12 04:04:11 +0000 | [diff] [blame] | 56 | g++ -o TestClient $(CFL) src/TestClient.cpp ./gen-cpp/ThriftTest.cpp ./gen-cpp/ThriftTest_types.cpp |
Mark Slee | e854063 | 2006-05-30 09:24:40 +0000 | [diff] [blame] | 57 | |
Mark Slee | 9e288d4 | 2007-01-24 23:42:12 +0000 | [diff] [blame] | 58 | small: |
| 59 | $(THRIFT) -cpp ../SmallTest.thrift |
| 60 | g++ -c $(CCFL) ./gen-cpp/SmallService.cpp ./gen-cpp/SmallTest_types.cpp |
| 61 | |
Mark Slee | e854063 | 2006-05-30 09:24:40 +0000 | [diff] [blame] | 62 | clean: |
Mark Slee | 0788a70 | 2007-01-25 08:14:50 +0000 | [diff] [blame^] | 63 | rm -fr *.o TestServer TestClient gen-cpp |