我刚开始用艰难的方式学习 C,我正在练习 #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.
有什么想法我做错了什么和/或如何解决这个问题?谢谢!