bugmake - Bugs: bug #40657, Suffix rules and prerequisites

 
 

bug #40657: Suffix rules and prerequisites

Submitted by:  John Marshall <jmarshall>
Submitted on:  Thu 21 Nov 2013 02:08:34 PM UTC  
 
Severity: 3 - NormalItem Group: Documentation
Status: NonePrivacy: Public
Assigned to: NoneOpen/Closed: Open
Component Version: 3.81Operating System: Any
Fixed Release: NoneTriage Status: None

Add a New Comment (Rich MarkupRich Markup):
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Thu 21 Nov 2013 02:08:34 PM UTC, original submission:

The "Suffix Rules" info node states

"Suffix rules cannot have any prerequisites of their own. If they have any, they are treated as normal files with funny names, not as suffix rules."

However this appears to be incorrect. Here is the example following that text, with -DHELLO added so we can see it for certain:

$ cat badsuffix.mk
.c.o: foo.h
$(CC) -DHELLO -c $(CFLAGS) $(CPPFLAGS) -o $@ $<
$ touch hello.c

$ make -f badsuffix.mk -n hello.o .c.o
cc -DHELLO -c -o hello.o hello.c
make: *** No rule to make target `foo.h', needed by `.c.o'. Stop.

$ make -f badsuffix.mk -p | grep -B4 -A1 'badsuffix.mk.*line 2'
[snip]
%.o: %.c
# commands to execute (from `badsuffix.mk', line 2):
$(CC) -DHELLO -c $(CFLAGS) $(CPPFLAGS) -o $@ $<
--
.c.o: foo.h
# Implicit rule search has not been done.
# Modification time never checked.
# File has not been updated.
# commands to execute (from `badsuffix.mk', line 2):
$(CC) -DHELLO -c $(CFLAGS) $(CPPFLAGS) -o $@ $<

So both a suffix rule and a rule for a funnily-named file have been made, and only one got the prerequisite. Perusal of the NEWS file suggests that this may have changed in 3.58 ("Suffix rules may have dependencies (which are ignored)"), but it seems that the documentation has not caught up.

John Marshall <jmarshall>

 

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

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by jmarshall (Submitted the item)
  •  

    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):

     

     

    No Changes Have Been Made to This Item

    Back to the top


    Powered by Savane 3.1-cleanup