Remove prefix with make

前端 未结 2 675
感动是毒
感动是毒 2020-12-29 02:26

Is there a way to remove a prefix from a string (a pathname in my case) in make?

As an example, suppose I had the string:

FILES = a/b/c.         


        
相关标签:
2条回答
  • 2020-12-29 03:05

    You can strip off a leading a/ with

    $(FILE:a/%=%)
    

    See the text substitution function reference for more options & details.

    0 讨论(0)
  • 2020-12-29 03:06

    Since you say GNU make, why not just:

    $(FILE:a/%=%)
    

    ?

    0 讨论(0)
提交回复
热议问题