6f18cffc166d0c828bdea62a2edf43698ffdd598
[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
9 # uncomment these lines to dist the generated sources
10 #BUILT_SOURCES = grammar.tab.h grammar.tab.c lex._gst_parse_yy.c
11 #libgstparse_la_SOURCES = lex._gst_parse_yy.c grammar.tab.c
12
13 # uncomment these lines to _NOT_ dist the generated sources
14 nodist_libgstparse_la_SOURCES = lex._gst_parse_yy.c grammar.tab.c
15 CLEANFILES += grammar.tab.c lex._gst_parse_yy.c
16
17 libgstparse_la_CFLAGS = $(GST_ALL_CFLAGS)
18 libgstparse_la_LIBADD = $(GST_ALL_LIBS)
19
20 noinst_HEADERS = grammar.tab.h types.h
21
22 grammar.tab.c grammar.tab.h: grammar.y
23         $(BISON_PATH) -d -v -p_gst_parse_yy $(srcdir)/grammar.y -o grammar.tab.c && \
24         mv grammar.tab.c grammar.tab_tmp.c && \
25         echo '#ifdef HAVE_CONFIG_H' > grammar.tab_tmp2.c && \
26         echo '#include <config.h>' >> grammar.tab_tmp2.c && \
27         echo '#endif' >> grammar.tab_tmp2.c && \
28         cat grammar.tab_tmp.c >> grammar.tab_tmp2.c && \
29         rm grammar.tab_tmp.c && \
30         mv grammar.tab_tmp2.c grammar.tab.c
31
32 lex._gst_parse_yy.c: parse.l grammar.tab.h
33         $(FLEX_PATH) -P_gst_parse_yy $^ && \
34         mv lex._gst_parse_yy.c lex._gst_parse_yy_tmp.c && \
35         echo '#ifdef HAVE_CONFIG_H' > lex._gst_parse_yy_tmp2.c && \
36         echo '#include <config.h>' >> lex._gst_parse_yy_tmp2.c && \
37         echo '#endif' >> lex._gst_parse_yy_tmp2.c && \
38         cat lex._gst_parse_yy_tmp.c >> lex._gst_parse_yy_tmp2.c && \
39         rm lex._gst_parse_yy_tmp.c && \
40         mv lex._gst_parse_yy_tmp2.c lex._gst_parse_yy.c
41
42 .NOTPARALLEL:
43