建议使用现成的东西 https://bbs.histb.com/ (无利益关系
说明:系统:Ubuntu 18.04 ,以sdkname指代sdk目录|压缩包
update,建议使用ubuntu 14.04,避免依赖错误,Docker打包好的编译环境(点我)
下载海思sdk:
链接:https://pan.baidu.com/s/1zCv8gYGjsRPkF6VE5FfjSg
提取码:uqrq
输出结果:out/芯片型号/板子型号/image
tar xvf sdkname.tar.gz<br>sudo chown -R username:username sdkname #更改所有者
cd sdkname
编辑 server_install.sh
将:result=$(make --version | awk '$0~/[0-9]\.[0-9]/{print $3}')
check_tools "make" "${result}" "=" 3 81 0
注释,保存之
执行:sudo bash server_install.sh
执行 :source ./env.sh
然后
make tools
cp configs/芯片型号/xx_cfg.mak cfg.mak
make menuconfig 设置编译选项
一键编译:make build
其他
分步骤编译
make prepare // 准备编译文件 编译其他目标前必须运行该命令
make hiboot // 编译boot 生成fastboot-burn.bin
make linux // 编译linux 生成hi_kernel.bin
make rootfs //编译rootfs 生成基本的rootfs目录 包括基本目录结构、busybox、C库、utils、基本启动脚本等
make common // 编译common 生成common的库和驱动
make msp // 编译msp 生成msp各个模块的库和驱动
make component //编译component 生成component的库和驱动
make rootbox //编译rootbox 生成用于制作根文件系统镜像的文件夹rootbox
make fs // 编译fs 生成用于烧写flash的根文件系统镜像 rootbox_xxx.jffs2/rootbox_xxx.yaffs/rootbox_xxx.cramfs
make sample //编译sample 生成各个sample的可执行程序 位于sample的各个子目录下