title: Expanded variable values in Makefile
body: <p>I am learning some basics of Makefile, and write simple example as below:</p>
  
  <pre><code>urname=Chang
  givenname=SJ
  fullname=$(givenname) $(surname)
  hello:
      @echo $(fullname)
  
  surname=Lin
  
  ALL_PACKAGES=
  hello1:
  ifeq (,$(ALL_PACKAGES))
      @echo There is no package
      $(error $(ALL_PACKAGES) is empty)
  else
      @echo there are some packages
  endif
      @echo $(ALL_PACKAGES)
  
  ALL_PACKAGES += package1
  </code></pre>
  
  <p>I can understand <code>make hello</code> result will be "SJ Lin", cause $(surname) is "Lin" finally.</p>
  
  <p>However, in result of <code>make hello1</code>,why $(ALL_PACKAGES) is empty in the if condition(I guess if will be "package1" in the same way on <code>make hello</code>)?</p>
  
  <p>Moreover, why the first echo message("There is no package") will not be printed but only error message do?</p>
  
  <p>Thanks teachers.</p>