[Scons-users] How to rebuild if target changes

Dirk Bächle tshortik at gmx.de
Wed Mar 5 03:17:19 EST 2014


Hi,

On 05.03.2014 07:42, Непомнящий Евгений Игоревич wrote:

> Hello!

>

> I have sconstruct:

> ------

> env = Environment(tools=['textfile'])

> env.Textfile('test.h', ['test1'])

> ------

>

> If I run it, I get file test.h.

>

> But If I change file test.h manually and run scons, I receive message

> " `.' is up to date."

>

> How to tell scons to rebuild file, if it changes since last build?


SCons will build the file "test.h" for you, as you requested. But then
its work is done. What you're doing with the file after it was built by
SCons, is out of the scope. We track only changes in the sources of a
target, not the target itself.

You either have to integrate the "change test.h" step into your actual
build, if you really need it, or you should check in "test.h" to a VCS.
Then you can restore it, if necessary.
Finally, another option is to simply remove the "test.h" file, and then
run SCons again.

Hope this helps.

Best regards,

Dirk



More information about the Scons-users mailing list