Gavin McDonald | 0b75e1a | 2010-10-28 02:12:01 +0000 | [diff] [blame] | 1 | # |
| 2 | # Licensed to the Apache Software Foundation (ASF) under one |
| 3 | # or more contributor license agreements. See the NOTICE file |
| 4 | # distributed with this work for additional information |
| 5 | # regarding copyright ownership. The ASF licenses this file |
| 6 | # to you under the Apache License, Version 2.0 (the |
| 7 | # "License"); you may not use this file except in compliance |
| 8 | # with the License. You may obtain a copy of the License at |
| 9 | # |
| 10 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 11 | # |
| 12 | # Unless required by applicable law or agreed to in writing, |
| 13 | # software distributed under the License is distributed on an |
| 14 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| 15 | # KIND, either express or implied. See the License for the |
| 16 | # specific language governing permissions and limitations |
| 17 | # under the License. |
| 18 | # |
| 19 | |
| 20 | # Makefile for Thrift test project. |
| 21 | # Default target is everything |
| 22 | |
| 23 | ifndef thrift_home |
| 24 | thrift_home=../.. |
| 25 | endif #thrift_home |
| 26 | |
| 27 | target: all |
| 28 | |
| 29 | ifndef boost_home |
| 30 | #boost_home=../../../../../thirdparty/boost_1_33_1 |
| 31 | boost_home=/usr/local/include/boost-1_33_1 |
| 32 | endif #boost_home |
| 33 | target: all |
| 34 | |
| 35 | include_paths = $(thrift_home)/lib/cpp/src \ |
| 36 | $(boost_home) |
| 37 | |
| 38 | include_flags = $(patsubst %,-I%, $(include_paths)) |
| 39 | |
| 40 | # Tools |
| 41 | ifndef THRIFT |
| 42 | THRIFT = ../../compiler/cpp/thrift |
| 43 | endif # THRIFT |
| 44 | |
| 45 | CC = g++ |
| 46 | LD = g++ |
| 47 | |
| 48 | # Compiler flags |
| 49 | DCFL = -Wall -O3 -g -I. -I./gen-cpp $(include_flags) -L$(thrift_home)/lib/cpp/.libs -lthrift -lthriftnb -levent |
| 50 | LFL = -L$(thrift_home)/lib/cpp/.libs -lthrift -lthriftnb -levent |
| 51 | CCFL = -Wall -O3 -I. -I./gen-cpp $(include_flags) |
| 52 | CFL = $(CCFL) $(LFL) |
| 53 | |
| 54 | all: server client |
| 55 | |
| 56 | debug: server-debug client-debug |
| 57 | |
| 58 | stubs: ../ThriftTest.thrift |
| 59 | $(THRIFT) --gen cpp ../ThriftTest.thrift |
| 60 | |
| 61 | server-debug: stubs |
| 62 | g++ -o TestServer $(DCFL) src/TestServer.cpp ./gen-cpp/ThriftTest.cpp ./gen-cpp/ThriftTest_types.cpp ../ThriftTest_extras.cpp |
| 63 | |
| 64 | client-debug: stubs |
| 65 | g++ -o TestClient $(DCFL) src/TestClient.cpp ./gen-cpp/ThriftTest.cpp ./gen-cpp/ThriftTest_types.cpp ../ThriftTest_extras.cpp |
| 66 | |
| 67 | server: stubs |
| 68 | g++ -o TestServer $(CFL) src/TestServer.cpp ./gen-cpp/ThriftTest.cpp ./gen-cpp/ThriftTest_types.cpp ../ThriftTest_extras.cpp |
| 69 | |
| 70 | client: stubs |
| 71 | g++ -o TestClient $(CFL) src/TestClient.cpp ./gen-cpp/ThriftTest.cpp ./gen-cpp/ThriftTest_types.cpp ../ThriftTest_extras.cpp |
| 72 | |
| 73 | small: |
| 74 | $(THRIFT) --gen cpp ../SmallTest.thrift |
| 75 | g++ -c $(CCFL) ./gen-cpp/SmallService.cpp ./gen-cpp/SmallTest_types.cpp |
| 76 | |
| 77 | clean: |
| 78 | rm -fr *.o TestServer TestClient gen-cpp |