In GNU Make, how do I convert a variable to lower case?

前端 未结 5 1030
误落风尘
误落风尘 2020-12-08 12:45

This is a silly question, but.... with GNU Make:

VAR = MixedCaseText
LOWER_VAR = $(VAR,lc)

default:
        @echo $(VAR)
        @echo $(LOWER_VAR)
<         


        
5条回答
  •  时光说笑
    2020-12-08 13:41

    I find this slightly cleaner...

    $(shell tr '[:upper:]' '[:lower:]' <<< $(VAR))
    

提交回复
热议问题