blob: 9d79541c584c74e39a6e7e366c63355f6f00ad68 [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 \
22 $(boost_home)
Marc Slemko3ea00332006-08-17 01:11:13 +000023
24include_flags = $(patsubst %,-I%, $(include_paths))
25
26# Tools
Aditya Agarwal3950f472006-10-11 02:50:15 +000027ifndef THRIFT
Mark Slee739dbe52007-02-01 22:55:30 +000028THRIFT = ../../compiler/cpp/thrift
Aditya Agarwal3950f472006-10-11 02:50:15 +000029endif # THRIFT
30
Marc Slemko3ea00332006-08-17 01:11:13 +000031CC = g++
32LD = g++
33
34# Compiler flags
Mark Sleee02385b2007-06-09 01:21:16 +000035DCFL = -Wall -O3 -g -I./gen-cpp $(include_flags) -L$(thrift_home)/lib/cpp/.libs -lthrift -lthriftnb -levent
36CFL = -Wall -O3 -I./gen-cpp $(include_flags) -L$(thrift_home)/lib/cpp/.libs -lthrift -lthriftnb -levent
Marc Slemko3ea00332006-08-17 01:11:13 +000037
Mark Sleee02385b2007-06-09 01:21:16 +000038all: stress-test stress-test-nb
Marc Slemko3ea00332006-08-17 01:11:13 +000039
Mark Sleee02385b2007-06-09 01:21:16 +000040debug: stress-test-debug stress-test-debug-nb
Marc Slemko3ea00332006-08-17 01:11:13 +000041
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
Mark Sleee02385b2007-06-09 01:21:16 +000045stress-test-debug-nb: stubs
46 g++ -o stress-test-nb $(DCFL) src/nb-main.cpp ./gen-cpp/Service.cpp gen-cpp/StressTest_types.cpp
47
48stress-test-nb: stubs
49 g++ -o stress-test-nb $(CFL) src/nb-main.cpp ./gen-cpp/Service.cpp gen-cpp/StressTest_types.cpp
50
Marc Slemko3ea00332006-08-17 01:11:13 +000051stress-test-debug: stubs
Mark Slee9a079272006-10-12 04:05:23 +000052 g++ -o stress-test $(DCFL) src/main.cpp ./gen-cpp/Service.cpp gen-cpp/StressTest_types.cpp
Marc Slemko3ea00332006-08-17 01:11:13 +000053
54stress-test: stubs
Mark Slee9a079272006-10-12 04:05:23 +000055 g++ -o stress-test $(CFL) src/main.cpp ./gen-cpp/Service.cpp gen-cpp/StressTest_types.cpp
Marc Slemko3ea00332006-08-17 01:11:13 +000056
57clean:
Mark Sleee02385b2007-06-09 01:21:16 +000058 rm -fr stress-test stress-test-nb gen-cpp