[Scons-users] turning off directory creation?

Gary Oberbrunner garyo at oberbrunner.com
Tue Apr 30 09:52:38 EDT 2013


On Tue, Apr 30, 2013 at 9:36 AM, Robert Zeigler <robert.zeigler at gmail.com>wrote:


> The real command creates the directory structure (and the target). The

> problem is the real command, unfortunately, depends on at least part of the

> directory structure NOT existing when it begins to run. The real command

> looks more like:

>

> Command(["a/b/c.txt"],["e/f/g.txt"], "buildc $SOURCE")

>

> And, unfortunately, "buildc" needs to start with a clean state, i.e. "a"

> can't exist when buildc runs, or else buildc will fail.

> But scons auto-creates a/b before ever running "buildc $SOURCE".

>

> As I said, long-term, reworking "buildc" to allow for pre-existing

> directory structures is the "right" solution; and my current dirty hack is

> along the lines of:

>

> Command(["a/b/c.txt"],["e/f/g.txt"], "rm -rf a && buildc $SOURCE")

>

> I'm just wondering if there is a way to make scons NOT create a/b before

> calling buildc.



Got it. There's no public way to do this in SCons today. You'd have to
patch SCons itself, and it would probably get dirty pretty quickly. Your
hack is actually pretty decent. If you want it slightly cleaner you could
use a list of two commands:
cmds = ['rm -rf $TARGET.dir', 'buildc $SOURCE']
or something like that.

--
Gary
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://four.pairlist.net/pipermail/scons-users/attachments/20130430/3013a2d3/attachment.htm>


More information about the Scons-users mailing list