%% Jon Wells <[EMAIL PROTECTED]> writes:

  jw> There seems to be a bug handling files with percent signs in their
  jw> names (and the person who decided to name temp files like that).

Targets with percent signs in their names require special handling,
since make will treat them as pattern rules if the percents aren't
properly escaped with a backslash.

  jw> It produces an incorrect error message when a dependent file is
  jw> missing, ie., it complains about there being no rule for the
  jw> target rather than saying it doesn't know how to construct the
  jw> missing file.

This is correct behavior.  This:

  jw> test%1: file%1 file%2
  jw>   cat $? > $@

is an implicit pattern rule, not an explicit rule to build test%1.

The way implicit rules work is they don't match unless they're possible.
This implicit rule isn't possible, since no "file%1" exists.  Thus, make
can't find _any_ rule that could build "test%1", and give the error:

  jw> make: *** No rule to make target `test%1', needed by `all'.  Stop.

If you want that rule to be considered an explicit rule, you have to
escape the percents in the target, like this:

  test\%1: file%1 file%2 ; cat $? > $@

Now you'll get:

  make: *** No rule to make target `file%1', needed by `test%1'.  Stop.

-- 
-------------------------------------------------------------------------------
 Paul D. Smith <[EMAIL PROTECTED]>          Find some GNU make tips at:
 http://www.gnu.org                      http://www.ultranet.com/~pauld/gmake/
 "Please remain calm...I may be mad, but I am a professional." --Mad Scientist

Reply via email to