1 # libgstparse.la is an optionally built helper library linked into core
2 noinst_LTLIBRARIES = libgstparse.la
4 CLEANFILES = grammar.tab.h grammar.output
10 lex._gst_parse_yy.pre.c
12 # uncomment these lines to dist the generated sources
13 #BUILT_SOURCES = grammar.tab.h grammar.tab.c lex._gst_parse_yy.c
14 #libgstparse_la_SOURCES = lex._gst_parse_yy.c grammar.tab.c
16 # uncomment these lines to _NOT_ dist the generated sources
17 nodist_libgstparse_la_SOURCES = lex._gst_parse_yy.c grammar.tab.c
18 CLEANFILES += grammar.tab.c lex._gst_parse_yy.c
20 libgstparse_la_CFLAGS = $(GST_ALL_CFLAGS)
21 libgstparse_la_LIBADD = $(GST_ALL_LIBS)
23 noinst_HEADERS = grammar.tab.h types.h
25 all: grammar.tab.pre.c grammar.tab.pre.h lex._gst_parse_yy.pre.c
27 grammar.tab.pre.c grammar.tab.pre.h: grammar.y
29 $(BISON_PATH) -d -v -p_gst_parse_yy $(srcdir)/grammar.y -o grammar.tab.c && \
30 mv grammar.tab.c grammar.tab_tmp.c && \
31 echo '#ifdef HAVE_CONFIG_H' > grammar.tab_tmp2.c && \
32 echo '#include <config.h>' >> grammar.tab_tmp2.c && \
33 echo '#endif' >> grammar.tab_tmp2.c && \
34 cat grammar.tab_tmp.c >> grammar.tab_tmp2.c && \
35 rm grammar.tab_tmp.c && \
36 mv grammar.tab_tmp2.c grammar.tab.c
37 mv grammar.tab.c grammar.tab.pre.c
38 mv grammar.tab.h grammar.tab.pre.h
40 echo "Timestamp issue on pregenerated bison output."
41 echo "Using probably outdated pregenerated sources..."
42 touch grammar.tab.pre.c grammar.tab.pre.h
45 lex._gst_parse_yy.pre.c: parse.l grammar.tab.pre.h
47 $(FLEX_PATH) -P_gst_parse_yy $^ && \
48 mv lex._gst_parse_yy.c lex._gst_parse_yy_tmp.c && \
49 echo '#ifdef HAVE_CONFIG_H' > lex._gst_parse_yy_tmp2.c && \
50 echo '#include <config.h>' >> lex._gst_parse_yy_tmp2.c && \
51 echo '#endif' >> lex._gst_parse_yy_tmp2.c && \
52 cat lex._gst_parse_yy_tmp.c >> lex._gst_parse_yy_tmp2.c && \
53 rm lex._gst_parse_yy_tmp.c && \
54 mv lex._gst_parse_yy_tmp2.c lex._gst_parse_yy.c && \
55 mv lex._gst_parse_yy.c lex._gst_parse_yy.pre.c
57 echo "Timestamp issue on pregenerated flex output."
58 echo "Using probably outdated pregenerated sources..."
59 touch lex._gst_parse_yy.pre.c
63 grammar.tab.c grammar.tab.h: grammar.y
64 $(BISON_PATH) -d -v -p_gst_parse_yy $(srcdir)/grammar.y -o grammar.tab.c && \
65 mv grammar.tab.c grammar.tab_tmp.c && \
66 echo '#ifdef HAVE_CONFIG_H' > grammar.tab_tmp2.c && \
67 echo '#include <config.h>' >> grammar.tab_tmp2.c && \
68 echo '#endif' >> grammar.tab_tmp2.c && \
69 cat grammar.tab_tmp.c >> grammar.tab_tmp2.c && \
70 rm grammar.tab_tmp.c && \
71 mv grammar.tab_tmp2.c grammar.tab.c
73 grammar.tab.c grammar.tab.h: grammar.tab.pre.c grammar.tab.pre.h
74 cp $(srcdir)/grammar.tab.pre.h grammar.tab.h
75 cp $(srcdir)/grammar.tab.pre.c grammar.tab.c
79 lex._gst_parse_yy.c: parse.l grammar.tab.h
80 $(FLEX_PATH) -P_gst_parse_yy $^ && \
81 mv lex._gst_parse_yy.c lex._gst_parse_yy_tmp.c && \
82 echo '#ifdef HAVE_CONFIG_H' > lex._gst_parse_yy_tmp2.c && \
83 echo '#include <config.h>' >> lex._gst_parse_yy_tmp2.c && \
84 echo '#endif' >> lex._gst_parse_yy_tmp2.c && \
85 cat lex._gst_parse_yy_tmp.c >> lex._gst_parse_yy_tmp2.c && \
86 rm lex._gst_parse_yy_tmp.c && \
87 mv lex._gst_parse_yy_tmp2.c lex._gst_parse_yy.c
89 lex._gst_parse_yy.c: lex._gst_parse_yy.pre.c grammar.tab.h grammar.tab.c
90 cp $(srcdir)/lex._gst_parse_yy.pre.c lex._gst_parse_yy.c