Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
B
brpc
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
brpc
Commits
70d77b20
Commit
70d77b20
authored
Aug 24, 2017
by
gejun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Combine all libs into one
parent
27db3d61
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
29 additions
and
94 deletions
+29
-94
Makefile
Makefile
+15
-62
Makefile
example/echo_c++/Makefile
+2
-2
Makefile
example/http_c++/Makefile
+1
-1
Makefile
example/memcache_c++/Makefile
+1
-1
Makefile
example/multi_threaded_echo_c++/Makefile
+2
-2
Makefile
example/redis_c++/Makefile
+1
-1
Makefile
test/Makefile
+4
-19
patch_from_svn
tools/patch_from_svn
+3
-6
No files found.
Makefile
View file @
70d77b20
...
...
@@ -7,8 +7,8 @@ include config.mk
# 3. Removed -Werror: Not block compilation for non-vital warnings, especially when the
# code is tested on newer systems. If the code is used in production, add -Werror back
CPPFLAGS
=
-DBTHREAD_USE_FAST_PTHREAD_MUTEX
-D__const__
=
-D_GNU_SOURCE
-DUSE_SYMBOLIZE
-DNO_TCMALLOC
-D__STDC_FORMAT_MACROS
-D__STDC_LIMIT_MACROS
-D__STDC_CONSTANT_MACROS
-DBRPC_REVISION
=
\"
$(
shell
git rev-parse
--short
HEAD
)
\"
CXXFLAGS
=
$(CPPFLAGS)
-
O2
-g
-pipe
-Wall
-W
-fPIC
-fstrict-aliasing
-Wno-invalid-offsetof
-Wno-unused-parameter
-fno-omit-frame-pointer
-std
=
c++0x
-include
brpc/config.h
CFLAGS
=
$(CPPFLAGS)
-
O2
-g
-pipe
-Wall
-W
-fPIC
-fstrict-aliasing
-Wno-unused-parameter
-fno-omit-frame-pointer
CXXFLAGS
=
$(CPPFLAGS)
-
g
-O2
-pipe
-Wall
-W
-fPIC
-fstrict-aliasing
-Wno-invalid-offsetof
-Wno-unused-parameter
-fno-omit-frame-pointer
-std
=
c++0x
-include
brpc/config.h
CFLAGS
=
$(CPPFLAGS)
-
g
-O2
-pipe
-Wall
-W
-fPIC
-fstrict-aliasing
-Wno-unused-parameter
-fno-omit-frame-pointer
HDRPATHS
=
-I
./src
$
(
addprefix
-I
,
$(HDRS)
)
LIBPATHS
=
$
(
addprefix
-L
,
$(LIBS)
)
SRCEXTS
=
.c .cc .cpp .proto
...
...
@@ -26,7 +26,6 @@ endif
BASE_SOURCES
=
\
src/base/third_party/dmg_fp/g_fmt.cc
\
src/base/third_party/dmg_fp/dtoa_wrapper.cc
\
src/base/third_party/dmg_fp/dtoa.cc
\
src/base/third_party/dynamic_annotations/dynamic_annotations.c
\
src/base/third_party/icu/icu_utf.cc
\
src/base/third_party/superfasthash/superfasthash.c
\
...
...
@@ -180,29 +179,24 @@ BASE_SOURCES = \
src/base/iobuf.cpp
BASE_OBJS
=
$
(
addsuffix .o,
$
(
basename
$(BASE_SOURCES)
))
BASE_DEBUG_OBJS
=
$
(
BASE_OBJS:.o
=
.dbg.o
)
BVAR_DIRS
=
src/bvar src/bvar/detail
BVAR_SOURCES
=
$
(
foreach d,
$(BVAR_DIRS)
,
$
(
wildcard
$
(
addprefix
$(d)
/
*
,
$(SRCEXTS)
)))
BVAR_OBJS
=
$
(
addsuffix .o,
$
(
basename
$(BVAR_SOURCES)
))
BVAR_DEBUG_OBJS
=
$
(
BVAR_OBJS:.o
=
.dbg.o
)
BTHREAD_DIRS
=
src/bthread
BTHREAD_SOURCES
=
$
(
foreach d,
$(BTHREAD_DIRS)
,
$
(
wildcard
$
(
addprefix
$(d)
/
*
,
$(SRCEXTS)
)))
BTHREAD_OBJS
=
$
(
addsuffix .o,
$
(
basename
$(BTHREAD_SOURCES)
))
BTHREAD_DEBUG_OBJS
=
$
(
BTHREAD_OBJS:.o
=
.dbg.o
)
JSON2PB_DIRS
=
src/json2pb
JSON2PB_SOURCES
=
$
(
foreach d,
$(JSON2PB_DIRS)
,
$
(
wildcard
$
(
addprefix
$(d)
/
*
,
$(SRCEXTS)
)))
JSON2PB_OBJS
=
$
(
addsuffix .o,
$
(
basename
$(JSON2PB_SOURCES)
))
JSON2PB_DEBUG_OBJS
=
$
(
JSON2PB_OBJS:.o
=
.dbg.o
)
BRPC_DIRS
=
src/brpc src/brpc/details src/brpc/builtin src/brpc/policy
BRPC_SOURCES
=
$
(
foreach d,
$(BRPC_DIRS)
,
$
(
wildcard
$
(
addprefix
$(d)
/
*
,
$(SRCEXTS)
)))
BRPC_PROTOS
=
$
(
filter %.proto,
$(BRPC_SOURCES)
)
BRPC_CFAMILIES
=
$
(
filter-out %.proto,
$(BRPC_SOURCES)
)
BRPC_OBJS
=
$
(
BRPC_PROTOS:.proto
=
.pb.o
)
$
(
addsuffix .o,
$
(
basename
$(BRPC_CFAMILIES)
))
BRPC_DEBUG_OBJS
=
$
(
BRPC_OBJS:.o
=
.dbg.o
)
MCPACK2PB_SOURCES
=
\
src/mcpack2pb/field_type.cpp
\
...
...
@@ -210,78 +204,37 @@ MCPACK2PB_SOURCES = \
src/mcpack2pb/parser.cpp
\
src/mcpack2pb/serializer.cpp
MCPACK2PB_OBJS
=
src/idl_options.pb.o
$
(
addsuffix .o,
$
(
basename
$(MCPACK2PB_SOURCES)
))
MCPACK2PB_DEBUG_OBJS
=
$
(
MCPACK2PB_OBJS:.o
=
.dbg.o
)
OBJS
=
$(BASE_OBJS)
$(BVAR_OBJS)
$(BTHREAD_OBJS)
$(JSON2PB_OBJS)
$(MCPACK2PB_OBJS)
$(BRPC_OBJS)
DEBUG_OBJS
=
$
(
OBJS:.o
=
.dbg.o
)
.PHONY
:
all
all
:
libbase.a libbvar.a libbthread.a libjson2pb.a libmcpack2pb.a
protoc-gen-mcpack libbrpc.a output/include output/lib output/bin
all
:
protoc-gen-mcpack libbrpc.a output/include output/lib output/bin
.PHONY
:
debug
debug
:
libb
ase.dbg.a libbvar.dbg.a libbthread.dbg.a libjson2pb.dbg.a libmcpack2pb.dbg.a libb
rpc.dbg.a
debug
:
libbrpc.dbg.a
.PHONY
:
clean
clean
:
clean_debug
@
echo
"Cleaning"
@
rm
-rf
libbase.a libbvar.a libbthread.a libjson2pb.a libmcpack2pb.a mcpack2pb/generator.o protoc-gen-mcpack libbrpc.a
\
$(BASE_OBJS)
$(BVAR_OBJS)
$(BTHREAD_OBJS)
$(JSON2PB_OBJS)
$(MCPACK2PB_OBJS)
$(BRPC_OBJS)
\
output/include output/lib output/bin
@
rm
-rf
mcpack2pb/generator.o protoc-gen-mcpack libbrpc.a
$(OBJS)
output/include output/lib output/bin
.PHONY
:
clean_debug
clean_debug
:
@
rm
-rf
libbase.dbg.a libbvar.dbg.a libbthread.dbg.a libjson2pb.dbg.a libmcpack2pb.dbg.a libbrpc.dbg.a
\
$(BASE_DEBUG_OBJS)
$(BVAR_DEBUG_OBJS)
$(BTHREAD_DEBUG_OBJS)
$(JSON2PB_DEBUG_OBJS)
$(MCPACK2PB_DEBUG_OBJS)
$(BRPC_DEBUG_OBJS)
libbase.a
:
$(BASE_OBJS)
@
echo
"Packing
$@
"
@
ar crs
$@
$^
libbase.dbg.a
:
$(BASE_DEBUG_OBJS)
@
echo
"Packing
$@
"
@
ar crs
$@
$^
libbvar.a
:
$(BVAR_OBJS)
@
echo
"Packing
$@
"
@
ar crs
$@
$^
libbvar.dbg.a
:
$(BVAR_DEBUG_OBJS)
@
echo
"Packing
$@
"
@
ar crs
$@
$^
libbthread.a
:
$(BTHREAD_OBJS)
@
echo
"Packing
$@
"
@
ar crs
$@
$^
libbthread.dbg.a
:
$(BTHREAD_DEBUG_OBJS)
@
echo
"Packing
$@
"
@
ar crs
$@
$^
libjson2pb.a
:
$(JSON2PB_OBJS)
@
echo
"Packing
$@
"
@
ar crs
$@
$^
libjson2pb.dbg.a
:
$(JSON2PB_DEBUG_OBJS)
@
echo
"Packing
$@
"
@
ar crs
$@
$^
libmcpack2pb.a
:
$(MCPACK2PB_OBJS)
@
echo
"Packing
$@
"
@
ar crs
$@
$^
libmcpack2pb.dbg.a
:
$(MCPACK2PB_DEBUG_OBJS)
@
echo
"Packing
$@
"
@
ar crs
$@
$^
@
rm
-rf
libbrpc.dbg.a
$(DEBUG_OBJS)
protoc-gen-mcpack
:
src/mcpack2pb/generator.o lib
mcpack2pb.a libbase.a libbthread.a libbvar
.a
protoc-gen-mcpack
:
src/mcpack2pb/generator.o lib
brpc
.a
@
echo
"Linking
$@
"
@
$(CXX)
-o
$@
$(LIBPATHS)
-Xlinker
"-("
$^
-Wl
,-Bstatic
$(STATIC_LINKINGS)
-Wl
,-Bdynamic
-Xlinker
"-)"
$(DYNAMIC_LINKINGS)
# force generation of pb headers before compiling to avoid fail-to-import issues in compiling pb.cc
libbrpc.a
:
$(BRPC_PROTOS:.proto=.pb.h) $(
BRPC_
OBJS)
libbrpc.a
:
$(BRPC_PROTOS:.proto=.pb.h) $(OBJS)
@
echo
"Packing
$@
"
@
ar crs
$@
$
^
@
ar crs
$@
$
(OBJS)
libbrpc.dbg.a
:
$(BRPC_PROTOS:.proto=.pb.h) $(
BRPC_
DEBUG_OBJS)
libbrpc.dbg.a
:
$(BRPC_PROTOS:.proto=.pb.h) $(DEBUG_OBJS)
@
echo
"Packing
$@
"
@
ar crs
$@
$
^
@
ar crs
$@
$
(DEBUG_OBJS)
.PHONY
:
output/include
output/include
:
...
...
@@ -291,7 +244,7 @@ output/include:
@
cp
src/idl_options.proto src/idl_options.pb.h
$@
.PHONY
:
output/lib
output/lib
:
libb
ase.a libbvar.a libbthread.a libjson2pb.a libmcpack2pb.a libb
rpc.a
output/lib
:
libbrpc.a
@
echo
"Copying to
$@
"
@
mkdir
-p
$@
@
cp
$^
$@
...
...
example/echo_c++/Makefile
View file @
70d77b20
...
...
@@ -6,7 +6,7 @@ include $(BRPC_PATH)/config.mk
CXXFLAGS
=
-std
=
c++0x
-g
-DNDEBUG
-O2
-D__const__
=
-pipe
-W
-Wall
-Werror
-Wno-unused-parameter
-fPIC
-fno-omit-frame-pointer
HDRPATHS
=
-I
$(BRPC_PATH)
/output/include
$
(
addprefix
-I
,
$(HDRS)
)
LIBPATHS
=
-L
$(BRPC_PATH)
/output/lib
$
(
addprefix
-L
,
$(LIBS)
)
STATIC_LINKINGS
+=
-lb
ase
-lbvar
-lbthread
-lbrpc
-ljson2pb
-lmcpack2pb
STATIC_LINKINGS
+=
-lb
rpc
CLIENT_SOURCES
=
client.cpp
SERVER_SOURCES
=
server.cpp
...
...
@@ -27,7 +27,7 @@ clean:
echo_client
:
$(PROTO_OBJS) $(CLIENT_OBJS)
@
echo
"Linking
$@
"
@
$(CXX)
$(LIBPATHS)
-Xlinker
"-("
$^
-Wl
,-Bstatic
$(STATIC_LINKINGS)
-Wl
,-Bdynamic
-Xlinker
"-)"
$(DYNAMIC_LINKINGS)
-o
$@
$(CXX)
$(LIBPATHS)
-Xlinker
"-("
$^
-Wl
,-Bstatic
$(STATIC_LINKINGS)
-Wl
,-Bdynamic
-Xlinker
"-)"
$(DYNAMIC_LINKINGS)
-o
$@
echo_server
:
$(PROTO_OBJS) $(SERVER_OBJS)
@
echo
"Linking
$@
"
...
...
example/http_c++/Makefile
View file @
70d77b20
...
...
@@ -10,7 +10,7 @@ ifeq ($(NEED_GPERFTOOLS), 1)
endif
HDRPATHS
=
-I
$(BRPC_PATH)
/output/include
$
(
addprefix
-I
,
$(HDRS)
)
LIBPATHS
=
-L
$(BRPC_PATH)
/output/lib
$
(
addprefix
-L
,
$(LIBS)
)
STATIC_LINKINGS
+=
-lb
ase
-lbvar
-lbthread
-lbrpc
-ljson2pb
-lmcpack2pb
STATIC_LINKINGS
+=
-lb
rpc
CLIENT_SOURCES
=
http_client.cpp
BENCHMARK_SOURCES
=
benchmark_http.cpp
...
...
example/memcache_c++/Makefile
View file @
70d77b20
...
...
@@ -3,7 +3,7 @@ include $(BRPC_PATH)/config.mk
CXXFLAGS
=
-std
=
c++0x
-g
-DNDEBUG
-O2
-D__const__
=
-pipe
-W
-Wall
-Werror
-fPIC
-fno-omit-frame-pointer
HDRPATHS
=
-I
$(BRPC_PATH)
/output/include
$
(
addprefix
-I
,
$(HDRS)
)
LIBPATHS
=
-L
$(BRPC_PATH)
/output/lib
$
(
addprefix
-L
,
$(LIBS)
)
STATIC_LINKINGS
+=
-lb
ase
-lbvar
-lbthread
-lbrpc
-ljson2pb
-lmcpack2pb
STATIC_LINKINGS
+=
-lb
rpc
SOURCES
=
$
(
wildcard
*
.cpp
)
OBJS
=
$
(
addsuffix .o,
$
(
basename
$(SOURCES)
))
...
...
example/multi_threaded_echo_c++/Makefile
View file @
70d77b20
...
...
@@ -10,7 +10,7 @@ ifeq ($(NEED_GPERFTOOLS), 1)
endif
HDRPATHS
=
-I
$(BRPC_PATH)
/output/include
$
(
addprefix
-I
,
$(HDRS)
)
LIBPATHS
=
-L
$(BRPC_PATH)
/output/lib
$
(
addprefix
-L
,
$(LIBS)
)
STATIC_LINKINGS
+=
-lb
ase
-lbvar
-lbthread
-lbrpc
-ljson2pb
-lmcpack2pb
STATIC_LINKINGS
+=
-lb
rpc
CLIENT_SOURCES
=
client.cpp
SERVER_SOURCES
=
server.cpp
...
...
@@ -31,7 +31,7 @@ clean:
echo_client
:
$(PROTO_OBJS) $(CLIENT_OBJS)
@
echo
"Linking
$@
"
@
$(CXX)
$(LIBPATHS)
-Xlinker
"-("
$^
-Wl
,-Bstatic
$(STATIC_LINKINGS)
-Wl
,-Bdynamic
-Xlinker
"-)"
$(DYNAMIC_LINKINGS)
-o
$@
$(CXX)
$(LIBPATHS)
-Xlinker
"-("
$^
-Wl
,-Bstatic
$(STATIC_LINKINGS)
-Wl
,-Bdynamic
-Xlinker
"-)"
$(DYNAMIC_LINKINGS)
-o
$@
echo_server
:
$(PROTO_OBJS) $(SERVER_OBJS)
@
echo
"Linking
$@
"
...
...
example/redis_c++/Makefile
View file @
70d77b20
...
...
@@ -4,7 +4,7 @@ CXXFLAGS = -std=c++0x -g -DNDEBUG -O2 -D__const__= -pipe -W -Wall -Werror -fPIC
HDRPATHS
=
-I
$(BRPC_PATH)
/output/include
$
(
addprefix
-I
,
$(HDRS)
)
LIBPATHS
=
-L
$(BRPC_PATH)
/output/lib
$
(
addprefix
-L
,
$(LIBS)
)
DYNAMIC_LINKINGS
+=
-lreadline
-lncurses
STATIC_LINKINGS
+=
-lb
ase
-lbvar
-lbthread
-lbrpc
-ljson2pb
-lmcpack2pb
STATIC_LINKINGS
+=
-lb
rpc
PRESS_SOURCES
=
redis_press.cpp
CLI_SOURCES
=
redis_cli.cpp
...
...
test/Makefile
View file @
70d77b20
...
...
@@ -160,37 +160,22 @@ clean:clean_bins
clean_bins
:
@
rm
-rf
$(TEST_BINS)
../libbase.dbg.a
:
@
$(MAKE)
-C
.. libbase.dbg.a
../libbvar.dbg.a
:
@
$(MAKE)
-C
.. libbvar.dbg.a
../libbthread.dbg.a
:
@
$(MAKE)
-C
.. libbthread.dbg.a
../libbrpc.dbg.a
:
@
$(MAKE)
-C
.. libbrpc.dbg.a
../libmcpack2pb.dbg.a
:
@
$(MAKE)
-C
.. libmcpack2pb.dbg.a
../libjson2pb.dbg.a
:
@
$(MAKE)
-C
.. libjson2pb.dbg.a
test_base
:
$(TEST_BASE_OBJS) ../libbase.dbg.a
test_base
:
$(TEST_BASE_OBJS) ../libbrpc.dbg.a
@
echo
"Linking
$@
"
@
$(CXX)
-o
$@
$(LIBPATHS)
-Xlinker
"-("
$^
-Wl
,-Bstatic
$(STATIC_LINKINGS)
-Wl
,-Bdynamic
-Xlinker
"-)"
$(DYNAMIC_LINKINGS)
test_bvar
:
$(TEST_BVAR_OBJS) ../libb
ase.dbg.a ../libbvar
.dbg.a
test_bvar
:
$(TEST_BVAR_OBJS) ../libb
rpc
.dbg.a
@
echo
"Linking
$@
"
@
$(CXX)
-o
$@
$(LIBPATHS)
-Xlinker
"-("
$^
-Wl
,-Bstatic
$(STATIC_LINKINGS)
-Wl
,-Bdynamic
-Xlinker
"-)"
$(DYNAMIC_LINKINGS)
bthread%unittest
:
bthread%unittest.o ../libb
ase.dbg.a ../libbvar.dbg.a ../libbthread
.dbg.a
bthread%unittest
:
bthread%unittest.o ../libb
rpc
.dbg.a
@
echo
"Linking
$@
"
@
$(CXX)
-o
$@
$(LIBPATHS)
-Xlinker
"-("
$^
-Wl
,-Bstatic
$(STATIC_LINKINGS)
-Wl
,-Bdynamic
-Xlinker
"-)"
$(DYNAMIC_LINKINGS)
brpc_%_unittest
:
$(TEST_PROTO_OBJS) brpc_%_unittest.o ../libb
ase.dbg.a ../libbvar.dbg.a ../libbthread.dbg.a ../libbrpc.dbg.a ../libmcpack2pb.dbg.a ../libjson2pb
.dbg.a
brpc_%_unittest
:
$(TEST_PROTO_OBJS) brpc_%_unittest.o ../libb
rpc
.dbg.a
@
echo
"Linking
$@
"
@
$(CXX)
-o
$@
$(LIBPATHS)
-Xlinker
"-("
$^
-Wl
,-Bstatic
$(STATIC_LINKINGS)
-Wl
,-Bdynamic
-Xlinker
"-)"
$(DYNAMIC_LINKINGS)
...
...
tools/patch_from_svn
View file @
70d77b20
...
...
@@ -5,7 +5,6 @@ if [ -z "$1" ]; then
exit
1
fi
PATCHFILE
=
$1
FILTER_TARGET_DIR_CMD
=
if
[
-d
"
$1
/.svn"
]
;
then
if
[
-z
"
$2
"
]
;
then
echo
"Second argument must be a SVN revision"
...
...
@@ -13,12 +12,11 @@ if [ -d "$1/.svn" ]; then
fi
CURRENT_DIR
=
`
pwd
`
SVN_DIR
=
$1
# replace the filepaths in diff
FILTER_TARGET_DIR_CMD
=
-e
\
"s|
$SVN_DIR
|
$CURRENT_DIR
/src/|g"
REV
=
$2
PATCHFILE
=
$REV
.patch
PATCHFILE
=
$
CURRENT_DIR
/
$
REV
.patch
echo
"*** Generating diff of
$SVN_DIR
@
$REV
"
svn diff
$SVN_DIR
-c
$REV
>
$PATCHFILE
cd
$SVN_DIR
&&
svn diff
.
-c
$REV
>
$PATCHFILE
cd
$CURRENT_DIR
fi
MODIFIED_PATCHFILE
=
"
$(
basename
$PATCHFILE
)
.brpc_os"
...
...
@@ -48,7 +46,6 @@ cat $PATCHFILE | sed -e 's/src\/baidu\/rpc\//src\/brpc\//g' \
-e
's/ base\// src\/base\//g'
\
-e
's/ bthread\// src\/bthread\//g'
\
-e
's/ bvar\// src\/bvar\//g'
\
$FILTER_TARGET_DIR_CMD
\
>
$MODIFIED_PATCHFILE
EXTRA_ARGS
=
if
[
-z
"
$DO_RUN
"
]
;
then
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment