Remove hardcoded path from parser; tell automake not to bother with swig or parser

This commit is contained in:
Sears Russell 2008-09-28 07:35:20 +00:00
parent f19dd1d2b4
commit a7e8751f2f
7 changed files with 24 additions and 19 deletions

View file

@ -19,6 +19,8 @@ AC_PROG_MAKE_SET
AC_PROG_LIBTOOL
AC_PROG_AWK
AC_PROG_RANLIB
AC_PROG_YACC
AC_PROG_LEX
# Checks for libraries.
# For SWIG & Python

View file

@ -1,4 +1,5 @@
LDADD=$(top_builddir)/src/stasis/libstasis.la $(top_builddir)/src/libdfa/librw.la
toplevel_SOURCES=toplevel.c algebra.c dml.c
noinst_PROGRAMS=toplevel
## TODO: Get lex + yacc to work w/ automake
#toplevel_SOURCES=toplevel.c algebra.c dml.c ddl.c tuple.c lang/ast.c lang/lexer.l lang/parse.y
#noinst_PROGRAMS=toplevel
AM_CFLAGS=-g -Wall -pedantic -std=gnu99

View file

@ -1,10 +1,10 @@
BISON_TARGET(RefParser ${CMAKE_CURRENT_SOURCE_DIR}/parse.y ${CMAKE_CURRENT_BINARY_DIR}/y.tab.c)
FLEX_TARGET(RefParser ${CMAKE_CURRENT_SOURCE_DIR}/lexer.lex ${CMAKE_CURRENT_BINARY_DIR}/lex.yy.c)
FLEX_TARGET(RefParser ${CMAKE_CURRENT_SOURCE_DIR}/lexer.l ${CMAKE_CURRENT_BINARY_DIR}/lex.yy.c)
#SET(INCLUDE_DIR ${INCLUDE_DIR} ${CMAKE_CURRENT_SOURCE_DIR})
#COPY_FILE(${CMAKE_CURRENT_SOURCE_DIR}/ast.h ${CMAKE_CURRENT_BINARY_DIR}/ast.h)
ADD_LIBRARY(refparse ${CMAKE_CURRENT_BINARY_DIR}/lex.yy.c ${CMAKE_CURRENT_BINARY_DIR}/y.tab.c ${CMAKE_CURRENT_SOURCE_DIR}/ast.c)
ADD_EXECUTABLE(parser ${CMAKE_CURRENT_BINARY_DIR}/lex.yy.c ${CMAKE_CURRENT_BINARY_DIR}/y.tab.c ${CMAKE_CURRENT_SOURCE_DIR}/ast.c ${CMAKE_CURRENT_SOURCE_DIR}/parse.c)
ADD_EXECUTABLE(parse_test ${CMAKE_CURRENT_BINARY_DIR}/lex.yy.c ${CMAKE_CURRENT_BINARY_DIR}/y.tab.c ${CMAKE_CURRENT_SOURCE_DIR}/ast.c ${CMAKE_CURRENT_SOURCE_DIR}/parse_test.c)
SET_TARGET_PROPERTIES(refparse PROPERTIES COMPILE_FLAGS "-Wno-implicit -Wno-unused -I ${CMAKE_CURRENT_SOURCE_DIR}")
SET_TARGET_PROPERTIES(parser PROPERTIES COMPILE_FLAGS "-Wno-implicit -Wno-unused -I ${CMAKE_CURRENT_SOURCE_DIR}")
SET_TARGET_PROPERTIES(parse_test PROPERTIES COMPILE_FLAGS "-Wno-implicit -Wno-unused -I ${CMAKE_CURRENT_SOURCE_DIR}")
ADD_TEST(test_parser ${CMAKE_CURRENT_SOURCE_DIR}/test_parser.pl)

View file

@ -3,7 +3,7 @@
#include <string.h>
#include "ast.h"
#include "y.tab.h"
#include "parser_private.h"
#include "src/apps/referential/lang/parser_private.h"
//#define DBG(x) printf("%s\t",x); ECHO
#define DBG(x)

View file

@ -4,9 +4,9 @@
#include <stdlib.h>
#include <string.h>
#include "ast.h"
#include "src/apps/referential/lang/ast.h"
#include "/home/sears/stasis/src/apps/referential/lang/parser_private.h"
#include "src/apps/referential/lang/parser_private.h"
void parse(char *buf, expr_list **result)

View file

@ -1,13 +1,15 @@
## XXX fix swig!
BUILT_SOURCES = stasis_wrap.cc
all: $(BUILD_SOURCES)
python_PYTHON = stasis.py
pyexec_LTLIBRARIES = _stasis.la
_stasis_la_SOURCES = stasis_wrap.cc
_stasis_la_CPPFLAGS = $(SWIG_PYTHON_CPPFLAGS) -I$(top_srcdir) -I$(top_srcdir)/src
_stasis_la_LDFLAGS = -module
_stasis_la_LIBADD = $(top_srcdir)/src/stasis/libstasis.la $(top_srcdir)/src/libdfa/librw.la
stasis_wrap.cc : lladd.i
$(SWIG) $(SWIG_PYTHON_OPT) -I$(top_srcdir)/src -I$(top_srcdir) -o $@ $<
#BUILT_SOURCES = stasis_wrap.cc
#
#all: $(BUILD_SOURCES)
#python_PYTHON = stasis.py
#pyexec_LTLIBRARIES = _stasis.la
#_stasis_la_SOURCES = stasis_wrap.cc
#_stasis_la_CPPFLAGS = $(SWIG_PYTHON_CPPFLAGS) -I$(top_srcdir) -I$(top_srcdir)/src
#_stasis_la_LDFLAGS = -module
#_stasis_la_LIBADD = $(top_srcdir)/src/stasis/libstasis.la $(top_srcdir)/src/libdfa/librw.la
#
#stasis_wrap.cc : lladd.i
# $(SWIG) $(SWIG_PYTHON_OPT) -I$(top_srcdir)/src -I$(top_srcdir) -o $@ $<