[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: makefile error output

From: Mike Maxwell
Subject: Re: makefile error output
Date: Fri, 26 Mar 2004 16:02:41 -0500

Paul D. Smith wrote:
> %% "Mike Maxwell" <address@hidden> writes:
>   mm> I just spent the morning trying to debug my makefile.  The
>   error msg was
> mm>     Make: *** Unable to make target  Stop
>   mm> (The name of the target has been changed to protect the
> innocent.)
> Please do not paraphrase like this.  By not providing the _EXACT_
> message you got, and the exact rule you wrote, etc. you are just
> confusing the issue.

I'm not sure what you mean by "paraphrase".  Apart from the name of the
target file, that is the error msg word-for-word.  Here, I'll cut-and-paste
the command and the error msg from the terminal:
   > make tarsets/
   make: *** No rule to make target `tarsets/'.
(I suspect that last line will not wrap correctly in email, but everything
from "make: ***" through "Stop." is one line--the error msg.)

> Either you are using some bastardized version of GNU make,
   > make --version
   GNU Make version 3.79.1, by Richard Stallman and Roland McGrath.
   Built for i386-redhat-linux-gnu
   Copyright (C) 1988, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 2000
      Free Software Foundation, Inc.
   This is free software; see the source for copying conditions.
   There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A

   Report bugs to <address@hidden>.
> or this is not what make printed.  There is no code in GNU
> make that will print that error message.

Well, there might not be in the latest and greatest version, but there seems
to be such code in 3.79.1.

> Given your description of what happened, the
> error message make printed would have been some form of:
>   No rule to make target `XXX'.
> IMO that message is much clearer than what you wrote above.

I'll agree with that last statement.  Unfortunately, that's not what 'make'
did, and that's the point of my original msg.

> ...The GNU
> make manual section explaining error messages says:
>      This means that `make' decided it needed to build a target, but
>      then couldn't find any instructions in the makefile on how to do
>      that, either explicit or implicit (including in the default rules
>      database).
>   mm> The problem turned out to be that I had misspelled one of the
>   mm> prerequisities:
>   mm> foo.baz   foo.ReadMe
>   mm>     ...
>   mm> Instead of a file foo.ReadMe, I had foo.Readme.  Simple to fix,
>   mm> hard for me to find.
> As Noel pointed out, if this is _REALLY_ what your makefile said then
> make would have told you that it didn't know how to build foo.ReadMe.

Again, I agree.  For the record, here's the line in my makefile (minus a
comment at the end that makes it wrap in email):

   tarsets/%.stage2.tgz: stage2/%  %.mchist %.ID %.ReadMe

The missing prereq was the last one, %.ReadMe (I had instead named the file, with a lowercase 'm').

>> From your description of what happened, I believe that you really had
> defined an implicit rule here, rather than an explicit rule as your
> example shows.

The above is the first line of the rule.  It has a number of tab-indented
lines below that, the first of which would have echo'd a msg to the
terminal, if 'make' had gotten that far.  It didn't, because it couldn't
figure out how to make the .ReadMe file.

>   mm> Couldn't make do the same thing?  I.e. when it tried to make the
>   mm> foo.ReadMe file, it could have said something like
>   mm>     Looking for foo.ReadMe...failed
>   mm>     Trying implicit prerequisite foo.ReadMe,v ...failed
>   mm>     Trying implicit prerequisite RCS/foo.ReadMe,v ...failed
>   mm>     etc.
>   mm> In other words, all it needs to do is add the string "
>   ...failed" if a mm> prereq fails (or " ...succeeded" if it
>   succeeds), to the output produced mm> with the -d flag.
> ...
> Make output doesn't print "failed", but you know it failed because it
> went on to continue looking for another rule to match.

Yes, but that requires a lot of sifting through and interpreting of output
to figure out; whereas if it output 'failed' when it failed, I could look
for a top-level failure (presumably indented less than lower-level
success/failures, which might even allow me to grep it out), which would be
the .ReadMe prereq; then I could go about looking for why that prereq failed
(which might take me into the second-level success/failures which contain
'.ReadMe', which I could again grep out, etc.)

    Mike Maxwell

reply via email to

[Prev in Thread] Current Thread [Next in Thread]