gst/parse/Makefile.am: Move types.h from EXTRA_DIST to noinst_HEADERS.
[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         grammar.tab.pre.c \
9         grammar.tab.pre.h \
10         lex._gst_parse_yy.pre.c
11
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
15
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
19
20 libgstparse_la_CFLAGS = $(GST_ALL_CFLAGS)
21 libgstparse_la_LIBADD = $(GST_ALL_LIBS)
22
23 noinst_HEADERS = grammar.tab.h types.h
24
25 all: grammar.tab.pre.c grammar.tab.pre.h lex._gst_parse_yy.pre.c
26
27 grammar.tab.pre.c grammar.tab.pre.h: grammar.y
28 if GENERATE_PARSER
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
39 else
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
43 endif
44
45 lex._gst_parse_yy.pre.c: parse.l grammar.tab.pre.h
46 if GENERATE_PARSER
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
56 else
57         echo "Timestamp issue on pregenerated flex output."
58         echo "Using probably outdated pregenerated sources..."
59         touch lex._gst_parse_yy.pre.c
60 endif
61
62 if GENERATE_PARSER
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
72 else
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
76 endif
77
78 if GENERATE_PARSER
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
88 else
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
91 endif
92
93
94 .NOTPARALLEL:
95