title: How to change variable values when a target is called
body: <p>I have following things in my Makefile(GNU)</p>
  
  <pre><code>DLIB =  $(DLIB_STATIC)
  DLIBFLAGS = $(DLIB_STATIC)
  DLIB_BUILDS =  $(DLIB_STATIC) LIBDDUMMY
  
  # DLIB =  $(DLIB_SHARED)
  # DLIBFLAGS = -Llib -lD
  # DLIB_BUILDS =  $(DLIB_SHARED)
  
  all: BUILDALL TB
  tgt2: BUILDALL TB
  
  TB: $(DLIB_BUILDS)
  </code></pre>
  
  <p>I need to modify values of <code>DLIB, DLIBFLAGS &amp; DLIB_BUILDS</code> as follows</p>
  
  <pre><code>DLIB =  $(DLIB_SHARED)
  DLIBFLAGS = -Llib -lD
  DLIB_BUILDS =  $(DLIB_SHARED)
  </code></pre>
  
  <p>when <code>tgt2</code> is called.</p>
  
  <p>I tried following</p>
  
  <pre><code>TEMP:
    DLIB =  $(DLIB_SHARED)
    DLIBFLAGS = -Llib -lD
    DLIB_BUILDS =  $(DLIB_SHARED)
  
  tgt2: TEMP BUILDALL
  </code></pre>
  
  <p>But it not working, how can I do that ?</p>