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