blob: fb3e38bc6dcae0f76348376fb06cb281d17dd22e [file] [log] [blame]
Gavin McDonald0b75e1a2010-10-28 02:12:01 +00001#
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
23ifndef thrift_home
24thrift_home=../..
25endif #thrift_home
26
27target: all
28
29ifndef boost_home
30#boost_home=../../../../../thirdparty/boost_1_33_1
31boost_home=/usr/local/include/boost-1_33_1
32endif #boost_home
33target: all
34
35include_paths = $(thrift_home)/lib/cpp/src \
36 $(boost_home)
37
38include_flags = $(patsubst %,-I%, $(include_paths))
39
40# Tools
41ifndef THRIFT
42THRIFT = ../../compiler/cpp/thrift
43endif # THRIFT
44
45CC = g++
46LD = g++
47
48# Compiler flags
49DCFL = -Wall -O3 -g -I. -I./gen-cpp $(include_flags) -L$(thrift_home)/lib/cpp/.libs -lthrift -lthriftnb -levent
50LFL = -L$(thrift_home)/lib/cpp/.libs -lthrift -lthriftnb -levent
51CCFL = -Wall -O3 -I. -I./gen-cpp $(include_flags)
52CFL = $(CCFL) $(LFL)
53
54all: server client
55
56debug: server-debug client-debug
57
58stubs: ../ThriftTest.thrift
59 $(THRIFT) --gen cpp ../ThriftTest.thrift
60
61server-debug: stubs
62 g++ -o TestServer $(DCFL) src/TestServer.cpp ./gen-cpp/ThriftTest.cpp ./gen-cpp/ThriftTest_types.cpp ../ThriftTest_extras.cpp
63
64client-debug: stubs
65 g++ -o TestClient $(DCFL) src/TestClient.cpp ./gen-cpp/ThriftTest.cpp ./gen-cpp/ThriftTest_types.cpp ../ThriftTest_extras.cpp
66
67server: stubs
68 g++ -o TestServer $(CFL) src/TestServer.cpp ./gen-cpp/ThriftTest.cpp ./gen-cpp/ThriftTest_types.cpp ../ThriftTest_extras.cpp
69
70client: stubs
71 g++ -o TestClient $(CFL) src/TestClient.cpp ./gen-cpp/ThriftTest.cpp ./gen-cpp/ThriftTest_types.cpp ../ThriftTest_extras.cpp
72
73small:
74 $(THRIFT) --gen cpp ../SmallTest.thrift
75 g++ -c $(CCFL) ./gen-cpp/SmallService.cpp ./gen-cpp/SmallTest_types.cpp
76
77clean:
78 rm -fr *.o TestServer TestClient gen-cpp