This is the mail archive of the automake@gnu.org mailing list for the automake project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: lex & yacc with C++ projects




> -----Original Message-----
> From: Guido Draheim [mailto:guidod-2002-@gmx.de] 
> Sent: Friday, April 26, 2002 9:49 PM

> aaaahhh. even though I need some enlightment what's wrong with a
> libstdc++ dependency for a c++ compiled source - so your project
> uses c++ files without libstdc++ and you want to include a parser 
> but that would bring you an unwanted lib-dependency?

Yes.
 
> anyway, since I'm thinking about it, I am wondering if the 
> following could work - what do you think about such rules...
> 
> .lo.tab.c :
>    $(LTCXXCOMPILE) -c $<
> 
> .o.tab.c :
>    $(CXXCOMPILE) -c $<
> 
> ... or does that not work with `make`? hmmm, just wondering...

These are the current rules:

fooparse.cc fooparse.h: fooparse.y
	bison -d -o fooparse.cc $(srcdir)/fooparse.y
	@mv fooparse.cc.h fooparse.h 2>/dev/null || mv fooparse.hh
fooparse.h

foolex.cc: foolex.l fooparse.h
	flex -8 $(srcdir)/foolex.l
	mv lex.yy.c foolex.cc

BUILT_SOURCES = fooparse.cc foolex.cc

... and in the PROGRAMS fooparse.cc foolex.cc fooparse.h

what would be great would be

in the _PROGRAMS fooparse.y foolex.l

LEX_LANG = CXX
YACC_LANG = CXX

or something similar (with the explicit behaviour that the lexx and yacc
mode will still be std C output.)

Rob


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]