GNU bug report logs - #8921
side stepping automake limitations with custom dependencies

Previous Next

Package: automake;

Reported by: Mike Frysinger <vapier <at> gentoo.org>

Date: Thu, 23 Jun 2011 00:00:02 UTC

Severity: normal

Done: "Ralf Wildenhues" <Ralf.Wildenhues <at> gmx.de>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Mike Frysinger <vapier <at> gentoo.org>
To: 8921 <at> debbugs.gnu.org
Cc: Jie Zhang <jzhang918 <at> gmail.com>
Subject: bug#8921: side stepping automake limitations with custom dependencies
Date: Wed, 22 Jun 2011 19:58:59 -0400
[Message part 1 (text/plain, inline)]
i'm working on a project (urjtag) that has yacc/lex files in it.  and other 
files in the directory depend on the generated output from yacc/lex.  so the 
automake file looks something like:
libbsdl_la_SOURCES =  \
	vhdl_bison.y \
	bsdl_bison.y \
	bsdl.c       \
	bsdl_sem.c
libbsdl_flex_la_SOURCES = \
	vhdl_flex.l  \
	bsdl_flex.l

since the bison(yacc) files depend on the output of the flex(lex) files, we 
want to express the dependency:
libbsdl_flex_la-vhdl_flex.o: vhdl_bison.h
libbsdl_flex_la-bsdl_flex.o: bsdl_bison.h

but with this, we hit an ugly limitation in automake itself.  FTFM:
	http://sources.redhat.com/automake/automake.html#Extending
	[quote]
	Note that Automake does not make any distinction between rules with
	commands and rules that only specify dependencies. So it is not possible
	to append new dependencies to an automake-defined target without
	redefining the entire rule.
	[/quote]

i happened to notice though that automake only parses exact semantic matches.  
it cannot handle going through variables.  so i tried out:
$(libbsdl_la_OBJECTS): bsdl_bison.h vhdl_bison.h

ignoring the minor fact that a few extra objects depend on the headers than 
necessary, i get nice behavior: automake generates the compile rules for me, 
and i get to express the dependency to make so parallel builds dont fail.

is this an undocumented feature ?  or a bug that'll get fixed at some point ?  
we've been using this for a few years now without problems, but past behavior 
does not guarantee future behavior ...
-mike
[signature.asc (application/pgp-signature, inline)]

This bug report was last modified 13 years and 323 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.