title: get the command line parameters from within a Makefile
body: <p>I'm trying to get the command line parameters used to invoke make utility inside a Makefile. Example:</p>
  
  <pre><code>make -C /some/folder -f someMakeFile.mk SOME_VAR=someValue
  </code></pre>
  
  <p>Inside someMakeFile.mk, I would like to get my hands on the following string:</p>
  
  <pre><code>-C /some/folder -f someMakeFile.mk
  </code></pre>
  
  <p>or</p>
  
  <pre><code>-C /some/folder -f someMakeFile.mk SOME_VAR=someValue
  </code></pre>
  
  <p>I'm not interested in SOME_VAR value, that is already well known. I'm interested in the rest of the command line switches for make utility itself (-C and -f).</p>
  
  <p>The reason I'm asking is because I would like to slightly alter the behavior of someMakeFile.mk when certain cmd line switches are used. For example, I would like to return dummy values from complex macro definitions when make is invoked in dry-run mode, rather than do the actual work. This would speed up the TAB auto-completion in bash when you type make than TAB+TAB to show the list of targets.</p>
  
  <p>Or, if this is not possible, is there a way (a variable or function) available for someMakeFile.mk to detect that is only a dry-run?</p>
  
  <p>Best regards</p>