gst/parse/Makefile.am: Fix the build by correcting the rule that gave wrong files...
[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 if GENERATE_PARSER
30         $(BISON_PATH) -d -v -p_gst_parse_yy $(srcdir)/grammar.y -o grammar.tab.c && \
31         mv grammar.tab.c grammar.tab_tmp.c && \
32         echo '#ifdef HAVE_CONFIG_H' > grammar.tab_tmp2.c && \
33         echo '#include <config.h>' >> grammar.tab_tmp2.c && \
34         echo '#endif' >> grammar.tab_tmp2.c && \
35         cat grammar.tab_tmp.c >> grammar.tab_tmp2.c && \
36         rm grammar.tab_tmp.c && \
37         mv grammar.tab_tmp2.c grammar.tab.c
38         cp grammar.tab.c grammar.tab.pre.c
39         cp grammar.tab.h grammar.tab.pre.h
40 else
41         echo "Timestamp issue on pregenerated bison output."
42         echo "Using probably outdated pregenerated sources..."
43         touch grammar.tab.pre.c grammar.tab.pre.h
44 endif
45
46 lex._gst_parse_yy.pre.c: parse.l grammar.tab.pre.h
47 if GENERATE_PARSER
48         $(FLEX_PATH) -P_gst_parse_yy $^ && \
49         mv lex._gst_parse_yy.c lex._gst_parse_yy_tmp.c && \
50         echo '#ifdef HAVE_CONFIG_H' > lex._gst_parse_yy_tmp2.c && \
51         echo '#include <config.h>' >> lex._gst_parse_yy_tmp2.c && \
52         echo '#endif' >> lex._gst_parse_yy_tmp2.c && \
53         cat lex._gst_parse_yy_tmp.c >> lex._gst_parse_yy_tmp2.c && \
54         rm lex._gst_parse_yy_tmp.c && \
55         mv lex._gst_parse_yy_tmp2.c lex._gst_parse_yy.c && \
56         cp lex._gst_parse_yy.c lex._gst_parse_yy.pre.c
57 else
58         echo "Timestamp issue on pregenerated flex output."
59         echo "Using probably outdated pregenerated sources..."
60         touch lex._gst_parse_yy.pre.c
61 endif
62
63 if GENERATE_PARSER
64 grammar.tab.c grammar.tab.h: grammar.y
65         $(BISON_PATH) -d -v -p_gst_parse_yy $(srcdir)/grammar.y -o grammar.tab.c && \
66         mv grammar.tab.c grammar.tab_tmp.c && \
67         echo '#ifdef HAVE_CONFIG_H' > grammar.tab_tmp2.c && \
68         echo '#include <config.h>' >> grammar.tab_tmp2.c && \
69         echo '#endif' >> grammar.tab_tmp2.c && \
70         cat grammar.tab_tmp.c >> grammar.tab_tmp2.c && \
71         rm grammar.tab_tmp.c && \
72         mv grammar.tab_tmp2.c grammar.tab.c
73 else
74 grammar.tab.c grammar.tab.h: grammar.tab.pre.c grammar.tab.pre.h
75         cp $(srcdir)/grammar.tab.pre.h grammar.tab.h
76         cp $(srcdir)/grammar.tab.pre.c grammar.tab.c
77 endif
78
79 if GENERATE_PARSER
80 lex._gst_parse_yy.c: parse.l grammar.tab.h
81         $(FLEX_PATH) -P_gst_parse_yy $^ && \
82         mv lex._gst_parse_yy.c lex._gst_parse_yy_tmp.c && \
83         echo '#ifdef HAVE_CONFIG_H' > lex._gst_parse_yy_tmp2.c && \
84         echo '#include <config.h>' >> lex._gst_parse_yy_tmp2.c && \
85         echo '#endif' >> lex._gst_parse_yy_tmp2.c && \
86         cat lex._gst_parse_yy_tmp.c >> lex._gst_parse_yy_tmp2.c && \
87         rm lex._gst_parse_yy_tmp.c && \
88         mv lex._gst_parse_yy_tmp2.c lex._gst_parse_yy.c
89 else
90 lex._gst_parse_yy.c: lex._gst_parse_yy.pre.c grammar.tab.h
91         cp $(srcdir)/lex._gst_parse_yy.pre.c lex._gst_parse_yy.c
92 endif
93
94
95 .NOTPARALLEL:
96