[問題] makefile patsubst 反斜線問題
Linux Ubuntu
https://imgur.com/0Qbop49
可以解釋一下
Backslashes that quote ‘%’ characters or other backslashes are removed from
the pattern before it is compared file names or has a stem substituted into it.
Backslashes that are not in danger of quoting '%' characters go unmolested.
看不懂這兩段話真正的含意,反斜線引用%或其他反斜線會在檔名比較或stem替代之前
移除? stem是什麼??
既然引用其他反斜線的反斜線會被移除,為什麼又說反斜線沒有參與到%的又不會被汙染(
不會被移除?
所以結論是 the\%weird\\%pattern\\ -> the%weird\%pattern\\?
新增剛剛的測試
PPP := $(patsubst aasdfBA.c\\\\,aasdfBC.c\\\\, aasdfBA.c\\\\)
PPP 會是aasdfBC.c\\ , A變成C了
但是如果只有PPP := $(patsubst aasdfBA.c\\,aasdfBC.c\\, aasdfBA.c\\\\)
PPP 不變動 還是aasdfBA.c\\ 所以就算沒有在%的前面的反斜線還是會被跳脫啊???
謝謝
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 210.242.38.34 (臺灣)
※ 文章網址: https://www.ptt.cc/bbs/C_and_CPP/M.1617012563.A.923.html
推
03/30 15:47,
3年前
, 1F
03/30 15:47, 1F
→
03/30 15:47,
3年前
, 2F
03/30 15:47, 2F
→
03/30 15:51,
3年前
, 3F
03/30 15:51, 3F
※ 編輯: anoymouse (210.242.38.34 臺灣), 04/06/2021 17:25:32
→
04/06 17:52,
3年前
, 4F
04/06 17:52, 4F
→
04/06 18:41,
3年前
, 5F
04/06 18:41, 5F
※ 編輯: anoymouse (210.242.38.34 臺灣), 04/07/2021 15:01:19
※ 編輯: anoymouse (210.242.38.34 臺灣), 04/07/2021 15:02:52
C_and_CPP 近期熱門文章
PTT數位生活區 即時熱門文章