This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: [patch] cleanup target makefile frag collection in toplevel
- From: Alexandre Oliva <aoliva at redhat dot com>
- To: DJ Delorie <dj at redhat dot com>
- Cc: neroden at doctormoo dot dyndns dot org, gcc-patches at gcc dot gnu dot org, gdb-patches at sources dot redhat dot com, binutils at sources dot redhat dot com
- Date: 10 Jul 2002 09:22:31 -0300
- Subject: Re: [patch] cleanup target makefile frag collection in toplevel
- Organization: GCC Team, Red Hat
- References: <20020525182125.GA22642@doctormoo.dyndns.org><200206200011.g5K0Blo23026@greed.delorie.com>
On Jun 19, 2002, DJ Delorie <dj@redhat.com> wrote:
> Me thinks you need the "for" inside the "if test -n". If all three
> variables are empty, the for will fail with a syntax error.
Nope. This is a problem when it is make that expands Makefile macros
then say `for var in ${MACRO}; do' is sent to the shell as `for var in
; do'. If it is a shell that expands shell variables, it doesn't
matter if they expand to an empty sequence: the for command is still
valid, and in fact enclosing the for command with a test doesn't
work. To wit, try:
if test -n; then
for var in; do
:
done
fi
you'll get a syntax error just the same.
--
Alexandre Oliva Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer aoliva@{cygnus.com, redhat.com}
CS PhD student at IC-Unicamp oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist Professional serial bug killer