雷竞技电竞平台Dialog Semiconductor客户支持-uvproj2Makefile sed SDK5.0.3 https://support.dialog-semiconductor.com/resource-keywords/uvproj2makefile-sed-sdk503 已解决:uvproj2Makefile中的sed问题(在OSX上) https://support.dialog-semiconductor.com/solved-sed-problem-uvproj2makefile-osx < div class = "字段field-name-taxonomy-forums field-type-taxonomy-term-reference field-label-above”> < div class = "字段标签" >论坛:,< / div > < div class = "字段条目" > < div class =”field-item甚至“rel = " sioc: has_container " > < a href = " /论坛/ dialog-smartbond-bluetooth-low-energy - % E2 % 80% 93 -软件”“=“sioc:容器sioc:论坛”属性= " rdfs: label skos: prefLabel”数据类型= " " >对话框Smartbond蓝牙低能量-软件< / > < / div > < / div > < / div > < div class =”字段field-name-body field-type-text-with-summary field-label-hidden”> < div class = "字段条目" > < div class =”field-item甚至“财产=“内容:编码”> < p >你好,< / p > < p >我想把次要的引导装载程序项目分成GCC + Makefile。为此,我找到了uvproj2Makefile util脚本,但脚本中的sed命令有问题。最后我发现sed模式似乎不足以覆盖uvproj文件结构,但我不是sed专家,所以不能自己修改它。
我只搜索了第一个错误,似乎所有错误都是由一个原因引起的。

Shell环境是Mac OSX和默认bash, SDK是5.0.3(不能从下拉菜单选择!)< / p > < p >============ 我所做的(1):请从“假设行“美元;是shell ===========
$ pwd
/Users/<username>/Downloads/DA1458x_SDK/5.0.3/utilities/uvproj2Makefile
$ chmod +x ./uvproj2Makefile
$ ./uvproj2Makefile -i ../secondary_bootloader/secondary_bootloader. .uvproj
conversion ../secondary_bootloader/secondary_bootloader. .uvproj Makefile。使用Makefile。tmpl模板…
sed: 1: "s!\ @ \ @core_inc_search_p…“:保有的换行符内替代模式< br / > sed: 1:“/ ^ core_inc_search_paths…“:额外的字符在d < br / > sed命令:1:“/ ^ core_inc_search_paths…“:额外字符结束时p < br / > sed命令:1:“/ ^ core_inc_search_paths…“:坏国旗在替代命令:& # 039;}& # 039;< br / >对话:我:没有这样的文件或目录< br / > sed: 1:“/ & lt; FileType> 1 & lt; \ /文件类型…“:额外字符结束时p < br / > sed命令:我:没有这样的文件或目录< br / > sed: 1:“/ ^ core_src_cfiles /,/^$ ...& ”:额外字符结束时p < br / > sed命令:1: "/^core_src_cfiles /,/^$ ...": bad flag in substitute command: '}'
sed: -i: No such file or directory
sed: 1: "/<FileType>3<\/FileType ...": extra characters at the end of p command
sed: -i: No such file or directory

==================

Secondly I copied the script to echo-out actual "core_inc_search_paths" variable which is defined at line 61 of ./uvproj2Makefile .

==========what I did (2)==========
$ sed -n 's/<IncludePath>\(.*\)<\/IncludePath>/\1/ p' ../secondary_bootloader/secondary_bootloader.uvproj

.\includes;..\..\sdk\platform\include;..\..\sdk\platform\driver\spi;..\..\sdk\platform\driver\i2c_eeprom;..\..\sdk\platform\driver\spi_flash;..\..\s
dk\platform\driver\gpio;..\..\sdk\platform\arch;..\..\sdk\platform\arch\compiler\rvds;..\..\sdk\platform\arch\ll\rvds;..\..\sdk\platform\driver\reg
.\includes
=============================

from this we can see that ".\/includes" appearing twice, and it causes "unescaped newline inside substitute pattern" error.
I understand the sed part is picking up include paths from <IncludePath>...</IncludePath> line of the uvproj file.
I checked the uvproj file and found the tag several lines, mostly no value but only 2 of them have ".\includes;...." and ".\includes" values.

My guess is the script assumes <IncludePath> tag with valid value appears only once.
Could you please check those sed line(s) to correctly convert those paths, and make it work.

Thanks in advance,
Kazuki

Device: 
Sun, 2016年1月31日15:49:07 +0000 山本和木 2646年https://support.dialog-semiconductor.com https://support.dialog-semiconductor.com/solved-sed-problem-uvproj2makefile-osx#comments