help-make
[Top][All Lists]
Advanced

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

Re: Reversing a list


From: Der Herr Hofrat
Subject: Re: Reversing a list
Date: Wed, 10 Jul 2002 11:00:14 +0200 (CEST)

> Hi All,
> 
> How do I reverse a given list.
> 
> eg:
> if
> TEST = a b c d e f g h
> 
> Then I need a
> 
> TEST1 to be (h g f e d c b a)
> 
>
not very elegant - but you always can use shell functions to define a
reverse function and then use call in the makefile to reference it.
I don't think make provides a build-in function for what you want.


---snip--- 
all: rev_args

reverse = $(shell echo $(1) | rev )

foo = "a b c"
bar = $(call reverse,$(foo))

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



hofrat



reply via email to

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