我讀過這個問題:Makefile: $subst in dependency list,但我仍然無法讓我的shell腳本正常工作。在多行makefile bash腳本中使用'subst'?
我有一個生成文件與內容的行:
#@[email protected]|test_create|Syntax: commoncmdsyntax test_create test_name=<test-name>
甲目標運行一個多bash腳本,其中,所述commoncmdsyntax
必須由含有單詞和空格的字符串來代替。
在腳本中,我使用cut來指定變量desc
字符串Syntax: commoncmdsyntax test_create test_name=<test-name>
。
問題是$(subst commoncmdsyntax,new text,$$desc)
不能代替commoncmdsyntax
由new text
。
我試圖用一個單詞替換它,如XX
,但它也不起作用。
請編輯您的問題以顯示'make -v'的輸出。祝你好運。 – shellter 2014-09-18 17:56:44
'make -v'報告我正在使用'GNU Make 3.81' – canellas 2014-09-18 18:17:28
輔助擴展在make 3.81中可用。 – 2014-09-18 18:28:04