[Scons-users] targets

Mats Wichmann mats at wichmann.us
Mon Oct 23 13:24:32 EDT 2017


slightly abstract question...

if the build process creates files in "pure Python" code, how can SCons
find out about such files?

we have places (usually external projects) where the construction of a
configured header is synthesized - code does some checks and then builds
a file using open()/write().  In one place this is to avoid having to
run the external project's ./configure because autoconf isn't available
on all the supported platforms.  In another it's a "config.h" for the
project itself.   The former never appears in the list of targets if you
dump the tree, the latter does - but that one is "installed" so
presumably that is where scons learns about it.

What is the best way to handle such generated files (so they are, for
example, handled when cleaning):

- try to arrange to have it constructed under control of scons? (my
preference, but I haven't sorted how yet)
- run some instruction that tells scons "here is a file you should care
about". if so, how?  I thought I read something once but can't find.
These files aren't really SideEffects as I understand them - that is,
they're not created as a result of creating another target, although I
suppose I could lie and attach them to something.
- other?

thanks,

-- mats


More information about the Scons-users mailing list