Convert Cygwin path to Windows path in a makefile

后端 未结 1 1762
别跟我提以往
别跟我提以往 2021-02-03 23:18

How can I convert a Cygwin style path ( /cygdrive/c/foo/bar ) to Windows style ( C:/foo/bar ) (yes, with / going forward) in a GNU makefile? I have the situation of using Cygwin

相关标签:
1条回答
  • 2021-02-03 23:55

    Use the shell function to execute the cygpath utility with the -w flag.

    Example:

    BAR := /cygdrive/c/foo/bar
    WIN_BAR := $(shell cygpath -w ${BAR})
    

    cygpath accepts a lot of additional options. See the man page for details.

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