automake
[Top][All Lists]
Advanced

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

Re: side stepping automake limitations with custom dependencies


From: Ralf Wildenhues
Subject: Re: side stepping automake limitations with custom dependencies
Date: Thu, 23 Jun 2011 22:02:49 +0200

Hi Jie,

* Jie Zhang wrote on Thu, Jun 23, 2011 at 03:30:43PM CEST:
> On Thu, Jun 23, 2011 at 1:52 AM, Ralf Wildenhues wrote:
> > The only thing that keeps me from setting current behavior in stone is
> > that it is sooo unintuitive and ugly.
> >
> There is another ugly way to achieve the same purpose, i.e. redefine
> the entire, like this:
> 
> vhdl_flex.lo: vhdl_flex.c vhdl_bison.h
> if am__fastdepCC
>         $(AM_V_CC)$(LTCOMPILE) -Wno-error -MT $@ -MD -MP -MF
> $(DEPDIR)/$*.Tpo -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<
>         $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
> else
>         $(AM_V_CC) @AM_BACKSLASH@
> if AMDEP
>         source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
>         DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
> endif
>         $(LTCOMPILE) -Wno-error -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<
> endif
> 
> This way also references several undocumented internal variables of
> Automake. Which way is preferred? or less ugly?

Well, this is waay more verbose, prone to bitrot as the automake-emitted
rules are improved over time (which is more likely than anything else),
and in this special case also unportable, as $< in non-inference rules
requires GNU make.

> The root cause of this issue is that Automake does not distinguish
> rules with commands and rules that only specify dependencies. I'm
> curious that why Automake does not distinguish them. Is it too
> difficult to implement or it is also a feature or just because no one
> does it?

With Posix make Makefiles, it would be doable with some more work, but
automake doesn't.  With GNU make extensions used in the Makefile.am, it
is almost impossible without implementing a large set of GNU make
extension parsing in automake as well.

At least that's what I think it was never tried.  This issue is from
before I knew what automake does.

Cheers,
Ralf



reply via email to

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