[Scons-users] How to write/append the compiler output to a logfile

Bill Deegan bill at baddogconsulting.com
Wed Dec 11 10:57:05 EST 2019


So you want to collect all C compilations output into a file which is the
input of a builder?
PRINT_CMD_LINE_FUNC is likely not the solution for that.

Changing CCCOM is o.k. It's not forbidden or advised against. It's normal
practice.

Also a command line with
"command source > output file"
Will overwrite the output file on each invocation. So you'd end up with
only the last one.

With this example:
'CCCOM': '$CC -o $TARGET[0] -c $CFLAGS $CCFLAGS $_CCCOMCOM $SOURCES' >
$TARGET[1]' but that's really changing CCCOM, so the (gcc) builder will not
be happy.

Would TARGET[1] be different for every target?

What is the post link/compile step. Is this run per compile and link? or is
this meant to run after all link and compiles are completed?

-Bill

On Wed, Dec 11, 2019 at 8:48 AM Arndt Pauschardt <arndt.pauschardt at web.de>
wrote:

> Hi,
> I have found PRINT_CMD_LINE_FUNC, so sorry for asking about logging the
> actual command line, I should have read the manual more thoroughly.
> PRINT_CMD_LINE_FUNC allows to do exactly what I want for the actual
> command line.
>
> On the output of the command I still would like your advice - in my
> example the object is a target and the logfile is (another) target.
> Thx
> Arndt
>
>
> *Gesendet:* Mittwoch, 11. Dezember 2019 um 13:10 Uhr
> *Von:* "Arndt Pauschardt" <arndt.pauschardt at web.de>
> *An:* scons-users at scons.org
> *Betreff:* [Scons-users] How to write/append the compiler output to a
> logfile
> Hi, everyone
> I would need a little advice ...
>
> I would like to write/append the compiler command line and the actual
> compiler output (its warnings, errors, ...) into a logfile.
> At the same time, I would like to keep the *COMSTR functionality of SCons
> so that the console output is showing what e.g CCCOMSTR is set to and the
> logfile has the output of CCCOM.
>
> I guess a possible solution is to tweak CCCOM from
> 'CCCOM': '$CC -o $TARGET -c $CFLAGS $CCFLAGS $_CCCOMCOM $SOURCES',
> to sth  like
> 'CCCOM': '$CC -o $TARGET -c $CFLAGS $CCFLAGS $_CCCOMCOM $SOURCES >
> $CCLOGFILE'
>
> but I'm not sure whether this is good solution:
> - to me, CCCOM is "owned" by the builder, in this case it would tbe gcc
> builder. So tweaking it is like reaching out into someone else's pocket.
> - I would like to use logfile as a source for a post-compile/link step, so
> it is not only a logfile, but also a target of the compile step and a
> source of a post-compile step. Therefore, CCCOM should look more like
> 'CCCOM': '$CC -o $TARGET[0] -c $CFLAGS $CCFLAGS $_CCCOMCOM $SOURCES' >
> $TARGET[1]' but that's really changing CCCOM, so the (gcc) builder will not
> be happy.
>
> So, all in all: How would/are you doing this? I googled it and searched
> the mailing list, but nothing substantial turned up so far.
>
> Thx
> Arndt
>
>
>
>
>
>
> _______________________________________________ Scons-users mailing list
> Scons-users at scons.org
> https://pairlist4.pair.net/mailman/listinfo/scons-users
> _______________________________________________
> Scons-users mailing list
> Scons-users at scons.org
> https://pairlist4.pair.net/mailman/listinfo/scons-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://pairlist4.pair.net/pipermail/scons-users/attachments/20191211/ce7628e4/attachment-0001.html>


More information about the Scons-users mailing list