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

 
 

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

Submitter:  Pierre Willard <willard>
Submitted:  Wed 04 Feb 2009 09:52:12 PM UTC
Votes: 2
 
Severity:  3 - Normal Item Group:  Bug
Status:  Duplicate Privacy:  Public
Assigned to:  None Open/Closed:  Closed
Component Version:  3.81 Operating System:  None
Fixed Release:  None Triage Status:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

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

This is a duplicate of bug #15110

Paul D. Smith <psmith>
Group 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 Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by psmith (Posted a comment)
  • -email is unavailable- added by mark_marshall (Voted in favor of this item)
  • -email is unavailable- added by willard (Submitted the item)
  •  

    There are 2 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.

    Only logged-in users can vote.

     

    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2009-08-02 psmith StatusNone Duplicate
        Open/ClosedOpen Closed
    2009-05-07 mark_marshall Carbon-Copy- Added mark_marshall

    Back to the top

    Powered by Savane 3.13-758e.
    Corresponding source code