Hello,
I am trying to convert secondary bootloader project into GCC+Makefile. For this I found uvproj2Makefile util script but having problem with sed command in the script.
Finally I found sed pattern seems not good enough to cover uvproj file structure but I am not sed specialist, so cannot mod it by myself.
I only searched about the first error and seems all errors caused from one reason.
Shell environment is Mac OSX and default bash, SDK is 5.0.3(cannot select from dropdown!).
============ what i did(1): please assume lines from "$" is the input to shell ===========
$ pwd
/Users/
$ chmod +x ./uvproj2Makefile
$ ./uvproj2Makefile -i ../secondary_bootloader/secondary_bootloader.uvproj
把. . / secondary_bootloader /自ry_bootloader.uvproj to Makefile.out using Makefile.tmpl as template...
sed: 1: "s!\@\@core_inc_search_p ...": unescaped newline inside substitute pattern
sed: 1: "/^core_inc_search_paths ...": extra characters at the end of d command
sed: 1: "/^core_inc_search_paths ...": extra characters at the end of p command
sed: 1: "/^core_inc_search_paths ...": bad flag in substitute command: '}'
sed: -i: No such file or directory
sed: 1: "/
sed: -i: No such file or directory
sed: 1: "/^core_src_cfiles /,/^$ ...": extra characters at the end of p command
sed: 1: "/^core_src_cfiles /,/^$ ...": bad flag in substitute command: '}'
sed: -i: No such file or directory
sed: 1: "/
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/
.\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
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
Could you please check those sed line(s) to correctly convert those paths, and make it work.
Thanks in advance,
Kazuki

Hi Kazuki,
I dont have a OSX to test it, although it should be a problem related with the line endings. I ve attached a uvproj2Makefile that should work in OS X. Also as an alternative you can try to install the gnu-sed, which should be compatible with our script. If you do that, then you can convert all references to sed in uvproj2Makefile to gnu-sed.
Thanks MT_dialog
Hello MT_dialog,
Thank you for your help.
Firstly, with "mac-sed" new script still didn't work - output file was blank.
and then I installed gnu-sed by homebrew as gsed, replace all 'sed' to 'gsed' and then worked.
The error I reported seems to be mac-sed problem; mac-sed seems based on BSD sed
and found some reports saying there are option mismatches with GNU sed.
Thanks && Regards,
Kazuki