title: How to make GNU make to rebuild phony target only when prerequisite changes?
body: <p>In my case I have <code>requirements</code> target, which installs needed Python packages and <code>test</code>, which runs tests and depends on previous one.</p>
  
  <p>Installing dependencies is a long operation and I want it to be executed only when <code>requirements.txt</code> changes. How can I achieve that?</p>
  
  <p>Here is a simplified example of Makefile, that I have now:</p>
  
  <pre><code>.PHONY: test requirements
  
  requirements: requirements.txt
      pip install -r $&lt;
  
  test: tests/ | requirements
      py.test $^
  </code></pre>