LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 02-14-2005, 04:18 AM   #1
lucs
Member
 
Registered: Feb 2005
Posts: 39

Rep: Reputation: 15
Another problem with Makefile


Hello!
I've typed a Makefile...but it doesn't work!

Here there's the new Makefile:

CC = gcc

STD0 = -D__KERNEL__ -I/usr/src/linux-2.4.28/include -Wall -Wstrict-prototypes -Wno-trigra
phs -O2 -fno-strict-aliasing -fno-common -fomit-frame-pointer -pipe -mpreferred-stack-bou
ndary=2 -march=i686 -DMODULE -nostdinc -iwithprefix include -DKBUILD_BASENAME

STD1 = -DEXPORT_SYMTAB


primo.o: primo.c
@echo "creazione primo.o"
$(CC) -c $(STD0)=primo $(STD1) primo.c -o primo.o



secondo.o: secondo.c
@echo "creazione secondo.o"
$(CC) -c $(STD0)=secondo secondo.c -o secondo.o

clean:
@rm *.o

The problem is that when I type make, it doesn't call the @echo and the second $(CC). Instead make clean works, why?

Does anyone could help me? Thanks to all...lucs
 
Old 02-14-2005, 04:43 AM   #2
jtshaw
Senior Member
 
Registered: Nov 2000
Location: Seattle, WA USA
Distribution: Ubuntu @ Home, RHEL @ Work
Posts: 3,892
Blog Entries: 1

Rep: Reputation: 67
I would add an "ALL = primo.o second.o" at the top of the file. And before the primo.o and second.o sections add an "all: $(ALL)" in there.
 
Old 02-14-2005, 10:45 AM   #3
lucs
Member
 
Registered: Feb 2005
Posts: 39

Original Poster
Rep: Reputation: 15
Talking Thanks

Thank you very much...finally it works, but I've a question: why do I have to insert two all label? Is this a gcc bugs...it should work with an only all label!! lucs
 
Old 02-14-2005, 05:06 PM   #4
jtshaw
Senior Member
 
Registered: Nov 2000
Location: Seattle, WA USA
Distribution: Ubuntu @ Home, RHEL @ Work
Posts: 3,892
Blog Entries: 1

Rep: Reputation: 67
Well I suppose you could do all: primo.o second.o instead of that but generally I do it that way.. who knows why though, I've been doing it for years.
 
  


Reply



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
Makefile Problem nelnel Programming 4 07-08-2005 02:31 AM
how to get (makefile -f makefile )output into the textview widget in Pygtk sailu_mvn Programming 3 02-28-2005 03:57 AM
Problem with Makefile lucs Slackware 7 02-11-2005 09:18 AM
generate Makefile from Makefile.in without calling ./configure ? chris78 Programming 2 05-02-2004 12:23 PM
Makefile separator problem Ownasaurus Linux - Software 5 09-07-2003 01:07 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 01:58 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