Commit b279d076 authored by gejun's avatar gejun

Replace COMAKEs with Makefile

Change-Id: I2f3f4ee769e4b682690b97cf7aa7030d2bcd2eea
parent 66d2dccf
#edit-mode: -*- python -*-
#coding:gbk
WORKROOT('../../../')
import commands
getRevCommand='$(shell git rev-parse --short HEAD)'
CXXFLAGS('-O2 -g -pipe -Wall -W -Werror -fPIC -fstrict-aliasing -Wno-invalid-offsetof -Wno-unused-parameter -fno-omit-frame-pointer -std=c++0x -include brpc/config.h')
CFLAGS('-O2 -g -pipe -Wall -W -Werror -fPIC -fstrict-aliasing -Wno-unused-parameter -fno-omit-frame-pointer')
CPPFLAGS('-D__const__= -DNDEBUG -DUSE_SYMBOLIZE -DNO_TCMALLOC -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -DBRPC_REVISION=\\"%s\\"' % getRevCommand)
INCPATHS('.')
CONFIGS('third-64/gflags@gflags_2-0-0-100_PD_BL')
CONFIGS('third-64/protobuf@protobuf_2-4-1-1100_PD_BL')
CONFIGS('third-64/leveldb@leveldb_1-0-0-0_PD_BL') # rpcz
sources = [
"base/third_party/dmg_fp/g_fmt.cc",
"base/third_party/dmg_fp/dtoa_wrapper.cc",
"base/third_party/dmg_fp/dtoa.cc",
"base/third_party/dynamic_annotations/dynamic_annotations.c",
"base/third_party/icu/icu_utf.cc",
"base/third_party/superfasthash/superfasthash.c",
"base/third_party/modp_b64/modp_b64.cc",
"base/third_party/nspr/prtime.cc",
"base/third_party/symbolize/demangle.cc",
"base/third_party/symbolize/symbolize.cc",
"base/third_party/xdg_mime/xdgmime.c",
"base/third_party/xdg_mime/xdgmimealias.c",
"base/third_party/xdg_mime/xdgmimecache.c",
"base/third_party/xdg_mime/xdgmimeglob.c",
"base/third_party/xdg_mime/xdgmimeicon.c",
"base/third_party/xdg_mime/xdgmimeint.c",
"base/third_party/xdg_mime/xdgmimemagic.c",
"base/third_party/xdg_mime/xdgmimeparent.c",
"base/third_party/xdg_user_dirs/xdg_user_dir_lookup.cc",
"base/third_party/snappy/snappy-sinksource.cc",
"base/third_party/snappy/snappy-stubs-internal.cc",
"base/third_party/snappy/snappy.cc",
"base/third_party/murmurhash3/murmurhash3.cpp",
"base/allocator/type_profiler_control.cc",
"base/arena.cpp",
"base/at_exit.cc",
"base/atomicops_internals_x86_gcc.cc",
"base/barrier_closure.cc",
"base/base_paths.cc",
"base/base_paths_posix.cc",
"base/base64.cc",
"base/base_switches.cc",
"base/big_endian.cc",
"base/bind_helpers.cc",
"base/build_time.cc",
"base/callback_helpers.cc",
"base/callback_internal.cc",
"base/command_line.cc",
"base/cpu.cc",
"base/debug/alias.cc",
"base/debug/asan_invalid_access.cc",
"base/debug/crash_logging.cc",
"base/debug/debugger.cc",
"base/debug/debugger_posix.cc",
"base/debug/dump_without_crashing.cc",
"base/debug/proc_maps_linux.cc",
"base/debug/stack_trace.cc",
"base/debug/stack_trace_posix.cc",
"base/environment.cc",
"base/files/file.cc",
"base/files/file_posix.cc",
"base/files/file_enumerator.cc",
"base/files/file_enumerator_posix.cc",
"base/files/file_path.cc",
"base/files/file_path_constants.cc",
"base/files/memory_mapped_file.cc",
"base/files/memory_mapped_file_posix.cc",
"base/files/scoped_file.cc",
"base/files/scoped_temp_dir.cc",
"base/file_util.cc",
"base/file_util_linux.cc",
"base/file_util_posix.cc",
"base/guid.cc",
"base/guid_posix.cc",
"base/hash.cc",
"base/lazy_instance.cc",
"base/location.cc",
"base/md5.cc",
"base/memory/aligned_memory.cc",
"base/memory/ref_counted.cc",
"base/memory/ref_counted_memory.cc",
"base/memory/shared_memory_posix.cc",
"base/memory/singleton.cc",
"base/memory/weak_ptr.cc",
"base/nix/mime_util_xdg.cc",
"base/nix/xdg_util.cc",
"base/path_service.cc",
"base/posix/file_descriptor_shuffle.cc",
"base/posix/global_descriptors.cc",
"base/process/internal_linux.cc",
"base/process/kill.cc",
"base/process/kill_posix.cc",
"base/process/launch.cc",
"base/process/launch_posix.cc",
"base/process/memory.cc",
"base/process/memory_linux.cc",
"base/process/process_handle_linux.cc",
"base/process/process_handle_posix.cc",
"base/process/process_info_linux.cc",
"base/process/process_iterator.cc",
"base/process/process_iterator_linux.cc",
"base/process/process_linux.cc",
"base/process/process_metrics.cc",
"base/process/process_metrics_linux.cc",
"base/process/process_metrics_posix.cc",
"base/process/process_posix.cc",
"base/rand_util.cc",
"base/rand_util_posix.cc",
"base/fast_rand.cpp",
"base/safe_strerror_posix.cc",
"base/sha1_portable.cc",
"base/strings/latin1_string_conversions.cc",
"base/strings/nullable_string16.cc",
"base/strings/safe_sprintf.cc",
"base/strings/string16.cc",
"base/strings/string_number_conversions.cc",
"base/strings/string_split.cc",
"base/strings/string_piece.cc",
"base/strings/string_util.cc",
"base/strings/string_util_constants.cc",
"base/strings/stringprintf.cc",
"base/strings/sys_string_conversions_posix.cc",
"base/strings/utf_offset_string_conversions.cc",
"base/strings/utf_string_conversion_utils.cc",
"base/strings/utf_string_conversions.cc",
"base/synchronization/cancellation_flag.cc",
"base/synchronization/condition_variable_posix.cc",
"base/synchronization/waitable_event_posix.cc",
"base/sys_info.cc",
"base/sys_info_linux.cc",
"base/sys_info_posix.cc",
"base/threading/non_thread_safe_impl.cc",
"base/threading/platform_thread_linux.cc",
"base/threading/platform_thread_posix.cc",
"base/threading/simple_thread.cc",
"base/threading/thread_checker_impl.cc",
"base/threading/thread_collision_warner.cc",
"base/threading/thread_id_name_manager.cc",
"base/threading/thread_local_posix.cc",
"base/threading/thread_local_storage.cc",
"base/threading/thread_local_storage_posix.cc",
"base/threading/thread_restrictions.cc",
"base/threading/watchdog.cc",
"base/time/clock.cc",
"base/time/default_clock.cc",
"base/time/default_tick_clock.cc",
"base/time/tick_clock.cc",
"base/time/time.cc",
"base/time/time_posix.cc",
"base/version.cc",
"base/logging.cc",
"base/class_name.cpp",
"base/errno.cpp",
"base/find_cstr.cpp",
"base/status.cpp",
"base/string_printf.cpp",
"base/thread_local.cpp",
"base/unix_socket.cpp",
"base/endpoint.cpp",
"base/fd_utility.cpp",
"base/files/temp_file.cpp",
"base/files/file_watcher.cpp",
"base/time.cpp",
"base/zero_copy_stream_as_streambuf.cpp",
"base/crc32c.cc",
"base/containers/case_ignored_flat_map.cpp",
"base/iobuf.cpp"
]
LDFLAGS('-lpthread -lrt -lssl -lcrypto -ldl -lz')
def GenProtoCpp(filelist):
protoc_bin=ENV.WorkRoot() + "/third-64/protobuf/bin/protoc"
import commands
for path in filelist.split(' '):
part = path.partition('/')
removed_ext = os.path.splitext(path)[0]
cpp_path = removed_ext + '.pb.cc'
cmd = protoc_bin + \
' --proto_path=' + part[0] + \
' --proto_path=' + ENV.WorkRoot() + '/third-64/protobuf/include/' + \
' --cpp_out=. ' + path
commands.getoutput(cmd);
TARGET(cpp_path, Prefixes(path + ' ' + protoc_bin), ShellCommands(cmd), CleanFiles(''))
GenProtoCpp(GLOB('./*.proto'))
GenProtoCpp(GLOB('./brpc/*.proto'))
GenProtoCpp(GLOB('./brpc/policy/*.proto'))
StaticLibrary('base', Sources(' '.join(sources)))
StaticLibrary('bvar',Sources(GLOB('bvar/*.cpp bvar/detail/*.cpp')))
StaticLibrary('bthread', Sources(GLOB('bthread/*.cpp')))
StaticLibrary('json2pb', Sources(GLOB('json2pb/*.cpp')))
StaticLibrary('mcpack2pb', Sources(GLOB('mcpack2pb/*.cpp idl_options.pb.cc'),
HeaderFiles(GLOB('mcpack2pb/*.h'))) - Sources('mcpack2pb/generator.cpp'))
Application('protoc-gen-mcpack', Sources('mcpack2pb/generator.cpp'),
Libraries('libmcpack2pb.a libbase.a libbthread.a libbvar.a'))
StaticLibrary('brpc',
Sources(GLOB('brpc/*.cpp brpc/policy/*.cpp brpc/builtin/*.cpp brpc/details/*.cpp brpc/*.pb.cc brpc/policy/*.pb.cc'))
- Sources('brpc/policy/baidu_naming_service.cpp brpc/policy/giano_authenticator.cpp'))
TARGET('output/include', PhonyMode('true'), Prefixes('libbase.a libbvar.a libbthread.a libjson2pb.a libmcpack2pb.a libbrpc.a'),
ShellCommands("for dir in `find base bvar bthread brpc -type f -name \"*.h\" -exec dirname {} \\; | sort | uniq`; do mkdir -p output/include/$$dir && cp $$dir/*.h output/include/$$dir/; done; for dir in `find base bvar bthread brpc -type f -name \"*.hpp\" -exec dirname {} \\; | sort | uniq`; do mkdir -p output/include/$$dir && cp $$dir/*.hpp output/include/$$dir/; done"),
CleanFiles('output/include'))
This source diff could not be displayed because it is too large. You can view the blob instead.
#edit-mode: -*- python -*-
#coding:gbk
#注意:在此目录下你无法comake2 -UB,comake2会抱怨baidu-rpc是本目录的父节点,
#如果你要运行本项目,得先在baidu-rpc目录下comake2 -UB后回到本目录comake2 -P。
#你自己的项目不会有这个问题(因为不会是baidu-rpc的子目录)
#到代码树根目录的相对路径
WORKROOT('../../../../../')
#C++编译参数.
CPPFLAGS('-std=c++0x -g -DNDEBUG -O2 -pipe -W -Wall -Werror -fPIC -fno-omit-frame-pointer -Wno-deprecated -Wno-unused-parameter')
#在目前的版本中,只要用到baidu-rpc的项目都强烈建议加下面一行,以避免在gcc4下的误优化
CPPFLAGS('-D__const__=')
#为了方便本例通过comake2 -UB下载依赖,我们直接import上层baidu-rpc的依赖,
##在你自己的项目中,你得把下面三行改成CONFIGS('public/baidu-rpc@ci-base')
INCPATHS('../../')
LIBS(GLOB('../../output/lib/lib*.a'))
ImportConfigsFrom('../../')
#链接参数.
LDFLAGS('-lpthread -lrt -lssl -lcrypto -ldl -lz')
#这是支持.proto作为源文件必须的
PROTOC(ENV.WorkRoot() + "/third-64/protobuf/bin/protoc")
#可执行文件
Application('echo_client', Sources('echo.proto client.cpp'))
Application('echo_server', Sources('echo.proto server.cpp'))
CC=gcc
CXX=g++
CPPFLAGS=-std=c++0x -g -DNDEBUG -O2 -pipe -W -Wall -Werror -fPIC -fno-omit-frame-pointer -Wno-deprecated -Wno-unused-parameter -D__const__=
CXXFLAGS=$(CPPFLAGS)
CFLAGS=$(CPPFLAGS)
GFLAGS_PATH=../../../../../third-64/gflags
LEVELDB_PATH=../../../../../third-64/leveldb
PROTOBUF_PATH=../../../../../third-64/protobuf
BRPC_PATH=../../output
INCPATH=-I$(BRPC_PATH)/include -I$(GFLAGS_PATH)/include -I$(LEVELDB_PATH)/include -I$(PROTOBUF_PATH)/include
PROTOC=$(PROTOBUF_PATH)/bin/protoc
LIBS=$(BRPC_PATH)/lib/libbase.a \
$(BRPC_PATH)/lib/libbrpc.a \
$(BRPC_PATH)/lib/libbthread.a \
$(BRPC_PATH)/lib/libbvar.a \
$(BRPC_PATH)/lib/libjson2pb.a \
$(BRPC_PATH)/lib/libmcpack2pb.a \
$(GFLAGS_PATH)/lib/libgflags.a \
$(LEVELDB_PATH)/lib/libleveldb.a \
$(PROTOBUF_PATH)/lib/libprotobuf.a \
-lpthread \
-lrt \
-lssl \
-lcrypto \
-ldl \
-lz
CLIENT_SOURCES = client.cpp
SERVER_SOURCES = server.cpp
PROTOS = echo.proto
PROTO_OBJS = $(addsuffix .pb.o, $(basename $(PROTOS)))
PROTO_GENS = $(addsuffix .pb.h, $(basename $(PROTOS))) $(addsuffix .pb.cc, $(basename $(PROTOS)))
CLIENT_OBJS = $(addsuffix .o, $(basename $(CLIENT_SOURCES)))
SERVER_OBJS = $(addsuffix .o, $(basename $(SERVER_SOURCES)))
.PHONY:all
all: echo_client echo_server
.PHONY:clean
clean:
@echo "Cleaning"
@rm -rf echo_client echo_server $(PROTO_GENS) $(PROTO_OBJS) $(CLIENT_OBJS) $(SERVER_OBJS)
echo_client:$(PROTO_OBJS) $(CLIENT_OBJS)
@echo "Linking $@"
@$(CXX) -Xlinker "-(" $^ $(LIBS) -Xlinker "-)" -o $@
echo_server:$(PROTO_OBJS) $(SERVER_OBJS)
@echo "Linking $@"
@$(CXX) -Xlinker "-(" $^ $(LIBS) -Xlinker "-)" -o $@
%.pb.cc:%.proto
@echo "Generating $@"
@$(PROTOC) --cpp_out=. --proto_path=. $<
%.o:%.cpp
@echo "Compiling $@"
@$(CXX) -c $(INCPATH) $(CXXFLAGS) $< -o $@
%.o:%.cc
@echo "Compiling $@"
@$(CXX) -c $(INCPATH) $(CXXFLAGS) $< -o $@
#edit-mode: -*- python -*-
#coding:gbk
#注意:在此目录下你无法comake2 -UB,comake2会抱怨baidu-rpc是本目录的父节点,
#如果你要运行本项目,得先在baidu-rpc目录下comake2 -UB后回到本目录comake2 -P。
#你自己的项目不会有这个问题(因为不会是baidu-rpc的子目录)
#到代码树根目录的相对路径
WORKROOT('../../../../../')
#C++编译参数.
CPPFLAGS('-std=c++0x -g -DNDEBUG -O2 -pipe -W -Wall -Werror -fPIC -fno-omit-frame-pointer -Wno-deprecated -Wno-unused-parameter')
#在目前的版本中,只要用到baidu-rpc的项目都强烈建议加下面一行,以避免在gcc4下的误优化
CPPFLAGS('-D__const__=')
#为了方便本例通过comake2 -UB下载依赖,我们直接import上层baidu-rpc的依赖,
#在你自己的项目中,你得把下面三行改成CONFIGS('public/baidu-rpc@ci-base')
INCPATHS('../../')
LIBS(GLOB('../../output/lib/lib*.a'))
ImportConfigsFrom('../../')
#链接参数.
LDFLAGS('-lpthread -lrt -lssl -lcrypto -ldl -lz')
#这是支持.proto作为源文件必须的
PROTOC(ENV.WorkRoot() + "/third-64/protobuf/bin/protoc")
#可执行文件
Application('echo_client', Sources('echo.proto client.cpp'))
Application('echo_server', Sources('echo.proto server.cpp'))
CC=gcc
CXX=g++
CPPFLAGS=-std=c++0x -g -DNDEBUG -O2 -pipe -W -Wall -Werror -fPIC -fno-omit-frame-pointer -Wno-deprecated -Wno-unused-parameter -D__const__=
CXXFLAGS=$(CPPFLAGS)
CFLAGS=$(CPPFLAGS)
GFLAGS_PATH=../../../../../third-64/gflags
LEVELDB_PATH=../../../../../third-64/leveldb
PROTOBUF_PATH=../../../../../third-64/protobuf
BRPC_PATH=../../output
INCPATH=-I$(BRPC_PATH)/include -I$(GFLAGS_PATH)/include -I$(LEVELDB_PATH)/include -I$(PROTOBUF_PATH)/include
PROTOC=$(PROTOBUF_PATH)/bin/protoc
LIBS=$(BRPC_PATH)/lib/libbase.a \
$(BRPC_PATH)/lib/libbrpc.a \
$(BRPC_PATH)/lib/libbthread.a \
$(BRPC_PATH)/lib/libbvar.a \
$(BRPC_PATH)/lib/libjson2pb.a \
$(BRPC_PATH)/lib/libmcpack2pb.a \
$(GFLAGS_PATH)/lib/libgflags.a \
$(LEVELDB_PATH)/lib/libleveldb.a \
$(PROTOBUF_PATH)/lib/libprotobuf.a \
-lpthread \
-lrt \
-lssl \
-lcrypto \
-ldl \
-lz
CLIENT_SOURCES = client.cpp
SERVER_SOURCES = server.cpp
PROTOS = echo.proto
PROTO_OBJS = $(addsuffix .pb.o, $(basename $(PROTOS)))
PROTO_GENS = $(addsuffix .pb.h, $(basename $(PROTOS))) $(addsuffix .pb.cc, $(basename $(PROTOS)))
CLIENT_OBJS = $(addsuffix .o, $(basename $(CLIENT_SOURCES)))
SERVER_OBJS = $(addsuffix .o, $(basename $(SERVER_SOURCES)))
.PHONY:all
all: echo_client echo_server
.PHONY:clean
clean:
@echo "Cleaning"
@rm -rf echo_client echo_server $(PROTO_GENS) $(PROTO_OBJS) $(CLIENT_OBJS) $(SERVER_OBJS)
echo_client:$(PROTO_OBJS) $(CLIENT_OBJS)
@echo "Linking $@"
@$(CXX) -Xlinker "-(" $^ $(LIBS) -Xlinker "-)" -o $@
echo_server:$(PROTO_OBJS) $(SERVER_OBJS)
@echo "Linking $@"
@$(CXX) -Xlinker "-(" $^ $(LIBS) -Xlinker "-)" -o $@
%.pb.cc:%.proto
@echo "Generating $@"
@$(PROTOC) --cpp_out=. --proto_path=. $<
%.o:%.cpp
@echo "Compiling $@"
@$(CXX) -c $(INCPATH) $(CXXFLAGS) $< -o $@
%.o:%.cc
@echo "Compiling $@"
@$(CXX) -c $(INCPATH) $(CXXFLAGS) $< -o $@
#edit-mode: -*- python -*-
#coding:gbk
#注意:在此目录下你无法comake2 -UB,comake2会抱怨baidu-rpc是本目录的父节点,
#如果你要运行本项目,得先在baidu-rpc目录下comake2 -UB后回到本目录comake2 -P。
#你自己的项目不会有这个问题(因为不会是baidu-rpc的子目录)
#到代码树根目录的相对路径
WORKROOT('../../../../../')
#C++编译参数.
CPPFLAGS('-std=c++0x -g -DNDEBUG -O2 -pipe -W -Wall -Werror -fPIC -fno-omit-frame-pointer -Wno-deprecated -Wno-unused-parameter')
#在目前的版本中,只要用到baidu-rpc的项目都强烈建议加下面一行,以避免在gcc4下的误优化
CPPFLAGS('-D__const__=')
#为了方便本例通过comake2 -UB下载依赖,我们直接import上层baidu-rpc的依赖,
#在你自己的项目中,你得把下面三行改成CONFIGS('public/baidu-rpc@ci-base')
INCPATHS('../../')
LIBS(GLOB('../../output/lib/lib*.a'))
ImportConfigsFrom('../../')
#链接参数.
LDFLAGS('-lpthread -lrt -lssl -lcrypto -ldl -lz')
#这是支持.proto作为源文件必须的
PROTOC(ENV.WorkRoot() + "/third-64/protobuf/bin/protoc")
#可执行文件
Application('echo_client', Sources('echo.proto client.cpp'))
Application('echo_server', Sources('echo.proto server.cpp'))
CC=gcc
CXX=g++
CPPFLAGS=-std=c++0x -g -DNDEBUG -O2 -pipe -W -Wall -Werror -fPIC -fno-omit-frame-pointer -Wno-deprecated -Wno-unused-parameter -D__const__=
CXXFLAGS=$(CPPFLAGS)
CFLAGS=$(CPPFLAGS)
GFLAGS_PATH=../../../../../third-64/gflags
LEVELDB_PATH=../../../../../third-64/leveldb
PROTOBUF_PATH=../../../../../third-64/protobuf
BRPC_PATH=../../output
INCPATH=-I$(BRPC_PATH)/include -I$(GFLAGS_PATH)/include -I$(LEVELDB_PATH)/include -I$(PROTOBUF_PATH)/include
PROTOC=$(PROTOBUF_PATH)/bin/protoc
LIBS=$(BRPC_PATH)/lib/libbase.a \
$(BRPC_PATH)/lib/libbrpc.a \
$(BRPC_PATH)/lib/libbthread.a \
$(BRPC_PATH)/lib/libbvar.a \
$(BRPC_PATH)/lib/libjson2pb.a \
$(BRPC_PATH)/lib/libmcpack2pb.a \
$(GFLAGS_PATH)/lib/libgflags.a \
$(LEVELDB_PATH)/lib/libleveldb.a \
$(PROTOBUF_PATH)/lib/libprotobuf.a \
-lpthread \
-lrt \
-lssl \
-lcrypto \
-ldl \
-lz
CLIENT_SOURCES = client.cpp
SERVER_SOURCES = server.cpp
PROTOS = echo.proto
PROTO_OBJS = $(addsuffix .pb.o, $(basename $(PROTOS)))
PROTO_GENS = $(addsuffix .pb.h, $(basename $(PROTOS))) $(addsuffix .pb.cc, $(basename $(PROTOS)))
CLIENT_OBJS = $(addsuffix .o, $(basename $(CLIENT_SOURCES)))
SERVER_OBJS = $(addsuffix .o, $(basename $(SERVER_SOURCES)))
.PHONY:all
all: echo_client echo_server
.PHONY:clean
clean:
@echo "Cleaning"
@rm -rf echo_client echo_server $(PROTO_GENS) $(PROTO_OBJS) $(CLIENT_OBJS) $(SERVER_OBJS)
echo_client:$(PROTO_OBJS) $(CLIENT_OBJS)
@echo "Linking $@"
@$(CXX) -Xlinker "-(" $^ $(LIBS) -Xlinker "-)" -o $@
echo_server:$(PROTO_OBJS) $(SERVER_OBJS)
@echo "Linking $@"
@$(CXX) -Xlinker "-(" $^ $(LIBS) -Xlinker "-)" -o $@
%.pb.cc:%.proto
@echo "Generating $@"
@$(PROTOC) --cpp_out=. --proto_path=. $<
%.o:%.cpp
@echo "Compiling $@"
@$(CXX) -c $(INCPATH) $(CXXFLAGS) $< -o $@
%.o:%.cc
@echo "Compiling $@"
@$(CXX) -c $(INCPATH) $(CXXFLAGS) $< -o $@
#edit-mode: -*- python -*-
#coding:gbk
#注意:在此目录下你无法comake2 -UB,comake2会抱怨baidu-rpc是本目录的父节点,
#如果你要运行本项目,得先在baidu-rpc目录下comake2 -UB后回到本目录comake2 -P。
#你自己的项目不会有这个问题(因为不会是baidu-rpc的子目录)
#到代码树根目录的相对路径
WORKROOT('../../../../../')
#C++编译参数.
CPPFLAGS('-std=c++0x -g -DNDEBUG -O2 -pipe -W -Wall -Werror -fPIC -fno-omit-frame-pointer -Wno-deprecated -Wno-unused-parameter')
#在目前的版本中,只要用到baidu-rpc的项目都强烈建议加下面一行,以避免在gcc4下的误优化
CPPFLAGS('-D__const__=')
#为了方便本例通过comake2 -UB下载依赖,我们直接import上层baidu-rpc的依赖,
##在你自己的项目中,你得把下面三行改成CONFIGS('public/baidu-rpc@ci-base')
INCPATHS('../../')
LIBS(GLOB('../../output/lib/lib*.a'))
ImportConfigsFrom('../../')
#分别开启cpu profiler和heap profiler,后者要求使用tcmalloc
CPPFLAGS('-DBRPC_ENABLE_CPU_PROFILER -DBRPC_ENABLE_HEAP_PROFILER')
CONFIGS('third-64/tcmalloc@1.7.0.200',Libraries('lib/libtcmalloc_and_profiler.a'))
#链接参数.
LDFLAGS('-lpthread -lrt -lssl -lcrypto -ldl -lz')
#这是支持.proto作为源文件必须的
PROTOC(ENV.WorkRoot() + "/third-64/protobuf/bin/protoc")
#可执行文件
Application('echo_client', Sources('echo.proto client.cpp'))
Application('echo_server', Sources('echo.proto server.cpp'))
CC=gcc
CXX=g++
CPPFLAGS=-std=c++0x -g -DNDEBUG -O2 -pipe -W -Wall -Werror -fPIC -fno-omit-frame-pointer -Wno-deprecated -Wno-unused-parameter -D__const__= -DBRPC_ENABLE_CPU_PROFILER -DBRPC_ENABLE_HEAP_PROFILER
CXXFLAGS=$(CPPFLAGS)
CFLAGS=$(CPPFLAGS)
GFLAGS_PATH=../../../../../third-64/gflags
LEVELDB_PATH=../../../../../third-64/leveldb
PROTOBUF_PATH=../../../../../third-64/protobuf
TCMALLOC_PATH=../../../../../third-64/tcmalloc
BRPC_PATH=../../output
INCPATH=-I$(BRPC_PATH)/include -I$(GFLAGS_PATH)/include -I$(LEVELDB_PATH)/include -I$(PROTOBUF_PATH)/include -I$(TCMALLOC_PATH)/include
PROTOC=$(PROTOBUF_PATH)/bin/protoc
LIBS=$(BRPC_PATH)/lib/libbase.a \
$(BRPC_PATH)/lib/libbrpc.a \
$(BRPC_PATH)/lib/libbthread.a \
$(BRPC_PATH)/lib/libbvar.a \
$(BRPC_PATH)/lib/libjson2pb.a \
$(BRPC_PATH)/lib/libmcpack2pb.a \
$(GFLAGS_PATH)/lib/libgflags.a \
$(LEVELDB_PATH)/lib/libleveldb.a \
$(PROTOBUF_PATH)/lib/libprotobuf.a \
$(TCMALLOC_PATH)/lib/libtcmalloc_and_profiler.a \
-lpthread -lrt -lssl -lcrypto -ldl -lz
CLIENT_SOURCES = client.cpp
SERVER_SOURCES = server.cpp
PROTOS = echo.proto
PROTO_OBJS = $(addsuffix .pb.o, $(basename $(PROTOS)))
PROTO_GENS = $(addsuffix .pb.h, $(basename $(PROTOS))) $(addsuffix .pb.cc, $(basename $(PROTOS)))
CLIENT_OBJS = $(addsuffix .o, $(basename $(CLIENT_SOURCES)))
SERVER_OBJS = $(addsuffix .o, $(basename $(SERVER_SOURCES)))
.PHONY:all
all: echo_client echo_server
.PHONY:clean
clean:
@echo "Cleaning"
@rm -rf echo_client echo_server $(PROTO_GENS) $(PROTO_OBJS) $(CLIENT_OBJS) $(SERVER_OBJS)
echo_client:$(PROTO_OBJS) $(CLIENT_OBJS)
@echo "Linking $@"
@$(CXX) -Xlinker "-(" $^ $(LIBS) -Xlinker "-)" -o $@
echo_server:$(PROTO_OBJS) $(SERVER_OBJS)
@echo "Linking $@"
@$(CXX) -Xlinker "-(" $^ $(LIBS) -Xlinker "-)" -o $@
%.pb.cc:%.proto
@echo "Generating $@"
@$(PROTOC) --cpp_out=. --proto_path=. $<
%.o:%.cpp
@echo "Compiling $@"
@$(CXX) -c $(INCPATH) $(CXXFLAGS) $< -o $@
%.o:%.cc
@echo "Compiling $@"
@$(CXX) -c $(INCPATH) $(CXXFLAGS) $< -o $@
#edit-mode: -*- python -*-
#coding:gbk
#注意:在此目录下你无法comake2 -UB,comake2会抱怨baidu-rpc是本目录的父节点,
#如果你要运行本项目,得先在baidu-rpc目录下comake2 -UB后回到本目录comake2 -P。
#你自己的项目不会有这个问题(因为不会是baidu-rpc的子目录)
#到代码树根目录的相对路径
WORKROOT('../../../../../')
#C++编译参数.
CPPFLAGS('-std=c++0x -g -DNDEBUG -O2 -pipe -W -Wall -Werror -fPIC -fno-omit-frame-pointer -Wno-deprecated -Wno-unused-parameter')
#在目前的版本中,只要用到baidu-rpc的项目都强烈建议加下面一行,以避免在gcc4下的误优化
CPPFLAGS('-D__const__=')
#为了方便本例通过comake2 -UB下载依赖,我们直接import上层baidu-rpc的依赖,
#在你自己的项目中,你得把下面三行改成CONFIGS('public/baidu-rpc@ci-base')
INCPATHS('../../')
LIBS(GLOB('../../output/lib/lib*.a'))
ImportConfigsFrom('../../')
#分别开启cpu profiler和heap profiler,后者要求使用tcmalloc
CPPFLAGS('-DBRPC_ENABLE_CPU_PROFILER -DBRPC_ENABLE_HEAP_PROFILER')
CONFIGS('third-64/tcmalloc@1.7.0.200',Libraries('lib/libtcmalloc_and_profiler.a'))
#链接参数.
LDFLAGS('-lpthread -lrt -lssl -lcrypto -ldl -lz')
#这是支持.proto作为源文件必须的
PROTOC(ENV.WorkRoot() + "/third-64/protobuf/bin/protoc")
#可执行文件
Application('echo_client', Sources('echo.proto client.cpp'))
Application('echo_server', Sources('echo.proto server.cpp'))
CC=gcc
CXX=g++
CPPFLAGS=-std=c++0x -g -DNDEBUG -O2 -pipe -W -Wall -Werror -fPIC -fno-omit-frame-pointer -Wno-deprecated -Wno-unused-parameter -D__const__= -DBRPC_ENABLE_CPU_PROFILER -DBRPC_ENABLE_HEAP_PROFILER
CXXFLAGS=$(CPPFLAGS)
CFLAGS=$(CPPFLAGS)
GFLAGS_PATH=../../../../../third-64/gflags
LEVELDB_PATH=../../../../../third-64/leveldb
PROTOBUF_PATH=../../../../../third-64/protobuf
TCMALLOC_PATH=../../../../../third-64/tcmalloc
BRPC_PATH=../../output
INCPATH=-I$(BRPC_PATH)/include -I$(GFLAGS_PATH)/include -I$(LEVELDB_PATH)/include -I$(PROTOBUF_PATH)/include -I$(TCMALLOC_PATH)/include
PROTOC=$(PROTOBUF_PATH)/bin/protoc
LIBS=$(BRPC_PATH)/lib/libbase.a \
$(BRPC_PATH)/lib/libbrpc.a \
$(BRPC_PATH)/lib/libbthread.a \
$(BRPC_PATH)/lib/libbvar.a \
$(BRPC_PATH)/lib/libjson2pb.a \
$(BRPC_PATH)/lib/libmcpack2pb.a \
$(GFLAGS_PATH)/lib/libgflags.a \
$(LEVELDB_PATH)/lib/libleveldb.a \
$(PROTOBUF_PATH)/lib/libprotobuf.a \
$(TCMALLOC_PATH)/lib/libtcmalloc_and_profiler.a \
-lpthread -lrt -lssl -lcrypto -ldl -lz
CLIENT_SOURCES = client.cpp
SERVER_SOURCES = server.cpp
PROTOS = echo.proto
PROTO_OBJS = $(addsuffix .pb.o, $(basename $(PROTOS)))
PROTO_GENS = $(addsuffix .pb.h, $(basename $(PROTOS))) $(addsuffix .pb.cc, $(basename $(PROTOS)))
CLIENT_OBJS = $(addsuffix .o, $(basename $(CLIENT_SOURCES)))
SERVER_OBJS = $(addsuffix .o, $(basename $(SERVER_SOURCES)))
.PHONY:all
all: echo_client echo_server
.PHONY:clean
clean:
@echo "Cleaning"
@rm -rf echo_client echo_server $(PROTO_GENS) $(PROTO_OBJS) $(CLIENT_OBJS) $(SERVER_OBJS)
echo_client:$(PROTO_OBJS) $(CLIENT_OBJS)
@echo "Linking $@"
@$(CXX) -Xlinker "-(" $^ $(LIBS) -Xlinker "-)" -o $@
echo_server:$(PROTO_OBJS) $(SERVER_OBJS)
@echo "Linking $@"
@$(CXX) -Xlinker "-(" $^ $(LIBS) -Xlinker "-)" -o $@
%.pb.cc:%.proto
@echo "Generating $@"
@$(PROTOC) --cpp_out=. --proto_path=. $<
%.o:%.cpp
@echo "Compiling $@"
@$(CXX) -c $(INCPATH) $(CXXFLAGS) $< -o $@
%.o:%.cc
@echo "Compiling $@"
@$(CXX) -c $(INCPATH) $(CXXFLAGS) $< -o $@
CC=gcc
CXX=g++
CXXFLAGS=
CFLAGS=
CPPFLAGS=-std=c++0x \
-g \
-DNDEBUG \
-O2 \
-pipe \
-W \
-Wall \
-Werror \
-fPIC \
-fno-omit-frame-pointer \
-Wno-deprecated \
-Wno-unused-parameter \
-D__const__=
INCPATH=-I../../
CPPFLAGS=-std=c++0x -g -DNDEBUG -O2 -pipe -W -Wall -Werror -fPIC -fno-omit-frame-pointer -Wno-deprecated -Wno-unused-parameter -D__const__=
CXXFLAGS=$(CPPFLAGS)
CFLAGS=$(CPPFLAGS)
GFLAGS_PATH=../../../../../third-64/gflags
LEVELDB_PATH=../../../../../third-64/leveldb
PROTOBUF_PATH=../../../../../third-64/protobuf
DEP_INCPATH=-I$(GFLAGS_PATH)/include -I$(LEVELDB_PATH)/include -I$(PROTOBUF_PATH)/include
BRPC_PATH=../../output
INCPATH=-I$(BRPC_PATH)/include -I$(GFLAGS_PATH)/include -I$(LEVELDB_PATH)/include -I$(PROTOBUF_PATH)/include
PROTOC=$(PROTOBUF_PATH)/bin/protoc
LIBS=../../output/lib/libbase.a \
../../output/lib/libbrpc.a \
../../output/lib/libbthread.a \
../../output/lib/libbvar.a \
../../output/lib/libjson2pb.a \
../../output/lib/libmcpack2pb.a \
LIBS=$(BRPC_PATH)/lib/libbase.a \
$(BRPC_PATH)/lib/libbrpc.a \
$(BRPC_PATH)/lib/libbthread.a \
$(BRPC_PATH)/lib/libbvar.a \
$(BRPC_PATH)/lib/libjson2pb.a \
$(BRPC_PATH)/lib/libmcpack2pb.a \
$(GFLAGS_PATH)/lib/libgflags.a \
$(LEVELDB_PATH)/lib/libleveldb.a \
$(PROTOBUF_PATH)/lib/libprotobuf.a \
......@@ -37,33 +25,39 @@ LIBS=../../output/lib/libbase.a \
-ldl \
-lz
CLIENT_SOURCES = client.cpp
SERVER_SOURCES = server.cpp
PROTOS = echo.proto
PROTO_OBJS = $(addsuffix .pb.o, $(basename $(PROTOS)))
PROTO_GENS = $(addsuffix .pb.h, $(basename $(PROTOS))) $(addsuffix .pb.cc, $(basename $(PROTOS)))
CLIENT_OBJS = $(addsuffix .o, $(basename $(CLIENT_SOURCES)))
SERVER_OBJS = $(addsuffix .o, $(basename $(SERVER_SOURCES)))
.PHONY:all
all: echo_client echo_server
.PHONY:clean
clean:
rm -rf echo_client
rm -rf echo_server
rm -rf echo.pb.cc
rm -rf echo.pb.h
rm -rf echo.pb.o
rm -rf client.o
rm -rf server.o
echo_client:echo.pb.o client.o
$(CXX) echo.pb.o client.o -Xlinker "-(" $(LIBS) -Xlinker "-)" -o echo_client
@echo "Cleaning"
@rm -rf echo_client echo_server $(PROTO_GENS) $(PROTO_OBJS) $(CLIENT_OBJS) $(SERVER_OBJS)
echo_server:echo.pb.o server.o
$(CXX) echo.pb.o server.o -Xlinker "-(" $(LIBS) -Xlinker "-)" -o echo_server
echo_client:$(PROTO_OBJS) $(CLIENT_OBJS)
@echo "Linking $@"
@$(CXX) -Xlinker "-(" $^ $(LIBS) -Xlinker "-)" -o $@
echo.pb.o:echo.pb.cc
$(CXX) -c $(INCPATH) $(DEP_INCPATH) $(CPPFLAGS) $(CXXFLAGS) -o echo.pb.o echo.pb.cc
echo_server:$(PROTO_OBJS) $(SERVER_OBJS)
@echo "Linking $@"
@$(CXX) -Xlinker "-(" $^ $(LIBS) -Xlinker "-)" -o $@
echo.pb.cc echo.pb.h:echo.proto
$(PROTOC) --cpp_out=. --proto_path=. echo.proto
%.pb.cc:%.proto
@echo "Generating $@"
@$(PROTOC) --cpp_out=. --proto_path=. $<
client.o:client.cpp
$(CXX) -c $(INCPATH) $(DEP_INCPATH) $(CPPFLAGS) $(CXXFLAGS) -o client.o client.cpp
%.o:%.cpp
@echo "Compiling $@"
@$(CXX) -c $(INCPATH) $(CXXFLAGS) $< -o $@
server.o:server.cpp
$(CXX) -c $(INCPATH) $(DEP_INCPATH) $(CPPFLAGS) $(CXXFLAGS) -o server.o server.cpp
%.o:%.cc
@echo "Compiling $@"
@$(CXX) -c $(INCPATH) $(CXXFLAGS) $< -o $@
#edit-mode: -*- python -*-
#coding:gbk
#注意:在此目录下你无法comake2 -UB,comake2会抱怨baidu-rpc是本目录的父节点,
#如果你要运行本项目,得先在baidu-rpc目录下comake2 -UB后回到本目录comake2 -P。
#你自己的项目不会有这个问题(因为不会是baidu-rpc的子目录)
#到代码树根目录的相对路径
WORKROOT('../../../../../')
#C++编译参数.
CPPFLAGS('-std=c++0x -g -DNDEBUG -O2 -pipe -W -Wall -Werror -fPIC -fno-omit-frame-pointer -Wno-deprecated -Wno-unused-parameter')
#在目前的版本中,只要用到baidu-rpc的项目都强烈建议加下面一行,以避免在gcc4下的误优化
CPPFLAGS('-D__const__=')
#为了方便本例通过comake2 -UB下载依赖,我们直接import上层baidu-rpc的依赖,
#在你自己的项目中,你得把下面三行改成CONFIGS('public/baidu-rpc@ci-base')
INCPATHS('../../')
LIBS(GLOB('../../output/lib/lib*.a'))
ImportConfigsFrom('../../')
#链接参数.
LDFLAGS('-lpthread -lrt -lssl -lcrypto -ldl -lz')
#这是支持.proto作为源文件必须的
PROTOC(ENV.WorkRoot() + "/third-64/protobuf/bin/protoc")
#可执行文件
Application('echo_client', Sources('echo.proto client.cpp'))
Application('echo_server', Sources('echo.proto server.cpp'))
CC=gcc
CXX=g++
CPPFLAGS=-std=c++0x -g -DNDEBUG -O2 -pipe -W -Wall -Werror -fPIC -fno-omit-frame-pointer -Wno-deprecated -Wno-unused-parameter -D__const__=
CXXFLAGS=$(CPPFLAGS)
CFLAGS=$(CPPFLAGS)
GFLAGS_PATH=../../../../../third-64/gflags
LEVELDB_PATH=../../../../../third-64/leveldb
PROTOBUF_PATH=../../../../../third-64/protobuf
BRPC_PATH=../../output
INCPATH=-I$(BRPC_PATH)/include -I$(GFLAGS_PATH)/include -I$(LEVELDB_PATH)/include -I$(PROTOBUF_PATH)/include
PROTOC=$(PROTOBUF_PATH)/bin/protoc
LIBS=$(BRPC_PATH)/lib/libbase.a \
$(BRPC_PATH)/lib/libbrpc.a \
$(BRPC_PATH)/lib/libbthread.a \
$(BRPC_PATH)/lib/libbvar.a \
$(BRPC_PATH)/lib/libjson2pb.a \
$(BRPC_PATH)/lib/libmcpack2pb.a \
$(GFLAGS_PATH)/lib/libgflags.a \
$(LEVELDB_PATH)/lib/libleveldb.a \
$(PROTOBUF_PATH)/lib/libprotobuf.a \
-lpthread \
-lrt \
-lssl \
-lcrypto \
-ldl \
-lz
CLIENT_SOURCES = client.cpp
SERVER_SOURCES = server.cpp
PROTOS = echo.proto
PROTO_OBJS = $(addsuffix .pb.o, $(basename $(PROTOS)))
PROTO_GENS = $(addsuffix .pb.h, $(basename $(PROTOS))) $(addsuffix .pb.cc, $(basename $(PROTOS)))
CLIENT_OBJS = $(addsuffix .o, $(basename $(CLIENT_SOURCES)))
SERVER_OBJS = $(addsuffix .o, $(basename $(SERVER_SOURCES)))
.PHONY:all
all: echo_client echo_server
.PHONY:clean
clean:
@echo "Cleaning"
@rm -rf echo_client echo_server $(PROTO_GENS) $(PROTO_OBJS) $(CLIENT_OBJS) $(SERVER_OBJS)
echo_client:$(PROTO_OBJS) $(CLIENT_OBJS)
@echo "Linking $@"
@$(CXX) -Xlinker "-(" $^ $(LIBS) -Xlinker "-)" -o $@
echo_server:$(PROTO_OBJS) $(SERVER_OBJS)
@echo "Linking $@"
@$(CXX) -Xlinker "-(" $^ $(LIBS) -Xlinker "-)" -o $@
%.pb.cc:%.proto
@echo "Generating $@"
@$(PROTOC) --cpp_out=. --proto_path=. $<
%.o:%.cpp
@echo "Compiling $@"
@$(CXX) -c $(INCPATH) $(CXXFLAGS) $< -o $@
%.o:%.cc
@echo "Compiling $@"
@$(CXX) -c $(INCPATH) $(CXXFLAGS) $< -o $@
#edit-mode: -*- python -*-
#coding:gbk
#注意:在此目录下你无法comake2 -UB,comake2会抱怨baidu-rpc是本目录的父节点,
#如果你要运行本项目,得先在baidu-rpc目录下comake2 -UB后回到本目录comake2 -P。
#你自己的项目不会有这个问题(因为不会是baidu-rpc的子目录)
#到代码树根目录的相对路径
WORKROOT('../../../../../')
#C++编译参数.
CPPFLAGS('-std=c++0x -g -DNDEBUG -O2 -pipe -W -Wall -Werror -fPIC -fno-omit-frame-pointer -Wno-deprecated -Wno-unused-parameter')
#在目前的版本中,只要用到baidu-rpc的项目都强烈建议加下面一行,以避免在gcc4下的误优化
CPPFLAGS('-D__const__=')
#为了方便本例通过comake2 -UB下载依赖,我们直接import上层baidu-rpc的依赖,
##在你自己的项目中,你得把下面三行改成CONFIGS('public/baidu-rpc@ci-base')
INCPATHS('../../')
LIBS(GLOB('../../output/lib/lib*.a'))
ImportConfigsFrom('../../')
#链接参数.
LDFLAGS('-lpthread -lrt -lssl -lcrypto -ldl -lz')
#这是支持.proto作为源文件必须的
PROTOC(ENV.WorkRoot() + "/third-64/protobuf/bin/protoc")
#可执行文件
Application('echo_client', Sources('echo.proto client.cpp'))
Application('echo_server', Sources('echo.proto server.cpp'))
CC=gcc
CXX=g++
CPPFLAGS=-std=c++0x -g -DNDEBUG -O2 -pipe -W -Wall -Werror -fPIC -fno-omit-frame-pointer -Wno-deprecated -Wno-unused-parameter -D__const__=
CXXFLAGS=$(CPPFLAGS)
CFLAGS=$(CPPFLAGS)
GFLAGS_PATH=../../../../../third-64/gflags
LEVELDB_PATH=../../../../../third-64/leveldb
PROTOBUF_PATH=../../../../../third-64/protobuf
BRPC_PATH=../../output
INCPATH=-I$(BRPC_PATH)/include -I$(GFLAGS_PATH)/include -I$(LEVELDB_PATH)/include -I$(PROTOBUF_PATH)/include
PROTOC=$(PROTOBUF_PATH)/bin/protoc
LIBS=$(BRPC_PATH)/lib/libbase.a \
$(BRPC_PATH)/lib/libbrpc.a \
$(BRPC_PATH)/lib/libbthread.a \
$(BRPC_PATH)/lib/libbvar.a \
$(BRPC_PATH)/lib/libjson2pb.a \
$(BRPC_PATH)/lib/libmcpack2pb.a \
$(GFLAGS_PATH)/lib/libgflags.a \
$(LEVELDB_PATH)/lib/libleveldb.a \
$(PROTOBUF_PATH)/lib/libprotobuf.a \
-lpthread \
-lrt \
-lssl \
-lcrypto \
-ldl \
-lz
CLIENT_SOURCES = client.cpp
SERVER_SOURCES = server.cpp
PROTOS = echo.proto
PROTO_OBJS = $(addsuffix .pb.o, $(basename $(PROTOS)))
PROTO_GENS = $(addsuffix .pb.h, $(basename $(PROTOS))) $(addsuffix .pb.cc, $(basename $(PROTOS)))
CLIENT_OBJS = $(addsuffix .o, $(basename $(CLIENT_SOURCES)))
SERVER_OBJS = $(addsuffix .o, $(basename $(SERVER_SOURCES)))
.PHONY:all
all: echo_client echo_server
.PHONY:clean
clean:
@echo "Cleaning"
@rm -rf echo_client echo_server $(PROTO_GENS) $(PROTO_OBJS) $(CLIENT_OBJS) $(SERVER_OBJS)
echo_client:$(PROTO_OBJS) $(CLIENT_OBJS)
@echo "Linking $@"
@$(CXX) -Xlinker "-(" $^ $(LIBS) -Xlinker "-)" -o $@
echo_server:$(PROTO_OBJS) $(SERVER_OBJS)
@echo "Linking $@"
@$(CXX) -Xlinker "-(" $^ $(LIBS) -Xlinker "-)" -o $@
%.pb.cc:%.proto
@echo "Generating $@"
@$(PROTOC) --cpp_out=. --proto_path=. $<
%.o:%.cpp
@echo "Compiling $@"
@$(CXX) -c $(INCPATH) $(CXXFLAGS) $< -o $@
%.o:%.cc
@echo "Compiling $@"
@$(CXX) -c $(INCPATH) $(CXXFLAGS) $< -o $@
#edit-mode: -*- python -*-
#coding:gbk
#到代码树根目录的相对路径
WORKROOT('../../../../../')
#C++编译参数.
CPPFLAGS('-std=c++0x -g -DNDEBUG -O2 -pipe -W -Wall -Werror -fPIC -fno-omit-frame-pointer -Wno-deprecated -Wno-unused-parameter')
#在目前的版本中,只要用到baidu-rpc的项目都强烈建议加下面一行,以避免在gcc4下的误优化
CPPFLAGS('-D__const__=')
#为了方便本例通过comake2 -UB下载依赖,我们直接import上层baidu-rpc的依赖,
#在你自己的项目中,你得把下面三行改成: CONFIGS('public/baidu-rpc@ci-base')
INCPATHS('../../')
LIBS(GLOB('../../output/lib/lib*.a'))
ImportConfigsFrom('../../')
#链接参数.
LDFLAGS('-lpthread -lrt -lssl -lcrypto -ldl -lz')
PROTOC(ENV.WorkRoot()+"/third-64/protobuf/bin/protoc")
PROTOFLAGS("--plugin=protoc-gen-mcpack=../../protoc-gen-mcpack --mcpack_out=.")
PROTOFLAGS('--proto_path=../../')
PROTOFLAGS('--proto_path=' + ENV.WorkRoot() + '/third-64/protobuf/include/')
#可执行文件
Application('echo_client', Sources('client.cpp echo.proto'))
Application('echo_server', Sources('server.cpp echo.proto'))
CC=gcc
CXX=g++
CPPFLAGS=-std=c++0x -g -DNDEBUG -O2 -pipe -W -Wall -Werror -fPIC -fno-omit-frame-pointer -Wno-deprecated -Wno-unused-parameter -D__const__= -DBRPC_ENABLE_CPU_PROFILER -DBRPC_ENABLE_HEAP_PROFILER
CXXFLAGS=$(CPPFLAGS)
CFLAGS=$(CPPFLAGS)
GFLAGS_PATH=../../../../../third-64/gflags
LEVELDB_PATH=../../../../../third-64/leveldb
PROTOBUF_PATH=../../../../../third-64/protobuf
TCMALLOC_PATH=../../../../../third-64/tcmalloc
BRPC_PATH=../../output
INCPATH=-I$(BRPC_PATH)/include -I$(GFLAGS_PATH)/include -I$(LEVELDB_PATH)/include -I$(PROTOBUF_PATH)/include -I$(TCMALLOC_PATH)/include
PROTOC=$(PROTOBUF_PATH)/bin/protoc
LIBS=$(BRPC_PATH)/lib/libbase.a \
$(BRPC_PATH)/lib/libbrpc.a \
$(BRPC_PATH)/lib/libbthread.a \
$(BRPC_PATH)/lib/libbvar.a \
$(BRPC_PATH)/lib/libjson2pb.a \
$(BRPC_PATH)/lib/libmcpack2pb.a \
$(GFLAGS_PATH)/lib/libgflags.a \
$(LEVELDB_PATH)/lib/libleveldb.a \
$(PROTOBUF_PATH)/lib/libprotobuf.a \
$(TCMALLOC_PATH)/lib/libtcmalloc_and_profiler.a \
-lpthread \
-lrt \
-lssl \
-lcrypto \
-ldl \
-lz
CLIENT_SOURCES = client.cpp
SERVER_SOURCES = server.cpp
PROTOS = echo.proto
PROTO_OBJS = $(addsuffix .pb.o, $(basename $(PROTOS)))
PROTO_GENS = $(addsuffix .pb.h, $(basename $(PROTOS))) $(addsuffix .pb.cc, $(basename $(PROTOS)))
CLIENT_OBJS = $(addsuffix .o, $(basename $(CLIENT_SOURCES)))
SERVER_OBJS = $(addsuffix .o, $(basename $(SERVER_SOURCES)))
.PHONY:all
all: echo_client echo_server
.PHONY:clean
clean:
@echo "Cleaning"
@rm -rf echo_client echo_server $(PROTO_GENS) $(PROTO_OBJS) $(CLIENT_OBJS) $(SERVER_OBJS)
echo_client:$(PROTO_OBJS) $(CLIENT_OBJS)
@echo "Linking $@"
@$(CXX) -Xlinker "-(" $^ $(LIBS) -Xlinker "-)" -o $@
echo_server:$(PROTO_OBJS) $(SERVER_OBJS)
@echo "Linking $@"
@$(CXX) -Xlinker "-(" $^ $(LIBS) -Xlinker "-)" -o $@
%.pb.cc:%.proto
@echo "Generating $@"
@$(PROTOC) --plugin=protoc-gen-mcpack=$(BRPC_PATH)/bin/protoc-gen-mcpack --proto_path=. --proto_path=$(BRPC_PATH)/include --proto_path=$(PROTOBUF_PATH)/include --cpp_out=. --mcpack_out=. $<
%.o:%.cpp
@echo "Compiling $@"
@$(CXX) -c $(INCPATH) $(CXXFLAGS) $< -o $@
%.o:%.cc
@echo "Compiling $@"
@$(CXX) -c $(INCPATH) $(CXXFLAGS) $< -o $@
#edit-mode: -*- python -*-
#coding:gbk
#注意:在此目录下你无法comake2 -UB,comake2会抱怨baidu-rpc是本目录的父节点,
#如果你要运行本项目,得先在baidu-rpc目录下comake2 -UB后回到本目录comake2 -P。
#你自己的项目不会有这个问题(因为不会是baidu-rpc的子目录)
#到代码树根目录的相对路径
WORKROOT('../../../../../')
#C++编译参数.
CPPFLAGS('-std=c++0x -g -DNDEBUG -O2 -pipe -W -Wall -Werror -fPIC -fno-omit-frame-pointer -Wno-deprecated -Wno-unused-parameter')
#在目前的版本中,只要用到baidu-rpc的项目都强烈建议加下面一行,以避免在gcc4下的误优化
CPPFLAGS('-D__const__=')
#为了方便本例通过comake2 -UB下载依赖,我们直接import上层baidu-rpc的依赖,
##在你自己的项目中,你得把下面三行改成CONFIGS('public/baidu-rpc@ci-base')
INCPATHS('../../')
LIBS(GLOB('../../output/lib/lib*.a'))
ImportConfigsFrom('../../')
#分别开启cpu profiler和heap profiler,后者要求使用tcmalloc
CPPFLAGS('-DBRPC_ENABLE_CPU_PROFILER -DBRPC_ENABLE_HEAP_PROFILER')
CONFIGS('third-64/tcmalloc@1.7.0.200',Libraries('lib/libtcmalloc_and_profiler.a'))
#若要开启HTTPS,建议静态链接1.0.2h以上版本的openssl,
#同时编译public/baidu-rpc和自己的Application,确保没有安全漏洞.
#CONFIGS('third-64/openssl@1.0.2.6123')
#链接参数,静态链接openssl时,务必去除-lssl -lcrypto.
LDFLAGS('-lpthread -lssl -lcrypto -lrt -ldl -lz')
#这是支持.proto作为源文件必须的
PROTOC(ENV.WorkRoot() + "/third-64/protobuf/bin/protoc")
#可执行文件
Application('http_client', Sources('http_client.cpp'))
Application('benchmark_http', Sources('benchmark_http.cpp'))
Application('http_server', Sources('http.proto http_server.cpp'))
CC=gcc
CXX=g++
CPPFLAGS=-std=c++0x -g -DNDEBUG -O2 -pipe -W -Wall -Werror -fPIC -fno-omit-frame-pointer -Wno-deprecated -Wno-unused-parameter -D__const__= -DBRPC_ENABLE_CPU_PROFILER -DBRPC_ENABLE_HEAP_PROFILER
CXXFLAGS=$(CPPFLAGS)
CFLAGS=$(CPPFLAGS)
GFLAGS_PATH=../../../../../third-64/gflags
LEVELDB_PATH=../../../../../third-64/leveldb
PROTOBUF_PATH=../../../../../third-64/protobuf
TCMALLOC_PATH=../../../../../third-64/tcmalloc
BRPC_PATH=../../output
INCPATH=-I$(BRPC_PATH)/include -I$(GFLAGS_PATH)/include -I$(LEVELDB_PATH)/include -I$(PROTOBUF_PATH)/include -I$(TCMALLOC_PATH)/include
PROTOC=$(PROTOBUF_PATH)/bin/protoc
LIBS=$(BRPC_PATH)/lib/libbase.a \
$(BRPC_PATH)/lib/libbrpc.a \
$(BRPC_PATH)/lib/libbthread.a \
$(BRPC_PATH)/lib/libbvar.a \
$(BRPC_PATH)/lib/libjson2pb.a \
$(BRPC_PATH)/lib/libmcpack2pb.a \
$(GFLAGS_PATH)/lib/libgflags.a \
$(LEVELDB_PATH)/lib/libleveldb.a \
$(PROTOBUF_PATH)/lib/libprotobuf.a \
$(TCMALLOC_PATH)/lib/libtcmalloc_and_profiler.a \
-lpthread -lrt -lssl -lcrypto -ldl -lz
CLIENT_SOURCES = http_client.cpp
BENCHMARK_SOURCES = benchmark_http.cpp
SERVER_SOURCES = http_server.cpp
PROTOS = http.proto
PROTO_OBJS = $(addsuffix .pb.o, $(basename $(PROTOS)))
PROTO_GENS = $(addsuffix .pb.h, $(basename $(PROTOS))) $(addsuffix .pb.cc, $(basename $(PROTOS)))
CLIENT_OBJS = $(addsuffix .o, $(basename $(CLIENT_SOURCES)))
BENCHMARK_OBJS = $(addsuffix .o, $(basename $(BENCHMARK_SOURCES)))
SERVER_OBJS = $(addsuffix .o, $(basename $(SERVER_SOURCES)))
.PHONY:all
all: http_client benchmark_http http_server
.PHONY:clean
clean:
@echo "Cleaning"
@rm -rf http_client benchmark_http http_server $(PROTO_GENS) $(PROTO_OBJS) $(CLIENT_OBJS) $(BENCHMARK_OBJS) $(SERVER_OBJS)
http_client:$(CLIENT_OBJS)
@echo "Linking $@"
@$(CXX) -Xlinker "-(" $^ $(LIBS) -Xlinker "-)" -o $@
benchmark_http:$(BENCHMARK_OBJS)
@echo "Linking $@"
@$(CXX) -Xlinker "-(" $^ $(LIBS) -Xlinker "-)" -o $@
http_server:$(PROTO_OBJS) $(SERVER_OBJS)
@echo "Linking $@"
@$(CXX) -Xlinker "-(" $^ $(LIBS) -Xlinker "-)" -o $@
%.pb.cc:%.proto
@echo "Generating $@"
@$(PROTOC) --cpp_out=. --proto_path=. $<
%.o:%.cpp
@echo "Compiling $@"
@$(CXX) -c $(INCPATH) $(CXXFLAGS) $< -o $@
%.o:%.cc
@echo "Compiling $@"
@$(CXX) -c $(INCPATH) $(CXXFLAGS) $< -o $@
#edit-mode: -*- python -*-
#coding:gbk
#注意:在此目录下你无法comake2 -UB,comake2会抱怨baidu-rpc是本目录的父节点,
#如果你要运行本项目,得先在baidu-rpc目录下comake2 -UB后回到本目录comake2 -P。
#你自己的项目不会有这个问题(因为不会是baidu-rpc的子目录)
#到代码树根目录的相对路径
WORKROOT('../../../../../')
#C++编译参数.
CPPFLAGS('-std=c++0x -g -DNDEBUG -O2 -pipe -W -Wall -Werror -fPIC -fno-omit-frame-pointer -Wno-deprecated -Wno-unused-parameter')
#在目前的版本中,只要用到baidu-rpc的项目都强烈建议加下面一行,以避免在gcc4下的误优化
CPPFLAGS('-D__const__=')
#为了方便本例通过comake2 -UB下载依赖,我们直接import上层baidu-rpc的依赖,
#在你自己的项目中,你得把下面三行改成CONFIGS('public/baidu-rpc@ci-base')
INCPATHS('../../')
LIBS(GLOB('../../output/lib/lib*.a'))
ImportConfigsFrom('../../')
#分别开启cpu profiler和heap profiler,后者要求使用tcmalloc
#CPPFLAGS('-DBRPC_ENABLE_CPU_PROFILER -DBRPC_ENABLE_HEAP_PROFILER')
CONFIGS('third-64/tcmalloc@1.7.0.200',Libraries('lib/libtcmalloc_and_profiler.a'))
#链接参数.
LDFLAGS('-lpthread -lrt -lssl -lcrypto -ldl -lz')
#可执行文件
Application('memcache_client', Sources('client.cpp'))
CC=gcc
CXX=g++
CPPFLAGS=-std=c++0x -g -DNDEBUG -O2 -pipe -W -Wall -Werror -fPIC -fno-omit-frame-pointer -Wno-deprecated -Wno-unused-parameter -D__const__= -DBRPC_ENABLE_CPU_PROFILER -DBRPC_ENABLE_HEAP_PROFILER
CXXFLAGS=$(CPPFLAGS)
CFLAGS=$(CPPFLAGS)
GFLAGS_PATH=../../../../../third-64/gflags
LEVELDB_PATH=../../../../../third-64/leveldb
PROTOBUF_PATH=../../../../../third-64/protobuf
TCMALLOC_PATH=../../../../../third-64/tcmalloc
BRPC_PATH=../../output
INCPATH=-I$(BRPC_PATH)/include -I$(GFLAGS_PATH)/include -I$(LEVELDB_PATH)/include -I$(PROTOBUF_PATH)/include -I$(TCMALLOC_PATH)/include
PROTOC=$(PROTOBUF_PATH)/bin/protoc
LIBS=$(BRPC_PATH)/lib/libbase.a \
$(BRPC_PATH)/lib/libbrpc.a \
$(BRPC_PATH)/lib/libbthread.a \
$(BRPC_PATH)/lib/libbvar.a \
$(BRPC_PATH)/lib/libjson2pb.a \
$(BRPC_PATH)/lib/libmcpack2pb.a \
$(GFLAGS_PATH)/lib/libgflags.a \
$(LEVELDB_PATH)/lib/libleveldb.a \
$(PROTOBUF_PATH)/lib/libprotobuf.a \
$(TCMALLOC_PATH)/lib/libtcmalloc_and_profiler.a \
-lpthread -lrt -lssl -lcrypto -ldl -lz
CLIENT_SOURCES = client.cpp
CLIENT_OBJS = $(addsuffix .o, $(basename $(CLIENT_SOURCES)))
.PHONY:all
all: memcache_client
.PHONY:clean
clean:
@echo "Cleaning"
@rm -rf memcache_client $(CLIENT_OBJS)
memcache_client:$(CLIENT_OBJS)
@echo "Linking $@"
@$(CXX) -Xlinker "-(" $^ $(LIBS) -Xlinker "-)" -o $@
%.o:%.cpp
@echo "Compiling $@"
@$(CXX) -c $(INCPATH) $(CXXFLAGS) $< -o $@
%.o:%.cc
@echo "Compiling $@"
@$(CXX) -c $(INCPATH) $(CXXFLAGS) $< -o $@
#edit-mode: -*- python -*-
#coding:gbk
#注意:在此目录下你无法comake2 -UB,comake2会抱怨baidu-rpc是本目录的父节点,
#如果你要运行本项目,得先在baidu-rpc目录下comake2 -UB后回到本目录comake2 -P。
#你自己的项目不会有这个问题(因为不会是baidu-rpc的子目录)
#到代码树根目录的相对路径
WORKROOT('../../../../../')
#C++编译参数.
CPPFLAGS('-std=c++0x -g -DNDEBUG -O2 -pipe -W -Wall -Werror -fPIC -fno-omit-frame-pointer -Wno-deprecated -Wno-unused-parameter -fno-omit-frame-pointer')
#在目前的版本中,只要用到baidu-rpc的项目都强烈建议加下面一行,以避免在gcc4下的误优化
CPPFLAGS('-D__const__=')
#为了方便本例通过comake2 -UB下载依赖,我们直接import上层baidu-rpc的依赖,
#在你自己的项目中,你得把下面三行改成CONFIGS('public/baidu-rpc@ci-base')
INCPATHS('../../')
LIBS(GLOB('../../output/lib/lib*.a'))
ImportConfigsFrom('../../')
#分别开启cpu profiler和heap profiler,后者要求使用tcmalloc
CPPFLAGS('-DBRPC_ENABLE_CPU_PROFILER -DBRPC_ENABLE_HEAP_PROFILER')
CONFIGS('third-64/tcmalloc@1.7.0.200',Libraries('lib/libtcmalloc_and_profiler.a'))
#链接参数.
LDFLAGS('-lpthread -lrt -lssl -lcrypto -ldl -lz')
#这是支持.proto作为源文件必须的
PROTOC(ENV.WorkRoot()+"/third-64/protobuf/bin/protoc")
#可执行文件
Application('echo_client', Sources('echo.proto client.cpp'))
Application('echo_server', Sources('echo.proto server.cpp'))
CC=gcc
CXX=g++
CPPFLAGS=-std=c++0x -g -DNDEBUG -O2 -pipe -W -Wall -Werror -fPIC -fno-omit-frame-pointer -Wno-deprecated -Wno-unused-parameter -D__const__= -DBRPC_ENABLE_CPU_PROFILER -DBRPC_ENABLE_HEAP_PROFILER
CXXFLAGS=$(CPPFLAGS)
CFLAGS=$(CPPFLAGS)
GFLAGS_PATH=../../../../../third-64/gflags
LEVELDB_PATH=../../../../../third-64/leveldb
PROTOBUF_PATH=../../../../../third-64/protobuf
TCMALLOC_PATH=../../../../../third-64/tcmalloc
BRPC_PATH=../../output
INCPATH=-I$(BRPC_PATH)/include -I$(GFLAGS_PATH)/include -I$(LEVELDB_PATH)/include -I$(PROTOBUF_PATH)/include -I$(TCMALLOC_PATH)/include
PROTOC=$(PROTOBUF_PATH)/bin/protoc
LIBS=$(BRPC_PATH)/lib/libbase.a \
$(BRPC_PATH)/lib/libbrpc.a \
$(BRPC_PATH)/lib/libbthread.a \
$(BRPC_PATH)/lib/libbvar.a \
$(BRPC_PATH)/lib/libjson2pb.a \
$(BRPC_PATH)/lib/libmcpack2pb.a \
$(GFLAGS_PATH)/lib/libgflags.a \
$(LEVELDB_PATH)/lib/libleveldb.a \
$(PROTOBUF_PATH)/lib/libprotobuf.a \
$(TCMALLOC_PATH)/lib/libtcmalloc_and_profiler.a \
-lpthread -lrt -lssl -lcrypto -ldl -lz
CLIENT_SOURCES = client.cpp
SERVER_SOURCES = server.cpp
PROTOS = echo.proto
PROTO_OBJS = $(addsuffix .pb.o, $(basename $(PROTOS)))
PROTO_GENS = $(addsuffix .pb.h, $(basename $(PROTOS))) $(addsuffix .pb.cc, $(basename $(PROTOS)))
CLIENT_OBJS = $(addsuffix .o, $(basename $(CLIENT_SOURCES)))
SERVER_OBJS = $(addsuffix .o, $(basename $(SERVER_SOURCES)))
.PHONY:all
all: echo_client echo_server
.PHONY:clean
clean:
@echo "Cleaning"
@rm -rf echo_client echo_server $(PROTO_GENS) $(PROTO_OBJS) $(CLIENT_OBJS) $(SERVER_OBJS)
echo_client:$(PROTO_OBJS) $(CLIENT_OBJS)
@echo "Linking $@"
@$(CXX) -Xlinker "-(" $^ $(LIBS) -Xlinker "-)" -o $@
echo_server:$(PROTO_OBJS) $(SERVER_OBJS)
@echo "Linking $@"
@$(CXX) -Xlinker "-(" $^ $(LIBS) -Xlinker "-)" -o $@
%.pb.cc:%.proto
@echo "Generating $@"
@$(PROTOC) --cpp_out=. --proto_path=. $<
%.o:%.cpp
@echo "Compiling $@"
@$(CXX) -c $(INCPATH) $(CXXFLAGS) $< -o $@
%.o:%.cc
@echo "Compiling $@"
@$(CXX) -c $(INCPATH) $(CXXFLAGS) $< -o $@
#edit-mode: -*- python -*-
#coding:gbk
#注意:在此目录下你无法comake2 -UB,comake2会抱怨baidu-rpc是本目录的父节点,
#如果你要运行本项目,得先在baidu-rpc目录下comake2 -UB后回到本目录comake2 -P。
#你自己的项目不会有这个问题(因为不会是baidu-rpc的子目录)
#到代码树根目录的相对路径
WORKROOT('../../../../../')
#C++编译参数.
CPPFLAGS('-std=c++0x -g -DNDEBUG -O2 -pipe -W -Wall -Werror -fPIC -fno-omit-frame-pointer -Wno-deprecated -Wno-unused-parameter')
#在目前的版本中,只要用到baidu-rpc的项目都强烈建议加下面一行,以避免在gcc4下的误优化
CPPFLAGS('-D__const__=')
#分别开启cpu profiler和heap profiler
CPPFLAGS('-DBRPC_ENABLE_CPU_PROFILER -DBRPC_ENABLE_HEAP_PROFILER')
CONFIGS('third-64/tcmalloc@1.7.0.200',Libraries('lib/libtcmalloc_and_profiler.a'))
#为了方便本例通过comake2 -UB下载依赖,我们直接import上层baidu-rpc的依赖,
##在你自己的项目中,你得把下面三行改成CONFIGS('public/baidu-rpc@ci-base')
INCPATHS('../../')
LIBS(GLOB('../../output/lib/lib*.a'))
ImportConfigsFrom('../../')
#链接参数.
LDFLAGS('-lpthread -lrt -lssl -lcrypto -ldl -lz')
#这是支持.proto作为源文件必须的
PROTOC(ENV.WorkRoot() + "/third-64/protobuf/bin/protoc")
#可执行文件
Application('echo_client', Sources('echo.proto client.cpp'))
Application('echo_server', Sources('echo.proto server.cpp'))
CC=gcc
CXX=g++
CPPFLAGS=-std=c++0x -g -DNDEBUG -O2 -pipe -W -Wall -Werror -fPIC -fno-omit-frame-pointer -Wno-deprecated -Wno-unused-parameter -D__const__= -DBRPC_ENABLE_CPU_PROFILER -DBRPC_ENABLE_HEAP_PROFILER
CXXFLAGS=$(CPPFLAGS)
CFLAGS=$(CPPFLAGS)
GFLAGS_PATH=../../../../../third-64/gflags
LEVELDB_PATH=../../../../../third-64/leveldb
PROTOBUF_PATH=../../../../../third-64/protobuf
TCMALLOC_PATH=../../../../../third-64/tcmalloc
BRPC_PATH=../../output
INCPATH=-I$(BRPC_PATH)/include -I$(GFLAGS_PATH)/include -I$(LEVELDB_PATH)/include -I$(PROTOBUF_PATH)/include -I$(TCMALLOC_PATH)/include
PROTOC=$(PROTOBUF_PATH)/bin/protoc
LIBS=$(BRPC_PATH)/lib/libbase.a \
$(BRPC_PATH)/lib/libbrpc.a \
$(BRPC_PATH)/lib/libbthread.a \
$(BRPC_PATH)/lib/libbvar.a \
$(BRPC_PATH)/lib/libjson2pb.a \
$(BRPC_PATH)/lib/libmcpack2pb.a \
$(GFLAGS_PATH)/lib/libgflags.a \
$(LEVELDB_PATH)/lib/libleveldb.a \
$(PROTOBUF_PATH)/lib/libprotobuf.a \
$(TCMALLOC_PATH)/lib/libtcmalloc_and_profiler.a \
-lpthread -lrt -lssl -lcrypto -ldl -lz
CLIENT_SOURCES = client.cpp
SERVER_SOURCES = server.cpp
PROTOS = echo.proto
PROTO_OBJS = $(addsuffix .pb.o, $(basename $(PROTOS)))
PROTO_GENS = $(addsuffix .pb.h, $(basename $(PROTOS))) $(addsuffix .pb.cc, $(basename $(PROTOS)))
CLIENT_OBJS = $(addsuffix .o, $(basename $(CLIENT_SOURCES)))
SERVER_OBJS = $(addsuffix .o, $(basename $(SERVER_SOURCES)))
.PHONY:all
all: echo_client echo_server
.PHONY:clean
clean:
@echo "Cleaning"
@rm -rf echo_client echo_server $(PROTO_GENS) $(PROTO_OBJS) $(CLIENT_OBJS) $(SERVER_OBJS)
echo_client:$(PROTO_OBJS) $(CLIENT_OBJS)
@echo "Linking $@"
@$(CXX) -Xlinker "-(" $^ $(LIBS) -Xlinker "-)" -o $@
echo_server:$(PROTO_OBJS) $(SERVER_OBJS)
@echo "Linking $@"
@$(CXX) -Xlinker "-(" $^ $(LIBS) -Xlinker "-)" -o $@
%.pb.cc:%.proto
@echo "Generating $@"
@$(PROTOC) --cpp_out=. --proto_path=. $<
%.o:%.cpp
@echo "Compiling $@"
@$(CXX) -c $(INCPATH) $(CXXFLAGS) $< -o $@
%.o:%.cc
@echo "Compiling $@"
@$(CXX) -c $(INCPATH) $(CXXFLAGS) $< -o $@
......@@ -10,7 +10,7 @@ function exit_func {
trap "exit_func" EXIT SIGINT SIGTERM
echo > server_list
starting_port=8002
starting_port=8004
pids=()
num_servers=5
interval=2
......
10.81.3.184:8004
10.81.3.184:8005
10.81.3.184:8006
10.81.3.184:8007
10.81.3.184:8008
10.81.3.184:8009
#edit-mode: -*- python -*-
#coding:gbk
#注意:在此目录下你无法comake2 -UB,comake2会抱怨baidu-rpc是本目录的父节点,
#如果你要运行本项目,得先在baidu-rpc目录下comake2 -UB后回到本目录comake2 -P。
#你自己的项目不会有这个问题(因为不会是baidu-rpc的子目录)
#到代码树根目录的相对路径
WORKROOT('../../../../../')
#C++编译参数.
CPPFLAGS('-std=c++0x -g -DNDEBUG -O2 -pipe -W -Wall -Werror -fPIC -fno-omit-frame-pointer -Wno-deprecated -Wno-unused-parameter')
#在目前的版本中,只要用到baidu-rpc的项目都强烈建议加下面一行,以避免在gcc4下的误优化
CPPFLAGS('-D__const__=')
#为了方便本例通过comake2 -UB下载依赖,我们直接import上层baidu-rpc的依赖,
#在你自己的项目中,你得把下面三行改成CONFIGS('public/baidu-rpc@ci-base')
INCPATHS('../../')
LIBS(GLOB('../../output/lib/lib*.a'))
ImportConfigsFrom('../../')
#分别开启cpu profiler和heap profiler,后者要求使用tcmalloc
CPPFLAGS('-DBRPC_ENABLE_CPU_PROFILER -DBRPC_ENABLE_HEAP_PROFILER')
CONFIGS('third-64/tcmalloc@1.7.0.200',Libraries('lib/libtcmalloc_and_profiler.a'))
#链接参数.
LDFLAGS('-lpthread -lrt -lssl -lcrypto -ldl -lz')
#这是支持.proto作为源文件必须的
PROTOC(ENV.WorkRoot()+"/third-64/protobuf/bin/protoc")
PROTOFLAGS("--plugin=protoc-gen-mcpack=../../protoc-gen-mcpack --mcpack_out=.")
PROTOFLAGS('--proto_path=../../')
PROTOFLAGS('--proto_path=' + ENV.WorkRoot() + '/third-64/protobuf/include/')
#可执行文件
Application('echo_client', Sources('echo.proto client.cpp'))
Application('echo_server', Sources('echo.proto server.cpp'))
CC=gcc
CXX=g++
CPPFLAGS=-std=c++0x -g -DNDEBUG -O2 -pipe -W -Wall -Werror -fPIC -fno-omit-frame-pointer -Wno-deprecated -Wno-unused-parameter -D__const__= -DBRPC_ENABLE_CPU_PROFILER -DBRPC_ENABLE_HEAP_PROFILER
CXXFLAGS=$(CPPFLAGS)
CFLAGS=$(CPPFLAGS)
GFLAGS_PATH=../../../../../third-64/gflags
LEVELDB_PATH=../../../../../third-64/leveldb
PROTOBUF_PATH=../../../../../third-64/protobuf
TCMALLOC_PATH=../../../../../third-64/tcmalloc
BRPC_PATH=../../output
INCPATH=-I$(BRPC_PATH)/include -I$(GFLAGS_PATH)/include -I$(LEVELDB_PATH)/include -I$(PROTOBUF_PATH)/include -I$(TCMALLOC_PATH)/include
PROTOC=$(PROTOBUF_PATH)/bin/protoc
LIBS=$(BRPC_PATH)/lib/libbase.a \
$(BRPC_PATH)/lib/libbrpc.a \
$(BRPC_PATH)/lib/libbthread.a \
$(BRPC_PATH)/lib/libbvar.a \
$(BRPC_PATH)/lib/libjson2pb.a \
$(BRPC_PATH)/lib/libmcpack2pb.a \
$(GFLAGS_PATH)/lib/libgflags.a \
$(LEVELDB_PATH)/lib/libleveldb.a \
$(PROTOBUF_PATH)/lib/libprotobuf.a \
$(TCMALLOC_PATH)/lib/libtcmalloc_and_profiler.a \
-lpthread \
-lrt \
-lssl \
-lcrypto \
-ldl \
-lz
CLIENT_SOURCES = client.cpp
SERVER_SOURCES = server.cpp
PROTOS = echo.proto
PROTO_OBJS = $(addsuffix .pb.o, $(basename $(PROTOS)))
PROTO_GENS = $(addsuffix .pb.h, $(basename $(PROTOS))) $(addsuffix .pb.cc, $(basename $(PROTOS)))
CLIENT_OBJS = $(addsuffix .o, $(basename $(CLIENT_SOURCES)))
SERVER_OBJS = $(addsuffix .o, $(basename $(SERVER_SOURCES)))
.PHONY:all
all: echo_client echo_server
.PHONY:clean
clean:
@echo "Cleaning"
@rm -rf echo_client echo_server $(PROTO_GENS) $(PROTO_OBJS) $(CLIENT_OBJS) $(SERVER_OBJS)
echo_client:$(PROTO_OBJS) $(CLIENT_OBJS)
@echo "Linking $@"
@$(CXX) -Xlinker "-(" $^ $(LIBS) -Xlinker "-)" -o $@
echo_server:$(PROTO_OBJS) $(SERVER_OBJS)
@echo "Linking $@"
@$(CXX) -Xlinker "-(" $^ $(LIBS) -Xlinker "-)" -o $@
%.pb.cc:%.proto
@echo "Generating $@"
@$(PROTOC) --plugin=protoc-gen-mcpack=$(BRPC_PATH)/bin/protoc-gen-mcpack --proto_path=. --proto_path=$(BRPC_PATH)/include --proto_path=$(PROTOBUF_PATH)/include --cpp_out=. --mcpack_out=. $<
%.o:%.cpp
@echo "Compiling $@"
@$(CXX) -c $(INCPATH) $(CXXFLAGS) $< -o $@
%.o:%.cc
@echo "Compiling $@"
@$(CXX) -c $(INCPATH) $(CXXFLAGS) $< -o $@
#edit-mode: -*- python -*-
#coding:gbk
#注意:在此目录下你无法comake2 -UB,comake2会抱怨baidu-rpc是本目录的父节点,
#如果你要运行本项目,得先在baidu-rpc目录下comake2 -UB后回到本目录comake2 -P。
#你自己的项目不会有这个问题(因为不会是baidu-rpc的子目录)
#到代码树根目录的相对路径
WORKROOT('../../../../../')
#C++编译参数.
CPPFLAGS('-std=c++0x -g -DNDEBUG -O2 -pipe -W -Wall -Werror -fPIC -fno-omit-frame-pointer -Wno-deprecated -Wno-unused-parameter')
#在目前的版本中,只要用到baidu-rpc的项目都强烈建议加下面一行,以避免在gcc4下的误优化
CPPFLAGS('-D__const__=')
#为了方便本例通过comake2 -UB下载依赖,我们直接import上层baidu-rpc的依赖,
#在你自己的项目中,你得把下面三行改成CONFIGS('public/baidu-rpc@ci-base')
INCPATHS('../../')
LIBS(GLOB('../../output/lib/lib*.a'))
ImportConfigsFrom('../../')
#分别开启cpu profiler和heap profiler,后者要求使用tcmalloc
CPPFLAGS('-DBRPC_ENABLE_CPU_PROFILER -DBRPC_ENABLE_HEAP_PROFILER')
CONFIGS('third-64/tcmalloc@1.7.0.200',Libraries('lib/libtcmalloc_and_profiler.a'))
#链接参数.
LDFLAGS('-lpthread -lrt -lssl -lcrypto -ldl -lz')
#这是支持.proto作为源文件必须的
PROTOC(ENV.WorkRoot()+"/third-64/protobuf/bin/protoc")
PROTOFLAGS("--plugin=protoc-gen-mcpack=../../protoc-gen-mcpack --mcpack_out=.")
PROTOFLAGS('--proto_path=../../')
PROTOFLAGS('--proto_path=' + ENV.WorkRoot() + '/third-64/protobuf/include/')
#可执行文件
Application('echo_client', Sources('echo.proto client.cpp'))
Application('echo_server', Sources('echo.proto server.cpp'))
CC=gcc
CXX=g++
CPPFLAGS=-std=c++0x -g -DNDEBUG -O2 -pipe -W -Wall -Werror -fPIC -fno-omit-frame-pointer -Wno-deprecated -Wno-unused-parameter -D__const__= -DBRPC_ENABLE_CPU_PROFILER -DBRPC_ENABLE_HEAP_PROFILER
CXXFLAGS=$(CPPFLAGS)
CFLAGS=$(CPPFLAGS)
GFLAGS_PATH=../../../../../third-64/gflags
LEVELDB_PATH=../../../../../third-64/leveldb
PROTOBUF_PATH=../../../../../third-64/protobuf
TCMALLOC_PATH=../../../../../third-64/tcmalloc
BRPC_PATH=../../output
INCPATH=-I$(BRPC_PATH)/include -I$(GFLAGS_PATH)/include -I$(LEVELDB_PATH)/include -I$(PROTOBUF_PATH)/include -I$(TCMALLOC_PATH)/include
PROTOC=$(PROTOBUF_PATH)/bin/protoc
LIBS=$(BRPC_PATH)/lib/libbase.a \
$(BRPC_PATH)/lib/libbrpc.a \
$(BRPC_PATH)/lib/libbthread.a \
$(BRPC_PATH)/lib/libbvar.a \
$(BRPC_PATH)/lib/libjson2pb.a \
$(BRPC_PATH)/lib/libmcpack2pb.a \
$(GFLAGS_PATH)/lib/libgflags.a \
$(LEVELDB_PATH)/lib/libleveldb.a \
$(PROTOBUF_PATH)/lib/libprotobuf.a \
$(TCMALLOC_PATH)/lib/libtcmalloc_and_profiler.a \
-lpthread \
-lrt \
-lssl \
-lcrypto \
-ldl \
-lz
CLIENT_SOURCES = client.cpp
SERVER_SOURCES = server.cpp
PROTOS = echo.proto
PROTO_OBJS = $(addsuffix .pb.o, $(basename $(PROTOS)))
PROTO_GENS = $(addsuffix .pb.h, $(basename $(PROTOS))) $(addsuffix .pb.cc, $(basename $(PROTOS)))
CLIENT_OBJS = $(addsuffix .o, $(basename $(CLIENT_SOURCES)))
SERVER_OBJS = $(addsuffix .o, $(basename $(SERVER_SOURCES)))
.PHONY:all
all: echo_client echo_server
.PHONY:clean
clean:
@echo "Cleaning"
@rm -rf echo_client echo_server $(PROTO_GENS) $(PROTO_OBJS) $(CLIENT_OBJS) $(SERVER_OBJS)
echo_client:$(PROTO_OBJS) $(CLIENT_OBJS)
@echo "Linking $@"
@$(CXX) -Xlinker "-(" $^ $(LIBS) -Xlinker "-)" -o $@
echo_server:$(PROTO_OBJS) $(SERVER_OBJS)
@echo "Linking $@"
@$(CXX) -Xlinker "-(" $^ $(LIBS) -Xlinker "-)" -o $@
%.pb.cc:%.proto
@echo "Generating $@"
@$(PROTOC) --plugin=protoc-gen-mcpack=$(BRPC_PATH)/bin/protoc-gen-mcpack --proto_path=. --proto_path=$(BRPC_PATH)/include --proto_path=$(PROTOBUF_PATH)/include --cpp_out=. --mcpack_out=. $<
%.o:%.cpp
@echo "Compiling $@"
@$(CXX) -c $(INCPATH) $(CXXFLAGS) $< -o $@
%.o:%.cc
@echo "Compiling $@"
@$(CXX) -c $(INCPATH) $(CXXFLAGS) $< -o $@
#edit-mode: -*- python -*-
#coding:gbk
#注意:在此目录下你无法comake2 -UB,comake2会抱怨baidu-rpc是本目录的父节点,
#如果你要运行本项目,得先在baidu-rpc目录下comake2 -UB后回到本目录comake2 -P。
#你自己的项目不会有这个问题(因为不会是baidu-rpc的子目录)
#到代码树根目录的相对路径
WORKROOT('../../../../../')
#C++编译参数.
CPPFLAGS('-std=c++0x -g -DNDEBUG -O2 -pipe -W -Wall -Werror -fPIC -fno-omit-frame-pointer -Wno-deprecated -Wno-unused-parameter')
#在目前的版本中,只要用到baidu-rpc的项目都强烈建议加下面一行,以避免在gcc4下的误优化
CPPFLAGS('-D__const__=')
#为了方便本例通过comake2 -UB下载依赖,我们直接import上层baidu-rpc的依赖,
#在你自己的项目中,你得把下面三行改成CONFIGS('public/baidu-rpc@ci-base')
INCPATHS('../../')
LIBS(GLOB('../../output/lib/lib*.a'))
ImportConfigsFrom('../../')
#链接参数.
LDFLAGS('-lpthread -lrt -lssl -lcrypto -ldl -lz')
#可执行文件
Application('echo_client', Sources('client.cpp'))
Application('echo_server', Sources('server.cpp'))
CC=gcc
CXX=g++
CPPFLAGS=-std=c++0x -g -DNDEBUG -O2 -pipe -W -Wall -Werror -fPIC -fno-omit-frame-pointer -Wno-deprecated -Wno-unused-parameter -D__const__=
CXXFLAGS=$(CPPFLAGS)
CFLAGS=$(CPPFLAGS)
GFLAGS_PATH=../../../../../third-64/gflags
LEVELDB_PATH=../../../../../third-64/leveldb
PROTOBUF_PATH=../../../../../third-64/protobuf
BRPC_PATH=../../output
INCPATH=-I$(BRPC_PATH)/include -I$(GFLAGS_PATH)/include -I$(LEVELDB_PATH)/include -I$(PROTOBUF_PATH)/include
PROTOC=$(PROTOBUF_PATH)/bin/protoc
LIBS=$(BRPC_PATH)/lib/libbase.a \
$(BRPC_PATH)/lib/libbrpc.a \
$(BRPC_PATH)/lib/libbthread.a \
$(BRPC_PATH)/lib/libbvar.a \
$(BRPC_PATH)/lib/libjson2pb.a \
$(BRPC_PATH)/lib/libmcpack2pb.a \
$(GFLAGS_PATH)/lib/libgflags.a \
$(LEVELDB_PATH)/lib/libleveldb.a \
$(PROTOBUF_PATH)/lib/libprotobuf.a \
-lpthread \
-lrt \
-lssl \
-lcrypto \
-ldl \
-lz
CLIENT_SOURCES = client.cpp
SERVER_SOURCES = server.cpp
PROTOS =
PROTO_OBJS = $(addsuffix .pb.o, $(basename $(PROTOS)))
PROTO_GENS = $(addsuffix .pb.h, $(basename $(PROTOS))) $(addsuffix .pb.cc, $(basename $(PROTOS)))
CLIENT_OBJS = $(addsuffix .o, $(basename $(CLIENT_SOURCES)))
SERVER_OBJS = $(addsuffix .o, $(basename $(SERVER_SOURCES)))
.PHONY:all
all: echo_client echo_server
.PHONY:clean
clean:
@echo "Cleaning"
@rm -rf echo_client echo_server $(PROTO_GENS) $(PROTO_OBJS) $(CLIENT_OBJS) $(SERVER_OBJS)
echo_client:$(PROTO_OBJS) $(CLIENT_OBJS)
@echo "Linking $@"
@$(CXX) -Xlinker "-(" $^ $(LIBS) -Xlinker "-)" -o $@
echo_server:$(PROTO_OBJS) $(SERVER_OBJS)
@echo "Linking $@"
@$(CXX) -Xlinker "-(" $^ $(LIBS) -Xlinker "-)" -o $@
%.pb.cc:%.proto
@echo "Generating $@"
@$(PROTOC) --cpp_out=. --proto_path=. $<
%.o:%.cpp
@echo "Compiling $@"
@$(CXX) -c $(INCPATH) $(CXXFLAGS) $< -o $@
%.o:%.cc
@echo "Compiling $@"
@$(CXX) -c $(INCPATH) $(CXXFLAGS) $< -o $@
#edit-mode: -*- python -*-
#coding:gbk
#注意:在此目录下你无法comake2 -UB,comake2会抱怨baidu-rpc是本目录的父节点,
#如果你要运行本项目,得先在baidu-rpc目录下comake2 -UB后回到本目录comake2 -P。
#你自己的项目不会有这个问题(因为不会是baidu-rpc的子目录)
#到代码树根目录的相对路径
WORKROOT('../../../../../')
#C++编译参数.
CPPFLAGS('-std=c++0x -g -DNDEBUG -O2 -pipe -W -Wall -Werror -fPIC -fno-omit-frame-pointer -Wno-deprecated -Wno-unused-parameter')
#在目前的版本中,只要用到baidu-rpc的项目都强烈建议加下面一行,以避免在gcc4下的误优化
CPPFLAGS('-D__const__=')
#为了方便本例通过comake2 -UB下载依赖,我们直接import上层baidu-rpc的依赖,
#在你自己的项目中,你得把下面三行改成CONFIGS('public/baidu-rpc@ci-base')
INCPATHS('../../')
LIBS(GLOB('../../output/lib/lib*.a'))
ImportConfigsFrom('../../')
#链接参数.
LDFLAGS('-lpthread -lrt -lssl -lcrypto -ldl -lz')
#这是支持.proto作为源文件必须的
PROTOC(ENV.WorkRoot() + "/third-64/protobuf/bin/protoc")
#可执行文件
Application('echo_client', Sources('echo.proto client.cpp'))
Application('echo_server', Sources('echo.proto server.cpp'))
CC=gcc
CXX=g++
CPPFLAGS=-std=c++0x -g -DNDEBUG -O2 -pipe -W -Wall -Werror -fPIC -fno-omit-frame-pointer -Wno-deprecated -Wno-unused-parameter -D__const__=
CXXFLAGS=$(CPPFLAGS)
CFLAGS=$(CPPFLAGS)
GFLAGS_PATH=../../../../../third-64/gflags
LEVELDB_PATH=../../../../../third-64/leveldb
PROTOBUF_PATH=../../../../../third-64/protobuf
BRPC_PATH=../../output
INCPATH=-I$(BRPC_PATH)/include -I$(GFLAGS_PATH)/include -I$(LEVELDB_PATH)/include -I$(PROTOBUF_PATH)/include
PROTOC=$(PROTOBUF_PATH)/bin/protoc
LIBS=$(BRPC_PATH)/lib/libbase.a \
$(BRPC_PATH)/lib/libbrpc.a \
$(BRPC_PATH)/lib/libbthread.a \
$(BRPC_PATH)/lib/libbvar.a \
$(BRPC_PATH)/lib/libjson2pb.a \
$(BRPC_PATH)/lib/libmcpack2pb.a \
$(GFLAGS_PATH)/lib/libgflags.a \
$(LEVELDB_PATH)/lib/libleveldb.a \
$(PROTOBUF_PATH)/lib/libprotobuf.a \
-lpthread \
-lrt \
-lssl \
-lcrypto \
-ldl \
-lz
CLIENT_SOURCES = client.cpp
SERVER_SOURCES = server.cpp
PROTOS = echo.proto
PROTO_OBJS = $(addsuffix .pb.o, $(basename $(PROTOS)))
PROTO_GENS = $(addsuffix .pb.h, $(basename $(PROTOS))) $(addsuffix .pb.cc, $(basename $(PROTOS)))
CLIENT_OBJS = $(addsuffix .o, $(basename $(CLIENT_SOURCES)))
SERVER_OBJS = $(addsuffix .o, $(basename $(SERVER_SOURCES)))
.PHONY:all
all: echo_client echo_server
.PHONY:clean
clean:
@echo "Cleaning"
@rm -rf echo_client echo_server $(PROTO_GENS) $(PROTO_OBJS) $(CLIENT_OBJS) $(SERVER_OBJS)
echo_client:$(PROTO_OBJS) $(CLIENT_OBJS)
@echo "Linking $@"
@$(CXX) -Xlinker "-(" $^ $(LIBS) -Xlinker "-)" -o $@
echo_server:$(PROTO_OBJS) $(SERVER_OBJS)
@echo "Linking $@"
@$(CXX) -Xlinker "-(" $^ $(LIBS) -Xlinker "-)" -o $@
%.pb.cc:%.proto
@echo "Generating $@"
@$(PROTOC) --cpp_out=. --proto_path=. $<
%.o:%.cpp
@echo "Compiling $@"
@$(CXX) -c $(INCPATH) $(CXXFLAGS) $< -o $@
%.o:%.cc
@echo "Compiling $@"
@$(CXX) -c $(INCPATH) $(CXXFLAGS) $< -o $@
#edit-mode: -*- python -*-
#coding:gbk
#注意:在此目录下你无法comake2 -UB,comake2会抱怨baidu-rpc是本目录的父节点,
#如果你要运行本项目,得先在baidu-rpc目录下comake2 -UB后回到本目录comake2 -P。
#你自己的项目不会有这个问题(因为不会是baidu-rpc的子目录)
#到代码树根目录的相对路径
WORKROOT('../../../../../')
#C++编译参数.
CPPFLAGS('-std=c++0x -g -DNDEBUG -O2 -pipe -W -Wall -Werror -fPIC -fno-omit-frame-pointer -Wno-deprecated -Wno-unused-parameter')
#在目前的版本中,只要用到baidu-rpc的项目都强烈建议加下面一行,以避免在gcc4下的误优化
CPPFLAGS('-D__const__=')
#为了方便本例通过comake2 -UB下载依赖,我们直接import上层baidu-rpc的依赖,
#在你自己的项目中,你得把下面三行改成CONFIGS('public/baidu-rpc@ci-base')
INCPATHS('../../')
LIBS(GLOB('../../output/lib/lib*.a'))
ImportConfigsFrom('../../')
#分别开启cpu profiler和heap profiler,后者要求使用tcmalloc
CPPFLAGS('-DBRPC_ENABLE_CPU_PROFILER -DBRPC_ENABLE_HEAP_PROFILER')
CONFIGS('third-64/tcmalloc@1.7.0.200',Libraries('lib/libtcmalloc_and_profiler.a'))
#链接参数.
LDFLAGS('-lpthread -lrt -lssl -lcrypto -ldl -lz')
#这是支持.proto作为源文件必须的
PROTOC(ENV.WorkRoot() + "/third-64/protobuf/bin/protoc")
#可执行文件
Application('echo_client', Sources('echo.proto client.cpp'))
Application('echo_server', Sources('echo.proto server.cpp'))
CC=gcc
CXX=g++
CPPFLAGS=-std=c++0x -g -DNDEBUG -O2 -pipe -W -Wall -Werror -fPIC -fno-omit-frame-pointer -Wno-deprecated -Wno-unused-parameter -D__const__= -DBRPC_ENABLE_CPU_PROFILER -DBRPC_ENABLE_HEAP_PROFILER
CXXFLAGS=$(CPPFLAGS)
CFLAGS=$(CPPFLAGS)
GFLAGS_PATH=../../../../../third-64/gflags
LEVELDB_PATH=../../../../../third-64/leveldb
PROTOBUF_PATH=../../../../../third-64/protobuf
TCMALLOC_PATH=../../../../../third-64/tcmalloc
BRPC_PATH=../../output
INCPATH=-I$(BRPC_PATH)/include -I$(GFLAGS_PATH)/include -I$(LEVELDB_PATH)/include -I$(PROTOBUF_PATH)/include -I$(TCMALLOC_PATH)/include
PROTOC=$(PROTOBUF_PATH)/bin/protoc
LIBS=$(BRPC_PATH)/lib/libbase.a \
$(BRPC_PATH)/lib/libbrpc.a \
$(BRPC_PATH)/lib/libbthread.a \
$(BRPC_PATH)/lib/libbvar.a \
$(BRPC_PATH)/lib/libjson2pb.a \
$(BRPC_PATH)/lib/libmcpack2pb.a \
$(GFLAGS_PATH)/lib/libgflags.a \
$(LEVELDB_PATH)/lib/libleveldb.a \
$(PROTOBUF_PATH)/lib/libprotobuf.a \
$(TCMALLOC_PATH)/lib/libtcmalloc_and_profiler.a \
-lpthread -lrt -lssl -lcrypto -ldl -lz
CLIENT_SOURCES = client.cpp
SERVER_SOURCES = server.cpp
PROTOS = echo.proto
PROTO_OBJS = $(addsuffix .pb.o, $(basename $(PROTOS)))
PROTO_GENS = $(addsuffix .pb.h, $(basename $(PROTOS))) $(addsuffix .pb.cc, $(basename $(PROTOS)))
CLIENT_OBJS = $(addsuffix .o, $(basename $(CLIENT_SOURCES)))
SERVER_OBJS = $(addsuffix .o, $(basename $(SERVER_SOURCES)))
.PHONY:all
all: echo_client echo_server
.PHONY:clean
clean:
@echo "Cleaning"
@rm -rf echo_client echo_server $(PROTO_GENS) $(PROTO_OBJS) $(CLIENT_OBJS) $(SERVER_OBJS)
echo_client:$(PROTO_OBJS) $(CLIENT_OBJS)
@echo "Linking $@"
@$(CXX) -Xlinker "-(" $^ $(LIBS) -Xlinker "-)" -o $@
echo_server:$(PROTO_OBJS) $(SERVER_OBJS)
@echo "Linking $@"
@$(CXX) -Xlinker "-(" $^ $(LIBS) -Xlinker "-)" -o $@
%.pb.cc:%.proto
@echo "Generating $@"
@$(PROTOC) --cpp_out=. --proto_path=. $<
%.o:%.cpp
@echo "Compiling $@"
@$(CXX) -c $(INCPATH) $(CXXFLAGS) $< -o $@
%.o:%.cc
@echo "Compiling $@"
@$(CXX) -c $(INCPATH) $(CXXFLAGS) $< -o $@
#edit-mode: -*- python -*-
#coding:gbk
#注意:在此目录下你无法comake2 -UB,comake2会抱怨baidu-rpc是本目录的父节点,
#如果你要运行本项目,得先在baidu-rpc目录下comake2 -UB后回到本目录comake2 -P。
#你自己的项目不会有这个问题(因为不会是baidu-rpc的子目录)
#到代码树根目录的相对路径
WORKROOT('../../../../../')
#C++编译参数.
CPPFLAGS('-std=c++0x -g -DNDEBUG -O2 -pipe -W -Wall -Werror -fPIC -fno-omit-frame-pointer -Wno-deprecated -Wno-unused-parameter')
#在目前的版本中,只要用到baidu-rpc的项目都强烈建议加下面一行,以避免在gcc4下的误优化
CPPFLAGS('-D__const__=')
#为了方便本例通过comake2 -UB下载依赖,我们直接import上层baidu-rpc的依赖,
#在你自己的项目中,你得把下面三行改成CONFIGS('public/baidu-rpc@ci-base')
INCPATHS('../../')
LIBS(GLOB('../../output/lib/lib*.a'))
ImportConfigsFrom('../../')
#分别开启cpu profiler和heap profiler,后者要求使用tcmalloc
CPPFLAGS('-DBRPC_ENABLE_CPU_PROFILER -DBRPC_ENABLE_HEAP_PROFILER')
CONFIGS('third-64/tcmalloc@1.7.0.200',Libraries('lib/libtcmalloc_and_profiler.a'))
#链接参数.
LDFLAGS('-lpthread -lrt -lssl -lcrypto -ldl -lz')
#这是支持.proto作为源文件必须的
PROTOC(ENV.WorkRoot() + "/third-64/protobuf/bin/protoc")
#可执行文件
Application('echo_client', Sources('echo.proto client.cpp'))
Application('echo_server', Sources('echo.proto server.cpp'))
CC=gcc
CXX=g++
CPPFLAGS=-std=c++0x -g -DNDEBUG -O2 -pipe -W -Wall -Werror -fPIC -fno-omit-frame-pointer -Wno-deprecated -Wno-unused-parameter -D__const__= -DBRPC_ENABLE_CPU_PROFILER -DBRPC_ENABLE_HEAP_PROFILER
CXXFLAGS=$(CPPFLAGS)
CFLAGS=$(CPPFLAGS)
GFLAGS_PATH=../../../../../third-64/gflags
LEVELDB_PATH=../../../../../third-64/leveldb
PROTOBUF_PATH=../../../../../third-64/protobuf
TCMALLOC_PATH=../../../../../third-64/tcmalloc
BRPC_PATH=../../output
INCPATH=-I$(BRPC_PATH)/include -I$(GFLAGS_PATH)/include -I$(LEVELDB_PATH)/include -I$(PROTOBUF_PATH)/include -I$(TCMALLOC_PATH)/include
PROTOC=$(PROTOBUF_PATH)/bin/protoc
LIBS=$(BRPC_PATH)/lib/libbase.a \
$(BRPC_PATH)/lib/libbrpc.a \
$(BRPC_PATH)/lib/libbthread.a \
$(BRPC_PATH)/lib/libbvar.a \
$(BRPC_PATH)/lib/libjson2pb.a \
$(BRPC_PATH)/lib/libmcpack2pb.a \
$(GFLAGS_PATH)/lib/libgflags.a \
$(LEVELDB_PATH)/lib/libleveldb.a \
$(PROTOBUF_PATH)/lib/libprotobuf.a \
$(TCMALLOC_PATH)/lib/libtcmalloc_and_profiler.a \
-lpthread -lrt -lssl -lcrypto -ldl -lz
CLIENT_SOURCES = client.cpp
SERVER_SOURCES = server.cpp
PROTOS = echo.proto
PROTO_OBJS = $(addsuffix .pb.o, $(basename $(PROTOS)))
PROTO_GENS = $(addsuffix .pb.h, $(basename $(PROTOS))) $(addsuffix .pb.cc, $(basename $(PROTOS)))
CLIENT_OBJS = $(addsuffix .o, $(basename $(CLIENT_SOURCES)))
SERVER_OBJS = $(addsuffix .o, $(basename $(SERVER_SOURCES)))
.PHONY:all
all: echo_client echo_server
.PHONY:clean
clean:
@echo "Cleaning"
@rm -rf echo_client echo_server $(PROTO_GENS) $(PROTO_OBJS) $(CLIENT_OBJS) $(SERVER_OBJS)
echo_client:$(PROTO_OBJS) $(CLIENT_OBJS)
@echo "Linking $@"
@$(CXX) -Xlinker "-(" $^ $(LIBS) -Xlinker "-)" -o $@
echo_server:$(PROTO_OBJS) $(SERVER_OBJS)
@echo "Linking $@"
@$(CXX) -Xlinker "-(" $^ $(LIBS) -Xlinker "-)" -o $@
%.pb.cc:%.proto
@echo "Generating $@"
@$(PROTOC) --cpp_out=. --proto_path=. $<
%.o:%.cpp
@echo "Compiling $@"
@$(CXX) -c $(INCPATH) $(CXXFLAGS) $< -o $@
%.o:%.cc
@echo "Compiling $@"
@$(CXX) -c $(INCPATH) $(CXXFLAGS) $< -o $@
#edit-mode: -*- python -*-
#coding:gbk
#注意:在此目录下你无法comake2 -UB,comake2会抱怨baidu-rpc是本目录的父节点,
#如果你要运行本项目,得先在baidu-rpc目录下comake2 -UB后回到本目录comake2 -P。
#你自己的项目不会有这个问题(因为不会是baidu-rpc的子目录)
#到代码树根目录的相对路径
WORKROOT('../../../../../')
#C++编译参数.
CPPFLAGS('-std=c++0x -g -DNDEBUG -O2 -pipe -W -Wall -Werror -fPIC -fno-omit-frame-pointer -Wno-deprecated -Wno-unused-parameter')
#在目前的版本中,只要用到baidu-rpc的项目都强烈建议加下面一行,以避免在gcc4下的误优化
CPPFLAGS('-D__const__=')
#为了方便本例通过comake2 -UB下载依赖,我们直接import上层baidu-rpc的依赖,
#在你自己的项目中,你得把下面三行改成CONFIGS('public/baidu-rpc@ci-base')
INCPATHS('../../')
LIBS(GLOB('../../output/lib/lib*.a'))
ImportConfigsFrom('../../')
#分别开启cpu profiler和heap profiler,后者要求使用tcmalloc
CPPFLAGS('-DBRPC_ENABLE_CPU_PROFILER -DBRPC_ENABLE_HEAP_PROFILER')
CONFIGS('third-64/tcmalloc@1.7.0.200',Libraries('lib/libtcmalloc_and_profiler.a'))
#链接参数.
LDFLAGS('-lpthread -lrt -lssl -lcrypto -ldl -lz -lreadline -lncurses')
Application('redis_cli', Sources('redis_cli.cpp'))
Application('client', Sources('client.cpp'))
CC=gcc
CXX=g++
CPPFLAGS=-std=c++0x -g -DNDEBUG -O2 -pipe -W -Wall -Werror -fPIC -fno-omit-frame-pointer -Wno-deprecated -Wno-unused-parameter -D__const__= -DBRPC_ENABLE_CPU_PROFILER -DBRPC_ENABLE_HEAP_PROFILER
CXXFLAGS=$(CPPFLAGS)
CFLAGS=$(CPPFLAGS)
GFLAGS_PATH=../../../../../third-64/gflags
LEVELDB_PATH=../../../../../third-64/leveldb
PROTOBUF_PATH=../../../../../third-64/protobuf
TCMALLOC_PATH=../../../../../third-64/tcmalloc
BRPC_PATH=../../output
INCPATH=-I$(BRPC_PATH)/include -I$(GFLAGS_PATH)/include -I$(LEVELDB_PATH)/include -I$(PROTOBUF_PATH)/include -I$(TCMALLOC_PATH)/include
LIBS=$(BRPC_PATH)/lib/libbase.a \
$(BRPC_PATH)/lib/libbrpc.a \
$(BRPC_PATH)/lib/libbthread.a \
$(BRPC_PATH)/lib/libbvar.a \
$(BRPC_PATH)/lib/libjson2pb.a \
$(BRPC_PATH)/lib/libmcpack2pb.a \
$(GFLAGS_PATH)/lib/libgflags.a \
$(LEVELDB_PATH)/lib/libleveldb.a \
$(PROTOBUF_PATH)/lib/libprotobuf.a \
$(TCMALLOC_PATH)/lib/libtcmalloc_and_profiler.a \
-lpthread -lrt -lssl -lcrypto -ldl -lz -lreadline -lncurses
PRESS_SOURCES = redis_press.cpp
CLI_SOURCES = redis_cli.cpp
PRESS_OBJS = $(addsuffix .o, $(basename $(PRESS_SOURCES)))
CLI_OBJS = $(addsuffix .o, $(basename $(CLI_SOURCES)))
.PHONY:all
all: redis_press redis_cli
.PHONY:clean
clean:
@echo "Cleaning"
@rm -rf redis_press redis_cli $(PRESS_OBJS) $(CLI_OBJS)
redis_press:$(PRESS_OBJS)
@echo "Linking $@"
@$(CXX) -Xlinker "-(" $^ $(LIBS) -Xlinker "-)" -o $@
redis_cli:$(CLI_OBJS)
@echo "Linking $@"
@$(CXX) -Xlinker "-(" $^ $(LIBS) -Xlinker "-)" -o $@
%.o:%.cpp
@echo "Compiling $@"
@$(CXX) -c $(INCPATH) $(CXXFLAGS) $< -o $@
%.o:%.cc
@echo "Compiling $@"
@$(CXX) -c $(INCPATH) $(CXXFLAGS) $< -o $@
#edit-mode: -*- python -*-
#coding:gbk
#注意:在此目录下你无法comake2 -UB,comake2会抱怨baidu-rpc是本目录的父节点,
#如果你要运行本项目,得先在baidu-rpc目录下comake2 -UB后回到本目录comake2 -P。
#你自己的项目不会有这个问题(因为不会是baidu-rpc的子目录)
#到代码树根目录的相对路径
WORKROOT('../../../../../')
#C++编译参数.
CPPFLAGS('-std=c++0x -g -DNDEBUG -O2 -pipe -W -Wall -Werror -fPIC -fno-omit-frame-pointer -Wno-deprecated -Wno-unused-parameter')
#在目前的版本中,只要用到baidu-rpc的项目都强烈建议加下面一行,以避免在gcc4下的误优化
CPPFLAGS('-D__const__=')
#为了方便本例通过comake2 -UB下载依赖,我们直接import上层baidu-rpc的依赖,
#在你自己的项目中,你得把下面三行改成CONFIGS('public/baidu-rpc@ci-base')
INCPATHS('../../')
LIBS(GLOB('../../output/lib/lib*.a'))
ImportConfigsFrom('../../')
#分别开启cpu profiler和heap profiler,后者要求使用tcmalloc
CPPFLAGS('-DBRPC_ENABLE_CPU_PROFILER -DBRPC_ENABLE_HEAP_PROFILER')
CONFIGS('third-64/tcmalloc@1.7.0.200',Libraries('lib/libtcmalloc_and_profiler.a'))
#链接参数.
LDFLAGS('-lpthread -lrt -lssl -lcrypto -ldl -lz')
#这是支持.proto作为源文件必须的
PROTOC(ENV.WorkRoot() + "/third-64/protobuf/bin/protoc")
#可执行文件
Application('echo_client', Sources('echo.proto client.cpp'))
Application('echo_server', Sources('echo.proto server.cpp'))
CC=gcc
CXX=g++
CPPFLAGS=-std=c++0x -g -DNDEBUG -O2 -pipe -W -Wall -Werror -fPIC -fno-omit-frame-pointer -Wno-deprecated -Wno-unused-parameter -D__const__= -DBRPC_ENABLE_CPU_PROFILER -DBRPC_ENABLE_HEAP_PROFILER
CXXFLAGS=$(CPPFLAGS)
CFLAGS=$(CPPFLAGS)
GFLAGS_PATH=../../../../../third-64/gflags
LEVELDB_PATH=../../../../../third-64/leveldb
PROTOBUF_PATH=../../../../../third-64/protobuf
TCMALLOC_PATH=../../../../../third-64/tcmalloc
BRPC_PATH=../../output
INCPATH=-I$(BRPC_PATH)/include -I$(GFLAGS_PATH)/include -I$(LEVELDB_PATH)/include -I$(PROTOBUF_PATH)/include -I$(TCMALLOC_PATH)/include
PROTOC=$(PROTOBUF_PATH)/bin/protoc
LIBS=$(BRPC_PATH)/lib/libbase.a \
$(BRPC_PATH)/lib/libbrpc.a \
$(BRPC_PATH)/lib/libbthread.a \
$(BRPC_PATH)/lib/libbvar.a \
$(BRPC_PATH)/lib/libjson2pb.a \
$(BRPC_PATH)/lib/libmcpack2pb.a \
$(GFLAGS_PATH)/lib/libgflags.a \
$(LEVELDB_PATH)/lib/libleveldb.a \
$(PROTOBUF_PATH)/lib/libprotobuf.a \
$(TCMALLOC_PATH)/lib/libtcmalloc_and_profiler.a \
-lpthread \
-lrt \
-lssl \
-lcrypto \
-ldl \
-lz
CLIENT_SOURCES = client.cpp
SERVER_SOURCES = server.cpp
PROTOS = echo.proto
PROTO_OBJS = $(addsuffix .pb.o, $(basename $(PROTOS)))
PROTO_GENS = $(addsuffix .pb.h, $(basename $(PROTOS))) $(addsuffix .pb.cc, $(basename $(PROTOS)))
CLIENT_OBJS = $(addsuffix .o, $(basename $(CLIENT_SOURCES)))
SERVER_OBJS = $(addsuffix .o, $(basename $(SERVER_SOURCES)))
.PHONY:all
all: echo_client echo_server
.PHONY:clean
clean:
@echo "Cleaning"
@rm -rf echo_client echo_server $(PROTO_GENS) $(PROTO_OBJS) $(CLIENT_OBJS) $(SERVER_OBJS)
echo_client:$(PROTO_OBJS) $(CLIENT_OBJS)
@echo "Linking $@"
@$(CXX) -Xlinker "-(" $^ $(LIBS) -Xlinker "-)" -o $@
echo_server:$(PROTO_OBJS) $(SERVER_OBJS)
@echo "Linking $@"
@$(CXX) -Xlinker "-(" $^ $(LIBS) -Xlinker "-)" -o $@
%.pb.cc:%.proto
@echo "Generating $@"
@$(PROTOC) --cpp_out=. --proto_path=. $<
%.o:%.cpp
@echo "Compiling $@"
@$(CXX) -c $(INCPATH) $(CXXFLAGS) $< -o $@
%.o:%.cc
@echo "Compiling $@"
@$(CXX) -c $(INCPATH) $(CXXFLAGS) $< -o $@
comake2 -P
make -sj8
#SelectiveChannel(timeout=100ms, backup=6ms) [
# Channel[list://0.0.0.0:8004,0.0.0.0:8005,0.0.0.0:8006]
# ParallelChannel[
# Channel[0.0.0.0:8007]
# Channel[0.0.0.0:8008]
# Channel[0.0.0.0:8009]]
# SelectiveChannel[
# Channel[list://0.0.0.0:8010(always timeout),0.0.0.0:8011,0.0.0.0:8012]
# Channel[0.0.0.0:8013]
# Channel[0.0.0.0:8014(unavailable)]]]
( ./echo_server -server_num 10 -sleep_us "0,0,0,0,0,0,1000000,0" -max_ratio 1 -min_ratio 1 -max_concurrency 10 & ) && ./echo_client -backup_ms 6 -dont_fail; pkill echo_server
#edit-mode: -*- python -*-
#coding:gbk
#注意:在此目录下你无法comake2 -UB,comake2会抱怨baidu-rpc是本目录的父节点,
#如果你要运行本项目,得先在baidu-rpc目录下comake2 -UB后回到本目录comake2 -P。
#你自己的项目不会有这个问题(因为不会是baidu-rpc的子目录)
#到代码树根目录的相对路径
WORKROOT('../../../../../')
#C++编译参数.
CPPFLAGS('-std=c++0x -g -DNDEBUG -O2 -pipe -W -Wall -Werror -fPIC -fno-omit-frame-pointer -Wno-deprecated -Wno-unused-parameter')
#在目前的版本中,只要用到baidu-rpc的项目都强烈建议加下面一行,以避免在gcc4下的误优化
CPPFLAGS('-D__const__=')
#为了方便本例通过comake2 -UB下载依赖,我们直接import上层baidu-rpc的依赖,
#在你自己的项目中,你得把下面三行改成CONFIGS('public/baidu-rpc@ci-base')
INCPATHS('../../')
LIBS(GLOB('../../output/lib/lib*.a'))
ImportConfigsFrom('../../')
#分别开启cpu profiler和heap profiler,后者要求使用tcmalloc
CPPFLAGS('-DBRPC_ENABLE_CPU_PROFILER -DBRPC_ENABLE_HEAP_PROFILER')
CONFIGS('third-64/tcmalloc@1.7.0.200',Libraries('lib/libtcmalloc_and_profiler.a'))
#链接参数.
LDFLAGS('-lpthread -lrt -lssl -lcrypto -ldl -lz')
#这是支持.proto作为源文件必须的
PROTOC(ENV.WorkRoot() + "/third-64/protobuf/bin/protoc")
#可执行文件
Application('echo_client', Sources('echo.proto client.cpp'))
Application('echo_server', Sources('echo.proto server.cpp'))
CC=gcc
CXX=g++
CPPFLAGS=-std=c++0x -g -DNDEBUG -O2 -pipe -W -Wall -Werror -fPIC -fno-omit-frame-pointer -Wno-deprecated -Wno-unused-parameter -D__const__= -DBRPC_ENABLE_CPU_PROFILER -DBRPC_ENABLE_HEAP_PROFILER
CXXFLAGS=$(CPPFLAGS)
CFLAGS=$(CPPFLAGS)
GFLAGS_PATH=../../../../../third-64/gflags
LEVELDB_PATH=../../../../../third-64/leveldb
PROTOBUF_PATH=../../../../../third-64/protobuf
TCMALLOC_PATH=../../../../../third-64/tcmalloc
BRPC_PATH=../../output
INCPATH=-I$(BRPC_PATH)/include -I$(GFLAGS_PATH)/include -I$(LEVELDB_PATH)/include -I$(PROTOBUF_PATH)/include -I$(TCMALLOC_PATH)/include
PROTOC=$(PROTOBUF_PATH)/bin/protoc
LIBS=$(BRPC_PATH)/lib/libbase.a \
$(BRPC_PATH)/lib/libbrpc.a \
$(BRPC_PATH)/lib/libbthread.a \
$(BRPC_PATH)/lib/libbvar.a \
$(BRPC_PATH)/lib/libjson2pb.a \
$(BRPC_PATH)/lib/libmcpack2pb.a \
$(GFLAGS_PATH)/lib/libgflags.a \
$(LEVELDB_PATH)/lib/libleveldb.a \
$(PROTOBUF_PATH)/lib/libprotobuf.a \
$(TCMALLOC_PATH)/lib/libtcmalloc_and_profiler.a \
-lpthread \
-lrt \
-lssl \
-lcrypto \
-ldl \
-lz
CLIENT_SOURCES = client.cpp
SERVER_SOURCES = server.cpp
PROTOS = echo.proto
PROTO_OBJS = $(addsuffix .pb.o, $(basename $(PROTOS)))
PROTO_GENS = $(addsuffix .pb.h, $(basename $(PROTOS))) $(addsuffix .pb.cc, $(basename $(PROTOS)))
CLIENT_OBJS = $(addsuffix .o, $(basename $(CLIENT_SOURCES)))
SERVER_OBJS = $(addsuffix .o, $(basename $(SERVER_SOURCES)))
.PHONY:all
all: echo_client echo_server
.PHONY:clean
clean:
@echo "Cleaning"
@rm -rf echo_client echo_server $(PROTO_GENS) $(PROTO_OBJS) $(CLIENT_OBJS) $(SERVER_OBJS)
echo_client:$(PROTO_OBJS) $(CLIENT_OBJS)
@echo "Linking $@"
@$(CXX) -Xlinker "-(" $^ $(LIBS) -Xlinker "-)" -o $@
echo_server:$(PROTO_OBJS) $(SERVER_OBJS)
@echo "Linking $@"
@$(CXX) -Xlinker "-(" $^ $(LIBS) -Xlinker "-)" -o $@
%.pb.cc:%.proto
@echo "Generating $@"
@$(PROTOC) --cpp_out=. --proto_path=. $<
%.o:%.cpp
@echo "Compiling $@"
@$(CXX) -c $(INCPATH) $(CXXFLAGS) $< -o $@
%.o:%.cc
@echo "Compiling $@"
@$(CXX) -c $(INCPATH) $(CXXFLAGS) $< -o $@
#edit-mode: -*- python -*-
#coding:gbk
#注意:在此目录下你无法comake2 -UB,comake2会抱怨baidu-rpc是本目录的父节点,
#如果你要运行本项目,得先在baidu-rpc目录下comake2 -UB后回到本目录comake2 -P。
#你自己的项目不会有这个问题(因为不会是baidu-rpc的子目录)
#到代码树根目录的相对路径
WORKROOT('../../../../../')
#C++编译参数.
CPPFLAGS('-std=c++0x -g -DNDEBUG -O2 -pipe -W -Wall -Werror -fPIC -fno-omit-frame-pointer -Wno-deprecated -Wno-unused-parameter')
#在目前的版本中,只要用到baidu-rpc的项目都强烈建议加下面一行,以避免在gcc4下的误优化
CPPFLAGS('-D__const__=')
#为了方便本例通过comake2 -UB下载依赖,我们直接import上层baidu-rpc的依赖,
##在你自己的项目中,你得把下面三行改成CONFIGS('public/baidu-rpc@ci-base')
INCPATHS('../../')
LIBS(GLOB('../../output/lib/lib*.a'))
ImportConfigsFrom('../../')
#链接参数.
LDFLAGS('-lpthread -lrt -lssl -lcrypto -ldl -lz')
#这是支持.proto作为源文件必须的
PROTOC(ENV.WorkRoot() + "/third-64/protobuf/bin/protoc")
#可执行文件
Application('echo_client', Sources('echo.proto client.cpp'))
Application('echo_server', Sources('echo.proto server.cpp'))
CC=gcc
CXX=g++
CPPFLAGS=-std=c++0x -g -DNDEBUG -O2 -pipe -W -Wall -Werror -fPIC -fno-omit-frame-pointer -Wno-deprecated -Wno-unused-parameter -D__const__=
CXXFLAGS=$(CPPFLAGS)
CFLAGS=$(CPPFLAGS)
GFLAGS_PATH=../../../../../third-64/gflags
LEVELDB_PATH=../../../../../third-64/leveldb
PROTOBUF_PATH=../../../../../third-64/protobuf
BRPC_PATH=../../output
INCPATH=-I$(BRPC_PATH)/include -I$(GFLAGS_PATH)/include -I$(LEVELDB_PATH)/include -I$(PROTOBUF_PATH)/include
PROTOC=$(PROTOBUF_PATH)/bin/protoc
LIBS=$(BRPC_PATH)/lib/libbase.a \
$(BRPC_PATH)/lib/libbrpc.a \
$(BRPC_PATH)/lib/libbthread.a \
$(BRPC_PATH)/lib/libbvar.a \
$(BRPC_PATH)/lib/libjson2pb.a \
$(BRPC_PATH)/lib/libmcpack2pb.a \
$(GFLAGS_PATH)/lib/libgflags.a \
$(LEVELDB_PATH)/lib/libleveldb.a \
$(PROTOBUF_PATH)/lib/libprotobuf.a \
-lpthread \
-lrt \
-lssl \
-lcrypto \
-ldl \
-lz
CLIENT_SOURCES = client.cpp
SERVER_SOURCES = server.cpp
PROTOS = echo.proto
PROTO_OBJS = $(addsuffix .pb.o, $(basename $(PROTOS)))
PROTO_GENS = $(addsuffix .pb.h, $(basename $(PROTOS))) $(addsuffix .pb.cc, $(basename $(PROTOS)))
CLIENT_OBJS = $(addsuffix .o, $(basename $(CLIENT_SOURCES)))
SERVER_OBJS = $(addsuffix .o, $(basename $(SERVER_SOURCES)))
.PHONY:all
all: echo_client echo_server
.PHONY:clean
clean:
@echo "Cleaning"
@rm -rf echo_client echo_server $(PROTO_GENS) $(PROTO_OBJS) $(CLIENT_OBJS) $(SERVER_OBJS)
echo_client:$(PROTO_OBJS) $(CLIENT_OBJS)
@echo "Linking $@"
@$(CXX) -Xlinker "-(" $^ $(LIBS) -Xlinker "-)" -o $@
echo_server:$(PROTO_OBJS) $(SERVER_OBJS)
@echo "Linking $@"
@$(CXX) -Xlinker "-(" $^ $(LIBS) -Xlinker "-)" -o $@
%.pb.cc:%.proto
@echo "Generating $@"
@$(PROTOC) --cpp_out=. --proto_path=. $<
%.o:%.cpp
@echo "Compiling $@"
@$(CXX) -c $(INCPATH) $(CXXFLAGS) $< -o $@
%.o:%.cc
@echo "Compiling $@"
@$(CXX) -c $(INCPATH) $(CXXFLAGS) $< -o $@
#edit-mode: -*- python -*-
#coding:gbk
WORKROOT('../../../../../')
CXXFLAGS('-std=c++0x -g -DNDEBUG -O2 -pipe -W -Wall -Werror -fPIC -Wno-deprecated -Wno-unused-parameter')
CPPFLAGS('-D__const__=')
INCPATHS('../../')
LIBS(GLOB('../../output/lib/lib*.a'))
ImportConfigsFrom('../../')
LDFLAGS('-lpthread -lrt -lssl -lcrypto -ldl -lz')
Application('parallel_http', Sources('parallel_http.cpp'))
CC=gcc
CXX=g++
CPPFLAGS=-std=c++0x -g -DNDEBUG -O2 -pipe -W -Wall -Werror -fPIC -fno-omit-frame-pointer -Wno-deprecated -Wno-unused-parameter -D__const__=
CXXFLAGS=$(CPPFLAGS)
CFLAGS=$(CPPFLAGS)
GFLAGS_PATH=../../../../../third-64/gflags
LEVELDB_PATH=../../../../../third-64/leveldb
PROTOBUF_PATH=../../../../../third-64/protobuf
BRPC_PATH=../../output
INCPATH=-I$(BRPC_PATH)/include -I$(GFLAGS_PATH)/include -I$(LEVELDB_PATH)/include -I$(PROTOBUF_PATH)/include
PROTOC=$(PROTOBUF_PATH)/bin/protoc
LIBS=$(BRPC_PATH)/lib/libbase.a \
$(BRPC_PATH)/lib/libbrpc.a \
$(BRPC_PATH)/lib/libbthread.a \
$(BRPC_PATH)/lib/libbvar.a \
$(BRPC_PATH)/lib/libjson2pb.a \
$(BRPC_PATH)/lib/libmcpack2pb.a \
$(GFLAGS_PATH)/lib/libgflags.a \
$(LEVELDB_PATH)/lib/libleveldb.a \
$(PROTOBUF_PATH)/lib/libprotobuf.a \
-lpthread -lrt -lssl -lcrypto -ldl -lz
CLIENT_SOURCES = parallel_http.cpp
CLIENT_OBJS = $(addsuffix .o, $(basename $(CLIENT_SOURCES)))
.PHONY:all
all: parallel_http
.PHONY:clean
clean:
@echo "Cleaning"
@rm -rf parallel_http $(CLIENT_OBJS)
parallel_http:$(CLIENT_OBJS)
@echo "Linking $@"
@$(CXX) -Xlinker "-(" $^ $(LIBS) -Xlinker "-)" -o $@
%.o:%.cpp
@echo "Compiling $@"
@$(CXX) -c $(INCPATH) $(CXXFLAGS) $< -o $@
%.o:%.cc
@echo "Compiling $@"
@$(CXX) -c $(INCPATH) $(CXXFLAGS) $< -o $@
#edit-mode: -*- python -*-
#coding:gbk
#注意:在此目录下你无法comake2 -UB,comake2会抱怨baidu-rpc是本目录的父节点,
#如果你要运行本项目,得先在baidu-rpc目录下comake2 -UB后回到本目录comake2 -P。
#你自己的项目不会有这个问题(因为不会是baidu-rpc的子目录)
#到代码树根目录的相对路径
WORKROOT('../../../../../')
#C++编译参数.
CPPFLAGS('-std=c++0x -D__const__= -g -DNDEBUG -O2 -pipe -W -Wall -Werror -fPIC -Wno-deprecated -Wno-unused-parameter')
#为了方便本例通过comake2 -UB下载依赖,我们直接import上层baidu-rpc的依赖,
#在你自己的项目中,你得改成CONFIGS('public/baidu-rpc@ci-base')
INCPATHS('../../')
LIBS(GLOB('../../output/lib/lib*.a'))
ImportConfigsFrom('../../')
#链接参数.
LDFLAGS('-lpthread -lrt -lssl -lcrypto -ldl -lz')
#这是支持.proto作为源文件必须的
PROTOC(ENV.WorkRoot() + "/third-64/protobuf/bin/protoc")
#可执行文件
Application('rpc_press', Sources(GLOB('*.cpp'), Prefixes(GLOB('*.h'))))
CC=gcc
CXX=g++
CPPFLAGS=-std=c++0x -g -DNDEBUG -O2 -pipe -W -Wall -Werror -fPIC -fno-omit-frame-pointer -Wno-deprecated -Wno-unused-parameter -D__const__=
CXXFLAGS=$(CPPFLAGS)
CFLAGS=$(CPPFLAGS)
GFLAGS_PATH=../../../../../third-64/gflags
LEVELDB_PATH=../../../../../third-64/leveldb
PROTOBUF_PATH=../../../../../third-64/protobuf
BRPC_PATH=../../output
INCPATH=-I$(BRPC_PATH)/include -I$(GFLAGS_PATH)/include -I$(LEVELDB_PATH)/include -I$(PROTOBUF_PATH)/include
PROTOC=$(PROTOBUF_PATH)/bin/protoc
LIBS=$(BRPC_PATH)/lib/libbase.a \
$(BRPC_PATH)/lib/libbrpc.a \
$(BRPC_PATH)/lib/libbthread.a \
$(BRPC_PATH)/lib/libbvar.a \
$(BRPC_PATH)/lib/libjson2pb.a \
$(BRPC_PATH)/lib/libmcpack2pb.a \
$(GFLAGS_PATH)/lib/libgflags.a \
$(LEVELDB_PATH)/lib/libleveldb.a \
$(PROTOBUF_PATH)/lib/libprotobuf.a \
-lpthread -lrt -lssl -lcrypto -ldl -lz
SOURCES = $(wildcard *.cpp)
OBJS = $(addsuffix .o, $(basename $(SOURCES)))
.PHONY:all
all: rpc_press
.PHONY:clean
clean:
@echo "Cleaning"
@rm -rf rpc_press $(OBJS)
rpc_press:$(OBJS)
@echo "Linking $@"
@$(CXX) -Xlinker "-(" $^ $(LIBS) -Xlinker "-)" -o $@
%.o:%.cpp
@echo "Compiling $@"
@$(CXX) -c $(INCPATH) $(CXXFLAGS) $< -o $@
%.o:%.cc
@echo "Compiling $@"
@$(CXX) -c $(INCPATH) $(CXXFLAGS) $< -o $@
#edit-mode: -*- python -*-
#coding:gbk
#注意:在此目录下你无法comake2 -UB,comake2会抱怨baidu-rpc是本目录的父节点,
#如果你要运行本项目,得先在baidu-rpc目录下comake2 -UB后回到本目录comake2 -P。
#你自己的项目不会有这个问题(因为不会是baidu-rpc的子目录)
#到代码树根目录的相对路径
WORKROOT('../../../../../')
#C++编译参数.
CPPFLAGS('-std=c++0x -g -DNDEBUG -O2 -pipe -W -Wall -Werror -fPIC -Wno-deprecated -Wno-unused-parameter')
#在目前的版本中,只要用到baidu-rpc的项目都强烈建议加下面一行,以避免在gcc4下的误优化
CPPFLAGS('-D__const__=')
#为了方便本例通过comake2 -UB下载依赖,我们直接import上层baidu-rpc的依赖,
#在你自己的项目中,你得改成CONFIGS('public/baidu-rpc@ci-base')
INCPATHS('../../')
LIBS(GLOB('../../output/lib/lib*.a'))
ImportConfigsFrom('../../')
#分别开启cpu profiler和heap profiler,后者要求使用tcmalloc
#CPPFLAGS('-DBRPC_ENABLE_CPU_PROFILER -DBRPC_ENABLE_HEAP_PROFILER')
#CONFIGS('third-64/tcmalloc@1.7.0.200',Libraries('lib/libtcmalloc_and_profiler.a'))
#链接参数.
LDFLAGS('-lpthread -lrt -lssl -lcrypto -ldl -lz')
#这是支持.proto作为源文件必须的
PROTOC(ENV.WorkRoot() + "/third-64/protobuf/bin/protoc")
#可执行文件
Application('rpc_replay', Sources('rpc_replay.cpp info_thread.cpp'))
CC=gcc
CXX=g++
CPPFLAGS=-std=c++0x -g -DNDEBUG -O2 -pipe -W -Wall -Werror -fPIC -fno-omit-frame-pointer -Wno-deprecated -Wno-unused-parameter -D__const__=
CXXFLAGS=$(CPPFLAGS)
CFLAGS=$(CPPFLAGS)
GFLAGS_PATH=../../../../../third-64/gflags
LEVELDB_PATH=../../../../../third-64/leveldb
PROTOBUF_PATH=../../../../../third-64/protobuf
BRPC_PATH=../../output
INCPATH=-I$(BRPC_PATH)/include -I$(GFLAGS_PATH)/include -I$(LEVELDB_PATH)/include -I$(PROTOBUF_PATH)/include
PROTOC=$(PROTOBUF_PATH)/bin/protoc
LIBS=$(BRPC_PATH)/lib/libbase.a \
$(BRPC_PATH)/lib/libbrpc.a \
$(BRPC_PATH)/lib/libbthread.a \
$(BRPC_PATH)/lib/libbvar.a \
$(BRPC_PATH)/lib/libjson2pb.a \
$(BRPC_PATH)/lib/libmcpack2pb.a \
$(GFLAGS_PATH)/lib/libgflags.a \
$(LEVELDB_PATH)/lib/libleveldb.a \
$(PROTOBUF_PATH)/lib/libprotobuf.a \
-lpthread -lrt -lssl -lcrypto -ldl -lz
SOURCES = $(wildcard *.cpp)
OBJS = $(addsuffix .o, $(basename $(SOURCES)))
.PHONY:all
all: rpc_replay
.PHONY:clean
clean:
@echo "Cleaning"
@rm -rf rpc_replay $(OBJS)
rpc_replay:$(OBJS)
@echo "Linking $@"
@$(CXX) -Xlinker "-(" $^ $(LIBS) -Xlinker "-)" -o $@
%.o:%.cpp
@echo "Compiling $@"
@$(CXX) -c $(INCPATH) $(CXXFLAGS) $< -o $@
%.o:%.cc
@echo "Compiling $@"
@$(CXX) -c $(INCPATH) $(CXXFLAGS) $< -o $@
#edit-mode: -*- python -*-
#coding:gbk
#注意:在此目录下你无法comake2 -UB,comake2会抱怨baidu-rpc是本目录的父节点,
#如果你要运行本项目,得先在baidu-rpc目录下comake2 -UB后回到本目录comake2 -P。
#你自己的项目不会有这个问题(因为不会是baidu-rpc的子目录)
#到代码树根目录的相对路径
WORKROOT('../../../../../')
#C++编译参数.
CPPFLAGS('-std=c++0x -g -DNDEBUG -O2 -pipe -W -Wall -Werror -fPIC -Wno-deprecated -Wno-unused-parameter')
#在目前的版本中,只要用到baidu-rpc的项目都强烈建议加下面一行,以避免在gcc4下的误优化
CPPFLAGS('-D__const__=')
#为了方便本例通过comake2 -UB下载依赖,我们直接import上层baidu-rpc的依赖,
#在你自己的项目中,你得改成CONFIGS('public/baidu-rpc@ci-base')
INCPATHS('../../')
LIBS(GLOB('../../output/lib/lib*.a'))
ImportConfigsFrom('../../')
#链接参数.
LDFLAGS('-lpthread -lrt -lssl -lcrypto -ldl -lz')
#这是支持.proto作为源文件必须的
PROTOC(ENV.WorkRoot() + "/third-64/protobuf/bin/protoc")
#可执行文件
Application('rpc_view', Sources('rpc_view.cpp view.proto'))
CC=gcc
CXX=g++
CPPFLAGS=-std=c++0x -g -DNDEBUG -O2 -pipe -W -Wall -Werror -fPIC -fno-omit-frame-pointer -Wno-deprecated -Wno-unused-parameter -D__const__=
CXXFLAGS=$(CPPFLAGS)
CFLAGS=$(CPPFLAGS)
GFLAGS_PATH=../../../../../third-64/gflags
LEVELDB_PATH=../../../../../third-64/leveldb
PROTOBUF_PATH=../../../../../third-64/protobuf
BRPC_PATH=../../output
INCPATH=-I$(BRPC_PATH)/include -I$(GFLAGS_PATH)/include -I$(LEVELDB_PATH)/include -I$(PROTOBUF_PATH)/include
PROTOC=$(PROTOBUF_PATH)/bin/protoc
LIBS=$(BRPC_PATH)/lib/libbase.a \
$(BRPC_PATH)/lib/libbrpc.a \
$(BRPC_PATH)/lib/libbthread.a \
$(BRPC_PATH)/lib/libbvar.a \
$(BRPC_PATH)/lib/libjson2pb.a \
$(BRPC_PATH)/lib/libmcpack2pb.a \
$(GFLAGS_PATH)/lib/libgflags.a \
$(LEVELDB_PATH)/lib/libleveldb.a \
$(PROTOBUF_PATH)/lib/libprotobuf.a \
-lpthread \
-lrt \
-lssl \
-lcrypto \
-ldl \
-lz
CLIENT_SOURCES = rpc_view.cpp
PROTOS = view.proto
PROTO_OBJS = $(addsuffix .pb.o, $(basename $(PROTOS)))
PROTO_GENS = $(addsuffix .pb.h, $(basename $(PROTOS))) $(addsuffix .pb.cc, $(basename $(PROTOS)))
CLIENT_OBJS = $(addsuffix .o, $(basename $(CLIENT_SOURCES)))
.PHONY:all
all: rpc_view
.PHONY:clean
clean:
@echo "Cleaning"
@rm -rf rpc_view $(PROTO_GENS) $(PROTO_OBJS) $(CLIENT_OBJS)
rpc_view:$(PROTO_OBJS) $(CLIENT_OBJS)
@echo "Linking $@"
@$(CXX) -Xlinker "-(" $^ $(LIBS) -Xlinker "-)" -o $@
%.pb.cc:%.proto
@echo "Generating $@"
@$(PROTOC) --cpp_out=. --proto_path=. $<
%.o:%.cpp
@echo "Compiling $@"
@$(CXX) -c $(INCPATH) $(CXXFLAGS) $< -o $@
%.o:%.cc
@echo "Compiling $@"
@$(CXX) -c $(INCPATH) $(CXXFLAGS) $< -o $@
#edit-mode: -*- python -*-
#coding:gbk
WORKROOT('../../../../../')
CPPFLAGS('-g -DNDEBUG -O2 -pipe -W -Wall -Werror -fPIC -fno-omit-frame-pointer -Wno-deprecated -Wno-unused-parameter -std=c++0x')
CPPFLAGS('-D__const__=')
INCPATHS('../../')
LIBS(GLOB('../../output/lib/lib*.a'))
ImportConfigsFrom('../../')
CPPFLAGS('-DBRPC_ENABLE_CPU_PROFILER -DBRPC_ENABLE_HEAP_PROFILER')
CONFIGS('third-64/tcmalloc@1.7.0.200',Libraries('lib/libtcmalloc_and_profiler.a'))
LDFLAGS('-lpthread -lrt -lssl -lcrypto -ldl -lz')
PROTOC(ENV.WorkRoot() + "/third-64/protobuf/bin/protoc")
Application('trackme_server', Sources('trackme_server.cpp'))
CC=gcc
CXX=g++
CPPFLAGS=-std=c++0x -g -DNDEBUG -O2 -pipe -W -Wall -Werror -fPIC -fno-omit-frame-pointer -Wno-deprecated -Wno-unused-parameter -D__const__=
CXXFLAGS=$(CPPFLAGS)
CFLAGS=$(CPPFLAGS)
GFLAGS_PATH=../../../../../third-64/gflags
LEVELDB_PATH=../../../../../third-64/leveldb
PROTOBUF_PATH=../../../../../third-64/protobuf
BRPC_PATH=../../output
INCPATH=-I$(BRPC_PATH)/include -I$(GFLAGS_PATH)/include -I$(LEVELDB_PATH)/include -I$(PROTOBUF_PATH)/include
PROTOC=$(PROTOBUF_PATH)/bin/protoc
LIBS=$(BRPC_PATH)/lib/libbase.a \
$(BRPC_PATH)/lib/libbrpc.a \
$(BRPC_PATH)/lib/libbthread.a \
$(BRPC_PATH)/lib/libbvar.a \
$(BRPC_PATH)/lib/libjson2pb.a \
$(BRPC_PATH)/lib/libmcpack2pb.a \
$(GFLAGS_PATH)/lib/libgflags.a \
$(LEVELDB_PATH)/lib/libleveldb.a \
$(PROTOBUF_PATH)/lib/libprotobuf.a \
-lpthread -lrt -lssl -lcrypto -ldl -lz
SOURCES = $(wildcard *.cpp)
OBJS = $(addsuffix .o, $(basename $(SOURCES)))
.PHONY:all
all: trackme_server
.PHONY:clean
clean:
@echo "Cleaning"
@rm -rf trackme_server $(OBJS)
trackme_server:$(OBJS)
@echo "Linking $@"
@$(CXX) -Xlinker "-(" $^ $(LIBS) -Xlinker "-)" -o $@
%.o:%.cpp
@echo "Compiling $@"
@$(CXX) -c $(INCPATH) $(CXXFLAGS) $< -o $@
%.o:%.cc
@echo "Compiling $@"
@$(CXX) -c $(INCPATH) $(CXXFLAGS) $< -o $@
......@@ -9,7 +9,6 @@
// A server to receive TrackMeRequest and send back TrackMeResponse.
#include <gflags/gflags.h>
#include <google/malloc_extension.h>
#include <memory>
#include <base/logging.h>
#include <brpc/server.h>
......@@ -78,14 +77,6 @@ private:
BugsLoader* _bugs;
};
static void* release_memory_thread(void*) {
while (true) {
MallocExtension::instance()->ReleaseFreeMemory();
bthread_usleep(5000000L/*5s*/);
}
return NULL;
}
int main(int argc, char* argv[]) {
google::ParseCommandLineFlags(&argc, &argv, true);
......@@ -110,8 +101,6 @@ int main(int argc, char* argv[]) {
LOG(ERROR) << "Fail to start TrackMeServer";
return -1;
}
bthread_t th;
bthread_start_background(&th, NULL, release_memory_thread, NULL);
server.RunUntilAskedToQuit();
bugs.stop();
return 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment