| Mark Slee | b32f3c6 | 2007-03-05 04:48:48 +0000 | [diff] [blame] | 1 | # Makefile for Thrift test project. | 
| David Reiss | 0c90f6f | 2008-02-06 22:18:40 +0000 | [diff] [blame] | 2 | # | 
| Mark Slee | b32f3c6 | 2007-03-05 04:48:48 +0000 | [diff] [blame] | 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 |  | 
| Mark Slee | c416a27 | 2007-03-05 05:40:37 +0000 | [diff] [blame] | 37 | all: server client | 
| Mark Slee | b32f3c6 | 2007-03-05 04:48:48 +0000 | [diff] [blame] | 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 |  | 
| Mark Slee | c416a27 | 2007-03-05 05:40:37 +0000 | [diff] [blame] | 45 | client: stubs | 
|  | 46 | g++ -o ThreadsClient $(CFL) ThreadsClient.cpp ./gen-cpp/ThreadsTest.cpp ./gen-cpp/ThreadsTest_types.cpp | 
|  | 47 |  | 
| Mark Slee | b32f3c6 | 2007-03-05 04:48:48 +0000 | [diff] [blame] | 48 | clean: | 
| Mark Slee | 4841b2d | 2007-03-05 05:41:04 +0000 | [diff] [blame] | 49 | rm -fr *.o ThreadsServer ThreadsClient gen-cpp gen-py |