機能が有効になっているかエラーが返されないかをテストする

機能が有効になっているかエラーが返されないかをテストする

-vを返すようにします。

GNU Make 4.2.1
Built for x86_64-pc-linux-gnu
Copyright (C) 1988-2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

ディレクトリにファイルを1つずつ: makefile

ifneq ($(jobserver),T)
$(error This makefile only works with a Make program that supports $$(eval))
endif

タイプ別の make 呼び出し

makefile:2: *** This makefile only works with a Make program that supports $(eval).  Stop.

頑張っても

ifneq ($(eval),T)
$(error This makefile only works with a Make program that supports $$(eval))
endif

まだ戻ってくる

makefile:2: *** This makefile only works with a Make program that supports $(eval).  Stop.

フォローする地図時間インターネットでは、これらのmakefileはmakeの機能が利用可能かどうかをテストします。エラーが発生しないでください。

ベストアンサー1

あなたはそれを逃しました使用evalテストする前に変数が設定されている場所は次のとおりです。

$(eval eval_available := T)
ifneq ($(eval_available),T)
$(error This makefile only works with a Make program that supports $$(eval))
endif

利用可能な場合はeval最初の行が設定されeval_availableTそうでない場合は設定されません。 2行目はにeval_available設定されていることを確認してくださいT

おすすめ記事