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


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

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

Submitter:  None
Submitted:  Thu 23 Mar 2006 03:22:13 PM UTC
Category:  None Priority:  5 - Normal
Severity:  2 - Minor Status:  None
Privacy:  Public Assigned to:  None
Originator Email:  -email is 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>
Group 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.



(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

No files currently attached


Depends on the following items: None found

Items that depend on this one: None found


CC list is empty


There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.


Follows 1 latest change.

Date Changed by Updated Field Previous Value => Replaced by
2006-03-23 None Carbon-Copy- Added gmarcus --AT-- ieee --DOT-- org

Back to the top

Powered by Savane 3.13-ee12.
Corresponding source code