title: How to copy a directory in a Makefile?
body: <p>I have a directory <code>images/</code> that I want to copy to <code>build/images/</code> from within a Makefile. The directory might contain multiple levels of subdirectories. What would be the most elegant way to do that? I want:</p>
  
  <ul>
  <li>avoid a full directory copy on each <code>make</code> run (i.e. no <code>cp -r</code>)</li>
  <li>guaranteed consistency (i.e. if a file changed in <code>images/</code> it should be automatically updated in <code>build/images/</code>)</li>
  <li>avoid to specify a rule for each image and each subdirectory in the Makefile</li>
  <li>solve the issue within <code>make</code>, so no <code>rsync</code> or <code>cp -u</code> if possible</li>
  </ul>
  
  <p>I am using GNU make, so GNU specific stuff is allowed.</p>