How to get File objects that will be compiled after a rebuild in SCons? -


i have process log files generated during compilation.

because compilers append errors logs created in previous builds, have delete error log files generated in previous build if files compiled again.

i need list of file objects compiled during rebuild. builders return files compiled.

is possible achieve scons ?

you approaching problem angle lead "rabbit hole" of scons' internals fast.

the main point here is: scons doesn't know log files, have teach it. in way, have mark (or tag) build steps being special such scons knows: "aha, when execute action create foo.o foo.cpp...there foo.log afterwards , need know it."

this methods sideeffect() , clean() there (see userguide , man page). former designed situation several build steps write (log) file, use same file name. single build steps need run in sequence, if scons called "-j" option. haven't given further info whether case you, assume it's not...so sideeffect isn't needed @ solve problem:

./runme.sh ========== #!/bin/sh  cp $1 $2 echo "hi there" >> out.log  ./sconstruct ============ env = environment() t = env.command('out.txt', 'in.txt', './runme.sh $source $target') env.clean(t, 'out.log') 

by adding clean() specification, scons knows has remove file out.log when actual target out.txt gets cleaned. if doing each compile command proves cumbersome, can write small python wrapper method it, or write own "pseudo-builder". can find more infos , guidelines latter in our toolsforfools guide. , yes, have explicitly call "scons -c" cleanup of log files , targets...scons won't automatically remove log files on each rebuild, because can't know want. (or other user) might want concatenate log output several builds, how scons know?

elaborating bit more on question asked, scons knows there target , source file. if source file has changed (not up-to-date) or target doesn't exist yet, knows list of actions can execute build target. can single string, or python function, or list of mix of those. there no semantic analysis going on, scons tries find out single actions mean. trying "guess" that, because executable "gcc" involved must compilation step, simple approach. if uses arbitrarily named link compiler? cross-compiling, spanning enormous tree of different compiler names different purposes? performance analysis , memory check tools insure++, have call "insure gcc" instead? finally, how define "compiling", when being able @ command-line give you? ;)


Comments

Popular posts from this blog

javascript - Thinglink image not visible until browser resize -

firebird - Error "invalid transaction handle (expecting explicit transaction start)" executing script from Delphi -

mongodb - How to keep track of users making Stripe Payments -