help-make
[Top][All Lists]
Advanced

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

the usage of strip


From: Peng Yu
Subject: the usage of strip
Date: Thu, 8 Jul 2010 16:49:04 -0500

Hi,

I don't get the what strip is for. In particular how "Replacing the
variable reference `$(needs_made)'  with the function call `$(strip
$(needs_made))'  in the ifneq directive would make it more robust"
(from the manual). I tries to add two consecutive spaces in a
variable. But I failed. Could somebody show me an example to
demonstrate the effect of strip?

$ make
a b c
a b c
$ cat Makefile
.PHONY: all

empty:=
space:=$(empty) $(empty)
twospaces:=$(empty) $(empty) $(empty)
foo:=a$(space)b$(twospaces)c
bar:=$(strip a$(space)b$(space)$(space)c)

all:
        @echo $(foo)
        @echo $(bar)


-- 
Regards,
Peng

PS. the document is not clear to me what strip doesn't. Could the
author improve it be adding some reproducible example (what is
'needs_made' in the example)?



reply via email to

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