X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=blobdiff_plain;f=src%2Flib%2Flttng-ctl%2Ffilter%2FMakefile.am;h=13a9e195a5f24b11bc85a2862221c76fd9106d07;hp=eb913e924f05f352a0fc7dca5075e8fa47b1c8c9;hb=1113825053b8f8ff141ffdc375bab04f9e78932b;hpb=a3eae3c98f047a8e795a01471adf8f4f7563947b diff --git a/src/lib/lttng-ctl/filter/Makefile.am b/src/lib/lttng-ctl/filter/Makefile.am index eb913e924..13a9e195a 100644 --- a/src/lib/lttng-ctl/filter/Makefile.am +++ b/src/lib/lttng-ctl/filter/Makefile.am @@ -7,9 +7,9 @@ noinst_HEADERS = filter-ast.h \ filter-symbols.h BUILT_SOURCES = filter-parser.h -AM_YFLAGS = -t -d -v -libfilter_la_SOURCES = filter-lexer.l filter-parser.y \ +libfilter_la_SOURCES = \ + filter-parser.y filter-lexer.l \ filter-visitor-set-parent.c \ filter-visitor-xml.c \ filter-visitor-generate-ir.c \ @@ -22,7 +22,42 @@ libfilter_la_SOURCES = filter-lexer.l filter-parser.y \ memstream.h libfilter_la_CFLAGS = -include filter-symbols.h +AM_YFLAGS = -t -d -v + +# start with empty files to clean +CLEANFILES = + +if HAVE_BISON +# we have bison: we can clean the generated parser files +CLEANFILES += filter-parser.c filter-parser.h filter-parser.output +else # HAVE_BISON +# create target used to stop the build if we want to build the parser, +# but we don't have the necessary tool to do so +ERR_MSG = "Error: Cannot build target because bison is missing." +ERR_MSG += "Make sure bison is installed and run the configure script again." + +filter-parser.c filter-parser.h: filter-parser.y + @echo $(ERR_MSG) + @false + +all-local: filter-parser.c filter-parser.h +endif # HAVE_BISON + +if HAVE_FLEX +# we have flex: we can clean the generated lexer files +CLEANFILES += filter-lexer.c +else # HAVE_FLEX +# create target used to stop the build if we want to build the lexer, +# but we don't have the necessary tool to do so +ERR_MSG = "Error: Cannot build target because flex is missing." +ERR_MSG += "Make sure flex is installed and run the configure script again." + +filter-lexer.c: filter-lexer.l + @echo $(ERR_MSG) + @false + +all-local: filter-lexer.c +endif # HAVE_FLEX + filter_grammar_test_SOURCES = filter-grammar-test.c filter_grammar_test_LDADD = libfilter.la - -CLEANFILES = filter-lexer.c filter-parser.c filter-parser.h filter-parser.output