title: Instead of "overriding commands for target", extend them
body: <p>In my current setting, I have some <code>.mk</code> that are automatically generated, over which I have no control. One of the rules defined in these files is <code>clean</code>.</p>
  
  <p>The part of the code I am working on uses <code>include</code> to access variables from those <code>.mk</code> files. However, I'd like to have another rule <code>clean</code> to remove the files generated in the folder I am working on.</p>
  
  <p>If I create a rule named <code>clean</code>, I get the warning</p>
  
  <pre><code>warning: overriding commands for target
  </code></pre>
  
  <p>Is there a way to "extend" clean, i.e., o make it run both the <code>clean</code> defined in those <code>.mk</code> files and my own <code>clean</code>?</p>
  
  <p>Of course, <a href="https://stackoverflow.com/questions/1644920/override-target-in-makefile-to-add-more-commands">I could create another rule <code>other_clean</code> and call the old <code>clean</code></a>. Or also I could do something like:</p>
  
  <pre><code>other_clean:
      make clean
      rm *.o
  </code></pre>
  
  <p>But I'd like to know if there is any functionality in make that allows me to "inherit" the recipe defined elsewhere into my own <code>clean</code>. I saw there are these things called <a href="https://www.gnu.org/software/make/manual/html_node/Double_002dColon.html#Double_002dColon" rel="nofollow noreferrer">double-colon rules</a>, but I can't use them because the files I am including are automatically generated.</p>