title: Variables expansion in Make
body: <p>Let us assume I have the following Makefile</p>
  
  <pre><code>N := 1
  .PHONY : target_$(N)
  target_$(N) :
      @echo $(N)
  
  N := 2
  .PHONY : target_$(N)
  target_$(N) :
      @echo $(N)
  </code></pre>
  
  <p>The result is:</p>
  
  <pre><code>$ make target_1
  2
  $ make target_2
  2
  </code></pre>
  
  <p>Is there any way of achieving what I want? My idea was to copy-paste a recipe using a variable as parameter. The variable has to be expanded in the target name and in the recipe for that target, perhaps it could appear in the dependencies too, but not for now. The problem is that recipe expansion seems to occur at the time of recipe execution, but I was expecting, and needing, it to occur at the same time that target expansion.</p>