title: Ask user to run makefile from root mode
body: <p>I have a makefile and configure shell in my project. I wrote code to ask user to run configure shell in root mode using the following code.</p>
  
  <pre><code>[ "$(whoami)" != "root" ] &amp;&amp; exec sudo -- "$0" "$@"
  </code></pre>
  
  <p>But when I run '<code>make install</code>'
  I need to ask user to run from root mode.
  So I just copied the code from the configure shell and copied it in another shell script file called '<code>runasroot.sh</code>'. Then I run this shell script from the <code>make install</code>.</p>
  
  <pre><code>install:
      @echo About to install XXX Project
      ./runasroot.sh
      find . -name "*.cgi" -exec cp {}  $(SCRIPTDEST)/ \;
  </code></pre>
  
  <p>When I run the above code, I got the below error.</p>
  
  <pre><code>About to install XXX Project
  ./runasroot.sh \;
  make: *** [install] Error 1
  </code></pre>
  
  <p>runasroot.sh</p>
  
  <pre><code>#!/bin/bash
  [ "$(whoami)" != "root" ] &amp;&amp; exec sudo -- "$0" "$@"
  </code></pre>