title: How the get the length of a vector in a makefile and use it in a for loop?
body: <p>How can I get the dimension of a vector in a makefile? I want to have a simple loop that goes through each element of 2 same-sized vectors.</p>
  
  <p>Example that doesn't work in terms of loop nor size of vectors but to give you an idea of what I am thinking about. The loop notation was taken from <a href="https://stackoverflow.com/questions/1490949/how-to-write-loop-in-makefile">this</a>:</p>
  
  <pre><code>V1=one two three four
  V2=bird stones parks bears
  print:
       size={#$(V1)}      &lt;- this is my invented notation, obviously it doesn't work.
       i=0
       while [[ $$i -le $$size ]] ; do \ 
      echo $(V1)[i] $(V2)[i] ; \
      ((i = i + 1)) ; \
  done
  </code></pre>
  
  <p>Output:</p>
  
  <pre><code>one bird
  two stones
  three parks
  four bears
  </code></pre>