[Scons-users] Passing Options that contain filename to default Builders

Dirk Bächle tshortik at gmx.de
Mon May 23 03:14:34 EDT 2016


Hi Stefan,

On 23.05.2016 08:46, lada-s at gamers-area.net wrote:
> Hello scons-users,
>
> I am working on porting a Make buildsystem originated project based on GNU ARM GCC to scons, but I am struggling with options that need information about the item built.
>
> The one example:
> Gcc has the options -M <filename> that are there for generating additional information about the build to a file. In Make I used following command: -MF"$(@:%.o=%.d)" which takes the build target name and replaces the postfix .o with .d to write dependencies to it.
>
> So gcc -MF"$(@:%.o=%.d)" test.c returned files test.o and test.d.
>
> The questions:
> How can I do this with SCons without writing a dedicated Builder?
> Are the $TARGET, $SOURCE replacements working within Object builder?
>

SCons usually detects these kind of dependencies on its own (assuming that you set the CPPPATH right for implicit header 
dependencies). So it's probably better to not care about these lines and skip them for the new build description.
If you then have some dependencies that aren't properly detected we can have a closer look at those...and a few custom builders 
might be required.
But for standard C/CPP things should "just work"...please try and report back if you find the time. Thanks a lot in advance for your 
feedback.

Best regards,

Dirk




More information about the Scons-users mailing list