Re: % vs. No rule to make target

2008-06-09 Thread Paul Smith
On Mon, 2008-06-09 at 12:02 +0800, [EMAIL PROTECTED] wrote:
 Maybe whatever prints messages prefixed by
make: *** No rule to make target
 is called from several different points in the code, and could give
 finer grained messages, all still on one line.
 
 Maybe there is a difference between no rule at all and yes, a few
 rules, but no best one. Like, no wires at all found and yes found
 some wires, but none that could complete the circut and several
 paths to complete the circut, but no best path, so giving up.

There is no several rules but no best rule.  In make, the very first
matching rule it finds that works is considered the best rule; only if
there is no matching rule at all do you get this message.

I suppose it would be possible to make a distinction in the output
between a situation where no rule that matched the target was found and
one where an implicit rule matched the target, but couldn't be used.
However, I don't know what helpful information that really gives you.
Plus, there would be no way you'd ever get the no rule matched the
target message unless you had customized your makefile to remove the
built-in rules, because there are a number of match anything built-in
rules, that match ALL targets.

-- 
---
 Paul D. Smith [EMAIL PROTECTED]  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


Re: % vs. No rule to make target

2008-06-09 Thread jidanni
Do differentiate error messages from different triggers, all in
preparation for a perl-like

  See perldiag for explanations of all Perl's diagnostics.  The use
  diagnostics pragma automatically turns Perl's normally terse warnings
  and errors into these longer forms.

hand holding facility for make, ten+ years down the road.


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


Re: % vs. No rule to make target

2008-06-09 Thread Paul Smith
On Tue, 2008-06-10 at 01:49 +0800, [EMAIL PROTECTED] wrote:
 Do differentiate error messages from different triggers,

I'm not sure this is fruitful, but to reiterate: there are no different
triggers.  There is one procedure.  It looks something like this (100%
psuedo code):

rule *r;
r = find_explicit_rule(target);
if (r)
return run_rule(r);

r = find_implicit_rule(target);
if (r)
return run_rule(r);

error(No rule found to create %s, target);

I guess what you're suggesting is something like:

rule *r;
int possible_rules;

r = find_explicit_rule(target);
if (r)
return run_rule(r);

r = find_implicit_rule(target, possible_rules);
if (r)
return run_rule(r);

if (possible_rules == 0)
error(No explicit rule found to create %s, target);
else
error(No implicit or explicit rule found to create %s, target);

I just don't see the point.  Even ignoring the fact that you'd never see
the message from the then part of the error statement (because by
default there plenty of rules that match any possible target), what does
this information do for you?



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


Re: % vs. No rule to make target

2008-06-09 Thread jidanni
PS what does this information do for you?

I don't know, all I am thinking is hooks (i.e., differing error
messages that can be post processed by:) for a future hand holding
system so one can ask what went wrong? And have super basic tutorial
information given... (target implementation date 2050, implementor:
some fellow like the one who wrote the Bash Advanced guide or Emacs
Lisp big manual.)

(Just make slightly differing messages if they can be made today
without rearranging the program just for this.)

 I guess what you're suggesting is something like:
I don't know, it's all over my head anyway. OK, thanks.


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


Re: % vs. No rule to make target

2008-06-08 Thread jidanni
OK, OK, is perhaps this message,
  make: *** No rule to make target `z', needed by `a'.  Stop.
is actually triggered by several different conditions, and could instead
be refashioned into several more exact messages, e.g., no rule at all,
no best rule, etc.


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


Re: % vs. No rule to make target

2008-06-08 Thread Paul Smith
On Mon, 2008-06-09 at 11:28 +0800, [EMAIL PROTECTED] wrote:
 OK, OK, is perhaps this message,
   make: *** No rule to make target `z', needed by `a'.  Stop.
 is actually triggered by several different conditions, and could
 instead be refashioned into several more exact messages, e.g., no rule
 at all, no best rule, etc.

Sorry, but I don't agree with your premise.  This message is triggered
by one, and exactly one, situation: make couldn't find a rule to build
that target.  It looked for an explicit rule and didn't find one; it
looked for an implicit rule and didn't find one.  So it gave up.  If
make had found one, it would have used it.

I don't understand the distinction you're making here between no rule
at all and no best rule (what's a best rule?), and just no rule.
Maybe if you could be more precise in your definitions I'd be able to
see what you're looking for.

Cheers!

-- 
---
 Paul D. Smith [EMAIL PROTECTED]  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


Re: % vs. No rule to make target

2008-06-08 Thread jidanni
PS I don't understand the distinction you're making here between no rule
PS at all and no best rule (what's a best rule?), and just no rule.

Maybe whatever prints messages prefixed by
   make: *** No rule to make target
is called from several different points in the code, and could give
finer grained messages, all still on one line.

Maybe there is a difference between no rule at all and yes, a few
rules, but no best one. Like, no wires at all found and yes found
some wires, but none that could complete the circut and several
paths to complete the circut, but no best path, so giving up.

Er, if still I'm getting nowhere, then you can drop this bug report. Sorry.


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


Re: % vs. No rule to make target

2008-06-06 Thread Paul Smith
On Fri, 2008-06-06 at 19:49 +0800, [EMAIL PROTECTED] wrote:
 All is well:
   $ cat Makefile
   all:z.bak
   %.bak:;
   $ make
   make: Nothing to be done for `all'.
 Until we add a %:
   $ cat Makefile
   all:z.bak
   %.bak:%;
   $ make
   make: *** No rule to make target `z.bak', needed by `all'.  Stop.
 Suddenly it can't find the rule anymore. Or prints the wrong message.
 Indeed, instead of % use
   %.bak:some_file_that_exists;
 No problem. But
   %.bak:some_file_that_does_not_exist;
 then make says it can't find the rule to make target z.bak, when it
 should say it can't find the rule to make target 
 some_file_that_does_not_exist,
 which it does when one uses
   z.bak:some_file_that_does_not_exist;

I have this weird deja-vu feeling like I've already explained this to
you before.

However.

There is nothing that can be done about this; this is expected behavior.

A pattern rule is not a guarantee that that particular rule will be used
to build every target that matches the pattern.  Indeed, the builtin
rules have a large number of different patterns that can build
%.o (for example), all with different prerequisites.

If there is no explicit rule to build a target, then make will search
the pattern rules, looking for one that matches.  Matches means that
BOTH the target pattern matches the target to be built, AND that all the
prerequisites exist OR can be built.

If the pattern does not match, make goes on to the next pattern and
tries that.

If no pattern matches, make says it doesn't know how to build the
target, just as you're seeing.

You are using your innate understanding of your environment and your
needs to see that the problem is that that particular prerequisite
doesn't exist, and suggesting make should also be able to see that...
but make CAN'T see that.  All it can see is that the makefile doesn't
contain any rules it can use to build that target.

It would be disaster to print all the possible prerequisites make looked
at to decide whether a given target could be built: consider all the
built-in rules to create executables (where the pattern, %, matches
everything); to check things out of source control (again where the
pattern matches everything); not to mention the above multiple rules to
build .o's: if you were missing a .c file you'd get a long list of
possible prerequisites (.c, .cc, .cpp, .f, .F, etc. etc.)


An explicit rule is, of course, much simpler for make: if there's an
implicit rule then that's the way the target must be built and if the
prerequisites don't exist make can tell you about that directly.



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