Marc Slemko | 3ea0033 | 2006-08-17 01:11:13 +0000 | [diff] [blame] | 1 | # Makefile for Thrift test project. |
Mark Slee | e02385b | 2007-06-09 01:21:16 +0000 | [diff] [blame] | 2 | # |
Marc Slemko | 3ea0033 | 2006-08-17 01:11:13 +0000 | [diff] [blame] | 3 | # Author: |
| 4 | # Marc Kwiatkowski <marc@facebook.com> |
Aditya Agarwal | 3950f47 | 2006-10-11 02:50:15 +0000 | [diff] [blame] | 5 | # Aditya Agarwal <aditya@facebook.com> |
Marc Slemko | 3ea0033 | 2006-08-17 01:11:13 +0000 | [diff] [blame] | 6 | |
| 7 | |
| 8 | ifndef thrift_home |
Aditya Agarwal | 3950f47 | 2006-10-11 02:50:15 +0000 | [diff] [blame] | 9 | thrift_home=../.. |
Marc Slemko | 3ea0033 | 2006-08-17 01:11:13 +0000 | [diff] [blame] | 10 | endif #thrift_home |
| 11 | |
| 12 | target: all |
| 13 | |
Marc Slemko | 3ea0033 | 2006-08-17 01:11:13 +0000 | [diff] [blame] | 14 | ifndef boost_home |
Aditya Agarwal | 3950f47 | 2006-10-11 02:50:15 +0000 | [diff] [blame] | 15 | #boost_home=../../../../../thirdparty/boost_1_33_1 |
| 16 | boost_home=/usr/local/include/boost-1_33_1 |
| 17 | endif #boost_home |
Marc Slemko | 3ea0033 | 2006-08-17 01:11:13 +0000 | [diff] [blame] | 18 | target: all |
| 19 | |
Aditya Agarwal | 3950f47 | 2006-10-11 02:50:15 +0000 | [diff] [blame] | 20 | include_paths = $(thrift_home)/lib/cpp/src \ |
Mark Slee | e02385b | 2007-06-09 01:21:16 +0000 | [diff] [blame] | 21 | $(thrift_home)/lib/cpp \ |
David Reiss | 832b262 | 2007-12-28 18:25:33 +0000 | [diff] [blame^] | 22 | $(thrift_home)/ \ |
Mark Slee | e02385b | 2007-06-09 01:21:16 +0000 | [diff] [blame] | 23 | $(boost_home) |
Marc Slemko | 3ea0033 | 2006-08-17 01:11:13 +0000 | [diff] [blame] | 24 | |
| 25 | include_flags = $(patsubst %,-I%, $(include_paths)) |
| 26 | |
| 27 | # Tools |
Aditya Agarwal | 3950f47 | 2006-10-11 02:50:15 +0000 | [diff] [blame] | 28 | ifndef THRIFT |
Mark Slee | 739dbe5 | 2007-02-01 22:55:30 +0000 | [diff] [blame] | 29 | THRIFT = ../../compiler/cpp/thrift |
Aditya Agarwal | 3950f47 | 2006-10-11 02:50:15 +0000 | [diff] [blame] | 30 | endif # THRIFT |
| 31 | |
Marc Slemko | 3ea0033 | 2006-08-17 01:11:13 +0000 | [diff] [blame] | 32 | CC = g++ |
| 33 | LD = g++ |
| 34 | |
| 35 | # Compiler flags |
Mark Slee | e02385b | 2007-06-09 01:21:16 +0000 | [diff] [blame] | 36 | DCFL = -Wall -O3 -g -I./gen-cpp $(include_flags) -L$(thrift_home)/lib/cpp/.libs -lthrift -lthriftnb -levent |
| 37 | CFL = -Wall -O3 -I./gen-cpp $(include_flags) -L$(thrift_home)/lib/cpp/.libs -lthrift -lthriftnb -levent |
Marc Slemko | 3ea0033 | 2006-08-17 01:11:13 +0000 | [diff] [blame] | 38 | |
Mark Slee | e02385b | 2007-06-09 01:21:16 +0000 | [diff] [blame] | 39 | all: stress-test stress-test-nb |
Marc Slemko | 3ea0033 | 2006-08-17 01:11:13 +0000 | [diff] [blame] | 40 | |
Mark Slee | e02385b | 2007-06-09 01:21:16 +0000 | [diff] [blame] | 41 | debug: stress-test-debug stress-test-debug-nb |
Marc Slemko | 3ea0033 | 2006-08-17 01:11:13 +0000 | [diff] [blame] | 42 | |
Aditya Agarwal | 3950f47 | 2006-10-11 02:50:15 +0000 | [diff] [blame] | 43 | stubs: ../StressTest.thrift |
Mark Slee | 632f323 | 2006-08-30 17:23:52 +0000 | [diff] [blame] | 44 | $(THRIFT) --cpp --php ../StressTest.thrift |
Marc Slemko | 3ea0033 | 2006-08-17 01:11:13 +0000 | [diff] [blame] | 45 | |
Mark Slee | e02385b | 2007-06-09 01:21:16 +0000 | [diff] [blame] | 46 | stress-test-debug-nb: stubs |
| 47 | g++ -o stress-test-nb $(DCFL) src/nb-main.cpp ./gen-cpp/Service.cpp gen-cpp/StressTest_types.cpp |
| 48 | |
| 49 | stress-test-nb: stubs |
| 50 | g++ -o stress-test-nb $(CFL) src/nb-main.cpp ./gen-cpp/Service.cpp gen-cpp/StressTest_types.cpp |
| 51 | |
Marc Slemko | 3ea0033 | 2006-08-17 01:11:13 +0000 | [diff] [blame] | 52 | stress-test-debug: stubs |
Mark Slee | 9a07927 | 2006-10-12 04:05:23 +0000 | [diff] [blame] | 53 | g++ -o stress-test $(DCFL) src/main.cpp ./gen-cpp/Service.cpp gen-cpp/StressTest_types.cpp |
Marc Slemko | 3ea0033 | 2006-08-17 01:11:13 +0000 | [diff] [blame] | 54 | |
| 55 | stress-test: stubs |
Mark Slee | 9a07927 | 2006-10-12 04:05:23 +0000 | [diff] [blame] | 56 | g++ -o stress-test $(CFL) src/main.cpp ./gen-cpp/Service.cpp gen-cpp/StressTest_types.cpp |
Marc Slemko | 3ea0033 | 2006-08-17 01:11:13 +0000 | [diff] [blame] | 57 | |
| 58 | clean: |
Mark Slee | e02385b | 2007-06-09 01:21:16 +0000 | [diff] [blame] | 59 | rm -fr stress-test stress-test-nb gen-cpp |