Hello Guillaume,

* Guillaume Rousse wrote on Thu, Feb 08, 2007 at 10:44:35AM CET:
> 
> I just found an issue in GNU make handling of empty variable in
> substitutions:
> A = foo
> LIST = $(A) $(B)
> LIST_H = $(LIST:=.h)
> 
> all:
>         echo $(LIST_H)
> 
> With GNU make 3.80, LIST_H is incorectly expanded to "foo.h .h", whereas
> in make 3.81, this is correctly expanded to "foo.h" only. How to
> workaround this ?

I think POSIX requires the part between `:' and `=' to be nonempty, but
not the part after `='.  So write

A = foo.h
LIST = $(A) $(B)
LIST_H = $(LIST:.h=)

Hope that helps.

Cheers,
Ralf


Reply via email to