LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 05-10-2012, 05:56 AM   #1
khodeir
Member
 
Registered: Feb 2009
Distribution: Debian
Posts: 243

Rep: Reputation: 33
makefile help needed


Hi all ,
I need some help
I made this rule
PHP Code:
SOURCE a.c b.c
OBJECT 
a.o b.o

$(OBJECT) : $(SOURCE)
    @echo 
"Invoking C compiler for $<"
    
$(CC) -$< 
every time this rule is used , it only compile a.c , any help ?!

Last edited by khodeir; 05-10-2012 at 05:57 AM.
 
Old 05-10-2012, 05:59 AM   #2
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,778

Rep: Reputation: 7304Reputation: 7304Reputation: 7304Reputation: 7304Reputation: 7304Reputation: 7304Reputation: 7304Reputation: 7304Reputation: 7304Reputation: 7304Reputation: 7304
you need to define a target, and every dependency will be compiled.
What is your full makefile?
(it this was your full makefile: the first target will be taken, which is a.o
 
Old 05-10-2012, 06:03 AM   #3
khodeir
Member
 
Registered: Feb 2009
Distribution: Debian
Posts: 243

Original Poster
Rep: Reputation: 33
full make file

PHP Code:
SOURCE a.c b.c
OBJECT 
a.o b.o

all 
: $(OBJECT)

$(OBJECT) : $(
SOURCE)
    @echo 
"Invoking C compiler for $<"
    
$(CC) -$< 
I want to generate a.o and b.o , so what is wrong with my makefile
 
Old 05-10-2012, 07:31 AM   #4
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,778

Rep: Reputation: 7304Reputation: 7304Reputation: 7304Reputation: 7304Reputation: 7304Reputation: 7304Reputation: 7304Reputation: 7304Reputation: 7304Reputation: 7304Reputation: 7304
how did you try it? Which command did you execute?
 
Old 05-10-2012, 07:38 AM   #5
khodeir
Member
 
Registered: Feb 2009
Distribution: Debian
Posts: 243

Original Poster
Rep: Reputation: 33
thanks for your reply
Iused "make all"
 
Old 05-10-2012, 08:01 AM   #6
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,778

Rep: Reputation: 7304Reputation: 7304Reputation: 7304Reputation: 7304Reputation: 7304Reputation: 7304Reputation: 7304Reputation: 7304Reputation: 7304Reputation: 7304Reputation: 7304
try -v or -d to see what's happening
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Error in Makefile:No rule to make target `g++',needed by... stop karthik.c Programming 5 03-09-2009 12:55 AM
Makefile help from experts needed markelo Programming 0 07-23-2006 01:13 PM
No rule to make target `/mkspecs/default/qmake.conf', needed by `Makefile'. Stop Julianus Linux - General 0 12-21-2003 07:17 AM
Makefile help needed for linksys WPC11 v.4 duziq Linux - Newbie 8 12-10-2003 11:26 AM
Files needed for recompile and missing Makefile Juniper34 Linux - Newbie 11 08-05-2003 12:42 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 02:13 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration