title: How do I run some code after every build in scons?
body: <p>I'm looking for a way to register somthing like an end-build callback in scons.  For example, I'm doing something like this right now:</p>
  
  <pre><code>def print_build_summary():
      failures = SCons.Script.GetBuildFailures()
      notifyExe = 'notify-send '
      if len(failures) &gt; 0:
          notifyExe = notifyExe + ' --urgency=critical Build Failed'
      else:
          notifyExe = notifyExe + ' --urgency=normal Build Succeed'
  
      os.system(notifyExe)
  
  atexit.register(print_build_summary)
  </code></pre>
  
  <p>This only works in non-interactive mode.  I'd like to be able to pop up something like this at the end of every build, specifically, when running multiple 'build' commands in an interactive scons session.</p>
  
  <p>The only suggestions I've found, looking around, seem to be to use the dependency system or the <code>AddPostAction</code> call to glom this on.  It doesn't seem quite right to me to do it that way, since it's not really a dependency (it's not even really a part of the build, strictly speaking) - it's just a static bit of code that needs to be run at the end of every build.</p>
  
  <p>Thanks!</p>