blob: 6c2244c403927c80c0863a55232801a88efb375b [file] [log] [blame]
Marc Slemko3ea00332006-08-17 01:11:13 +00001# Makefile for Thrift test project.
Mark Sleee02385b2007-06-09 01:21:16 +00002#
Marc Slemko3ea00332006-08-17 01:11:13 +00003# 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 \
Mark Sleee02385b2007-06-09 01:21:16 +000021 $(thrift_home)/lib/cpp \
David Reiss832b2622007-12-28 18:25:33 +000022 $(thrift_home)/ \
Mark Sleee02385b2007-06-09 01:21:16 +000023 $(boost_home)
Marc Slemko3ea00332006-08-17 01:11:13 +000024
25include_flags = $(patsubst %,-I%, $(include_paths))
26
27# Tools
Aditya Agarwal3950f472006-10-11 02:50:15 +000028ifndef THRIFT
Mark Slee739dbe52007-02-01 22:55:30 +000029THRIFT = ../../compiler/cpp/thrift
Aditya Agarwal3950f472006-10-11 02:50:15 +000030endif # THRIFT
31
Marc Slemko3ea00332006-08-17 01:11:13 +000032CC = g++
33LD = g++
34
35# Compiler flags
Mark Sleee02385b2007-06-09 01:21:16 +000036DCFL = -Wall -O3 -g -I./gen-cpp $(include_flags) -L$(thrift_home)/lib/cpp/.libs -lthrift -lthriftnb -levent
37CFL = -Wall -O3 -I./gen-cpp $(include_flags) -L$(thrift_home)/lib/cpp/.libs -lthrift -lthriftnb -levent
Marc Slemko3ea00332006-08-17 01:11:13 +000038
Mark Sleee02385b2007-06-09 01:21:16 +000039all: stress-test stress-test-nb
Marc Slemko3ea00332006-08-17 01:11:13 +000040
Mark Sleee02385b2007-06-09 01:21:16 +000041debug: stress-test-debug stress-test-debug-nb
Marc Slemko3ea00332006-08-17 01:11:13 +000042
Aditya Agarwal3950f472006-10-11 02:50:15 +000043stubs: ../StressTest.thrift
Mark Slee632f3232006-08-30 17:23:52 +000044 $(THRIFT) --cpp --php ../StressTest.thrift
Marc Slemko3ea00332006-08-17 01:11:13 +000045
Mark Sleee02385b2007-06-09 01:21:16 +000046stress-test-debug-nb: stubs
47 g++ -o stress-test-nb $(DCFL) src/nb-main.cpp ./gen-cpp/Service.cpp gen-cpp/StressTest_types.cpp
48
49stress-test-nb: stubs
50 g++ -o stress-test-nb $(CFL) src/nb-main.cpp ./gen-cpp/Service.cpp gen-cpp/StressTest_types.cpp
51
Marc Slemko3ea00332006-08-17 01:11:13 +000052stress-test-debug: stubs
Mark Slee9a079272006-10-12 04:05:23 +000053 g++ -o stress-test $(DCFL) src/main.cpp ./gen-cpp/Service.cpp gen-cpp/StressTest_types.cpp
Marc Slemko3ea00332006-08-17 01:11:13 +000054
55stress-test: stubs
Mark Slee9a079272006-10-12 04:05:23 +000056 g++ -o stress-test $(CFL) src/main.cpp ./gen-cpp/Service.cpp gen-cpp/StressTest_types.cpp
Marc Slemko3ea00332006-08-17 01:11:13 +000057
58clean:
Mark Sleee02385b2007-06-09 01:21:16 +000059 rm -fr stress-test stress-test-nb gen-cpp