First of all, I would avoid wildcards in compilation rules, using $^ instead,
so any leftovers wouldn&#x27;t hurt. In the case of compilation tool being too
stupid, I would build a list of expected files out of known&#x2F;present sources
($(wildcard ...), $(foreach ...), $(patsubst ...)), and then call `rm&#x27; before
calling the dumb tool:<p><pre><code>  rm -f $(filter-out $(EXPECTED),$(FOUND))</code></pre>