1 # libgstparse.la is an optionally built helper library linked into core
2 noinst_LTLIBRARIES = libgstparse.la
4 CLEANFILES = grammar.tab.h parse_lex.h grammar.output
10 # uncomment these lines to dist the generated sources
11 #BUILT_SOURCES = grammar.tab.h grammar.tab.c parse_lex.h lex.priv_gst_parse_yy.c
12 #libgstparse_la_SOURCES = lex.priv_gst_parse_yy.c grammar.tab.c
14 # uncomment these lines to _NOT_ dist the generated sources
15 nodist_libgstparse_la_SOURCES = lex.priv_gst_parse_yy.c grammar.tab.c grammar.tag.h parse_lex.h
16 CLEANFILES += grammar.tab.c lex.priv_gst_parse_yy.c
18 libgstparse_la_CFLAGS = $(GST_ALL_CFLAGS) -DBUILDING_GST -DYYMALLOC=g_malloc -DYYFREE=g_free
19 libgstparse_la_LIBADD = $(GST_ALL_LIBS)
21 noinst_HEADERS = types.h
23 grammar.tab.c grammar.tab.h: grammar.y
24 $(AM_V_GEN)$(BISON_PATH) -d -v -ppriv_gst_parse_yy $(srcdir)/grammar.y -o grammar.tab.c && \
25 mv grammar.tab.c grammar.tab_tmp.c && \
26 echo '#ifdef HAVE_CONFIG_H' > grammar.tab_tmp2.c && \
27 echo '#include <config.h>' >> grammar.tab_tmp2.c && \
28 echo '#endif' >> grammar.tab_tmp2.c && \
29 cat grammar.tab_tmp.c >> grammar.tab_tmp2.c && \
30 rm grammar.tab_tmp.c && \
31 mv grammar.tab_tmp2.c grammar.tab.c
33 lex.priv_gst_parse_yy.c parse_lex.h: parse.l grammar.tab.h
34 $(AM_V_GEN)$(FLEX_PATH) --header-file=parse_lex.h -Ppriv_gst_parse_yy $^ && \
35 mv lex.priv_gst_parse_yy.c lex.priv_gst_parse_yy_tmp.c && \
36 echo '#ifdef HAVE_CONFIG_H' > lex.priv_gst_parse_yy_tmp2.c && \
37 echo '#include <config.h>' >> lex.priv_gst_parse_yy_tmp2.c && \
38 echo '#endif' >> lex.priv_gst_parse_yy_tmp2.c && \
39 { grep -q priv_gst_parse_yyget_column parse_lex.h || \
40 { echo 'int priv_gst_parse_yyget_column (void * yyscanner);' >> lex.priv_gst_parse_yy_tmp2.c && \
41 echo 'void priv_gst_parse_yyset_column (int column_no , void * yyscanner);' >> lex.priv_gst_parse_yy_tmp2.c; }; } && \
42 cat lex.priv_gst_parse_yy_tmp.c >> lex.priv_gst_parse_yy_tmp2.c && \
43 rm lex.priv_gst_parse_yy_tmp.c && \
44 mv lex.priv_gst_parse_yy_tmp2.c lex.priv_gst_parse_yy.c