Toggle navigation
Toggle navigation
此项目
正在载入...
Sign in
胡斌
/
srs
转到一个项目
Toggle navigation
项目
群组
代码片段
帮助
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
winlin
2014-02-28 20:52:26 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
985034860cbc15a1616785b5e234cb85808966b0
98503486
1 parent
7e0cf2b9
add comments for depends
隐藏空白字符变更
内嵌
并排对比
正在显示
1 个修改的文件
包含
40 行增加
和
13 行删除
trunk/auto/modules.sh
trunk/auto/modules.sh
查看文件 @
9850348
# generate the module info to Makefile
#
# params:
# $SRS_OBJS the objs directory. ie. objs
# $SRS_MAKEFILE the makefile name. ie. Makefile
# $MODULE_DIR the module dir. ie. src/os/linux
# $MODULE_ID the id of module. ie. CORE
# $MODULE_DEPENDS array, the denpend MODULEs id. ie. (CORE OS)
# $ModuleLibIncs array, the depend 3rdpart library includes. ie. (objs/st-1.9/obj objs/libx264/obj)
# $MODULE_FILES array, the head/cpp files of modules. ie. (public log)
#
# $SRS_OBJS the objs directory. ie. objs
# $SRS_MAKEFILE the makefile name. ie. Makefile
#
# $MODULE_DIR the module dir. ie. src/os/linux
# $MODULE_ID the id of module. ie. CORE
# $MODULE_DEPENDS array, the denpend MODULEs id. ie. (CORE OS)
# $ModuleLibIncs array, the depend 3rdpart library includes. ie. (objs/st-1.9/obj objs/libx264/obj)
# $MODULE_FILES array, the head/cpp files of modules. ie. (public log)
#
# returns:
#
$MODULE_OBJS array, the objects of the modules.
#
$MODULE_OBJS array, the objects of the modules, used for link the binary
FILE
=
${
SRS_OBJS
}
/
${
SRS_MAKEFILE
}
echo
"#####################################################################################"
>>
${
FILE
}
echo
"# the
${
MODULE_ID
}
module."
>>
${
FILE
}
echo
"#####################################################################################"
>>
${
FILE
}
echo
>>
${
FILE
}
# INCS
INCS_NAME
=
"
${
MODULE_ID
}
_INCS"
echo
"# the
${
MODULE_ID
}
module."
>>
${
FILE
}
echo
"# INCS for
${
MODULE_ID
}
, headers of module and its depends to compile"
>>
${
FILE
}
#
# the public include files, for example:
# CORE_MODULE_INCS = -Isrc/core
echo
"
${
MODULE_ID
}
_MODULE_INCS = -I
${
MODULE_DIR
}
"
>>
${
FILE
}
#
# the private include files, for example:
# CORE_INCS = -Isrc/core -Iobjs/st -Iobjs -Iobjs/hp -Iobjs
# MAIN_INCS = -Isrc/main $(CORE_MODULE_INCS) -Iobjs/st -Iobjs
# where the public will be used for other modules which depends on it.
INCS_NAME
=
"
${
MODULE_ID
}
_INCS"
#
# current module header files
echo
-n
"
${
INCS_NAME
}
= -I
${
MODULE_DIR
}
"
>>
${
FILE
}
#
# depends module header files
for
item
in
${
MODULE_DEPENDS
[*]
}
;
do
DEP_INCS_NAME
=
"
${
item
}
_INCS"
do
DEP_INCS_NAME
=
"
${
item
}
_MODULE_INCS"
echo
-n
"
\$
(
${
DEP_INCS_NAME
}
) "
>>
${
FILE
}
done
#
# depends library header files
for
item
in
${
ModuleLibIncs
[*]
}
;
do
echo
-n
"-I
${
item
}
"
>>
${
FILE
}
done
echo
""
>>
${
FILE
}
echo
""
>>
${
FILE
}
;
echo
""
>>
${
FILE
}
# DEPS
echo
"# DEPS for
${
MODULE_ID
}
, the depends of make schema"
>>
${
FILE
}
# depends on headers of self module, for example:
# CORE_DEPS = src/core/srs_core.hpp
DEPS_NAME
=
"
${
MODULE_ID
}
_DEPS"
echo
-n
"
${
DEPS_NAME
}
= "
>>
${
FILE
}
for
item
in
${
MODULE_FILES
[*]
}
;
do
...
...
@@ -36,6 +60,8 @@ for item in ${MODULE_FILES[*]}; do
echo
-n
"
${
HEADER_FILE
}
"
>>
${
FILE
}
fi
done
# depends on other modules, for example:
# MAIN_DEPS = $(CORE_DEPS)
for
item
in
${
MODULE_DEPENDS
[*]
}
;
do
DEP_DEPS_NAME
=
"
${
item
}
_DEPS"
echo
-n
"
\$
(
${
DEP_DEPS_NAME
}
) "
>>
${
FILE
}
...
...
@@ -43,6 +69,7 @@ done
echo
""
>>
${
FILE
}
;
echo
""
>>
${
FILE
}
# OBJ
echo
"# OBJ for
${
MODULE_ID
}
, each object file"
>>
${
FILE
}
MODULE_OBJS
=()
for
item
in
${
MODULE_FILES
[*]
}
;
do
CPP_FILE
=
"
${
MODULE_DIR
}
/
${
item
}
.cpp"
...
...
@@ -56,7 +83,7 @@ for item in ${MODULE_FILES[*]}; do
done
echo
""
>>
${
FILE
}
#
Makefile
#
parent Makefile, to create module output dir before compile it.
echo
" mkdir -p
${
SRS_OBJS
}
/
${
MODULE_DIR
}
"
>>
${
SRS_MAKEFILE
}
echo
-n
"generate module
${
MODULE_ID
}
ok"
;
echo
'!'
;
...
...
请
注册
或
登录
后发表评论