[Scons-users] force rebuild of a specific target

Carnë Draug carandraug+dev at gmail.com
Sat Oct 17 15:02:21 EDT 2015


On 16 October 2015 at 15:47, Roberto De Vecchi
<roberto.devecchi at vi-grade.com> wrote:
> Hi all,
>
> I'm looking for a way to request scons to rebuild a specific target.
> The best for me would be to find a way compatible with the interactive mode.
>
> Digging a bit in the scons code base I found the option -assume-new that
> seems to do what I need ( mark a node as out of date ), but it's not yet
> implemented.
>
> As an alternative I tried issuing a clean + build commands on specific
> node, but in this way the clean command is cleaning all the nodes on
> which my target depends on making the build process too time consuming.
>
> Any idea / suggestion is welcome!

I had a similar problem.  In my case, I had a target named data and wanted
an update target that would force rebuild of that target.  I solved it by
doing:

    data = env.Command(...)
    env.Alias("data", data)

    if "update" in COMMAND_LINE_TARGETS:
      env.AlwaysBuild(data)
      env.Alias("update", data)

Carnë


More information about the Scons-users mailing list