David Reiss | 0c90f6f | 2008-02-06 22:18:40 +0000 | [diff] [blame] | 1 | # |
David Reiss | ea2cba8 | 2009-03-30 21:35:00 +0000 | [diff] [blame] | 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 | # |
Mark Slee | e854063 | 2006-05-30 09:24:40 +0000 | [diff] [blame] | 19 | |
David Reiss | ea2cba8 | 2009-03-30 21:35:00 +0000 | [diff] [blame] | 20 | # Makefile for Thrift test project. |
Mark Slee | e854063 | 2006-05-30 09:24:40 +0000 | [diff] [blame] | 21 | # Default target is everything |
Marc Slemko | 6be374b | 2006-08-04 03:16:25 +0000 | [diff] [blame] | 22 | |
| 23 | ifndef thrift_home |
Aditya Agarwal | 0cc0c0a | 2006-09-05 22:38:13 +0000 | [diff] [blame] | 24 | thrift_home=../.. |
Marc Slemko | 6be374b | 2006-08-04 03:16:25 +0000 | [diff] [blame] | 25 | endif #thrift_home |
Marc Slemko | e6889de | 2006-08-12 00:32:53 +0000 | [diff] [blame] | 26 | |
Mark Slee | e854063 | 2006-05-30 09:24:40 +0000 | [diff] [blame] | 27 | target: all |
| 28 | |
Marc Slemko | e6889de | 2006-08-12 00:32:53 +0000 | [diff] [blame] | 29 | ifndef boost_home |
Aditya Agarwal | 0cc0c0a | 2006-09-05 22:38:13 +0000 | [diff] [blame] | 30 | #boost_home=../../../../../thirdparty/boost_1_33_1 |
Mark Slee | d3d733a | 2006-09-01 22:19:06 +0000 | [diff] [blame] | 31 | boost_home=/usr/local/include/boost-1_33_1 |
| 32 | endif #boost_home |
Marc Slemko | e6889de | 2006-08-12 00:32:53 +0000 | [diff] [blame] | 33 | target: all |
| 34 | |
Aditya Agarwal | 0cc0c0a | 2006-09-05 22:38:13 +0000 | [diff] [blame] | 35 | include_paths = $(thrift_home)/lib/cpp/src \ |
Marc Slemko | e6889de | 2006-08-12 00:32:53 +0000 | [diff] [blame] | 36 | $(boost_home) |
| 37 | |
| 38 | include_flags = $(patsubst %,-I%, $(include_paths)) |
| 39 | |
Mark Slee | e854063 | 2006-05-30 09:24:40 +0000 | [diff] [blame] | 40 | # Tools |
Marc Slemko | b09f588 | 2006-08-23 22:03:34 +0000 | [diff] [blame] | 41 | ifndef THRIFT |
Mark Slee | 6f5e2cb | 2007-01-25 08:01:28 +0000 | [diff] [blame] | 42 | THRIFT = ../../compiler/cpp/thrift |
Marc Slemko | b09f588 | 2006-08-23 22:03:34 +0000 | [diff] [blame] | 43 | endif # THRIFT |
| 44 | |
Mark Slee | e854063 | 2006-05-30 09:24:40 +0000 | [diff] [blame] | 45 | CC = g++ |
| 46 | LD = g++ |
| 47 | |
| 48 | # Compiler flags |
David Reiss | cf8c94a | 2009-04-03 19:07:19 +0000 | [diff] [blame] | 49 | DCFL = -Wall -O3 -g -I. -I./gen-cpp $(include_flags) -L$(thrift_home)/lib/cpp/.libs -lthrift -lthriftnb -levent |
Mark Slee | 0788a70 | 2007-01-25 08:14:50 +0000 | [diff] [blame] | 50 | LFL = -L$(thrift_home)/lib/cpp/.libs -lthrift -lthriftnb -levent |
David Reiss | cf8c94a | 2009-04-03 19:07:19 +0000 | [diff] [blame] | 51 | CCFL = -Wall -O3 -I. -I./gen-cpp $(include_flags) |
Mark Slee | 9e288d4 | 2007-01-24 23:42:12 +0000 | [diff] [blame] | 52 | CFL = $(CCFL) $(LFL) |
Mark Slee | e854063 | 2006-05-30 09:24:40 +0000 | [diff] [blame] | 53 | |
| 54 | all: server client |
| 55 | |
Mark Slee | 6e53644 | 2006-06-30 18:28:50 +0000 | [diff] [blame] | 56 | debug: server-debug client-debug |
| 57 | |
Mark Slee | e854063 | 2006-05-30 09:24:40 +0000 | [diff] [blame] | 58 | stubs: ../ThriftTest.thrift |
David Reiss | b139f64 | 2009-02-17 20:28:46 +0000 | [diff] [blame] | 59 | $(THRIFT) --gen cpp ../ThriftTest.thrift |
Mark Slee | e854063 | 2006-05-30 09:24:40 +0000 | [diff] [blame] | 60 | |
Mark Slee | 6e53644 | 2006-06-30 18:28:50 +0000 | [diff] [blame] | 61 | server-debug: stubs |
David Reiss | 356d570 | 2009-04-02 23:49:18 +0000 | [diff] [blame] | 62 | g++ -o TestServer $(DCFL) src/TestServer.cpp ./gen-cpp/ThriftTest.cpp ./gen-cpp/ThriftTest_types.cpp ../ThriftTest_extras.cpp |
Mark Slee | 6e53644 | 2006-06-30 18:28:50 +0000 | [diff] [blame] | 63 | |
| 64 | client-debug: stubs |
David Reiss | 356d570 | 2009-04-02 23:49:18 +0000 | [diff] [blame] | 65 | g++ -o TestClient $(DCFL) src/TestClient.cpp ./gen-cpp/ThriftTest.cpp ./gen-cpp/ThriftTest_types.cpp ../ThriftTest_extras.cpp |
Mark Slee | 6e53644 | 2006-06-30 18:28:50 +0000 | [diff] [blame] | 66 | |
Mark Slee | e854063 | 2006-05-30 09:24:40 +0000 | [diff] [blame] | 67 | server: stubs |
David Reiss | 356d570 | 2009-04-02 23:49:18 +0000 | [diff] [blame] | 68 | g++ -o TestServer $(CFL) src/TestServer.cpp ./gen-cpp/ThriftTest.cpp ./gen-cpp/ThriftTest_types.cpp ../ThriftTest_extras.cpp |
Mark Slee | e854063 | 2006-05-30 09:24:40 +0000 | [diff] [blame] | 69 | |
| 70 | client: stubs |
David Reiss | 356d570 | 2009-04-02 23:49:18 +0000 | [diff] [blame] | 71 | g++ -o TestClient $(CFL) src/TestClient.cpp ./gen-cpp/ThriftTest.cpp ./gen-cpp/ThriftTest_types.cpp ../ThriftTest_extras.cpp |
Mark Slee | e854063 | 2006-05-30 09:24:40 +0000 | [diff] [blame] | 72 | |
Mark Slee | 9e288d4 | 2007-01-24 23:42:12 +0000 | [diff] [blame] | 73 | small: |
David Reiss | b139f64 | 2009-02-17 20:28:46 +0000 | [diff] [blame] | 74 | $(THRIFT) --gen cpp ../SmallTest.thrift |
Mark Slee | 9e288d4 | 2007-01-24 23:42:12 +0000 | [diff] [blame] | 75 | g++ -c $(CCFL) ./gen-cpp/SmallService.cpp ./gen-cpp/SmallTest_types.cpp |
| 76 | |
Mark Slee | e854063 | 2006-05-30 09:24:40 +0000 | [diff] [blame] | 77 | clean: |
Mark Slee | 0788a70 | 2007-01-25 08:14:50 +0000 | [diff] [blame] | 78 | rm -fr *.o TestServer TestClient gen-cpp |