1 # SPDX-License-Identifier: MIT
3 AM_CPPFLAGS += -I$(builddir) -I$(srcdir)
4 AM_YFLAGS = -t -d -v -Wno-yacc
6 noinst_LTLIBRARIES = libctf-parser.la libctf-ast.la
8 BUILT_SOURCES = parser.hpp
10 libctf_parser_la_SOURCES = lexer.lpp parser.ypp objstack.cpp
11 # scanner-symbols.h is included to prefix generated yy_* symbols
13 libctf_parser_la_CPPFLAGS = $(AM_CPPFLAGS) \
14 -include $(srcdir)/scanner-symbols.hpp
16 # This library contains (mostly) generated code, silence some warnings that it
18 libctf_parser_la_CXXFLAGS = $(AM_CXXFLAGS) \
19 -Wno-unused-function \
20 -Wno-null-dereference \
21 -Wno-missing-field-initializers
23 libctf_ast_la_SOURCES = \
24 visitor-generate-ir.cpp \
25 visitor-semantic-validator.cpp \
26 visitor-parent-links.cpp \
35 decoder-packetized-file-stream-to-buf.cpp \
36 decoder-packetized-file-stream-to-buf.hpp \
40 ctf-meta-visitors.hpp \
41 ctf-meta-validate.cpp \
42 ctf-meta-update-meanings.cpp \
43 ctf-meta-update-in-ir.cpp \
44 ctf-meta-update-default-clock-classes.cpp \
45 ctf-meta-update-text-array-sequence.cpp \
46 ctf-meta-update-alignments.cpp \
47 ctf-meta-update-value-storing-indexes.cpp \
48 ctf-meta-update-stream-class-config.cpp \
49 ctf-meta-warn-meaningless-header-fields.cpp \
50 ctf-meta-translate.cpp \
51 ctf-meta-resolve.cpp \
52 ctf-meta-configure-ir-trace.cpp \
53 ctf-meta-configure-ir-trace.hpp
55 if BABELTRACE_BUILD_WITH_MINGW
56 libctf_ast_la_LIBADD = -lintl -liconv -lole32
59 # start with empty files to clean
63 # we have bison: we can clean the generated parser files
64 CLEANFILES += parser.cpp parser.hpp parser.output
66 # create target used to stop the build if we want to build the parser,
67 # but we don't have the necessary tool to do so
68 ERR_MSG = "Error: Cannot build target because bison is missing."
69 ERR_MSG += "Make sure bison is installed and run the configure script again."
71 parser.cpp parser.hpp: parser.ypp
75 all-local: parser.cpp parser.hpp
79 # we have flex: we can clean the generated lexer files
80 CLEANFILES += lexer.cpp
82 # create target used to stop the build if we want to build the lexer,
83 # but we don't have the necessary tool to do so
84 ERR_MSG = "Error: Cannot build target because flex is missing."
85 ERR_MSG += "Make sure flex is installed and run the configure script again."
87 filter-lexer.cpp: lexer.lpp