automake
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Yacc Support?


From: kj1nabble
Subject: Yacc Support?
Date: Fri, 2 Mar 2007 00:45:58 -0800 (PST)

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. 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
-- 
View this message in context: 
http://www.nabble.com/Yacc-Support--tf3332417.html#a9266040
Sent from the Gnu - Automake - General mailing list archive at Nabble.com.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]