title: Embedding bash script into makefile
body: <p>I want to include some conditional statement into a makefile:</p>
  
  <pre><code>SHELL=/bin/bash
  all: 
          $(g++ -Wall main.cpp othersrc.cpp -o hello)
          @if [[ $? -ne -1 ]]; then \
            echo "Compile failed!"; \
            exit 1; \
          fi
  </code></pre>
  
  <p>But get an error:</p>
  
  <blockquote>
    <p>/bin/bash: -c: line 0: conditional binary operator expected /bin/bash:
    -c: line 0: syntax error near <code>-1' /bin/bash: -c: line 0:</code>if [[  -ne -1 ]]; then \' makefile:3: recipe for target 'all' failed make: *** [all] Error 1</p>
  </blockquote>
  
  <p>How to fix it?</p>