helpmake - Support: sr #105252, Documentation of '4.14 Generating...

 
 

You are not allowed to post comments on this tracker with your current authentification level.

sr #105252: Documentation of '4.14 Generating Prerequisites Automatically'

Submitted by:  None
Submitted on:  Thu 23 Mar 2006 03:22:13 PM UTC  
 
Category: NonePriority: 5 - Normal
Severity: 2 - MinorStatus: None
Privacy: PublicAssigned to: None
Originator Email: -unavailable-Open/Closed: Open
Operating System: None

Thu 23 Mar 2006 03:52:56 PM UTC, comment #1:

Your suggestion is definitely clearer; unfortunately it doesn't work with older versions of GCC (GCC 2.x), which don't support the -MF or -MT flags.

However, in the next release of GNU make (the one after 3.81) I'm planning on dropping support for K&R C and modifying the code to require a C89 compiler at least. At that time it might be worthwhile to modify the manual to assume a GCC 3.x compiler as well.

Paul D. Smith <psmith>
Project Administrator
Thu 23 Mar 2006 03:22:13 PM UTC, original submission:

In Section '4.14 Generating Prerequisites Automatically', to generate:

main.o main.d : main.c defs.h

you propose:

%.d: %.c
@set -e; rm -f $@; \
$(CC) -M $(CPPFLAGS) $< > $@.$$$$; \
sed 's,\($\)\.o[ :],\1.o $@ : ,g' < $@.$$$$ > $@; \
rm -f $@.$$$$

I think it may be clearer without the criptic sed command. I propose:

%.d: %.c
$(CC) -MM -MF $@ -MT $(<:.c=.o) -MT $@ $<

producing the same output.

Anonymous

 

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

CC list is empty

 

Do you think this task is very important?
If so, you can click here to add your encouragement to it.
This task has 0 encouragements so far.

Only logged-in users can vote.

 

Please enter the title of George Orwell's famous dystopian book (it's a date):

 

 

Follows 1 latest change.

Date Changed By Updated Field Previous Value => Replaced By
Thu 23 Mar 2006 03:22:13 PM UTCNoneCarbon-Copy-=>Added gmarcus --AT-- ieee --DOT-- org

Back to the top


Powered by Savane 3.1-cleanup