bugmake - Bugs: bug #25493, -include filename does not show...

 
 

bug #25493: -include filename does not show correct dependency errors

Submitted by:  Pierre Willard <willard>
Submitted on:  Wed 04 Feb 2009 09:52:12 PM UTC  
Votes:  2  
 
Severity: 3 - NormalItem Group: Bug
Status: DuplicatePrivacy: Public
Assigned to: NoneOpen/Closed: Closed
Component Version: 3.81Operating System: None
Fixed Release: NoneTriage Status: None

Add a New Comment(Rich Markup)
   

You are not logged in

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

 

Sun 02 Aug 2009 11:51:48 PM UTC, comment #1:

This is a duplicate of bug #15110

Paul D. Smith <psmith>
Project Administrator
Wed 04 Feb 2009 09:52:12 PM UTC, original submission:

When using the "-include filename"(instead of just "include filename"), if this filename includes dependencies that are missing, make does not show those missing dependencies...

For example, if using:

-include foo.d

with foo.d being:

food.d foo.o: foo.c xxx.h

Let's say xxx.h does not exist (and cannot be generated) , the make fails, but it does not say it's because of xxx.h missing.

If instead, this is used:

include foo.d

then it works fine...

I understand that the '-' in front of include means that THIS file 'foo.d' should not itself generate an error, but I would expect the content of foo.d to be used normally....

Full 1st example:
-----------------

$ cat bad.mak

all: foo.d foo.ooo

COMPILE=gcc

%.o: %.c
$(COMPILE) -c $<

%.d: %.c
$(COMPILE) -c $< -MM -o $*.d

-include foo.d

foo.ooo: foo.o
ld -o foo.ooo foo.o
[/cygdrive/d/tstmake]
$ make -f bad.mak
make: *** No rule to make target `foo.d', needed by `all'. Stop.
[/cygdrive/d/tstmake]
$ cat good.mak

all: foo.d foo.ooo

COMPILE=gcc

%.o: %.c
$(COMPILE) -c $<

%.d: %.c
$(COMPILE) -c $< -MM -o $*.d

include foo.d

foo.ooo: foo.o
ld -o foo.ooo foo.o
[/cygdrive/d/tstmake]
$ make -f good.mak
make: *** No rule to make target `xxx.h', needed by `foo.d'. Stop.
[/cygdrive/d/tstmake]
$ cat foo.d
foo.d foo.o: foo.c xxx.h

the only difference between the 'good.mak' and 'bad.mak' is the '-' prefix on the include...
See that the good.mak really displays what the problem is... whereas the bad.mak messages are not helpful.

Full 2nd example:
-----------------
it's the same if foo.d is not a direct target. It's even worse as make fails without ANY error message.
Example2:
$ cat bad2.mak

all: foo.ooo

COMPILE=gcc

%.o: %.c
$(COMPILE) -c $<

%.d: %.c
$(COMPILE) -c $< -MM -o $*.d

-include foo.d

foo.ooo: foo.o
ld -o foo.ooo foo.o
[/cygdrive/d/tstmake]
$ make -f bad2.mak
[/cygdrive/d/tstmake]
$ cat makefile

all:
$(MAKE) -f bad2.mak

[/cygdrive/d/tstmake]
$ make
make -f bad2.mak
make: *** [all] Error 2
[/cygdrive/d/tstmake]
$ cat foo.d
foo.d foo.o: foo.c xxx.h

See that the 'make -f bad2.mak' shows no message at all..(but going thru a makefile shows Error 2).

Pierre Willard <willard>

 

(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 psmith (Posted a comment)
  • -unavailable- added by mark_marshall (Voted in favor of this item)
  • -unavailable- added by willard (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 2 encouragements so far.

    Only logged-in users can vote.

     

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

     

     

    Follow 3 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sun 02 Aug 2009 11:51:48 PM UTCpsmithStatusNone=>Duplicate
      Open/ClosedOpen=>Closed
    Thu 07 May 2009 08:15:40 AM UTCmark_marshallCarbon-Copy-=>Added mark_marshall

    Back to the top


    Powered by Savane 3.1-cleanup1