mirror of
https://github.com/valitydev/thrift.git
synced 2024-11-07 10:48:51 +00:00
0788a70568
Summary: libthriftnb is the one that requires libevent. It was really annoying that you always had to put -levent in your link step to build thrift programs when youa re not using any of the c++ nonblocking stuff. This way, if you're using nonblocking you can do that, but the normal case is easier to link. Reviewed By: makefile git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664951 13f79535-47bb-0310-9956-ffa450edef68
64 lines
1.5 KiB
Thrift
64 lines
1.5 KiB
Thrift
# Makefile for Thrift test project.
|
|
#
|
|
# Author:
|
|
# Mark Slee <mcslee@facebook.com>
|
|
|
|
# Default target is everything
|
|
|
|
ifndef thrift_home
|
|
thrift_home=../..
|
|
endif #thrift_home
|
|
|
|
target: all
|
|
|
|
ifndef boost_home
|
|
#boost_home=../../../../../thirdparty/boost_1_33_1
|
|
boost_home=/usr/local/include/boost-1_33_1
|
|
endif #boost_home
|
|
target: all
|
|
|
|
include_paths = $(thrift_home)/lib/cpp/src \
|
|
$(boost_home)
|
|
|
|
include_flags = $(patsubst %,-I%, $(include_paths))
|
|
|
|
# Tools
|
|
ifndef THRIFT
|
|
THRIFT = ../../compiler/cpp/thrift
|
|
endif # THRIFT
|
|
|
|
CC = g++
|
|
LD = g++
|
|
|
|
# Compiler flags
|
|
DCFL = -Wall -O3 -g -I./gen-cpp $(include_flags) -L$(thrift_home)/lib/cpp/.libs -lthrift -lthriftnb -levent
|
|
LFL = -L$(thrift_home)/lib/cpp/.libs -lthrift -lthriftnb -levent
|
|
CCFL = -Wall -O3 -I./gen-cpp $(include_flags)
|
|
CFL = $(CCFL) $(LFL)
|
|
|
|
all: server client
|
|
|
|
debug: server-debug client-debug
|
|
|
|
stubs: ../ThriftTest.thrift
|
|
$(THRIFT) --cpp ../ThriftTest.thrift
|
|
|
|
server-debug: stubs
|
|
g++ -o TestServer $(DCFL) src/TestServer.cpp ./gen-cpp/ThriftTest.cpp ./gen-cpp/ThriftTest_types.cpp
|
|
|
|
client-debug: stubs
|
|
g++ -o TestClient $(DCFL) src/TestClient.cpp ./gen-cpp/ThriftTest.cpp ./gen-cpp/ThriftTest_types.cpp
|
|
|
|
server: stubs
|
|
g++ -o TestServer $(CFL) src/TestServer.cpp ./gen-cpp/ThriftTest.cpp ./gen-cpp/ThriftTest_types.cpp
|
|
|
|
client: stubs
|
|
g++ -o TestClient $(CFL) src/TestClient.cpp ./gen-cpp/ThriftTest.cpp ./gen-cpp/ThriftTest_types.cpp
|
|
|
|
small:
|
|
$(THRIFT) -cpp ../SmallTest.thrift
|
|
g++ -c $(CCFL) ./gen-cpp/SmallService.cpp ./gen-cpp/SmallTest_types.cpp
|
|
|
|
clean:
|
|
rm -fr *.o TestServer TestClient gen-cpp
|