bug-make
[Top][All Lists]
Advanced

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

Re: make buildin function strings handling


From: Rob Walker
Subject: Re: make buildin function strings handling
Date: Mon, 21 May 2012 14:01:36 -0700
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:12.0) Gecko/20120428 Thunderbird/12.0.1

That's the expected behavior...

Your code below is equivalent to:

tmp1=$(obj)
tmp2=$(word 1,$(obj))

Try it yourself:

makefile:

all: ; @#
$(info $(word 1,$$(foo))

-Rob

On 5/21/2012 9:24 AM, Incarnation Lee wrote:
I am improving my codes which managed by gnu make recently. And I found a behavior of make buildin function when handling strings. I assume that this maybe for some specific situations. My OS is Ubuntu 12.04 and with gnu make v.3.81. Details list follow:
obj=a.o b.o c.o

define Test
tmp1=$(word 1, $$(obj))
endef
$(eval $(call Test))
tmp2=$(word 1,$(obj))

echo $(tmp1)
echo $(tmp2)

do make -n
and get the result
a.o b.o c.o(tmp1)
a.o(tmp2)


_______________________________________________
Bug-make mailing list
address@hidden
https://lists.gnu.org/mailman/listinfo/bug-make




reply via email to

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