这个问题与Convert Cygwin path to Windows path in a makefile有关,但并不相同。
我需要转换 Windows 路径,例如:
C:\src\bin
Run Code Online (Sandbox Code Playgroud)
进入 Unix 路径,例如:
/c/src/bin
Run Code Online (Sandbox Code Playgroud)
在 makefile 中,我可以使用以下代码来转换此类路径:
slashedpath = $(subst \\,\/,$(windowspath))
unixpath = $(shell cygpath -u $(slashedpath))
Run Code Online (Sandbox Code Playgroud)
当cygpath函数不可用时,如何在 GNU Make 正在处理的 makefile 中执行相同的转换?
ps 如果$(windowspath)
包含多个路径怎么办?如何将它们全部转换?