On 31 October 2010 10:54, Jan Engelhardt <jeng...@medozas.de> wrote: > Hi, > > > While trying to utilize Autotools in a preexisting project that > previously just relied on Makefiles, I came across ylwrap failing for > some absurd, unknown reason. I couldn't help but run sh -x and debug it > piecewise. > > So what's ultimately done is running flex inside a temp directory, > > flex /home/jengelh/code/iproute2/tc/emp_ematch_lex.l > > It turns out flex produces a file called lex.ematch_.c, which is > something ylwrap so does not expect at all - it only checks for > what's in pairlist="yy.lex.c emp_ematch_lex.c". > > I can use AM_LFLAGS = -o yy.lex.c to work around it, but that feels like > an ugly hack. What's up with flex here? >
Ylwrap renames your Lex and Yacc files to their respective <source names.{c,h}> So if your lexer was foo.l it would output foo.c not lex.yy.c which is what your expecting. Here is a Makefile.am snippet of a basic compiler i write a while back: bin_PROGRAMS= cmod$(EXEEXT) noinst_LIBRARIES = libparser.a AM_CPPFLAGS = -I$(top_srcdir)/include AM_YFLAGS = -d cmod_SOURCES = \ mm-cmod.c \ dd-util.c \ dd-vec.c \ ii-toplev.c \ ii-mod-dot.c \ bb-linux-i386.c cmod_LDADD = libparser.a libcparser_a_YFLAGS = -d libparser_a_CFLAGS = -DMOD -DPARSER libparser_a_SOURCES = ss-parser.y ss-lexer.l Hope this helps. --Phil