title: Makefile executes only the first target
body: <p>I have files that look like this</p>
  
  <pre><code>1_0_fa.bam  1_1_fa.bam  1_2_fa.bam  1_3_fa.bam  1_4_fa.bam  1_5_fa.bam
  1_6_fa.bam  1_7_fa.bam  1_8_fa.bam  1_9_fa.bam  1_0_mo.bam  1_1_mo.bam
  1_2_mo.bam  1_3_mo.bam  1_4_mo.bam  1_5_mo.bam  1_6_mo.bam  1_7_mo.bam
  1_8_mo.bam  1_9_mo.bam  1_0_p1.bam  1_1_p1.bam  1_2_p1.bam  1_3_p1.bam
  1_4_p1.bam  1_5_p1.bam  1_6_p1.bam  1_7_p1.bam  1_8_p1.bam  1_9_p1.bam
  </code></pre>
  
  <p>I'd like to combine them by bin, which is the second number in the name. Here is my Makefile (GNU make 3.81)</p>
  
  <pre><code>SHELL = /bin/sh
  bins = 0 1 2 3 4 5 6 7 8 9
  $(info $(bins))
  code = 1
  
  define buildVCF
  
  $(info $(1))
  $(eval targ = $(code)_$(1)_bin.vcf)
  $(info $(targ))
  targs += $(targ)
  $(eval deps = $(wildcard $(code)_$(1)_*.bam))
  $(info $(deps))
  
  $(targ): $(deps)
      cat $$^ &gt; $$@
  
  endef
  
  $(foreach bin,$(bins),$(eval $(call buildVCF,$(bin))))
  
  all: $(targs)
  </code></pre>
  
  <p>If i do <code>make -n</code>, it produces</p>
  
  <pre><code>0 1 2 3 4 5 6 7 8 9
  0
  1_0_bin.vcf
  1_0_p1.bam 1_0_mo.bam 1_0_fa.bam
  1
  1_1_bin.vcf
  1_1_fa.bam 1_1_p1.bam 1_1_mo.bam
  2
  1_2_bin.vcf
  1_2_mo.bam 1_2_p1.bam 1_2_fa.bam
  3
  1_3_bin.vcf
  1_3_fa.bam 1_3_mo.bam 1_3_p1.bam
  4
  1_4_bin.vcf
  1_4_mo.bam 1_4_fa.bam 1_4_p1.bam
  5
  1_5_bin.vcf
  1_5_fa.bam 1_5_mo.bam 1_5_p1.bam
  6
  1_6_bin.vcf
  1_6_p1.bam 1_6_fa.bam 1_6_mo.bam
  7
  1_7_bin.vcf
  1_7_fa.bam 1_7_p1.bam 1_7_mo.bam
  8
  1_8_bin.vcf
  1_8_fa.bam 1_8_mo.bam 1_8_p1.bam
  9
  1_9_bin.vcf
  1_9_mo.bam 1_9_p1.bam 1_9_fa.bam
  cat 1_0_p1.bam 1_0_mo.bam 1_0_fa.bam &gt; 1_0_bin.vcf
  </code></pre>
  
  <p>Why is not building the rest of the targets?</p>