Makefile文件:ERROR1 [英] Makefile: Error1
问题描述
我有一个非常简单的C程序:
I have a very simple c programme:
int main()
{
return(1);
}
和一个简单的Makefile:
and a simple Makefile:
all:
gcc -ansi -pedantic -o tmp tmp.c
./tmp
然而,当我键入制作
我收到以下错误信息:
$ make
gcc -ansi -pedantic -o tmp tmp.c
./tmp
make: *** [all] Error 1
什么明显的事情我缺少什么?
What obvious thing am I missing?
推荐答案
请退出与一个错误,如果任何的命令,它与一个错误执行退出。
Make exits with an error if any command it executes exits with an error.
由于您的程序为1的code退出,让看到,作为一个错误,然后返回相同的错误本身。
Since your program is exiting with a code of 1, make sees that as an error, and then returns the same error itself.
您可以让make忽略错误放置一个 - 在这样的行的开头:
You can tell make to ignore errors by placing a - at the beginning of the line like this:
-./tmp
您可以看到更多有关错误的Makefile文件处理<一个href=\"http://sunsite.ualberta.ca/Documentation/Gnu/make-3.79/html_chapter/make_5.html#SEC48\">here.
You can see more about error handling in makefiles here.
这篇关于Makefile文件:ERROR1的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!