1
私のすべてのサービス用のベースメイクファイルがあります。デフォルトの「テスト」ターゲットを使用したい場合もあれば、それを上書きしたい場合もあります。これらは私がこれまでに持っていたファイルです(明らかに期待通りに動作しません)。メイクファイルの追加とオーバーライドの両方を許可する
MakefileBase
test:
./.../run-tests.sh
Makefileの
BASE_FILE := /path/to/MakefileBase
include ${BASE_FILE}
test:
@$(MAKE) -f $(BASE_FILE) test # un/comment this line in order to run the default tests.
# echo "custom test"
期待どおりに動作します警告を除いて、私は私が
Makefile:10: warning: overriding commands for target `test'
/.../MakefileBase:63: warning: ignoring old commands for target `test'
echo "no tests"
no tests
次取得コメントアウト最初の行でテストを実行問題は親関数を使用しようとすると次のエラーが発生することです。
Makefile:9: warning: overriding commands for target `test'
/.../MakefileBase:63: warning: ignoring old commands for target `test'
make[1]: test: No such file or directory
make[1]: *** No rule to make target `test'. Stop.
make: *** [test] Error 2
それだけで、コマンドを追加します:: は '「私はまったく何もしないようにしたい」エコーそれが実行されますベースファイルからのコマンドとエコーよりも –