Search code examples
pythonscons

How can I set the TARGET.dir property in Scons?


In a SConstruct script, there is an area where the following is called:

env.Command(
    [[kl2edkBin, "-o", "${TARGET.dir}"] + klSources]
) 

I want to set the value of that TARGET.dir. But I have no idea where it is coming from. How can I change the inputs to that kl2edk command (without modifying that SConstruct file)?

this may be a very stupid question. I'm trying to get something working while learning the least possible scons, and to top it off I'm not a regular python user. I've spent a bit of time googling, but nothing comes up, which suggests to me I'm misunderstanding something at a very fundamental level.


Solution

  • The "TARGET" in the Command refers to the path of the first given target, and "TARGET.dir" returns its folder (=dirname) dynamically. So you can't easily change the output dir without touching the SConstruct...