Note that there are some explanatory texts on larger screens.

plurals
  1. POMakefile (non-case sensitive goals)
    text
    copied!<p>when using a makefile, I want the following to be possible: </p> <pre><code>make clean make Clean make CLean make CLEan make CLEAn make ... </code></pre> <p>and have all to do the same thing in my makefile.<br> (ie. I don't want make goals to be case sensitive)</p> <p>Sure, I could just write every possibly like this: </p> <pre><code>.PHONY clean Clean CLean CLEan CLEAn ... clean Clean CLean CLEan CLEAn ...: $(DELETE_STUFF) </code></pre> <p>but I think you can see why this is not desired..<br> I know that 'make' has a built in macro called: MAKECMDGOALS which will be equal to whatever you type after typing make. </p> <pre><code>for example, running 'make clean all backup' $(MAKECMDGOALS) = "clean all backup" </code></pre> <p>I tried to do this at the top of my makefile: </p> <pre><code>MAKECMDGOALS:= $(shell echo $(MAKECMDGOALS) | tr "[:upper:]" "[:lower:]") </code></pre> <p>it does change the variable to all lowercase, but will still only call the rule for the target goal typed. </p> <p>I've even tried to override it like this: </p> <pre><code>override MAKECMDGOALS:= $(shell echo $(MAKECMDGOALS) | tr "[:upper:]" "[:lower:]") </code></pre> <p>in hopes that will be done sooner, yet no success. </p> <p>I was going to make a target like this: </p> <pre><code>$(MAKECMDGOALS): MAKECMDGOALS:= $(shell echo $(MAKECMDGOALS) | tr "[:upper:]" "[:lower:]") #BUT I CAN'T CALL OTHER TARGETS FROM THE SHELL </code></pre> <p>I know it's a silly detail to fuss over, but surely there has got to be a way right? </p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload