make:***没有制定目标的规则 [英] make: *** No rule to make target

查看:218
本文介绍了make:***没有制定目标的规则的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个名为project.c的源文件。在同一文件夹中我有一个

Makefile包含:


CC = gcc

CFLAGS = -g
< br $>
项目:project.c

$(CC)$(CFLAGS)project.c -o project

但是当我从文件夹运行make时我得到:


make:***没有规则来制作目标`project.c'','project''需要。停止。

我可能做错什么提示?

I have a source file called project.c. In the same folder I have a
Makefile containing:

CC=gcc
CFLAGS=-g

project: project.c
$(CC) $(CFLAGS) project.c -o project
But when I run make from the folder I just get:

make: *** No rule to make target `project.c'', needed by `project''. Stop.
Any hints to what I might be doing wrong?

推荐答案

(CC)


(CFLAGS)project.c -o project

但是当我从文件夹中运行make时我得到:


make:** *没有规则来制作目标`project.c'','project''需要。停止。

我可能做错了什么提示?
(CFLAGS) project.c -o project
But when I run make from the folder I just get:

make: *** No rule to make target `project.c'', needed by `project''. Stop.
Any hints to what I might be doing wrong?


2006年12月11日星期一22:53:29 +0100, comp.lang.c,Johs

< sd *@sdf.comwrote:
On Mon, 11 Dec 2006 22:53:29 +0100, in comp.lang.c , Johs
<sd*@sdf.comwrote:

>我有一个名为project的源文件。 C。在同一个文件夹中,我有一个
Makefile,其中包含:
>I have a source file called project.c. In the same folder I have a
Makefile containing:



这是一个gcc和/或make问题,在这里不是主题。尝试

comp.unix.programming或gcc组。还试着看一些样品

makefile什么工作

-

马克麦金太尔


" ;调试的次数是首先编写代码的两倍。

因此,如果你尽可能巧妙地编写代码,那么,按照定义你是b $ b,而不是聪明到可以调试它。

--Brian Kernighan

This is a gcc and/or make problem, and not topical here. Try
comp.unix.programming or a gcc group. Also try looking at some sample
makefiles that work
--
Mark McIntyre

"Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are,
by definition, not smart enough to debug it."
--Brian Kernighan


这篇关于make:***没有制定目标的规则的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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