help-make
[Top][All Lists]
Advanced

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

Re: I am not understanding .SECONDEXPANSION :(


From: Paul Smith
Subject: Re: I am not understanding .SECONDEXPANSION :(
Date: Fri, 23 Mar 2012 11:26:13 -0400

On Fri, 2012-03-23 at 08:05 -0700, Mark Galeck (CW) wrote:
> This works:
> .PHONY: foobar%
> OBJS := foobar0 foobar1
> 
> %: $(filter $*%,$(OBJS))
>       @echo $@: $^
> 
> $(MAKEFILE_LIST) $(OBJS): ;

I guess that depends on what you mean by "works".  The $* here evaluates
to the empty string since automatic variables are not valid anywhere but
inside recipes.

So, $(filter %,$(OBJS)) obviously matches everything.  But since OBJS
only contains things that you want to match, you don't notice.  If you
changed your OBJS value to include something that didn't match the
pattern you'd definitely see that it didn't work :-)





reply via email to

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