From: Mark Cave-Ayland Date: Thu, 3 Jul 2008 09:28:38 +0000 (+0000) Subject: Add the parser build rules back into the liblwgeom Makefile, so now any changes to... X-Git-Tag: 1.4.0b1~874 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=94babd74afdba76e14f3bdc42faa8b3b3a38f1ef;p=postgis Add the parser build rules back into the liblwgeom Makefile, so now any changes to either the lexer or parser source files will automatically invoke a rebuild of the relevant output files during make git-svn-id: http://svn.osgeo.org/postgis/trunk@2820 b70326c6-7e19-0410-871a-916f4a2858ee --- diff --git a/configure.ac b/configure.ac index d24c9c7bc..363b264c9 100644 --- a/configure.ac +++ b/configure.ac @@ -46,6 +46,16 @@ POSTGIS_MINOR_VERSION=`cat Version.config | grep POSTGIS_MINOR_VERSION | sed 's/ POSTGIS_MICRO_VERSION=`cat Version.config | grep POSTGIS_MICRO_VERSION | sed 's/[[^=]]*=\([[0-9]]\)/\1/g'` +dnl +dnl Search for flex/bison to build the parser +dnl + +AC_PROG_LEX +AC_PROG_YACC +AC_SUBST([LEX]) +AC_SUBST([YACC]) + + dnl dnl Search for xsltproc which is required for building documentation dnl diff --git a/liblwgeom/Makefile.in b/liblwgeom/Makefile.in index a5aaf5186..04563f46d 100644 --- a/liblwgeom/Makefile.in +++ b/liblwgeom/Makefile.in @@ -13,6 +13,9 @@ CC=@CC@ CFLAGS=@CFLAGS@ @PICFLAGS@ @WARNFLAGS@ +YACC=@YACC@ +LEX=@LEX@ + # Standalone LWGEOM objects SA_OBJS=measures.o \ box2d.o \ @@ -48,4 +51,13 @@ clean: # Command to build each of the .o files $(SA_OBJS): %.o: %.c $(CC) $(CFLAGS) -c -o $@ $< + +# Commands to generate the lexer and parser from input files +wktparse.tab.c: wktparse.y + $(YACC) -vd -p lwg_parse_yy wktparse.y + mv -f y.tab.c wktparse.tab.c + mv -f y.tab.h wktparse.tab.h + +lex.yy.c: wktparse.lex wktparse.tab.c + $(LEX) -Plwg_parse_yy -i -f -o 'lex.yy.c' wktparse.lex