473,385 Members | 2,014 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

make: *** No rule to make target

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?
Dec 11 '06 #1
10 11413
On Mon, 11 Dec 2006 22:53:29 +0100, in comp.lang.c , Johs
<sd*@sdf.comwrote:
>I have a source file called project.c. In the same folder I have a
Makefile containing:
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
Dec 11 '06 #2
Johs wrote:
>
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?
You probably haven't got a source file named "project.c". Maybe
you created it with VC, and got it named "project.cpp". Or
something, like wrong case letters, or running in wrong directory.

--
Some informative links:
<news:news.announce.newusers
<http://www.geocities.com/nnqweb/>
<http://www.catb.org/~esr/faqs/smart-questions.html>
<http://www.caliburn.nl/topposting.html>
<http://www.netmeister.org/news/learn2quote.html>
<http://cfaj.freeshell.org/google/>

Dec 11 '06 #3
Mark McIntyre wrote:
On Mon, 11 Dec 2006 22:53:29 +0100, in comp.lang.c , Johs
<sd*@sdf.comwrote:
I have a source file called project.c. In the same folder I have a
Makefile containing:

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
Makefiles are kind of like sourdough, you[1] never can get one made
from scratch to work, you have to start with one that does and gently
modify it.

1. At least a dozen a people are preparing to write polemics about how
they create makefiles all the time from scratch. It's a joke. Like many
jokes has at least a crumb[2] of truth.

2. Just to extend the sourdough simile.

Brian

Dec 11 '06 #4

Johs wrote:
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?
If you're running "make," you have nothing listed as make: in your
Makefile. What you really want is "make project" (or turn "project:"
into "make:").

make looks for the make: target. If you run it with an argument, it
uses that target.

Dec 12 '06 #5
"Greg Johnston" <gr***********@gmail.comwrites:
Johs wrote:
>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?

If you're running "make," you have nothing listed as make: in your
Makefile. What you really want is "make project" (or turn "project:"
into "make:").

make looks for the make: target. If you run it with an argument, it
uses that target.
Wrong.

Post to a newsgroup specific to your system (likely
comp.unix.programmer), or read the documentation for "make".

--
Keith Thompson (The_Other_Keith) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <* <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.
Dec 12 '06 #6
check to see if there is project.c in the directory. You might have
named it differently or in the make file check if you have named
project.c or project correctly in all places ..
Johs wrote:
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?
Dec 12 '06 #7
Default User wrote:
Mark McIntyre wrote:
>On Mon, 11 Dec 2006 22:53:29 +0100, in comp.lang.c , Johs
<sd*@sdf.comwrote:
>>I have a source file called project.c. In the same folder I have a
Makefile containing:
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

Makefiles are kind of like sourdough, you[1] never can get one made
from scratch to work, you have to start with one that does and gently
modify it.

1. At least a dozen a people are preparing to write polemics about how
they create makefiles all the time from scratch. It's a joke. Like many
jokes has at least a crumb[2] of truth.

2. Just to extend the sourdough simile.
You know some crusty old-timer will raise the issue anyway. Any way you
slice it, you can't win.
Dec 12 '06 #8
Johs wrote:
CC=gcc
CFLAGS=-g

project: project.c
$(CC) $(CFLAGS) project.c -o project
The 'project: project.c' line is at fault here. Targets (for example,
your 'project') can only depend on other targets, and project.c isn't a
target. (Targets are basically things which make knows how to create.
make doesn't know how to create a .c file by default, but it does know
how to make things like .o files.)

Andrew Sidwell
Dec 12 '06 #9

"Andrew Sidwell" <ne**@entai.co.ukwrote in message
news:JY****************@newsfe5-win.ntli.net...
Johs wrote:
CC=gcc
CFLAGS=-g

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

The 'project: project.c' line is at fault here. Targets (for example,
your 'project') can only depend on other targets, and project.c isn't a
target. (Targets are basically things which make knows how to create.
make doesn't know how to create a .c file by default, but it does know
how to make things like .o files.)

Andrew Sidwell
Wrong.
Dec 12 '06 #10
Andrew Sidwell <ne**@entai.co.ukwrites:
Johs wrote:
>CC=gcc
CFLAGS=-g

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

The 'project: project.c' line is at fault here. Targets (for example,
your 'project') can only depend on other targets, and project.c isn't a
target. (Targets are basically things which make knows how to create.
make doesn't know how to create a .c file by default, but it does know
how to make things like .o files.)
Please take this discussion to a more appropriate newsgroup, one where
make is topical and they can explain why you're wrong.

--
Keith Thompson (The_Other_Keith) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <* <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.
Dec 12 '06 #11

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Vincento Harris | last post by:
Sql Server 7 Standard Edition My Server was renamed and the normal steps of reinstalling and running sp_dropserver and sp_addserver were followed. Everything seems to work fine but jobs from the...
6
by: jmborr | last post by:
While running make, I obtain the following error: make: *** No rule to make target `amino_acid_param.h', needed by `pdb2txt_relax.o'. Stop. I'm confused, since header files (*.h) shouldn't...
2
by: JimBo | last post by:
I just download fox toolkit.. and whenever I try to compile one of the example programs that comes with it.. I get an error much. Here is an example of what I see when I try to compile the...
6
by: Chris Travers | last post by:
Hi all; I am using PostgreSQL 7.4 on RedHat 9, though I don't think that is important to this problem. I am attempting to write a rule that will check to see whether certain conditions are...
4
by: Jeff Boes | last post by:
(I thought I posted this yesterday from Google Groups, but it doesn't appear to have "taken".) I'm having a problem with a rule designed to log new rows inserted into one table. The base table...
10
by: Extremest | last post by:
I know there are ways to make this a lot faster. Any newsreader does this in seconds. I don't know how they do it and I am very new to c#. If anyone knows a faster way please let me know. All...
11
by: zhangzhan | last post by:
hello.everyone,i am an chinese.i study in shanxi unniversity,as i like english very much,i also wanr to make friends with a foriger. .....i really don't kown what i should to say ,as i first came...
1
by: D3|\\||\\|!$ | last post by:
Hi all!!! I have been trying to port a piece of C++ code from windows to Linux environment. I'm using redhat9 which has KDE3 and QT3.1.x on it. I used KDevelop 2.1 bundled with it. I created a...
1
by: NeophyteDK | last post by:
hello Im trying to cross compile php for powerpc on Win XP with MinGW. I have succesfully cc'ed Lighttpd, with the same toochain. i use the command line: CC=powerpc-linux-gcc AR=powerpc-linux-ar...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.