Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
M
mediasoup
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
聂卓夫
mediasoup
Commits
8062c365
提交
8062c365
authored
8月 03, 2015
作者:
Iñaki Baz Castillo
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add jsoncpp as Git submodule.
上级
4cebbc41
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
67 行增加
和
62 行删除
+67
-62
.gitmodules
.gitmodules
+3
-0
Makefile
Makefile
+63
-62
jsoncpp
deps/jsoncpp
+1
-0
没有找到文件。
.gitmodules
0 → 100644
浏览文件 @
8062c365
[submodule "deps/jsoncpp"]
path = deps/jsoncpp
url = https://github.com/open-source-parsers/jsoncpp.git
Makefile
浏览文件 @
8062c365
program
_NAME
:=
mediasoup
APP
_NAME
:=
mediasoup
#
#
# Compiler
# Compiler
#
#
# CXX = g++-4.8
# CXX
:
= g++-4.8
# CXX = g++-4.9 -fdiagnostics-color=auto
# CXX
:
= g++-4.9 -fdiagnostics-color=auto
# CXX = clang++
# CXX
:
= clang++
#
#
#
CXXFLAGS Option
s
#
Development flag
s
# Comment/uncomment them during development.
# Comment/uncomment them during development.
#
#
DO_DEBUG_SYMBOLS
:=
-g
DO_DEBUG_SYMBOLS
:=
-g
...
@@ -17,10 +17,10 @@ DO_DEBUG_SYMBOLS := -g
...
@@ -17,10 +17,10 @@ DO_DEBUG_SYMBOLS := -g
# DO_OPTIMIZE := -O3
# DO_OPTIMIZE := -O3
# DO_PEDANTIC := -pedantic -Wno-gnu-zero-variadic-macro-arguments
# DO_PEDANTIC := -pedantic -Wno-gnu-zero-variadic-macro-arguments
#
#
CXXFLAGS
+
=
$(DO_DEBUG_SYMBOLS)
$(DO_SANITIZE)
$(DO_OPTIMIZE)
$(DO_PEDANTIC)
DEV_FLAGS
:
=
$(DO_DEBUG_SYMBOLS)
$(DO_SANITIZE)
$(DO_OPTIMIZE)
$(DO_PEDANTIC)
#
#
# C
XXFLAGS c
ustom macros
# Custom macros
# Added to the CXXFLAGS exported variable (before running make).
# Added to the CXXFLAGS exported variable (before running make).
#
#
# -DMS_DEVEL enables MS_TRACE().
# -DMS_DEVEL enables MS_TRACE().
...
@@ -30,98 +30,99 @@ CXXFLAGS += $(DO_DEBUG_SYMBOLS) $(DO_SANITIZE) $(DO_OPTIMIZE) $(DO_PEDANTIC)
...
@@ -30,98 +30,99 @@ CXXFLAGS += $(DO_DEBUG_SYMBOLS) $(DO_SANITIZE) $(DO_OPTIMIZE) $(DO_PEDANTIC)
# Settings.
# Settings.
#
#
#
Directory where the executable will be placed
.
#
App source files
.
program_BIN_DIR
:=
./bin
APP_SOURCES
:=
$(
shell
find ./src
-name
"*.cpp"
)
#
Directories containing program header files
.
#
App headers directory
.
program_INCLUDE_DIRS
:=
./include
APP_HEADERS_DIR
:=
./include
# External libraries with pkg-config support.
# App header files (just for documentation).
program_PKG_LIBRARIES
=
libuv
>=
1.0.2, libconfig++
>=
1.4.8, openssl
>=
1.0.1, libsrtp
>=
1.5.2
APP_HEADERS
:=
$(
shell
find
$(APP_HEADERS_DIR)
-name
"*.h"
)
# Other libraries to link with (don't put here those libs having pkg-config file).
program_OTHER_LIBRARIES
:=
pthread
#
Directories where search for other libraries
.
#
App binary directory
.
# program_OTHER_LIBRARIES_DIRS := /usr/local/lib
APP_BIN_DIR
:=
./bin
#
Directories containing other libraries header files
.
#
System libraries to link with
.
# program_OTHER_LIBRARIES_INCLUDE_DIRS := /usr/local/include
SYSTEM_LIBRARIES
:=
pthread
# External libraries with pkg-config support.
PKG_LIBRARIES
:=
PKG_LIBRARIES
+=
libuv
>=
1.6.1
PKG_LIBRARIES
+=
libconfig++
>=
1.4.8
PKG_LIBRARIES
+=
openssl
>=
1.0.1
PKG_LIBRARIES
+=
libsrtp
>=
1.5.2
# All the .cpp files.
# Dependencies source files.
program_CXX_SRCS
:=
$
(
wildcard src/
*
.cpp src/
*
/
*
.cpp src/
*
/
*
/
*
.cpp src/
*
/
*
/
*
/
*
.cpp src/
*
/
*
/
*
/
*
/
*
.cpp
)
DEP_SOURCES
:=
DEP_SOURCES
+=
./deps/jsoncpp/dist/jsoncpp.cpp
# All the .h files.
# Dependencies header directories.
program_CXX_INCLUDES
:=
$
(
wildcard include/
*
.h include/
*
/
*
.h include/
*
/
*
/
*
.h include/
*
/
*
/
*
/
*
.h include/
*
/
*
/
*
/
*
/
*
.h
)
DEP_HEADERS_DIRS
:=
DEP_HEADERS_DIRS
+=
./deps/jsoncpp/dist
#
C++ object files to build
.
#
Dependencies static libraries to link with
.
program_CXX_OBJS
:=
${
program_CXX_SRCS
:.cpp
=.o
}
DEP_LIBRARIES
:=
# Get all the .o files under src. Useful for 'make clean' as objects belinging to
# Object files to build.
# already deleted source files are also deleted.
ALL_OBJS
=
${
APP_SOURCES
:.cpp
=.o
}
${
DEP_SOURCES
:.cpp
=.o
}
program_all_CXX_OBJS
=
$
(
wildcard src/
*
.o src/
*
/
*
.o src/
*
/
*
/
*
.o src/
*
/
*
/
*
/
*
.o src/
*
/
*
/
*
/
*
/
*
.o
)
# CPPFLAGS is the C preprocessor flags, so anything that compiles a C or C++ source
# CPPFLAGS is the C preprocessor flags, so anything that compiles a C or C++ source
# file into an object file will use this flag.
# file into an object file will use this flag.
# This adds -I$(includedir) for every include directory in $(program_INCLUDE_DIRS) and
CPPFLAGS
+=
-I
$(APP_HEADERS_DIR)
# $(program_OTHER_LIBRARIES_INCLUDE_DIRS).
CPPFLAGS
+=
$
(
foreach
dir
,
$(DEP_HEADERS_DIRS)
,
-I
$(dir)
)
CPPFLAGS
+=
$
(
foreach includedir,
$(program_INCLUDE_DIRS)
,
-I
$(includedir)
)
CPPFLAGS
+=
$(
shell
pkg-config
--cflags
"
$(PKG_LIBRARIES)
"
)
CPPFLAGS
+=
$
(
foreach includedir,
$(program_OTHER_LIBRARIES_INCLUDE_DIRS)
,
-I
$(includedir)
)
# CXXFLAGS gives a list of flags that should be passed to the C++ compiler (use
# CXXFLAGS gives a list of flags that should be passed to the C++ compiler (use
# this, for example, to set the version of the C++ language, to specify the
# this, for example, to set the version of the C++ language, to specify the
# warning settings, or for other options specific to the C++ compiler).
# warning settings, or for other options specific to the C++ compiler).
CXXFLAGS
+=
-std
=
c++11
-Wall
CXXFLAGS
+=
-std
=
c++11
-Wall
$(DEV_FLAGS)
# LDFLAGS are used when linking, this will cause the appropriate flags to
# LDFLAGS are used when linking, this will cause the appropriate flags to
# be passed to the linker.
# be passed to the linker.
# This adds -L$(librarydir) for every library directory given in $(program_OTHER_LIBRARIES_DIRS)
LDFLAGS
+=
$
(
foreach library,
$(SYSTEM_LIBRARIES)
,
-l
$(library)
)
# and -l$(library) for every library given in $(program_OTHER_LIBRARIES).
LDFLAGS
+=
$(
shell
pkg-config
--libs
"
$(PKG_LIBRARIES)
"
)
LDFLAGS
+=
$
(
foreach librarydir,
$(program_OTHER_LIBRARIES_DIRS)
,
-L
$(librarydir)
)
LDFLAGS
+=
$
(
foreach library,
$(program_OTHER_LIBRARIES)
,
-l
$(library)
)
# Add flags required by external libraries with pkg-config support.
CPPFLAGS
+=
$(
shell
pkg-config
--cflags
"
$(program_PKG_LIBRARIES)
"
)
LDFLAGS
+=
$(
shell
pkg-config
--libs
"
$(program_PKG_LIBRARIES)
"
)
#
#
# Targets
# Targets
#
#
# This indicates that "all",
program
_NAME, "check_pkg_libraries" and "clean" are
# This indicates that "all",
APP
_NAME, "check_pkg_libraries" and "clean" are
# "phony targets". Therefore calling "make XXXX" should execute the content of its
# "phony targets". Therefore calling "make XXXX" should execute the content of its
# build rules, even if a newer file named "XXXX" exists.
# build rules, even if a newer file named "XXXX" exists.
.PHONY
:
all $(
program_NAME) check_pkg_libraries clean distclean
.PHONY
:
all $(
APP_NAME) check_pkg_libraries clean deps
# This is first build rule in the Makefile, and so executing "make" and executing
# This is first build rule in the Makefile, and so executing "make" and executing
# "make all" are the same. The target simply depends on $(
program
_NAME).
# "make all" are the same. The target simply depends on $(
APP
_NAME).
all
:
$(
program
_NAME)
all
:
$(
APP
_NAME)
# The
program
depends on the object files (which are automatically built using the
# The
app
depends on the object files (which are automatically built using the
# predefined build rules, nothing needs to be given explicitly for them).
# predefined build rules, nothing needs to be given explicitly for them).
# The build rule $(LINK.cc) is used to link the object files and output a file with
# The build rule $(LINK.cc) is used to link the object files and output a file with
# the same name as the
program
. Note that LINK.cc makes use of CXX, CXXFLAGS,
# the same name as the
app
. Note that LINK.cc makes use of CXX, CXXFLAGS,
# LFLAGS, etc. LINK.cc is usually defined as: $(CXX) $(CXXFLAGS) $(CPPFLAGS)
# LFLAGS, etc. LINK.cc is usually defined as: $(CXX) $(CXXFLAGS) $(CPPFLAGS)
# $(LDFLAGS) $(TARGET_ARCH).
# $(LDFLAGS) $(TARGET_ARCH).
$(
program_NAME)
:
check_pkg_libraries $(program_CXX
_OBJS)
$(
APP_NAME)
:
check_pkg_libraries $(ALL
_OBJS)
mkdir
-p
$(program
_BIN_DIR)
@
mkdir
-p
$(APP
_BIN_DIR)
$
(
LINK.cc
)
$(
program_CXX_OBJS)
-o
$(program_BIN_DIR)
/
$(program
_NAME)
$
(
LINK.cc
)
$(
ALL_OBJS)
$(DEP_LIBRARIES)
-o
$(APP_BIN_DIR)
/
$(APP
_NAME)
# Check the required libraries with pkg-support.
# Check the required libraries with pkg-support.
check_pkg_libraries
:
check_pkg_libraries
:
pkg-config
--exists
--print-errors
"
$(
program_
PKG_LIBRARIES)
"
pkg-config
--exists
--print-errors
"
$(PKG_LIBRARIES)
"
# This target removes the built
program
and the generated object files. The @ symbol
# This target removes the built
app
and the generated object files. The @ symbol
# indicates that the line should be run silently, and the - symbol indicates that
# indicates that the line should be run silently, and the - symbol indicates that
# errors should be ignored (i.e., the file
already
doesn't exist).
# errors should be ignored (i.e., the file doesn't exist).
clean
:
clean
:
@
-
$(RM)
$(program_NAME)
$(RM)
-rf
$(APP_BIN_DIR)
@
-
$(RM)
$(program_all_CXX_OBJS)
$(RM)
$(ALL_OBJS)
# doc: check_pkg_libraries $(program_CXX_OBJS)
deps
:
# cldoc generate $(CXXFLAGS) $(CPPFLAGS) $(LDFLAGS) --output cldoc $(program_CXX_SRCS)
# Retrieve Git data for dependencies.
#
$(
shell
git submodule init
)
doc
:
check_pkg_libraries $(program_CXX_OBJS)
#
$(
shell
git submodule update
)
cldoc generate
$(CXXFLAGS)
$(CPPFLAGS)
$(LDFLAGS)
--
--output
cldoc
$(program_CXX_SRCS)
$(program_CXX_INCLUDES)
# jsoncpp stuff.
$(
shell
cd
./deps/jsoncpp
&&
python amalgamate.py
>
/dev/null
)
doc
:
cldoc generate
$(CXXFLAGS)
$(CPPFLAGS)
$(LDFLAGS)
--
--output
cldoc
$(APP_SOURCES)
$(APP_HEADERS)
jsoncpp
@
d84702c9
Subproject commit d84702c9036505d0906b2f3d222ce5498ec65bc6
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论