blob: 14f1a5890dc86d4a8052ebc80ebab941935c4c3d [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# 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
51all: server client
52
53stubs: ThreadsTest.thrift
54 $(THRIFT) --gen cpp --gen py ThreadsTest.thrift
55
56server: stubs
57 g++ -o ThreadsServer $(CFL) ThreadsServer.cpp ./gen-cpp/ThreadsTest.cpp ./gen-cpp/ThreadsTest_types.cpp
58
59client: stubs
60 g++ -o ThreadsClient $(CFL) ThreadsClient.cpp ./gen-cpp/ThreadsTest.cpp ./gen-cpp/ThreadsTest_types.cpp
61
62clean:
63 $(RM) -r *.o ThreadsServer ThreadsClient gen-cpp gen-py