<div dir="ltr"><div dir="ltr">On Wed, Apr 22, 2020 at 11:40 AM Sebastian Huber <<a href="mailto:sebastian.huber@embedded-brains.de">sebastian.huber@embedded-brains.de</a>> wrote:<br></div><div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On 21/04/2020 19:18, Gedare Bloom wrote:<br>
<br>
> On Tue, Apr 21, 2020 at 8:42 AM Vijay Kumar Banerjee <<a href="mailto:vijay@rtems.org" target="_blank">vijay@rtems.org</a>> wrote:<br>
>><br>
>><br>
>> On Tue, Apr 21, 2020 at 7:10 AM Chris Johns <<a href="mailto:chrisj@rtems.org" target="_blank">chrisj@rtems.org</a>> wrote:<br>
>>> On 21/4/20 7:03 am, Vijay Kumar Banerjee wrote:<br>
>>>> On Mon, Apr 20, 2020 at 11:33 PM Sebastian Huber<br>
>>>> <<a href="mailto:sebastian.huber@embedded-brains.de" target="_blank">sebastian.huber@embedded-brains.de</a><br>
>>>> <mailto:<a href="mailto:sebastian.huber@embedded-brains.de" target="_blank">sebastian.huber@embedded-brains.de</a>>> wrote:<br>
>>>> We don't have to reinvent the wheel. We could copy the wscript of the<br>
>>>> new build system to the examples and add a couple of specification<br>
>>>> items. Building test programs is really not that much different to<br>
>>>> building applications.<br>
>>>><br>
>>>> Just to make sure I understood correctly: Do you suggest that we replace<br>
>>>> the rtems_waf in examples with the wscript similar to the new build system?<br>
>> Hi,<br>
>>> Please do not do this. I am reluctant to again head down the path of<br>
>>> exposing the internals of the rtems.git build system to users via<br>
>>> examples. It says to our users they need to use this approach to<br>
>>> building RTEMS applications and that is not the case. It also removes<br>
>>> the need for us to make sure we correctly handle exporting the needed<br>
>>> build data for a BSP. I like the current separation.<br>
>>><br>
>> Understood.<br>
>>> I prefer the examples are just that, an example of code to use and how<br>
>>> to build an application with different build systems. I welcome support<br>
>>> for other build systems being added to our examples. It just needs<br>
>>> someone to maintain whatever is added.<br>
>>><br>
>>> The rtems_waf approach is based on the currently exported data and when<br>
>>> a new build system is agreed on and merged it will be updated.<br>
>>><br>
>> I tried for some time to figure out some way to fix the dependency check errors<br>
>> but couldn't find any other solution. I also tried building the whole source from<br>
>> the build directory by adding this something like this:<br>
>> ```<br>
>> rule = 'cp ${SRC} ${TGT}'<br>
>> bld (rule = rule, source = 'init.c', target = 'fat-root-init.c')<br>
>> ```<br>
>> This again works nicely with the build but gets stuck in the post run checks by<br>
>> gccdeps that seems to search for the headers only in the source directory.<br>
>><br>
>> Do you have some suggestions to try out? Patching the gccdeps works but<br>
>> it seems like we don't want to do that (?)<br>
>><br>
> This was quite challenging for me to figure out how to make work the<br>
> first time. I had to wade through the waf book to figure out how to<br>
> make the generated header file visible. You might need to do some<br>
> digging as well to see how it might be possible.<br>
><br>
> I think the next best solution is to have gccdeps search the build<br>
> tree for the generated header file.<br>
><br>
> The worst solution is to touch an empty header file in the source tree.<br></blockquote><div><br></div><div>Hi,</div><div><br></div><div>After reading through the Waf book and some different trials, I came up with a</div><div>nice one-line solution that works like a charm:<br></div><div><br></div><div><a href="https://lists.rtems.org/pipermail/devel/2020-April/059556.html">https://lists.rtems.org/pipermail/devel/2020-April/059556.html</a><br></div><div><br></div><div>I used the find_or_declare function with it which returns a Node object under the</div><div>source or build folders. If nothing is found, it creates the corresponding node in</div><div>the build directory and the folder structure required for writing the file during the</div><div>build phase. If the path is not under the build directory, then a fake filesystem</div><div>structure is created for the output files. This makes the header file searchable</div><div>after post_run, without the need to change the gccdeps.</div><div><br></div><div>I have tested it and it works great. Please review the patch and let me know if</div><div>it's good to go.</div><div><br></div><div>Best regards,</div><div>Vijay</div></div></div></div>