[patch] cleanup target makefile frag collection in toplevel

Alexandre Oliva aoliva@redhat.com
Wed Jul 10 06:01:00 GMT 2002


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



More information about the Gcc-patches mailing list