blob: df7239691911fd1f29c2133b7d77b1d9f838fe30 [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 Sleeb32f3c62007-03-05 04:48:48 +000019
20# Default target is everything
21
22ifndef thrift_home
23thrift_home=../../
24endif #thrift_home
25
26target: all
27
28ifndef boost_home
29boost_home=/usr/local/include/boost-1_33_1
30endif #boost_home
31target: all
32
33include_paths = $(thrift_home)/lib/cpp/src \
34 $(boost_home)
35
36include_flags = $(patsubst %,-I%, $(include_paths))
37
38# Tools
39ifndef THRIFT
40THRIFT = ../../compiler/cpp/thrift
41endif # THRIFT
42
43CC = g++
44LD = g++
45
46# Compiler flags
47LFL = -L$(thrift_home)/lib/cpp/.libs -lthrift
48CCFL = -Wall -O3 -g -I./gen-cpp $(include_flags)
49CFL = $(CCFL) $(LFL)
50
Mark Sleec416a272007-03-05 05:40:37 +000051all: server client
Mark Sleeb32f3c62007-03-05 04:48:48 +000052
53stubs: ThreadsTest.thrift
David Reiss0c87ad42008-12-02 02:11:13 +000054 $(THRIFT) --gen cpp --gen py ThreadsTest.thrift
Mark Sleeb32f3c62007-03-05 04:48:48 +000055
56server: stubs
Roger Meierbb09f442011-05-31 20:35:37 +000057 $(CC) -o ThreadsServer $(CFL) ThreadsServer.cpp ./gen-cpp/ThreadsTest.cpp ./gen-cpp/ThreadsTest_types.cpp
Mark Sleeb32f3c62007-03-05 04:48:48 +000058
Mark Sleec416a272007-03-05 05:40:37 +000059client: stubs
Roger Meierbb09f442011-05-31 20:35:37 +000060 $(CC) -o ThreadsClient $(CFL) ThreadsClient.cpp ./gen-cpp/ThreadsTest.cpp ./gen-cpp/ThreadsTest_types.cpp
Mark Sleec416a272007-03-05 05:40:37 +000061
Mark Sleeb32f3c62007-03-05 04:48:48 +000062clean:
David Reiss2ca456a2008-02-24 16:42:18 +000063 $(RM) -r *.o ThreadsServer ThreadsClient gen-cpp gen-py