Let's say you have a variable in a makefile fragment like the following:
MY_LIST=a b c d
How do I then reverse the order of that list? I need:
$(warning MY_LIST=${MY_LIST})
to show
MY_LIST=d c b a
Edit: the real problem is that
ld -r some_object.o ${MY_LIST}
produces an a.out
with undefined symbols because the items in MY_LIST
are actually archives, but in the wrong order. If the order of MY_LIST
is reversed, it will link correctly (I think). If you know a smarter way to get the link order right, clue me in.