title: "make -j 4: command not found" when invoking make from a script
body: <p>I'm having trouble adding <strong><em><code>-j 4</code></em></strong> to my make command. Its causing my Bash script to fail with:</p>
  
  <pre><code>./cryptest.sh: line 208: make -j 4: command not found
  ERROR: failed to make cryptest.exe
  </code></pre>
  
  <p>Here's the Bash that determines when to add <strong><em><code>-j 4</code></em></strong>. It seems to mostly be working:</p>
  
  <pre><code># $MAKE is already set and either 'make' or 'gmake'
  CPU=$(cat /proc/cpuinfo | grep -c '^processor')
  if [ "$CPU" -gt "1" ]; then
      echo "$CPU processors, using \"$MAKE -j $CPU\""
      MAKE="$MAKE -j $CPU"
  fi
  </code></pre>
  
  <p>Then, the Bash that invokes it and cause the error:</p>
  
  <pre><code>"$MAKE" static dynamic cryptest.exe 2&gt;&amp;1 | tee -a "$TEST_RESULTS"
  if [ "${PIPESTATUS[0]}" -ne "0" ]; then
          echo "ERROR: failed to make cryptest.exe" | tee -a "$TEST_RESULTS"
  fi
  </code></pre>
  
  <p>There are similar questions on Stack Overflow with other commands, like <a href="https://stackoverflow.com/a/19786259">Execute command as a string in Bash</a>, but its not obvious to me how to simply append the command's arguments to the command. And doing the obvious results in errors like above, so questions like <a href="https://stackoverflow.com/q/4181703/608639">How can I concatenate string variables in Bash</a> don't seem to work in this instance.</p>
  
  <p>How do I append <strong><em><code>-j 4</code></em></strong> to <strong><em><code>$MAKE</code></em></strong>?</p>
  
  <hr>
  
  <p>I also tried the following,:</p>
  
  <pre><code>MAKE="$MAKE" "-j $CPU"
  </code></pre>
  
  <p>But it resulted in:</p>
  
  <pre><code>./cryptest.sh: line 186: -j 4: command not found
  </code></pre>
  
  <hr>
  
  <p>Finally, there's 50 to 75 of these:</p>
  
  <pre><code>export CXXFLAGS="..."
  "$MAKE" static dynamic ...
  </code></pre>
  
  <p>So I want to fix 1 <code>"$MAKE"</code>, and not 50 or 75 uses of it.</p>