I can't figure out how to do automake using yacc. I made a makefile (Makefile-noAutomake) and generating/compiling with yacc works fine in this simple case. However, I need to ensure it build with automake. I have used automake in the past with just C code, but yacc/lex has been cryptic. I've been going over the gnu page for 2 days now. Nobody seems to have a single example using a yacc Makefile.am. And I believe I'm following the gnu docs (
http://www.gnu.org/software/automake...c-and-Lex.html)
Any thoughts? I think it has something to do with how I set up my bin in Makefile.am.
First, the files and compiling using a simple makefile.
Files: ----------------------------------
g.y
l.l
appgen.c
app.c
app.h
Makefile:
"Makefile-noAutomake": -------------------
OBJS:=g.o l.o app.o appgen.o
all: app
$(OBJS): app.h
lc: y.tab.h $(OBJS)
gcc -o app $(OBJS)
y.tab.h: g.y
yacc -d g.y
---------------------------------------
Running (w/output):
$ make -f Makefile-noAutomake
yacc -d g.y
yacc g.y
mv -f y.tab.c g.c
gcc -g -O0 -c -o g.o g.c
flex -t l.l > l.c
gcc -g -O0 -c -o l.o l.c
gcc -g -O0 -c -o app.o app.c
gcc -g -O0 -c -o appgen.o appgen.c
gcc -o app g.o l.o app.o appgen.o
rm g.c l.c
-------------------------------------
Now to the automake stuff that doesn't seem to work...
------------------------------------
configure.ac:
...
AC_CONFIG_AUX_DIR([ylwrap]) # do I need ylwrap?
AM_INIT_AUTOMAKE
...
AC_MSG_NOTICE([using CFLAGS=$CFLAGS])
AC_MSG_NOTICE([using CXXFLAGS=$CXXFLAGS])
AC_MSG_NOTICE([using CPPFLAGS=$CPPFLAGS])
AC_MSG_NOTICE([using LDFLAGS=$LDFLAGS])
AC_MSG_NOTICE([using YFLAGS=$YFLAGS])
...
AC_PROG_CXX
AC_PROG_CC
AC_PROG_INSTALL
AC_PROG_LIBTOOL
AC_PROG_YACC
AC_PROG_LEX
...
--------------------------------------
Makefile.am:
bin_PROGRAMS = app
lc_SOURCES = l.l app.c g.y appgen.c
AM_YFLAGS=-d
AM_CXXFLAGS = -g -O0
AM_LFLAGS=-t