title: Make fails checking if directory exists
body: <p>I googled for this, but I can't figure out why Bash complains with the following code to check if a directory exists:</p>
  
  <p>test.mk</p>
  
  <pre><code>#!/bin/bash
  
  MYDIR="dl"
  all:
          if [ ! -d $MYDIR ]; then
          #if [ ! -d "${MYDIR}" ]; then
          #if [ ! -d ${MYDIR} ]; then
                  #Here
          fi
  </code></pre>
  
  <p>make -f test.mk</p>
  
  <pre><code>if [ ! -d YDIR ]; then
  /bin/sh: Syntax error: end of file unexpected
  make: *** [all] Error 2
  </code></pre>
  
  <p>Does someone know why it fails? And why does it call /bin/sh instead of /bin/bash? Thank you.</p>
  
  <hr>
  
  <p>Edit: unlike Bash, make doesn't support multi-line block. Here's working code:</p>
  
  <pre><code>MYDIR="dl"
  all:
          if [ ! -d ${MYDIR} ]; then\
                  echo "Here";\
          else\
                  echo "There";\
          fi
  </code></pre>