summaryrefslogtreecommitdiffstats
path: root/libsmartcols/src/Makemodule.am
diff options
context:
space:
mode:
Diffstat (limited to 'libsmartcols/src/Makemodule.am')
-rw-r--r--libsmartcols/src/Makemodule.am64
1 files changed, 62 insertions, 2 deletions
diff --git a/libsmartcols/src/Makemodule.am b/libsmartcols/src/Makemodule.am
index 2bb19fd..377888e 100644
--- a/libsmartcols/src/Makemodule.am
+++ b/libsmartcols/src/Makemodule.am
@@ -1,5 +1,4 @@
-
# smartcols.h is generated, so it's stored in builddir!
smartcolsincdir = $(includedir)/libsmartcols
nodist_smartcolsinc_HEADERS = libsmartcols/src/libsmartcols.h
@@ -21,7 +20,68 @@ libsmartcols_la_SOURCES= \
libsmartcols/src/calculate.c \
libsmartcols/src/grouping.c \
libsmartcols/src/walk.c \
- libsmartcols/src/init.c
+ libsmartcols/src/init.c \
+ \
+ libsmartcols/src/filter-parser.c \
+ libsmartcols/src/filter-scanner.c \
+ libsmartcols/src/filter-parser.h \
+ libsmartcols/src/filter-scanner.h \
+ \
+ libsmartcols/src/filter.c \
+ libsmartcols/src/filter-param.c \
+ libsmartcols/src/filter-expr.c
+
+BUILT_SOURCES += libsmartcols/src/filter-parser.c \
+ libsmartcols/src/filter-parser.h \
+ libsmartcols/src/filter-scanner.c \
+ libsmartcols/src/filter-scanner.h
+
+EXTRA_DIST += libsmartcols/src/filter-parser.y \
+ libsmartcols/src/filter-scanner.l
+
+## Generate filter parser (YACC) and tokenizer (LEX) .c and .h files.
+#
+# Note that we need advanced bison and flex features and configuration
+# directives to generated thread safe parser (usable in stared library), so
+# it's probably a bad idea to use "-y" (posix compatible) as default in
+# autotools. We also need to generate .c and .h files in the same time to avoid
+# duplicate stuff.
+#
+SCOLS_YACC_BASENAME = libsmartcols/src/filter-parser
+SCOLS_YACC_STEMP = $(SCOLS_YACC_BASENAME).stamp
+
+SCOLS_LEX_BASENAME = libsmartcols/src/filter-scanner
+SCOLS_LEX_STEMP = $(SCOLS_LEX_BASENAME).stamp
+
+
+$(SCOLS_YACC_STEMP): $(SCOLS_YACC_BASENAME).y
+ @rm -f $(SCOLS_YACC_STEMP).tmp
+ @touch -f $(SCOLS_YACC_STEMP).tmp
+ $(AM_V_YACC) $(BISON) $< --output=${basename $@}.c --defines=${basename $@}.h
+ @mv -f $(SCOLS_YACC_STEMP).tmp $@
+
+$(SCOLS_YACC_BASENAME).c $(SCOLS_YACC_BASENAME).h: $(SCOLS_YACC_STEMP)
+ @test -f $@ || rm -f $(SCOLS_YACC_STEMP)
+ @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) $(SCOLS_YACC_STEMP)
+
+
+$(SCOLS_LEX_STEMP): $(SCOLS_LEX_BASENAME).l
+ @rm -f $(SCOLS_LEX_STEMP).tmp
+ @touch -f $(SCOLS_LEX_STEMP).tmp
+ $(AM_V_GEN) $(FLEX) --header-file=${basename $@}.h --outfile=${basename $@}.c $<
+ @mv -f $(SCOLS_LEX_STEMP).tmp $@
+
+$(SCOLS_LEX_BASENAME).c $(SCOLS_LEX_BASENAME).h: $(SCOLS_LEX_STEMP)
+ @test -f $@ || rm -f $(SCOLS_LEX_STEMP)
+ @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) $(SCOLS_LEX_STEMP)
+
+# Each part of the parser depends on the header files
+$(SCOLS_LEX_BASENAME).c: $(SCOLS_YACC_BASENAME).h
+$(SCOLS_YACC_BASENAME).c: $(SCOLS_LEX_BASENAME).h
+
+# Don't re-generate parser when use sources from tarball
+EXTRA_DIST += $(SCOLS_YACC_STEMP) $(SCOLS_LEX_STEMP)
+
libsmartcols_la_LIBADD = $(LDADD) libcommon.la