Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Kernel Liteos A
提交
1722aaa8
K
Kernel Liteos A
项目概览
OpenHarmony
/
Kernel Liteos A
大约 2 年 前同步成功
通知
475
Star
414
Fork
55
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
4
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
K
Kernel Liteos A
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
4
Issue
4
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
1722aaa8
编写于
7月 31, 2021
作者:
O
openharmony_ci
提交者:
Gitee
7月 31, 2021
浏览文件
操作
浏览文件
下载
差异文件
!475 将toybox和mksh加入到gn编译代替其make编译
Merge pull request !475 from Caoruihong/gn_build_apps
上级
88358ab3
c54bfa16
变更
5
显示空白变更内容
内联
并排
Showing
5 changed file
with
95 addition
and
12 deletion
+95
-12
Makefile
Makefile
+4
-3
apps/BUILD.gn
apps/BUILD.gn
+3
-3
apps/mksh/BUILD.gn
apps/mksh/BUILD.gn
+51
-2
apps/module.mk
apps/module.mk
+2
-2
apps/toybox/BUILD.gn
apps/toybox/BUILD.gn
+35
-2
未找到文件。
Makefile
浏览文件 @
1722aaa8
...
@@ -152,8 +152,9 @@ $(LITEOS_LIBS_TARGET): $(__LIBS) sysroot
...
@@ -152,8 +152,9 @@ $(LITEOS_LIBS_TARGET): $(__LIBS) sysroot
$(HIDE)
echo
"=============== make lib done ==============="
$(HIDE)
echo
"=============== make lib done ==============="
##### make menuconfig #####
##### make menuconfig #####
menuconfig
:
KCONFIG_CMDS
=
$(
notdir
$(
wildcard
$(
dir
$(
shell
which menuconfig
))
*
config
))
$(HIDE)
menuconfig
$(KCONFIG_CMDS)
:
$(HIDE)$@
$(args)
##### menuconfig end #######
##### menuconfig end #######
$(LITEOS_MENUCONFIG_H)
:
.config
$(LITEOS_MENUCONFIG_H)
:
.config
...
@@ -229,4 +230,4 @@ update_config:
...
@@ -229,4 +230,4 @@ update_config:
$(HIDE)
test
-f
"
$(CONFIG)
"
&&
cp
-v
"
$(CONFIG)
"
.config
&&
menuconfig
&&
savedefconfig
--out
"
$(CONFIG)
"
$(HIDE)
test
-f
"
$(CONFIG)
"
&&
cp
-v
"
$(CONFIG)
"
.config
&&
menuconfig
&&
savedefconfig
--out
"
$(CONFIG)
"
.PHONY
:
all lib clean cleanall $(LITEOS_TARGET) debug release help update_all_config update_config
.PHONY
:
all lib clean cleanall $(LITEOS_TARGET) debug release help update_all_config update_config
.PHONY
:
prepare sysroot cleanrootfs $(ROOTFS) $(ROOTFSDIR) $(APPS)
menuconfig
$(LITEOS_LIBS_TARGET) $(__LIBS) $(OUT)
.PHONY
:
prepare sysroot cleanrootfs $(ROOTFS) $(ROOTFSDIR) $(APPS)
$(KCONFIG_CMDS)
$(LITEOS_LIBS_TARGET) $(__LIBS) $(OUT)
apps/BUILD.gn
浏览文件 @
1722aaa8
...
@@ -35,13 +35,13 @@ group("apps") {
...
@@ -35,13 +35,13 @@ group("apps") {
if (defined(LOSCFG_SHELL)) {
if (defined(LOSCFG_SHELL)) {
deps += [
deps += [
"shell",
"shell",
#
"mksh",
"mksh",
#
"toybox",
"toybox",
]
]
}
}
if (defined(LOSCFG_USER_INIT_DEBUG)) {
if (defined(LOSCFG_USER_INIT_DEBUG)) {
#
deps += [ "init" ]
deps += [ "init" ]
}
}
if (defined(LOSCFG_NET_LWIP_SACK_TFTP)) {
if (defined(LOSCFG_NET_LWIP_SACK_TFTP)) {
...
...
apps/mksh/BUILD.gn
浏览文件 @
1722aaa8
...
@@ -34,7 +34,56 @@ group("mksh") {
...
@@ -34,7 +34,56 @@ group("mksh") {
deps = [ ":build_mksh" ]
deps = [ ":build_mksh" ]
}
}
copy("copy_mksh_src") {
sources = [ "$LITEOSTHIRDPARTY/mksh" ]
outputs = [ "$target_out_dir/mksh_build" ]
}
build_ext_component("build_mksh") {
build_ext_component("build_mksh") {
exec_path = rebase_path(target_out_dir)
deps = [ ":copy_mksh_src" ]
command = "make -C $LITEOSTHIRDPARTY/mksh"
deps += [ "//prebuilts/lite/sysroot" ]
exec_path = rebase_path("$target_out_dir/mksh_build")
cflags = [
"-flto",
"-fdata-sections",
"-ffunction-sections",
"-Oz",
"-fstack-protector-strong",
"-D_FORTIFY_SOURCE=2",
"-DMKSH_DISABLE_TTY_WARNING",
"-DMKSH_SMALL=1",
"-DMKSH_ASSUME_UTF8=1",
"-DMKSH_SMALL_BUT_FAST=0",
"-DMKSH_S_NOVI=1",
"-DHAVE_CAN_FSTACKPROTECTORSTRONG=1",
"-DMKSH_LESS_CMDLINE_EDITING",
"-DMKSH_LESS_BUILDINS",
"-DMKSH_NO_INITCOMS",
"-DADAPT_FOR_LITEOS_A",
]
cflags = string_join(" ", cflags)
extra_flags = string_join(" ", target_arch_cflags)
if (ohos_build_compiler == "clang") {
extra_flags += " --target=$target_triple"
extra_flags += " --sysroot=" + rebase_path(ohos_current_sysroot)
}
command = "rm -rf .git && env"
command += " CC=\"$ohos_current_cc_command\""
command += " TARGET_OS=OpenHarmony"
command += " CFLAGS=\"$cflags $extra_flags\""
command += " LDFLAGS=\"-Wl,--gc-sections -flto -O2\""
command += " sh ./Build.sh -r"
# copy mksh and .mkshrc to out dir
command += " && mkdir -p "
command += rebase_path("$root_out_dir/bin", exec_path)
command += " "
command += rebase_path("$root_out_dir/etc", exec_path)
command += " && $ohos_current_strip_command mksh -o "
command += rebase_path("$root_out_dir/bin/mksh", exec_path)
command += " && cp -f .mkshrc "
command += rebase_path("$root_out_dir/etc", exec_path)
}
}
apps/module.mk
浏览文件 @
1722aaa8
...
@@ -33,8 +33,8 @@ APP_SUBDIRS :=
...
@@ -33,8 +33,8 @@ APP_SUBDIRS :=
ifeq
($(LOSCFG_SHELL), y)
ifeq
($(LOSCFG_SHELL), y)
APP_SUBDIRS
+=
shell
APP_SUBDIRS
+=
shell
APP_SUBDIRS
+=
mksh
#
APP_SUBDIRS += mksh
APP_SUBDIRS
+=
toybox
#
APP_SUBDIRS += toybox
endif
endif
ifeq
($(LOSCFG_USER_INIT_DEBUG), y)
ifeq
($(LOSCFG_USER_INIT_DEBUG), y)
...
...
apps/toybox/BUILD.gn
浏览文件 @
1722aaa8
...
@@ -34,7 +34,40 @@ group("toybox") {
...
@@ -34,7 +34,40 @@ group("toybox") {
deps = [ ":build_toybox" ]
deps = [ ":build_toybox" ]
}
}
copy("copy_toybox_src") {
sources = [ "$LITEOSTHIRDPARTY/toybox" ]
outputs = [ "$target_out_dir/toybox_build" ]
}
copy("copy_toybox_config") {
deps = [ ":copy_toybox_src" ]
sources = [ "liteos_a_custom.config" ]
outputs = [ "$target_out_dir/{{source_file_part}}" ]
}
build_ext_component("build_toybox") {
build_ext_component("build_toybox") {
exec_path = rebase_path(target_out_dir)
deps = [ ":copy_toybox_src", ":copy_toybox_config" ]
command = "make -C $LITEOSTHIRDPARTY/toybox"
deps += [ "//prebuilts/lite/sysroot" ]
exec_path = rebase_path("$target_out_dir/toybox_build")
cflags = [
"-fstack-protector-strong",
"-D_FORTIFY_SOURCE=2",
]
cflags = string_join(" ", cflags)
extra_flags = string_join(" ", target_arch_cflags)
if (ohos_build_compiler == "clang") {
extra_flags += " --target=$target_triple"
extra_flags += " --sysroot=" + rebase_path(ohos_current_sysroot)
}
command = "rm -rf .git && cp -rfp porting/liteos_a/. . && env"
command += " CC=\"$ohos_current_cc_command\""
command += " STRIP=\"$ohos_current_strip_command\""
command += " OUTNAME=toybox"
command += " CFLAGS=\"$cflags $extra_flags\""
command += " make toybox"
command += " && install -D toybox "
command += rebase_path("$root_out_dir/bin/toybox", exec_path)
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录