|
From: | Williams, James P |
Subject: | "Advanced Auto-Dependency Generation" and lex/yacc (again) |
Date: | Thu, 26 Jan 2006 09:21:21 -0600 |
I'm trying to implement automatic dependency generation using the excellent idea posted here.
http://make.paulandlesley.org/autodep.html
The following email seems to describe the problem I'm having.
http://lists.gnu.org/archive/html/help-make/2001-12/msg00014.html
In my case, however, I'm trying to implement this in a general way that can be #included by Makefiles from many different applications. Also, files other than lex.c files can #include yacc.h. So the dependency graph could look like this.
prog.exe: goo.o lex.o yacc.o
goo.o: goo.c yacc.h
lex.o: lex.c yacc.h
yacc.o: yacc.c
lex.c: lex.l
yacc.c yacc.h: yacc.y
And just because there's a lex.l doesn't mean there's an associated yacc.y.
How can I teach make these dependencies in a general way without having to write them by hand, using "Advanced Auto-Dependencies"? I don't see a way to detect the goo.o/yacc.h dependency because it requires that yacc be run first. I'm coming to the conclusion that I must return to automatically building the dependency files using implicit rules, i.e., "Basic Auto-Dependencies" (see first link above), with all of the problems that introduces. Is that really the best way to do this?
Thanks,
Jim
[Prev in Thread] | Current Thread | [Next in Thread] |