This is a silly question, but.... with GNU Make:
VAR = MixedCaseText
LOWER_VAR = $(VAR,lc)
default:
@echo $(VAR)
@echo $(LOWER_VAR)
In the above example, what's the correct syntax for converting VAR's contents to lower case? The syntax shown (and everything else I've run across) result in LOWER_VAR being an empty string.
I find this slightly cleaner...
you can always spawn off tr
or
The 'lc' functions you trying to call is from GNU Make Standard Library
Assuming that is installed , the proper syntax would be
To handle capital letters with accents:
Results:
You can do this directly in gmake, without using the GNU Make Standard Library:
It looks a little clunky, but it gets the job done.
If you do go with the $(shell) variety, please do use
:=
instead of just=
, as inLOWER_VAR := $(shell echo $VAR | tr A-Z a-z)
. That way, you only invoke the shell one time, when the variable is declared, instead of every time the variable is referenced!Hope that helps.