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

2009-02-04 Thread Pierre Willard

URL:
  http://savannah.gnu.org/bugs/?25493

 Summary: -include filename does not show correct dependency
errors
 Project: make
Submitted by: willard
Submitted on: Wed 04 Feb 2009 09:52:12 PM GMT
Severity: 3 - Normal
  Item Group: Bug
  Status: None
 Privacy: Public
 Assigned to: None
 Open/Closed: Open
 Discussion Lock: Any
   Component Version: 3.81
Operating System: None
   Fixed Release: None

___

Details:

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







___

Reply to this item at:

  http://savannah.gnu.org/bugs/?25493

___
  Message sent via/by Savannah
  http://savannah.gnu.org/



___
Bug-make mailing list
Bug-make@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-make


Re: -include filename does not show correct dependency errors

2009-01-28 Thread willard

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/opentv/tstmake]
$ make -f bad2.mak
[/cygdrive/d/opentv/tstmake]
$ cat makefile

all:
$(MAKE) -f bad2.mak

[/cygdrive/d/opentv/tstmake]
$ make 
make -f bad2.mak
make: *** [all] Error 2
[/cygdrive/d/opentv/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).
I am sure I can find a work-around, but this seems like a nasty bug THAT
SHOULD BE FIXED.


-- 
View this message in context: 
http://www.nabble.com/-include-filename-does-not-show-correct-dependency-errors-tp21699973p21710735.html
Sent from the Gnu - Make - Bugs mailing list archive at Nabble.com.



___
Bug-make mailing list
Bug-make@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-make


Re: -include filename does not show correct dependency errors

2009-01-28 Thread Philip Guenther
On Wed, Jan 28, 2009 at 9:39 AM, willard pie...@willard.com wrote:
 it's the same if foo.d is not a direct target. It's even worse as make fails
 without ANY error message.

Nice!  xxx.h gets marked as failed and the error silenced, and the
silencing applies to all paths to xxx.h and not just the foo.d-xxx.h
path.


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

(echo $? after running make works too)


 I am sure I can find a work-around, but this seems like a nasty bug THAT
 SHOULD BE FIXED.

Whoa, no need to yell!  I didn't intend to suggest that the bug should
not be fixed.  My don't spend time banging you head comment was for
you, as a user of make, and not the developers of make (of which I am
_not_ one).

Hmm, since you feel strongly about this, the GNU make developers would
probably find it helpful if you were to verify whether this bug still
exists in the development (CVS) version of GNU make and, if so, file a
bug for it or, if there already is bug for it, comment on that bug.
If nothing else, that would let you be notified when the bug *is*
fixed.


Philip Guenther


___
Bug-make mailing list
Bug-make@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-make


Re: -include filename does not show correct dependency errors

2009-01-28 Thread willard


I am new to this message board... I did not intend to yell... 
Thanks for the info... I hope the Gnu Make developers are listening to
bug-m...@gnu.org.
I had a quick look at the CVS tree bug tracking (on sourceforge.net), and I
didn't see anything resembling this issue...

-- 
View this message in context: 
http://www.nabble.com/-include-filename-does-not-show-correct-dependency-errors-tp21699973p21715450.html
Sent from the Gnu - Make - Bugs mailing list archive at Nabble.com.



___
Bug-make mailing list
Bug-make@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-make


Re: -include filename does not show correct dependency errors

2009-01-28 Thread Paul Smith
On Wed, 2009-01-28 at 13:27 -0800, willard wrote:
 
 I am new to this message board... I did not intend to yell... 
 Thanks for the info... I hope the Gnu Make developers are listening to
 bug-m...@gnu.org.
 I had a quick look at the CVS tree bug tracking (on sourceforge.net), and I
 didn't see anything resembling this issue...

??

There's no GNU make project on sourceforge.net, at least not that I'm
aware of.  GNU make, like most other GNU projects and all (as far as I'm
aware) FSF projects, is hosted on Savannah, which is a hosting service
using free software, not SourceForge which is not free software.

Try here:

https://savannah.gnu.org/projects/make/

-- 
---
 Paul D. Smith psm...@gnu.org  Find some GNU make tips at:
 http://www.gnu.org  http://make.mad-scientist.us
 Please remain calm...I may be mad, but I am a professional. --Mad Scientist


___
Bug-make mailing list
Bug-make@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-make


-include filename does not show correct dependency errors

2009-01-27 Thread willard

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

For example, if using:

-include foo.d

with foo.d being:

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

Looks like a bug to me.
Btw, I am using make 3.81.

-- 
View this message in context: 
http://www.nabble.com/-include-filename-does-not-show-correct-dependency-errors-tp21699973p21699973.html
Sent from the Gnu - Make - Bugs mailing list archive at Nabble.com.



___
Bug-make mailing list
Bug-make@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-make


Re: -include filename does not show correct dependency errors

2009-01-27 Thread Philip Guenther
On Tue, Jan 27, 2009 at 8:59 PM, willard pie...@willard.com wrote:
 When using the -include filename(instead of just include filename), if
 this filename includes dependencies that are missing, makefile does not show
 those missing dependencies...

 For example, if using:

 -include foo.d

 with foo.d being:

 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.

Well, what _does_ it say?  When I set up things to match your
description, it mentions xxx.h for me:

$ ls
Makefile foo.cfoo.d
$ cat Makefile
all: foo
-include foo.d
$ cat foo.d
foo.o: foo.c xxx.h
$ make
make: *** No rule to make target `xxx.h', needed by `foo.o'.  Stop.
$ make --version | head -1
GNU Make 3.81


Philip Guenther


___
Bug-make mailing list
Bug-make@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-make


Re: -include filename does not show correct dependency errors

2009-01-27 Thread willard

this is my example (create the foo.d manually as below)

$ 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/opentv/tstmake]
$ make -f bad.mak
make: *** No rule to make target `foo.d', needed by `all'.  Stop.
[/cygdrive/d/opentv/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/opentv/tstmake]
$ make -f good.mak
make: *** No rule to make target `xxx.h', needed by `foo.d'.  Stop.
[/cygdrive/d/opentv/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.


-- 
View this message in context: 
http://www.nabble.com/-include-filename-does-not-show-correct-dependency-errors-tp21699973p21700324.html
Sent from the Gnu - Make - Bugs mailing list archive at Nabble.com.



___
Bug-make mailing list
Bug-make@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-make


Re: -include filename does not show correct dependency errors

2009-01-27 Thread Philip Guenther
On Tue, Jan 27, 2009 at 9:44 PM, willard pie...@willard.com wrote:
 this is my example (create the foo.d manually as below)

Well, now that you've shown your whole Makefile, I have a guess as to
why make is behaving as it is.  It's tied that the face that you use
foo.d both as an implicit target (by virtue of being an included
makefile) and as an explicit target, as a dependency of 'all'.  My
guess is that when make first tries to build foo.d and fails, it marks
foo.d as unbuildable, but not why.  Later, when you have it try to
build foo.d (again), it sees that it has already marked it as failed,
so gives up directly.

My advice is to avoid this by fixing your auto-dependency method.  If
you just build the *.d files concurrently with the *.o files, then you
could avoid naming foo.d as either dependency or target.  The details
of why that works correctly and how to actually do that concurrent
building can be found in the Advanced Auto-Dependencies section of
http://make.paulandlesley.org/autodep.html

Yeah, make should give a less misleading error message, but why spend
time banging your head on a bug that could be avoided by making your
own code less wasteful?


Philip Guenther


___
Bug-make mailing list
Bug-make@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-make