title: How to restart GNU make (without causing an error)
body: <p>I need to restart the <code>make</code> process in case some intermediate target gets (re)build.</p>
  
  <p>This is the case when a PIP requirements file gets (re)compiled, because the checksum of the resulting file is used in the path to the virtualenv that is used in the Makefile.
  If the requirements file gets updated, the same <code>$(MAKECMDGOALS)</code> should get rebuild from the beginning.</p>
  
  <p>I have come up with the following, but this requires to make the outer/inital make process fail (<code>exit 1</code>), which I would like to avoid.</p>
  
  <pre><code>foo:
      echo "foo"
  
      # Need to restart make if this has been used as intermediate target.
      if [ $(MAKECMDGOALS) != "$@" ]; then \
          echo "Restarting make..."; \
          touch $@; \
          $(MAKE) $(MAKECMDGOALS); \
          exit 1; \
      fi
  
  bar: foo
      echo "bar"
  
  .PHONY: bar
  </code></pre>