2015-11-12 114 views
1

我趕上一個make錯誤neded:沒有規則使目標'|'通過

make: no rule to make `|' needed by cryptest.exe 

這裏的食譜:

cryptest.exe: public_service | libcryptopp.a $(TESTOBJS) 
    $(CXX) -o [email protected] $(CXXFLAGS) $(TESTOBJS) ./libcryptopp.a $(LDFLAGS) $(LDLIBS) 

|Order-only prerequisites。僅限訂單的先決條件通常有效,所以我不確定在這種情況下會出現什麼問題。

爲什麼我收到make錯誤?


我對這個問題表示歉意。我以前的這個問題已經被問及過很多次了。不幸的是,Google和Bing似乎都無法使用像|

+0

做出什麼版本的GNU的? –

+0

@ 200_success - gmake版本是3.79.1。 – jww

回答

1

僅限訂購的先決條件是GNU Make 3.80中引入的一項功能。從NEWS文件

摘錄:

Version 3.80

  • A new feature exists: order-only prerequisites. These prerequisites affect the order in which targets are built, but they do not impact the rebuild/no-rebuild decision of their dependents. That is to say, they allow you to require target B be built before target A, without requiring that target A will always be rebuilt if target B is updated. Patch for this feature provided by Greg McGary <…@mcgary.org> .
+0

不幸的是,'.FEATURES'默認變量,你可以用來測試功能的存在,在GNU Make 3.81中引入 - 甚至更晚。 –

+0

啊,謝謝。我認爲可能是這樣。但[手冊](http://www.gnu.org/software/make/manual/html_node/Prerequisite-Types.html)沒有討論該功能的限制,因此我將其跳躍總是可用的。我會嘗試構建和安裝Gmake 4.1(應該是一種享受...) – jww