Marc Slemko | 3ea0033 | 2006-08-17 01:11:13 +0000 | [diff] [blame] | 1 | # Makefile for Thrift test project. |
| 2 | # |
| 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 \ |
| 21 | $(thrift_home)/lib/cpp \ |
Marc Slemko | 3ea0033 | 2006-08-17 01:11:13 +0000 | [diff] [blame] | 22 | $(boost_home) |
| 23 | |
| 24 | include_flags = $(patsubst %,-I%, $(include_paths)) |
| 25 | |
| 26 | # Tools |
Aditya Agarwal | 3950f47 | 2006-10-11 02:50:15 +0000 | [diff] [blame^] | 27 | ifndef THRIFT |
| 28 | THRIFT = ../../compiler/cpp/bin/thrift |
| 29 | endif # THRIFT |
| 30 | |
Marc Slemko | 3ea0033 | 2006-08-17 01:11:13 +0000 | [diff] [blame] | 31 | CC = g++ |
| 32 | LD = g++ |
| 33 | |
| 34 | # Compiler flags |
Aditya Agarwal | 3950f47 | 2006-10-11 02:50:15 +0000 | [diff] [blame^] | 35 | DCFL = -Wall -O3 -g -I./gen-cpp $(include_flags) -L$(thrift_home)/lib/cpp/.libs -lthrift -levent |
| 36 | CFL = -Wall -O3 -I./gen-cpp $(include_flags) -L$(thrift_home)/lib/cpp/.libs -lthrift -levent |
Marc Slemko | 3ea0033 | 2006-08-17 01:11:13 +0000 | [diff] [blame] | 37 | |
| 38 | all: stress-test |
| 39 | |
| 40 | debug: stress-test-debug |
| 41 | |
Aditya Agarwal | 3950f47 | 2006-10-11 02:50:15 +0000 | [diff] [blame^] | 42 | stubs: ../StressTest.thrift |
Mark Slee | 632f323 | 2006-08-30 17:23:52 +0000 | [diff] [blame] | 43 | $(THRIFT) --cpp --php ../StressTest.thrift |
Marc Slemko | 3ea0033 | 2006-08-17 01:11:13 +0000 | [diff] [blame] | 44 | |
| 45 | stress-test-debug: stubs |
Aditya Agarwal | 3950f47 | 2006-10-11 02:50:15 +0000 | [diff] [blame^] | 46 | g++ -o stress-test $(DCFL) src/main.cc ./gen-cpp/Service.cc gen-cpp/StressTest_types.cc |
Marc Slemko | 3ea0033 | 2006-08-17 01:11:13 +0000 | [diff] [blame] | 47 | |
| 48 | stress-test: stubs |
Aditya Agarwal | 3950f47 | 2006-10-11 02:50:15 +0000 | [diff] [blame^] | 49 | g++ -o stress-test $(CFL) src/main.cc ./gen-cpp/Service.cc gen-cpp/StressTest_types.cc |
Marc Slemko | 3ea0033 | 2006-08-17 01:11:13 +0000 | [diff] [blame] | 50 | |
| 51 | clean: |
Aditya Agarwal | 3950f47 | 2006-10-11 02:50:15 +0000 | [diff] [blame^] | 52 | rm -fr stress-test gen-cpp |