blob: cbe8bb1a1aee704cca5373431939393291d10a35 [file] [log] [blame]
Marc Slemko3ea00332006-08-17 01:11:13 +00001# Makefile for Thrift test project.
2#
3# Author:
4# Marc Kwiatkowski <marc@facebook.com>
Aditya Agarwal3950f472006-10-11 02:50:15 +00005# Aditya Agarwal <aditya@facebook.com>
Marc Slemko3ea00332006-08-17 01:11:13 +00006
7
8ifndef thrift_home
Aditya Agarwal3950f472006-10-11 02:50:15 +00009thrift_home=../..
Marc Slemko3ea00332006-08-17 01:11:13 +000010endif #thrift_home
11
12target: all
13
Marc Slemko3ea00332006-08-17 01:11:13 +000014ifndef boost_home
Aditya Agarwal3950f472006-10-11 02:50:15 +000015#boost_home=../../../../../thirdparty/boost_1_33_1
16boost_home=/usr/local/include/boost-1_33_1
17endif #boost_home
Marc Slemko3ea00332006-08-17 01:11:13 +000018target: all
19
Aditya Agarwal3950f472006-10-11 02:50:15 +000020include_paths = $(thrift_home)/lib/cpp/src \
21 $(thrift_home)/lib/cpp \
Marc Slemko3ea00332006-08-17 01:11:13 +000022 $(boost_home)
23
24include_flags = $(patsubst %,-I%, $(include_paths))
25
26# Tools
Aditya Agarwal3950f472006-10-11 02:50:15 +000027ifndef THRIFT
28THRIFT = ../../compiler/cpp/bin/thrift
29endif # THRIFT
30
Marc Slemko3ea00332006-08-17 01:11:13 +000031CC = g++
32LD = g++
33
34# Compiler flags
Aditya Agarwal3950f472006-10-11 02:50:15 +000035DCFL = -Wall -O3 -g -I./gen-cpp $(include_flags) -L$(thrift_home)/lib/cpp/.libs -lthrift -levent
36CFL = -Wall -O3 -I./gen-cpp $(include_flags) -L$(thrift_home)/lib/cpp/.libs -lthrift -levent
Marc Slemko3ea00332006-08-17 01:11:13 +000037
38all: stress-test
39
40debug: stress-test-debug
41
Aditya Agarwal3950f472006-10-11 02:50:15 +000042stubs: ../StressTest.thrift
Mark Slee632f3232006-08-30 17:23:52 +000043 $(THRIFT) --cpp --php ../StressTest.thrift
Marc Slemko3ea00332006-08-17 01:11:13 +000044
45stress-test-debug: stubs
Aditya Agarwal3950f472006-10-11 02:50:15 +000046 g++ -o stress-test $(DCFL) src/main.cc ./gen-cpp/Service.cc gen-cpp/StressTest_types.cc
Marc Slemko3ea00332006-08-17 01:11:13 +000047
48stress-test: stubs
Aditya Agarwal3950f472006-10-11 02:50:15 +000049 g++ -o stress-test $(CFL) src/main.cc ./gen-cpp/Service.cc gen-cpp/StressTest_types.cc
Marc Slemko3ea00332006-08-17 01:11:13 +000050
51clean:
Aditya Agarwal3950f472006-10-11 02:50:15 +000052 rm -fr stress-test gen-cpp