title: How eval function can be used in makefile?
body: <p>In the manual:</p>
  
  <blockquote>
    <p>The eval function is very special: it allows you to define new
    makefile constructs that are not constant; which are the result of
    evaluating other variables and functions. The argument to the eval
    function is expanded, then the results of that expansion are parsed as
    makefile syntax.</p>
    
    <p>It’s important to realize that the eval argument is expanded twice;
    first by the eval function, then the results of that expansion are
    expanded again when they are parsed as makefile syntax. This means you
    may need to provide extra levels of escaping for “$” characters when
    using eval.</p>
  </blockquote>
  
  <p>the "expanded twice" confuses me.</p>
  
  <p>for example, i create a makefile :</p>
  
  <pre><code>define func
      tmp = $(OBJPATH)/$(strip $1)
      objs += $$(tmp)
      $$(tmp) : $2
          gcc $$^ -o $$@
  endef
  
  all : foo
  
  $(eval $(call func, foo, 1.c))    
  </code></pre>
  
  <p>how will the eval function be expanded ?</p>