gst/parse/: Make the parser reentrant and recursively callable. This requires flex...
[platform/upstream/gstreamer.git] / gst / parse / Makefile.am
1 # libgstparse.la is an optionally built helper library linked into core
2 noinst_LTLIBRARIES = libgstparse.la
3
4 CLEANFILES = grammar.tab.h grammar.output
5 EXTRA_DIST = \
6         grammar.y \
7         parse.l \
8         types.h \
9         grammar.tab.pre.c \
10         grammar.tab.pre.h \
11         lex._gst_parse_yy.pre.c
12
13 # uncomment these lines to dist the generated sources
14 #BUILT_SOURCES = grammar.tab.h grammar.tab.c lex._gst_parse_yy.c 
15 #libgstparse_la_SOURCES = lex._gst_parse_yy.c grammar.tab.c
16
17 # uncomment these lines to _NOT_ dist the generated sources
18 nodist_libgstparse_la_SOURCES = lex._gst_parse_yy.c grammar.tab.c
19 CLEANFILES += grammar.tab.c lex._gst_parse_yy.c 
20
21 libgstparse_la_CFLAGS = $(GST_ALL_CFLAGS)
22 libgstparse_la_LIBADD = $(GST_ALL_LIBS)
23
24 noinst_HEADERS = grammar.tab.h
25
26 all: grammar.tab.pre.c grammar.tab.pre.h lex._gst_parse_yy.pre.c
27
28 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         cp grammar.tab.c grammar.tab.pre.c
38         cp grammar.tab.h grammar.tab.pre.h
39
40 lex._gst_parse_yy.pre.c: parse.l grammar.tab.pre.h
41         $(FLEX_PATH) -P_gst_parse_yy $^ && \
42         mv lex._gst_parse_yy.c lex._gst_parse_yy_tmp.c && \
43         echo '#ifdef HAVE_CONFIG_H' > lex._gst_parse_yy_tmp2.c && \
44         echo '#include <config.h>' >> lex._gst_parse_yy_tmp2.c && \
45         echo '#endif' >> lex._gst_parse_yy_tmp2.c && \
46         cat lex._gst_parse_yy_tmp.c >> lex._gst_parse_yy_tmp2.c && \
47         rm lex._gst_parse_yy_tmp.c && \
48         mv lex._gst_parse_yy_tmp2.c lex._gst_parse_yy.c
49         cp lex._gst_parse_yy.c lex._gst_parse_yy.pre.c
50
51 if GENERATE_PARSER
52 grammar.tab.c grammar.tab.h: grammar.y 
53         $(BISON_PATH) -d -v -p_gst_parse_yy $(srcdir)/grammar.y -o grammar.tab.c && \
54         mv grammar.tab.c grammar.tab_tmp.c && \
55         echo '#ifdef HAVE_CONFIG_H' > grammar.tab_tmp2.c && \
56         echo '#include <config.h>' >> grammar.tab_tmp2.c && \
57         echo '#endif' >> grammar.tab_tmp2.c && \
58         cat grammar.tab_tmp.c >> grammar.tab_tmp2.c && \
59         rm grammar.tab_tmp.c && \
60         mv grammar.tab_tmp2.c grammar.tab.c
61 else
62 grammar.tab.c grammar.tab.h: grammar.tab.pre.c grammar.tab.pre.h
63         cp $(srcdir)/grammar.tab.pre.h grammar.tab.h
64         cp $(srcdir)/grammar.tab.pre.c grammar.tab.c
65 endif
66  
67 if GENERATE_PARSER
68 lex._gst_parse_yy.c: parse.l grammar.tab.h
69         $(FLEX_PATH) -P_gst_parse_yy $^ && \
70         mv lex._gst_parse_yy.c lex._gst_parse_yy_tmp.c && \
71         echo '#ifdef HAVE_CONFIG_H' > lex._gst_parse_yy_tmp2.c && \
72         echo '#include <config.h>' >> lex._gst_parse_yy_tmp2.c && \
73         echo '#endif' >> lex._gst_parse_yy_tmp2.c && \
74         cat lex._gst_parse_yy_tmp.c >> lex._gst_parse_yy_tmp2.c && \
75         rm lex._gst_parse_yy_tmp.c && \
76         mv lex._gst_parse_yy_tmp2.c lex._gst_parse_yy.c
77 else
78 lex._gst_parse_yy.c: lex._gst_parse_yy.pre.c
79         cp $(srcdir)/lex._gst_parse_yy.pre.c lex._gst_parse_yy.c
80 endif
81
82
83 .NOTPARALLEL:
84