Learn C the Hard Way を始めたばかりで、演習 2 に取り組んでいます。
リンクはこちら: http://c.learncodethehardway.org/book/ex2.html
手順は、これだけを含むファイルを作成することです。
CFLAGS=-Wall -g
clean:
rm -f ex1
そのため、これを作成して Makefile.c として保存しましたが、コンパイラ (MINGW) で指定したとおりに実行すると、次のエラーが発生します。
$make clean
cc makefile.c -o makefile
makefile.c:3:1: warning: data definition has no type or storage class [enabled by default]
makefile.c:3:9: error: 'Wall' undeclared here (not in a function)
makefile.c:3:15: error: 'g' undeclared here (not in a function)
makefile.c:5:1: error expected ',' or ';' before 'clean'
cc Makefile.c -o Makefile
Makefile.c:3:1: warning: data definition has no type or storage class [enabled by default]
Makefile.c:3:9: error: 'Wall' undeclared here (not in a function)
Makefile.c:3:15: error: 'g' undeclared here (not in a function)
Makefile.c:5:1: error expected ',' or ';' before 'clean'
make: *** No rule to make target 'clean'. Stop.
私が間違っていること、および/またはこれを修正する方法はありますか? ありがとう!