blob: fb3e38bc6dcae0f76348376fb06cb281d17dd22e [file] [log] [blame]
David Reiss0c90f6f2008-02-06 22:18:40 +00001#
David Reissea2cba82009-03-30 21:35:00 +00002# 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 Sleee8540632006-05-30 09:24:40 +000019
David Reissea2cba82009-03-30 21:35:00 +000020# Makefile for Thrift test project.
Mark Sleee8540632006-05-30 09:24:40 +000021# Default target is everything
Marc Slemko6be374b2006-08-04 03:16:25 +000022
23ifndef thrift_home
Aditya Agarwal0cc0c0a2006-09-05 22:38:13 +000024thrift_home=../..
Marc Slemko6be374b2006-08-04 03:16:25 +000025endif #thrift_home
Marc Slemkoe6889de2006-08-12 00:32:53 +000026
Mark Sleee8540632006-05-30 09:24:40 +000027target: all
28
Marc Slemkoe6889de2006-08-12 00:32:53 +000029ifndef boost_home
Aditya Agarwal0cc0c0a2006-09-05 22:38:13 +000030#boost_home=../../../../../thirdparty/boost_1_33_1
Mark Sleed3d733a2006-09-01 22:19:06 +000031boost_home=/usr/local/include/boost-1_33_1
32endif #boost_home
Marc Slemkoe6889de2006-08-12 00:32:53 +000033target: all
34
Aditya Agarwal0cc0c0a2006-09-05 22:38:13 +000035include_paths = $(thrift_home)/lib/cpp/src \
Marc Slemkoe6889de2006-08-12 00:32:53 +000036 $(boost_home)
37
38include_flags = $(patsubst %,-I%, $(include_paths))
39
Mark Sleee8540632006-05-30 09:24:40 +000040# Tools
Marc Slemkob09f5882006-08-23 22:03:34 +000041ifndef THRIFT
Mark Slee6f5e2cb2007-01-25 08:01:28 +000042THRIFT = ../../compiler/cpp/thrift
Marc Slemkob09f5882006-08-23 22:03:34 +000043endif # THRIFT
44
Mark Sleee8540632006-05-30 09:24:40 +000045CC = g++
46LD = g++
47
48# Compiler flags
David Reisscf8c94a2009-04-03 19:07:19 +000049DCFL = -Wall -O3 -g -I. -I./gen-cpp $(include_flags) -L$(thrift_home)/lib/cpp/.libs -lthrift -lthriftnb -levent
Mark Slee0788a702007-01-25 08:14:50 +000050LFL = -L$(thrift_home)/lib/cpp/.libs -lthrift -lthriftnb -levent
David Reisscf8c94a2009-04-03 19:07:19 +000051CCFL = -Wall -O3 -I. -I./gen-cpp $(include_flags)
Mark Slee9e288d42007-01-24 23:42:12 +000052CFL = $(CCFL) $(LFL)
Mark Sleee8540632006-05-30 09:24:40 +000053
54all: server client
55
Mark Slee6e536442006-06-30 18:28:50 +000056debug: server-debug client-debug
57
Mark Sleee8540632006-05-30 09:24:40 +000058stubs: ../ThriftTest.thrift
David Reissb139f642009-02-17 20:28:46 +000059 $(THRIFT) --gen cpp ../ThriftTest.thrift
Mark Sleee8540632006-05-30 09:24:40 +000060
Mark Slee6e536442006-06-30 18:28:50 +000061server-debug: stubs
David Reiss356d5702009-04-02 23:49:18 +000062 g++ -o TestServer $(DCFL) src/TestServer.cpp ./gen-cpp/ThriftTest.cpp ./gen-cpp/ThriftTest_types.cpp ../ThriftTest_extras.cpp
Mark Slee6e536442006-06-30 18:28:50 +000063
64client-debug: stubs
David Reiss356d5702009-04-02 23:49:18 +000065 g++ -o TestClient $(DCFL) src/TestClient.cpp ./gen-cpp/ThriftTest.cpp ./gen-cpp/ThriftTest_types.cpp ../ThriftTest_extras.cpp
Mark Slee6e536442006-06-30 18:28:50 +000066
Mark Sleee8540632006-05-30 09:24:40 +000067server: stubs
David Reiss356d5702009-04-02 23:49:18 +000068 g++ -o TestServer $(CFL) src/TestServer.cpp ./gen-cpp/ThriftTest.cpp ./gen-cpp/ThriftTest_types.cpp ../ThriftTest_extras.cpp
Mark Sleee8540632006-05-30 09:24:40 +000069
70client: stubs
David Reiss356d5702009-04-02 23:49:18 +000071 g++ -o TestClient $(CFL) src/TestClient.cpp ./gen-cpp/ThriftTest.cpp ./gen-cpp/ThriftTest_types.cpp ../ThriftTest_extras.cpp
Mark Sleee8540632006-05-30 09:24:40 +000072
Mark Slee9e288d42007-01-24 23:42:12 +000073small:
David Reissb139f642009-02-17 20:28:46 +000074 $(THRIFT) --gen cpp ../SmallTest.thrift
Mark Slee9e288d42007-01-24 23:42:12 +000075 g++ -c $(CCFL) ./gen-cpp/SmallService.cpp ./gen-cpp/SmallTest_types.cpp
76
Mark Sleee8540632006-05-30 09:24:40 +000077clean:
Mark Slee0788a702007-01-25 08:14:50 +000078 rm -fr *.o TestServer TestClient gen-cpp