[Top][All Lists]

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

Re: $(wildcard) not expanding generated files

From: DervishD
Subject: Re: $(wildcard) not expanding generated files
Date: Tue, 21 Jan 2003 11:10:50 +0100
User-agent: Mutt/1.4i
User-agent: Mutt/1.4i <http://www.mutt.org>

    Hi Johan :)

    I'm writing to the bug mailinglist so anybody can read the
message, ok?, but really is for you ;)

> this seems to be by design, to overcome the fact that
>   OBJECTS = *.o
> doesn't expand the list, whereas
>   OBJECTS = $(wildcard *.o)
> does.

    Yes, I know, it is very useful for that purpose. In fact, it is
currently avoiding me empty expansions...

> $(wildcard is expanded upon the first pass over the makefile, ie.
> when no rules have been executed yet; so your 'testfile' doesn't
> yet exist, and  $(wildcard is replaced with an empty string.

    In the Makefile I put, yes, this is true. In the original, the
$(wildcard) call is inside another macro that is $(call)'ed, and so I
supposed that the functions inside weren't expanded at the first pass
over the Makefile, but when $(call)'ed. It is something like:

    myfunction=lots of things and $(wildcard $(1)) between them.


        $(call myfunction, with_this_parameter*)

    I supposed that the $(wildcard) call was expanded at the time of
$(call). And I was wrong :((

> >     Don't know if this is a bug, but anyway this doesn't work and it
> > should (IMHO). The problem is the function $(wildcard) not working
> > properly when the argument is a generated file. Let me explain it
> Define "properly" ;-)

    Mmmm. "When I want it to" XDDDD

> > created file. Is this a bug or a feature?
> Feature.

    I was afraid of that... 
> > Will this undesired
> > behaviour (undesired by me, at least) be solved if I replace
> > $(wildcard pattern) with $(shell echo pattern)?
> No, you'd probably need 'ls', 'echo' just echoes the given
> characters, and uses no wildcard expansion AFAIK, depending on your
> shell.

    Yes, you're true again. I'll do better with 'ls'.

> $(wildcard has not been designed for the use you want from it. Let
> us know what it is that you want to achieve, and we can discuss
> possible solutions.

    No problem, it is not a bug, but a misuse by me. I'll try to
solve the problem using $(shell).
> HTH,

    It has helped a lot, and thank you very much for the explanation,
the advice and for answering *real* soon. You saved me a bunch of
hours of work :))

    Raúl Núñez de Arenas Coronado

reply via email to

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