bug-automake
[Top][All Lists]
Advanced

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

Re: even @C_FALSE@ (unsatisfied) contains rule to produce binary


From: Ralf Wildenhues
Subject: Re: even @C_FALSE@ (unsatisfied) contains rule to produce binary
Date: Tue, 12 Oct 2010 00:13:35 +0200
User-agent: Mutt/1.5.20 (2010-08-04)

Hi Jan,

thanks for taking the time to report it here.

* Jan Kratochvil wrote on Mon, Oct 11, 2010 at 09:57:28PM CEST:
> The "a" program gets built only `if F' below.  Makefile.in correctly contains:
> @address@hidden: b.c
> @F_TRUE@      gcc -o $@ $< -Wall
> 
> But while does it also contains:
> @address@hidden(EXEEXT): $(a_OBJECTS) $(a_DEPENDENCIES)
> @F_FALSE@     @rm -f a$(EXEEXT)
> @F_FALSE@     $(LINK) $(a_OBJECTS) $(a_LDADD) $(LIBS)
> 
> which does not work anyway as $(a_OBJECTS) is not defined in @address@hidden

> ==> Makefile.am <==
> AUTOMAKE_OPTIONS = foreign
> if F
> bin_PROGRAMS = a
> a_SOURCES = b.c
> a: b.c
>       gcc -o $@ $< -Wall
> 
> endif F

IIUC then this won't cause a problem because if F is false then 'a'
won't be built anyway, because nothing depends on it.  (I think you
concluded this on binutils as well, but I'm adding it here for
reference.)  If anybody has a similar example where the dead rule has
some actual impact, then we should reconsider this.

Point is, in some situations it is actually desirable to retain the
automake-provided rules in the non-overridden conditional case.

Thanks,
Ralf



reply via email to

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