Mark Slee | b32f3c6 | 2007-03-05 04:48:48 +0000 | [diff] [blame^] | 1 | # Makefile for Thrift test project. |
| 2 | # |
| 3 | # Author: |
| 4 | # Mark Slee <mcslee@facebook.com> |
| 5 | |
| 6 | # Default target is everything |
| 7 | |
| 8 | ifndef thrift_home |
| 9 | thrift_home=../../ |
| 10 | endif #thrift_home |
| 11 | |
| 12 | target: all |
| 13 | |
| 14 | ifndef boost_home |
| 15 | boost_home=/usr/local/include/boost-1_33_1 |
| 16 | endif #boost_home |
| 17 | target: all |
| 18 | |
| 19 | include_paths = $(thrift_home)/lib/cpp/src \ |
| 20 | $(boost_home) |
| 21 | |
| 22 | include_flags = $(patsubst %,-I%, $(include_paths)) |
| 23 | |
| 24 | # Tools |
| 25 | ifndef THRIFT |
| 26 | THRIFT = ../../compiler/cpp/thrift |
| 27 | endif # THRIFT |
| 28 | |
| 29 | CC = g++ |
| 30 | LD = g++ |
| 31 | |
| 32 | # Compiler flags |
| 33 | LFL = -L$(thrift_home)/lib/cpp/.libs -lthrift |
| 34 | CCFL = -Wall -O3 -g -I./gen-cpp $(include_flags) |
| 35 | CFL = $(CCFL) $(LFL) |
| 36 | |
| 37 | all: server |
| 38 | |
| 39 | stubs: ThreadsTest.thrift |
| 40 | $(THRIFT) -cpp -py ThreadsTest.thrift |
| 41 | |
| 42 | server: stubs |
| 43 | g++ -o ThreadsServer $(CFL) ThreadsServer.cpp ./gen-cpp/ThreadsTest.cpp ./gen-cpp/ThreadsTest_types.cpp |
| 44 | |
| 45 | clean: |
| 46 | rm -fr *.o ThreadsServer gen-cpp |