help-make
[Top][All Lists]
Advanced

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

RE: $(wildcard ) evaluation


From: Rinehart, Raleigh
Subject: RE: $(wildcard ) evaluation
Date: Wed, 23 Jul 2008 15:31:16 -0500

> On Wed, Jul 23, 2008 at 12:54 PM, Rinehart, Raleigh
> <address@hidden> wrote:
> ...
> >> My guess is that the *.out files are created as the side-effect of
> >> some other rule.  Make doesn't know that, so it doesn't know to add
> >> them to the cache, so $(wildcard *.out) gives the wrong result.
> >>
> >> Raleigh, does that sound like it could be case?  What creates the
*.out
> >> files?
> >
> > This is what I am thinking is the case, but not because the files
are
> > created "behind make's back".
> ...
> > However, the way this is being invoked via a submake $(MAKE) leads
me to
> > believe from the observed behaviour that the changes to the cache
are
> > not getting propagated back up the stack.  Thus the top-level make
> > (where the wildcard gets expanded) doesn't have them in it's cache.
I
> > guess I'll have to do a $(shell ...) for things to work as they are.
> 
> Yep, that counts as 'behind the back' for the parent make.  Just
> another reason Recursive Make Considered Harmful.  My recommendation
> is to get rid of the use of recursive make, at least for that step.
> 

I agree and wish there were some way to avoid it at this point with
re-architecting the whole system.  However there are other constraints
that are preventing me from doing that so I'm stuck with it.  Luckily
this is somewhat of an edge case in our build system.  The "normal"
build process is much better.
 
> Of course, there's the question of why you're using $(wildcard *.out)
> instead of just *.out directly in the rules.  Why not let the shell do
> the expansion?

Yes, I had that 'doh moment a few minutes ago.  I've changed things to
do exactly this and surprise it works!

Thanks to everyone for all your help, it was very much appreciated.
Now on to the next challenge, having the .o files compiled in target
specific directories!

> 
> 
> Philip Guenther







reply via email to

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