[Top][All Lists]

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

Re: problem with $(wildcard ,,,)

From: Paul D. Smith
Subject: Re: problem with $(wildcard ,,,)
Date: Mon, 30 Apr 2001 21:22:25 -0400

%% "Nic Ferrier" <address@hidden> writes:

  nf> I think I've found a problem with version 3.79.1 of make. The
  nf> problem also exists with 3.78.1

  nf> The problem is that the $(wildcard) function doesn't always work. If
  nf> the file that is tested only exists as the result of an operation
  nf> performed by a pre-requisite it does not return the file.

This is a known issue, related to the fact that GNU make uses a
directory cache in order to speed up processing.  Because of this cache,
once the directory is read it will only be seen (from within make) to
contain changes that make knows about: that is, new files that appear as
targets, etc. in the makefile and not as side effect of shell commands
that make can't know anything about.

The best way to solve the problem is to inform make that you're creating
that file, somehow (the details depend on exactly what you're doing, and
this can't always be achieved).  If you cannot do that, you may be
forced to use a $(shell ...) command like $(shell echo *.c) or whatever,
instead of the builtin $(wildcard ...)  (be aware that "echo *.c" won't
sort the results, if that matters to you).

 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]