Commit | Line | Data |
---|---|---|
0235b0db MJ |
1 | # SPDX-License-Identifier: MIT |
2 | ||
05c03100 | 3 | AM_CPPFLAGS += -I$(builddir) -I$(srcdir) |
042f640b | 4 | AM_YFLAGS = -t -d -v -Wno-yacc |
e98a2d6e PP |
5 | |
6 | noinst_LTLIBRARIES = libctf-parser.la libctf-ast.la | |
7 | ||
540d833d MJ |
8 | BUILT_SOURCES = parser.h |
9 | ||
06a626b8 | 10 | libctf_parser_la_SOURCES = lexer.l parser.y objstack.c |
540d833d | 11 | # scanner-symbols.h is included to prefix generated yy_* symbols |
e98a2d6e | 12 | # with bt_. |
05c03100 | 13 | libctf_parser_la_CPPFLAGS = $(AM_CPPFLAGS) \ |
06a626b8 | 14 | -include $(srcdir)/scanner-symbols.h |
d5ed90f6 SM |
15 | |
16 | # This library contains (mostly) generated code, silence some warnings that it | |
17 | # produces. | |
18 | libctf_parser_la_CFLAGS = $(AM_CFLAGS) \ | |
19 | -Wno-unused-function \ | |
20 | -Wno-null-dereference | |
e98a2d6e | 21 | |
e98a2d6e | 22 | libctf_ast_la_SOURCES = \ |
06a626b8 JG |
23 | visitor-generate-ir.c \ |
24 | visitor-semantic-validator.c \ | |
4353f877 PP |
25 | visitor-parent-links.c \ |
26 | ast.h \ | |
27 | objstack.h \ | |
28 | parser.h \ | |
9103e903 | 29 | parser-wrap.h \ |
4353f877 | 30 | scanner.h \ |
1e649dff PP |
31 | scanner-symbols.h \ |
32 | decoder.c \ | |
55314f2a | 33 | decoder.h \ |
152b521b SM |
34 | decoder-packetized-file-stream-to-buf.c \ |
35 | decoder-packetized-file-stream-to-buf.h \ | |
55314f2a | 36 | logging.c \ |
44c440bc PP |
37 | logging.h \ |
38 | ctf-meta.h \ | |
39 | ctf-meta-visitors.h \ | |
40 | ctf-meta-validate.c \ | |
41 | ctf-meta-update-meanings.c \ | |
42 | ctf-meta-update-in-ir.c \ | |
43 | ctf-meta-update-default-clock-classes.c \ | |
44 | ctf-meta-update-text-array-sequence.c \ | |
45 | ctf-meta-update-value-storing-indexes.c \ | |
afd45274 | 46 | ctf-meta-update-stream-class-config.c \ |
83ebb7f1 | 47 | ctf-meta-warn-meaningless-header-fields.c \ |
44c440bc | 48 | ctf-meta-translate.c \ |
335a2da5 PP |
49 | ctf-meta-resolve.c \ |
50 | ctf-meta-configure-ir-trace.c \ | |
51 | ctf-meta-configure-ir-trace.h | |
4353f877 | 52 | |
e98a2d6e | 53 | if BABELTRACE_BUILD_WITH_MINGW |
916d0d91 | 54 | libctf_ast_la_LIBADD = -lintl -liconv -lole32 |
e98a2d6e PP |
55 | endif |
56 | ||
540d833d MJ |
57 | # start with empty files to clean |
58 | CLEANFILES = | |
59 | ||
60 | if HAVE_BISON | |
61 | # we have bison: we can clean the generated parser files | |
62 | CLEANFILES += parser.c parser.h parser.output | |
63 | else # HAVE_BISON | |
64 | # create target used to stop the build if we want to build the parser, | |
65 | # but we don't have the necessary tool to do so | |
66 | ERR_MSG = "Error: Cannot build target because bison is missing." | |
67 | ERR_MSG += "Make sure bison is installed and run the configure script again." | |
68 | ||
69 | parser.c parser.h: parser.y | |
70 | @echo $(ERR_MSG) | |
71 | @false | |
72 | ||
73 | all-local: parser.c parser.h | |
74 | endif # HAVE_BISON | |
75 | ||
76 | if HAVE_FLEX | |
77 | # we have flex: we can clean the generated lexer files | |
78 | CLEANFILES += lexer.c | |
79 | else # HAVE_FLEX | |
80 | # create target used to stop the build if we want to build the lexer, | |
81 | # but we don't have the necessary tool to do so | |
82 | ERR_MSG = "Error: Cannot build target because flex is missing." | |
83 | ERR_MSG += "Make sure flex is installed and run the configure script again." | |
84 | ||
85 | filter-lexer.c: lexer.l | |
2cb42eae MD |
86 | @echo $(ERR_MSG) |
87 | @false | |
540d833d MJ |
88 | |
89 | all-local: lexer.c | |
90 | endif # HAVE_FLEX |