Makefile文件:ERROR1 [英] Makefile: Error1

查看:3842
本文介绍了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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆