help-make
[Top][All Lists]
Advanced

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

Re: Reversing a list


From: Jens Schweikhardt
Subject: Re: Reversing a list
Date: Wed, 10 Jul 2002 11:41:06 +0200
User-agent: Mutt/1.2.5i

On Wed, Jul 10, 2002 at 02:40:50PM +0530, address@hidden wrote:
# Hi All,
# 
# How do I reverse a given list.

Why would you want to?

# 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)

Assuming your list is a list of dependencies then you have a serious
design error in your Makefile. You should never write a Makefile where
the order of dependencies is significant. If h needs to be made before g
etc, then write

g: h
f: g
e: f
d: e
c: d
b: c
a: b

and let make figure out what needs to be done in which order. This is
what make is all about. If you get in the way with your own idea of the
proper sequence, you're in effect trying to outsmart make, which is
likely to bite you for any non-trivial build process.

If, however, your reversed list appears in some commands, you have the
full unix toolbox at your disposal and this is not really a make
question. news:comp.unix.shell comes to mind.

Regards,

        Jens
-- 
Jens Schweikhardt  http://www.schweikhardt.net/
SIGSIG -- signature too long (core dumped)



reply via email to

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