title: In Makefile assign path variable dependent if path exists
body: <p>I develop my c++ app alternately on debian and ubuntu and the library root dir of informix database is different on both distributions.</p>
  
  <p>What's a nice way of handling it in Makefile so i don't have to change it manually each time?
  I thought of just testing on existance of the directory so it's more general then checking uname or lsb-release or hostname.</p>
  
  <p>And how is the syntax for assigning in a condition? I get the "missing seperator" error on try#2</p>
  
  <pre><code>// prepare
  INFORMIXDIR_DEB=/usr/informix
  INFORMIXDIR_UBU=/opt/IBM/informix 
  
  // tried #1
  $(INFORMIXDIR_DEB):  
          if [ -d $(INFORMIXDIR_DEB) ]; then INFORMIXDIR=$INFORMIXDIR_DEB; fi;
  
  // tried #2
  $(INFORMIXDIR_DEB):  
         INFORMIXDIR=$(INFORMIXDIR_DEB)
  
  // tried #3
  if [ -d $(INFORMIXDIR_UBU) ] ; 
      then INFORMIXDIR=$INFORMIXDIR_UBU;
  fi;
  </code></pre>