X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=plugins%2Fctf%2Fcommon%2Fmetadata%2FMakefile.am;h=b6cf623824509cd88aabbded247f1baefc7e3e1f;hb=540d833dfbe259815a0aec6a231dbe54a74aec4e;hp=925b31a9493153d3f63dbf341cb8c0fbebbab19c;hpb=60725cf905bddb7a33fc3fc07efedb35766076c0;p=babeltrace.git diff --git a/plugins/ctf/common/metadata/Makefile.am b/plugins/ctf/common/metadata/Makefile.am index 925b31a9..b6cf6238 100644 --- a/plugins/ctf/common/metadata/Makefile.am +++ b/plugins/ctf/common/metadata/Makefile.am @@ -1,11 +1,12 @@ AM_CPPFLAGS += -I$(builddir) -I$(srcdir) -BUILT_SOURCES = parser.h parser.c lexer.c AM_YFLAGS = -t -d -v noinst_LTLIBRARIES = libctf-parser.la libctf-ast.la +BUILT_SOURCES = parser.h + libctf_parser_la_SOURCES = lexer.l parser.y objstack.c -# ctf-scanner-symbols.h is included to prefix generated yy_* symbols +# scanner-symbols.h is included to prefix generated yy_* symbols # with bt_. libctf_parser_la_CPPFLAGS = $(AM_CPPFLAGS) \ -include $(srcdir)/scanner-symbols.h @@ -31,4 +32,37 @@ if BABELTRACE_BUILD_WITH_MINGW libctf_ast_la_LIBADD += -lrpcrt4 -lintl -liconv -lole32 $(POPT_LIBS) endif -CLEANFILES = $(BUILT_SOURCES) parser.output +# start with empty files to clean +CLEANFILES = + +if HAVE_BISON +# we have bison: we can clean the generated parser files +CLEANFILES += parser.c parser.h 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." + +parser.c parser.h: parser.y + @echo $(ERR_MSG) + @false + +all-local: parser.c parser.h +endif # HAVE_BISON + +if HAVE_FLEX +# we have flex: we can clean the generated lexer files +CLEANFILES += 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: lexer.l + @echo $(ERR_MSG) + @false + +all-local: lexer.c +endif # HAVE_FLEX