[Scons-dev] Cleaning a target on rebuild

Bill Deegan bill at baddogconsulting.com
Thu Aug 21 01:19:44 EDT 2014


William,

You are thinking about order here.  The better way to think in SCons is
about dependencies and actions.
SCons is designed for dependencies and actions and not for forcing order of
execution.

It seems likely what you really want is to use :
AddPreAction(target, action) , env.AddPreAction(target, action)

See manpage: http://www.scons.org/doc/2.3.2/HTML/scons-man.html

Where the action would be removing whatever files you want cleaned before
the target in question is built.


-Bill



On Wed, Aug 20, 2014 at 6:14 PM, William Blevins <wblevins001 at gmail.com>
wrote:

> Is there a way to trigger a Clean for a target when SCons is required to
> rebuild it (IE. always build this target from clean if the target is not
> up-to-date)?
>
> Example:
>
> // variables
> t = Compile( A.x )
> z = Clean( t, <some additional clean items> )
>
> // workflow
> if t not up_to_date:
>     execute z (call this clean)
>     execute t (compile A.x)
>
> V/R,
> William
>
> _______________________________________________
> Scons-dev mailing list
> Scons-dev at scons.org
> http://two.pairlist.net/mailman/listinfo/scons-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://two.pairlist.net/pipermail/scons-dev/attachments/20140820/56b78de8/attachment.html>


More information about the Scons-dev mailing list