automake
[Top][All Lists]
Advanced

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

Re: Weird behavior with multiple conditionals in single Makefile.am


From: Dalibor Topic
Subject: Re: Weird behavior with multiple conditionals in single Makefile.am
Date: Thu, 29 Jul 2004 14:08:11 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7b) Gecko/20040421

Alexandre Duret-Lutz wrote:
Dalibor Topic wrote:

Hi all,
I'm fighting with something rather bizarre in automake 1.8.5 / 1.8d.
In a subdir, my Makefile.am looks like this:


if COND_KAFFE_X_AWT
       MAYBE_KAFFE_X_AWT = X
else
       MAYBE_KAFFE_X_AWT =
endif
if COND_KAFFE_QT_AWT
       MAYBE_KAFFE_QT_AWT = qt
else
       MAYBE_KAFFE_QT_AWT =
endif
if COND_CLASSPATH_GTK_AWT
       MAYBE_CLASSPATH_GTK_AWT = classpath-gtk
else
       MAYBE_CLASSPATH_GTK_AWT =
endif
SUBDIRS = \
       $(MAYBE_KAFFE_X_AWT) \
       $(MAYBE_KAFFE_QT_AWT) \
       $(MAYBE_CLASSPATH_GTK_AWT)
DIST_SUBDIRS = \
       X \
       qt \
       classpath-gtk


Now that you have found your culprit, you can rewrite the above
as follows:

if COND_KAFFE_X_AWT
  MAYBE_KAFFE_X_AWT = X
endif
if COND_KAFFE_QT_AWT
  MAYBE_KAFFE_QT_AWT = qt
endif
if COND_CLASSPATH_GTK_AWT
  MAYBE_CLASSPATH_GTK_AWT = classpath-gtk
endif
SUBDIRS = \
  $(MAYBE_KAFFE_X_AWT) \
  $(MAYBE_KAFFE_QT_AWT) \
  $(MAYBE_CLASSPATH_GTK_AWT)

I.e., let Automake define DIST_SUBDIRS itself, and omit the
empty definitions.

Thanks for the tip! Checked in and fixed.

Would it be possible to add a warning to automake about such [1]
tabs-vs-spaces oddities?


With the current sniffer, this sounds hard.  But feel free to
give it a try...

Uh, ... I wouldn't call myself a great portable shell hacker, so I doubt I'd be the right person for that. In particular since my first thought was adding posix sh backends to flex & bison :)

cheers,
dalibor topic





reply via email to

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