[Top][All Lists]

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

Re: gmake bug?

From: Paul D. Smith
Subject: Re: gmake bug?
Date: Mon, 16 Oct 2000 13:48:15 -0400

%% "Peters, Sam" <address@hidden> writes:

  ps> This is a dirt simple test case that seems to act funny.  This is
  ps> really all I have time to submit.  I might be able to answer a
  ps> question about this if you ask.  make.include has no business
  ps> appearing in my output.  Here is a typescript.

  ps> -include make.include

  ps> %: %.bar
  ps>         touch $<

First, this is a weird rule because it never updates its target!  It
only updates the prerequisite, which is _quite_ odd.  I assume this is
just an example.

This is a "match-anything" rule.  Because the target is "%", you are
telling make that _ANY_ target can be built if (in this case) there
exists a file (or a way to build a file) with the name <target>.bar.

There are many issues one has to consider when using match-anything
rules; you should read the GNU make manual section "Match-Anything
Pattern Rules" for a discussion of these.

  ps> baker:/tmp> ls make.include
  ps> make.include not found
  ps> baker:/tmp> gmake foo
  ps> touch make.include.bar

To get this output, you must have a file "make.include.bar" in your

Make always tries to rebuild the makefile and all included makefiles,
before it runs any other rules.  If it can, it will re-exec itself.  You
should see the GNU make manual section "How Makefiles Are Remade" for
more information on this feature.

If you have a file named "make.include.bar" in your directory, make will
use the implicit rule to intuit that it can rebuild "make.include" from
that file, and it will proceed to do so, printing the rule it uses as
you see above.

This is all perfectly correct behavior.

 Paul D. Smith <address@hidden>          Find some GNU make tips at:
 http://www.gnu.org                      http://www.paulandlesley.org/gmake/
 "Please remain calm...I may be mad, but I am a professional." --Mad Scientist

reply via email to

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