title: For each on target of Makefile variable
body: <p>I've makefile which looks like follows</p>
  
  <p><code>apps = app1 app2 app3</code></p>
  
  <p><code>all: dir app1 app2 app3 zip cleanup</code></p>
  
  <p>Now I want to do some loop on the list of <code>apps</code> varible, </p>
  
  <p>something like </p>
  
  <pre><code>`loop on apps
  
  endloop`
  </code></pre>
  
  <p>Is it possible in makefile to loop on it, I need to do loop on <code>apps</code> varible list</p>
  
  <p><strong>update</strong></p>
  
  <p>lets say this variable(<code>apps</code>) is <strong>generated</strong> by my program in the <code>make</code> file, which provide for each project diffrent values of apps, sometimes its <code>apps= app1 app2</code> sometimes its <code>apps= app1</code> and sometimes can be 20 apps or more <code>apps= app1 app2 appN</code></p>
  
  <p>How can I iterate on <code>apps</code> varible and do something, for example in each iteration print something like:</p>
  
  <pre><code>now im in `app1`
  now im in `app2`
  etc
  </code></pre>
  
  <p>When trying the following</p>
  
  <pre><code>.PHONY: foo
  all: foo
  APPS = app1 app2 app3 app4
  foo : $(APPS)
      for $$f in $(APPS); do echo $$f is here; done
  </code></pre>
  
  <p>I got following error:</p>
  
  <p><code>make: *** No rule to make target</code>app1', needed by <code>foo'.  Stop.</code></p>