title: How can i initialize and then iterate an array in linux makefile?
body: <p>I need to create an array with directories and then inereate it, creating one more array in each step which will include all files found via 'find' command for each derictory and also iterate this array. I was trying to do something like this:</p>
  
  <pre><code>declare -a arr=(a b c) ;\
  for key in "$${arr[@]}" ; do \
      ...
    done\
  </code></pre>
  
  <p>but it does not work. 
  Even this gets error:</p>
  
  <pre><code>all:
          declare -a array=(a b c) ;\
          echo "$${array[1]}" \
  </code></pre>
  
  <p>gets error:</p>
  
  <pre><code>/bin/sh: 1: Syntax error: "(" unexpected
  Makefile:4: recipe for target 'gg' failed
  make: *** [gg] Error 2
  </code></pre>