Skip to content
Snippets Groups Projects
  1. Mar 10, 2015
  2. Mar 09, 2015
  3. Mar 06, 2015
    • Brad King's avatar
    • Brad King's avatar
      Makefile: Fix multiple custom command outputs regression (#15116) · 66a9c90c
      Brad King authored
      In commit v3.2.0-rc1~272^2~2 (Makefile: Fix rebuild with multiple custom
      command outputs, 2014-12-05) we changed the generated makefile pattern
      for multiple outputs from
      
        out1: depends...
                commands...
        out2: out1
      
      to
      
        out1 out2: depends...
                commands...
      
      This was based on the incorrect assumption that make tools would treat
      this as a combined output rule and run the command(s) exactly once for
      them.  It turns out that instead this new pattern is equivalent to
      
        out1: depends...
                commands...
        out2: depends...
                commands...
      
      so the commands may be run more than once.
      
      Some documents suggest using a "dedicated witness" stamp file:
      
        stamp: depends...
                rm -f stamp
                touch stamp.tmp
                commands...
                mv stamp.tmp stamp
        out1 out2: stamp
      
      However, if the commands fail the error message will refer to the stamp
      instead of any of the real outputs, which may be confusing to readers.
      Also, this approach seems to have the same behavior of the original
      approach that motiviated the above commit: multiple invocations are
      needed to bring consumers of the outputs up to date.
      
      Instead we can return to the original approach but add an explicit
      touch to each extra output rule:
      
        out1: depends...
                commands...
        out2: out1
                touch -c out2
      
      This causes make tools to recognize that all outputs have changed and
      therefore to execute any commands that consume them.
      66a9c90c
  4. Mar 03, 2015
  5. Mar 02, 2015
  6. Feb 28, 2015
  7. Feb 27, 2015
  8. Feb 26, 2015
  9. Feb 24, 2015
  10. Feb 23, 2015
  11. Feb 20, 2015
  12. Feb 19, 2015
  13. Feb 18, 2015
  14. Feb 13, 2015
  15. Feb 12, 2015
  16. Feb 11, 2015
Loading