title: Makefile Rules and If Statements -- How?
body: <p>I'm new to Makefiles so please bear with me.</p>
  
  <p>I need to modify a Makefile so some rules call different utilities depending on a variable. </p>
  
  <p>Right now, a rule looks like:</p>
  
  <pre><code>ci:
      [shell syntax for tool (A)]
  </code></pre>
  
  <p>But now I need ci to have a different syntax depending on the variable. So I define a global variable at the top of the file:</p>
  
  <pre><code>TOOL = toolA
  </code></pre>
  
  <p>or </p>
  
  <pre><code>TOOL = toolB
  </code></pre>
  
  <p>Ideally what I'd like is something like this, but <strong>obviously it doesn't work</strong>:</p>
  
  <pre><code>ifeq ($TOOL, toolA)
      ci:
          [syntax for tool (A)]
  else
      ci:
          [syntax for tool (B)
  endif
  </code></pre>
  
  <p>Does anyone know the best way to implement something like this properly?</p>
  
  <p>Thanks!!</p>
  
  <p><strong>EDIT</strong>: The tool syntax is more complicated than one line. Sometimes its multiple lines and not just "toolA args etc etc". Sorry for the confusion!</p>