Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Kernel Liteos A
提交
875c4629
K
Kernel Liteos A
项目概览
OpenHarmony
/
Kernel Liteos A
大约 1 年 前同步成功
通知
455
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
875c4629
编写于
7月 27, 2021
作者:
O
openharmony_ci
提交者:
Gitee
7月 27, 2021
浏览文件
操作
浏览文件
下载
差异文件
!458 OHOS_Image改为GN编译生成
Merge pull request !458 from Caoruihong/default_gn
上级
0dc79479
abf4d8fb
变更
7
显示空白变更内容
内联
并排
Showing
7 changed file
with
57 addition
and
52 deletion
+57
-52
BUILD.gn
BUILD.gn
+42
-20
Makefile
Makefile
+1
-1
drivers/BUILD.gn
drivers/BUILD.gn
+0
-13
kernel/user/BUILD.gn
kernel/user/BUILD.gn
+7
-3
liteos.gni
liteos.gni
+1
-1
platform/BUILD.gn
platform/BUILD.gn
+2
-14
tools/build/mk/los_config.mk
tools/build/mk/los_config.mk
+4
-0
未找到文件。
BUILD.gn
浏览文件 @
875c4629
...
...
@@ -31,8 +31,12 @@ import("//build/lite/config/component/lite_component.gni")
declare_args() {
tee_enable = false
liteos_name = "OHOS_Image"
}
cmd = "if [ -f $device_path/BUILD.gn ]; then echo true; else echo false; fi"
HAVE_DEVICE_SDK = exec_script("//build/lite/run_shell_cmd.py", [ cmd ], "value")
LITEOS_MENUCONFIG_H = rebase_path("$root_out_dir/config.h")
tee = ""
...
...
@@ -66,7 +70,7 @@ if (exec_script("//build/lite/run_shell_cmd.py", [ "if [ -f $f ]; then echo true
print("liteos_config_file:", liteos_config_file)
exec_script("//build/lite/run_shell_cmd.py", [ "which genconfig || pip install --user kconfiglib" ])
exec_script("//build/lite/run_shell_cmd.py", [ "which genconfig || pip
3
install --user kconfiglib" ])
exec_script("//build/lite/run_shell_cmd.py",
[
...
...
@@ -156,8 +160,16 @@ config("public") {
"net:public",
"shell:public",
"lib:public",
":std_include",
]
configs += [
"$HDFTOPDIR:public",
"//drivers/liteos:public",
]
if (HAVE_DEVICE_SDK) {
configs += [ "$device_path:public" ]
}
}
config("los_nostdinc") {
...
...
@@ -259,21 +271,20 @@ config("los_config") {
":arch_config",
":los_nostdinc",
":los_nostdlib",
":std_include",
]
}
liteos_name = "liteos2"
liteos_out = rebase_path("$target_out_dir/$liteos_name")
executable(liteos_name) {
executable("liteos") {
configs = [] # clear default configs
configs += [ ":los_config" ]
configs += [ ":public" ]
ldflags = [
"-static",
"-Wl,--gc-sections",
"-Wl,-Map=
" + rebase_path("$liteos_out.map")
,
"-Wl,-Map=
$liteos_name.map"
,
"-Wl,--no-eh-frame-hdr",
"-Wl,--whole-archive",
]
libgcc = exec_script("//build/lite/run_shell_cmd.py", [ "$cc -print-libgcc-file-name" ], "trim string")
...
...
@@ -282,28 +293,33 @@ executable(liteos_name) {
ldflags += [ "-Wl,-T" + rebase_path("tools/build/liteos_llvm.ld", root_build_dir) ]
} else {
ldflags += [ "-Wl,-T" + rebase_path("tools/build/liteos.ld", root_build_dir) ]
ldflags += [ "-nostartfiles" ]
ldflags += [ "-
Wl,-
nostartfiles" ]
}
output_dir = target_out_dir
output_name = liteos_name
deps = [
":modules",
]
}
build_ext_component("build_liteos_bin") {
deps = [ ":$liteos_name" ]
exec_path = rebase_path(target_out_dir)
copy("copy_liteos") {
deps = [ ":liteos" ]
sources = [ "$target_out_dir/unstripped/bin/$liteos_name" ]
outputs = [ "$root_out_dir/{{source_file_part}}" ]
}
build_ext_component("build_kernel_image") {
deps = [ ":copy_liteos" ]
exec_path = rebase_path(root_out_dir)
objcopy = "${compile_prefix}objcopy$toolchain_cmd_suffix"
objdump = "${compile_prefix}objdump$toolchain_cmd_suffix"
liteos = rebase_path("$target_out_dir/unstripped/bin/$liteos_name")
command = "$objcopy -O binary $liteos $liteos_out.bin"
command += " && sh -c '$objdump -t $liteos | sort >$liteos_out.sym.sorted'"
command += " && sh -c '$objdump -d $liteos >$liteos_out.asm'"
command = "$objcopy -O binary $liteos_name $liteos_name.bin"
command += " && sh -c '$objdump -t $liteos_name | sort >$liteos_name.sym.sorted'"
command += " && sh -c '$objdump -d $liteos_name >$liteos_name.asm'"
}
group("modules") {
...
...
@@ -321,6 +337,15 @@ group("modules") {
"shell",
"syscall",
]
deps += [
"$HDFTOPDIR",
"//drivers/liteos",
]
if (HAVE_DEVICE_SDK) {
deps += [ device_path ]
}
}
group("apps") {
...
...
@@ -332,10 +357,7 @@ group("tests") {
}
group("kernel") {
deps = [
":make",
":tests",
]
deps = [ ":build_kernel_image" ]
}
group("liteos_a") {
...
...
Makefile
浏览文件 @
875c4629
...
...
@@ -67,7 +67,7 @@ CONFIG ?= $(PRODUCT_PATH)/config/debug$(tee).config
endif
ifeq
($(shell which menuconfig),)
$(shell
pip
install
--user
kconfiglib
>/dev/null)
$(shell
pip
3
install
--user
kconfiglib
>/dev/null)
endif
$(shell
env
CONFIG_
=
$(CONFIG_)
DEVICE_PATH
=
$(DEVICE_PATH)
olddefconfig
>
/dev/null
)
...
...
drivers/BUILD.gn
浏览文件 @
875c4629
...
...
@@ -29,9 +29,6 @@
import("//kernel/liteos_a/liteos.gni")
cmd = "if [ -f $device_path/drivers/BUILD.gn ]; then echo true; else echo false; fi"
HAVE_DEVICE_DRIVERS = exec_script("//build/lite/run_shell_cmd.py", [ cmd ], "value")
module_switch = defined(LOSCFG_DRIVERS)
group("drivers") {
if (module_switch) {
...
...
@@ -43,12 +40,7 @@ group("drivers") {
"char/random",
"char/video",
"mtd/multi_partition",
"//drivers/adapter/khdf/liteos",
"//drivers/liteos",
]
if (HAVE_DEVICE_DRIVERS) {
deps += [ "$device_path/drivers" ]
}
}
}
...
...
@@ -61,10 +53,5 @@ config("public") {
"char/random:public",
"char/video:public",
"mtd/multi_partition:public",
"//drivers/adapter/khdf/liteos:public",
"//drivers/liteos:public",
]
if (HAVE_DEVICE_DRIVERS) {
configs += [ "$device_path/drivers:public" ]
}
}
kernel/user/BUILD.gn
浏览文件 @
875c4629
...
...
@@ -50,14 +50,18 @@ executable(module_name) {
]
output_dir = target_out_dir
output_name = "lib$module_name"
output_extension = "O"
}
group("user") {
public_deps = [ ":$module_name" ]
deps = [ ":copy_userinit" ]
}
config("public") {
lib_dirs = [ "$target_out_dir/unstripped/bin" ]
}
copy("copy_userinit") {
deps = [ ":$module_name" ]
sources = [ "$target_out_dir/unstripped/bin/$module_name" ]
outputs = [ "$root_out_dir/lib$module_name.O" ]
}
liteos.gni
浏览文件 @
875c4629
...
...
@@ -39,7 +39,7 @@ template("kernel_module") {
not_needed(invoker, "*")
}
} else {
s
tatic_library
(target_name) {
s
ource_set
(target_name) {
forward_variables_from(invoker, "*")
}
}
...
...
platform/BUILD.gn
浏览文件 @
875c4629
...
...
@@ -29,9 +29,6 @@
import("//kernel/liteos_a/liteos.gni")
cmd = "if [ -f " + rebase_path("//$LOSCFG_BOARD_CONFIG_PATH/BUILD.gn") + " ]; then echo true; else echo false; fi"
HAVE_BOARD_CONFIG = exec_script("//build/lite/run_shell_cmd.py", [ cmd ], "value")
module_name = "bsp"
kernel_module(module_name) {
sources = [ "main.c" ]
...
...
@@ -64,18 +61,10 @@ kernel_module(module_name) {
group("platform") {
public_deps = [ ":$module_name" ]
deps = [ ":board.ld" ]
if (HAVE_BOARD_CONFIG) {
deps += [ "//$LOSCFG_BOARD_CONFIG_PATH" ]
}
}
config("public") {
include_dirs = [
".",
]
if (HAVE_BOARD_CONFIG) {
configs = [ "//$LOSCFG_BOARD_CONFIG_PATH:public" ]
}
include_dirs = [ "." ]
}
source_set("board") {
...
...
@@ -84,8 +73,7 @@ source_set("board") {
configs = []
configs += [
"$LITEOSTOPDIR:los_config",
"$LITEOSTOPDIR/kernel/base:public",
":public",
"$LITEOSTOPDIR:public",
]
asmflags = [
...
...
tools/build/mk/los_config.mk
浏览文件 @
875c4629
...
...
@@ -29,6 +29,10 @@
CONFIG_FILE
?=
$(LITEOSTOPDIR)
/.config
-include
$(CONFIG_FILE)
LOSCFG_BOARD_CONFIG_PATH
:=
$
(
LOSCFG_BOARD_CONFIG_PATH:
"%"
=
%
)
ifeq
($(wildcard $(LITEOSTOPDIR)/../../$(LOSCFG_BOARD_CONFIG_PATH) $(LOSCFG_BOARD_CONFIG_PATH)),)
LOSCFG_BOARD_CONFIG_PATH
:=
$
(
LOSCFG_BOARD_CONFIG_PATH:%/config/board
=
%/board
)
endif
ifeq
($(LOSCFG_COMPILER_HIMIX_32), y)
CROSS_COMPILE
:=
arm-linux-ohoseabi-
else
ifeq
($(LOSCFG_COMPILER_CLANG_LLVM), y)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录