|
From: | Alan Larkin |
Subject: | LEX/YACC definitions header |
Date: | Wed, 23 Apr 2003 15:05:10 -0700 |
Before discovering auto* tools last week I had a
makefile that contained (amongst other stuff)
#--- Makefile
LFLAGS = -o$@
YFLAGS = --defines=$(@:.cpp=.hpp) -y OBJECTS =
\
... $(SRC_DIR)/ForrestLexer.o \ $(SRC_DIR)/ForrestParser.o \ ... ForrestLexer.c: ForrestLexer.l
ForrestParser.cpp ForrestParser.hpp: ForrestParser.ypp #---
It built a dll which linked in a flex/bison parser.
ForrestParser.hpp is included in the source files that use the parser. It
automatically computes the dependencies which causes ForrestParser.hpp to be
generated before its needed. Works a treat.
Now Im am having difficulty writing Makefile.am for
this project. It currently looks like
#--- Makefile.am
MAINTAINERCLEANFILES = Makefile.in
AM_CPPFLAGS = -I"C:/Program
Files/Java/j2sdk1.4.1_01/include" -I"C:/Program
Files/Java/j2sdk1.4.1_01/include/win32"
AM_YFLAGS = --defines=$(@:.c++=.hpp)
-y
lib_LTLIBRARIES =
libforrest.la
libforrest_la_SOURCES = \ ... ForrestLexer.l \ ForrestParser.y++ \ ... libforrest_la_LDFLAGS = -no-undefined -version-info 0:0:0 libforrest_la_LIBADD = @LEXLIB@ $(top_srcdir)/replace/libreplace.la ForrestParser.hpp: ForrestParser.y++ #
???
#---
% make
[... normal stuff] gcc -DHAVE_CONFIG_H -I. -I. -I. "-IC:/Program Files/Java/j2sdk1.4.1_01/include" "-IC:/Program Files/Java/j2sdk1.4.1_01/include/win32" -g -O2 -MT ForrestLexer.lo -MD -MP -MF .deps/ForrestLexer.Tpo -c ForrestLexer.c -DPIC -o .libs/ForrestLexer.o ForrestLexer.l:7:29: ForrestParser.hpp: No such file or directory [... copious quantities of errors from ForrestLexer.c] How do I write my .am so that ForrestParser.hpp is
generated? I define AM_PROG_LEX and AC_PROG_YACC in configure.in. Thats all I
need there in order to make the parser right?
Also, while I have you, whats the correct way to
get rid of that hard coded inclusion of the Java include directory?
Many thanks.
|
[Prev in Thread] | Current Thread | [Next in Thread] |