从u-boot的编译结果中提取include目录

本文介绍了一种用于分析U-Boot SPL的shell脚本工具,通过该工具可以解析和提取U-Boot SPL的配置信息,包括目录和文件名表,为U-Boot的定制和优化提供便利。

ac@DESKTOP-BJ1MJGM:~/u-boot-2019.01/spl$ arm-linux-gnueabihf-objdump -g u-boot-spl | awk '/The Directory Table/,/The File Name Table/' | awk '{if (strtonum($1) > 0)print $2}' | sort -k2n | uniq

#!/bin/bash
basedir=`cd $(dirname $0); pwd -P`
cat $basedir/head.xml
objdump -g $1 | awk '/The Directory Table/,/The File Name Table/' | awk '{if (strtonum($1) > 0)print $2}' | sort -k2n | uniq | awk '{print "<includepath workspace_path=\"false\">"$0"</includepath>"}'
cat $basedir/central.xml
objdump -g $1 | awk '/The Directory Table/,/The File Name Table/' | awk '{if (strtonum($1) > 0)print $2}' | sort -k2n | uniq | awk '{print "<includepath workspace_path=\"false\">"$0"</includepath>"}'
cat $basedir/tail.xml

 下载地址

使用说明:

./tools.sh ~/u-boot-2019.01/spl/u-boot-spl ~/u-boot-2019.01/spl/u-boot.cfg

转载于:https://www.cnblogs.com/arci/p/10413944.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值