Simplicity Studio Version: SV5.7.1.1
1. 需要用到的脚本文件:
1. copy-libs.sh
2. objects.sh
3. dos2unix.sh
4. win.sh
直接运行win.sh 即可。
2.思路:
编译路径:comdir=GNU ARM v10.2.1 - Default
- 将需要用到的 library 复制到 “GNU ARM v10.2.1 - Default/libs” 目录下,并更改objects.mk 相关路径。
- 将文件格式转为unix格式。
- 将绝对路径换成相对路径。
3. 脚本
- copy-libs.sh
#!/bin/bash
dir="./libs/"
if [ ! -d "$dir" ];then
mkdir $dir
echo "创建文件夹成功"
else
echo "文件夹已经存在"
fi
suffix=.a
count=0
for section in $( < objects.mk )
do
if [[ $section == *$suffix* ]]
then
let count++
#删除 \r,不然复制会出错
section=$( echo $section | tr -d "\r" )
echo $count:[$section]
cp $section $dir
fi
done
echo $0 end.
- objects.sh
- dos2unix.sh
- win.sh