title: GNU Make target built twice before "up to date"; why not after first pass?
body: <p>I'm missing some possibly mundane but critical understanding of how make determines if a dependency must be built. I've boiled my issue down to a very simple example.</p>
  
  <pre><code>build:
      mkdir -p $@
  
  .PRECIOUS: build/%.txt
  build/%.txt: build
      @echo "$*" &gt; $@
  
  %.zip: %.txt
      zip -jquX $@ $&lt;
  </code></pre>
  
  <p>I feel the first run of <code>make build/foo.zip</code> should first create the "build" directory, then write "build/foo.txt", and last build "build/foo.zip" leaving "build/foo.txt". Then, all consecutive runs should have nothing to do, since no dependencies are newer than the target which depends on them.</p>
  
  <p>However, I get the following output:</p>
  
  <pre><code>➜  make build/f.zip
  mkdir -p build
  zip -jquX build/f.zip build/f.txt
  
  ➜  make build/f.zip
  zip -jquX build/f.zip build/f.txt
  
  ➜  make build/f.zip
  make: 'build/f.zip' is up to date.
  </code></pre>
  
  <p>How can this be avoided? What is causing the second zip operation not to be skipped?</p>
  
  <h3>More information</h3>
  
  <p>I am using GNU Make 4.2.1 on Antergos with an ext4 filesystem inside VirtualBox.</p>