blob: 1a753b3a1be44053590f3171e5b3dac4161fab51 [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
20ifndef thrift_home
21thrift_home=../..
22endif #thrift_home
23
24target: all
25
26ifndef boost_home
27#boost_home=../../../../../thirdparty/boost_1_33_1
28boost_home=/usr/local/include/boost-1_33_1
29endif #boost_home
30target: all
31
32include_paths = $(thrift_home)/lib/cpp/src \
33 $(thrift_home)/lib/cpp \
34 $(thrift_home)/ \
35 $(boost_home)
36
37include_flags = $(patsubst %,-I%, $(include_paths))
38
39# Tools
40ifndef THRIFT
41THRIFT = ../../compiler/cpp/thrift
42endif # THRIFT
43
44CC = g++
45LD = g++
46
47# Compiler flags
48DCFL = -Wall -O3 -g -I./gen-cpp $(include_flags) -L$(thrift_home)/lib/cpp/.libs -lthrift -lthriftnb -levent
49CFL = -Wall -O3 -I./gen-cpp $(include_flags) -L$(thrift_home)/lib/cpp/.libs -lthrift -lthriftnb -levent
50
51all: stress-test stress-test-nb
52
53debug: stress-test-debug stress-test-debug-nb
54
55stubs: ../StressTest.thrift
56 $(THRIFT) --gen cpp --gen php ../StressTest.thrift
57
58stress-test-debug-nb: stubs
59 g++ -o stress-test-nb $(DCFL) src/nb-main.cpp ./gen-cpp/Service.cpp gen-cpp/StressTest_types.cpp
60
61stress-test-nb: stubs
62 g++ -o stress-test-nb $(CFL) src/nb-main.cpp ./gen-cpp/Service.cpp gen-cpp/StressTest_types.cpp
63
64stress-test-debug: stubs
65 g++ -o stress-test $(DCFL) src/main.cpp ./gen-cpp/Service.cpp gen-cpp/StressTest_types.cpp
66
67stress-test: stubs
68 g++ -o stress-test $(CFL) src/main.cpp ./gen-cpp/Service.cpp gen-cpp/StressTest_types.cpp
69
70clean:
71 rm -fr stress-test stress-test-nb gen-cpp