title: Alias target names in Makefiles or alternative approach
body: <p>I have a directory where I download some data from somewhere on which I want to perform some operations by a script. When said directory does not yet exists, I want <code>make</code> to automatically download the files, which I would also like to be able to initiate by running <code>make fetch</code>. However, I don't want the download process to be started everytime I run make for the other target.</p>
  
  <p>My attempt so far:</p>
  
  <pre><code>.PHONY: fetch
  fetch: data/www.example.org
  
  foo.dat: | data/www.example.org
      somescript &gt; foo.dat
  
  data/www.example.org:
      wget --mirror --prefix-directory=data http://www.example.org
  </code></pre>
  
  <p>This has almost the desired effects, except for when I run <code>make fetch</code> it gives me:</p>
  
  <pre><code>$ make fetch
  make: Nothing to be done for `fetch'.
  </code></pre>
  
  <p>I could, of course, simply copy the recipe of <code>data/www.example.org</code> to <code>fetch</code>, however as the recipe may get more complex in the future, I would like to avoid that kind of solution.</p>
  
  <p><strong>EDIT:</strong></p>
  
  <p>It seems kind of obvious in hindsight, but for some reason I didn't think of using variables. I think, my mind kept searching for some kind of "neater" way. But <em>that</em> does solve it for me, so thanks to <a href="https://stackoverflow.com/users/96588/l0b0">l0b0</a> for pointing it out to me:</p>
  
  <pre><code>FETCH = wget --mirror --prefix-directory=data http://www.example.org
  
  .PHONY: fetch
  fetch:
      $(FETCH)
  
  foo.dat: | data/www.example.org
      somescript &gt; foo.dat
  
  data/www.example.org:
      $(FETCH)
  </code></pre>