Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: [joshk@xxxxxxxxxxxxxxx: Bug#271196: makefile completion catches some delayed expansions as targets]



On Thu, Sep 30, 2004 at 10:44:59AM +0100, Peter Stephenson wrote:
> I did notice that this target:
>   builds/$(CONFIG)/stamp-builddir
> gets shortened to
>   builds//stamp-builddir
> 
> I realise there it's not likely to be able to do the substitution
> properly, but I'm not sure why it's doing it at all.

I wanted substitutions for targets such as this:

rsync$(EXEEXT): ...

so that completion returns either "rsync" or "rsync.exe", as
appropriate.  I'm surprised that the makefile you cited didn't set
CONFIG somewhere inside it.  Perhaps it was in an include that didn't
get processed?

One option that could make this better is to not expand variables that
are not set.  Thus, in the case of the $(EXEEXT) var (since it is
usually set to an empty string) it would get expanded.  In your cited
case (if CONFIG was not set) the target would be returned unchanged.
The only drawback I see to this is that some folks might be depending on
the fact that an unset variable is just as good as an empty variable in
a makefile.  However, since there would be a work-around for such
situations (by setting the variable to an empty value), I could live
with that behavior.  Thoughts?

..wayne..



Messages sorted by: Reverse Date, Date, Thread, Author