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