Makefile.am 3.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. SUBDIRS = . tests
  2. AM_CPPFLAGS = -I$(top_builddir)/src/lib -I$(top_srcdir)/src/lib
  3. AM_CPPFLAGS += $(BOOST_INCLUDES)
  4. AM_CXXFLAGS = $(KEA_CXXFLAGS)
  5. # Some versions of GCC warn about some versions of Boost regarding
  6. # missing initializer for members in its posix_time.
  7. # https://svn.boost.org/trac/boost/ticket/3477
  8. # But older GCC compilers don't have the flag.
  9. AM_CXXFLAGS += $(WARNING_NO_MISSING_FIELD_INITIALIZERS_CFLAG)
  10. lib_LTLIBRARIES = libkea-eval.la
  11. libkea_eval_la_SOURCES =
  12. libkea_eval_la_SOURCES += eval_log.cc eval_log.h
  13. libkea_eval_la_SOURCES += evaluate.cc evaluate.h
  14. libkea_eval_la_SOURCES += token.cc token.h
  15. libkea_eval_la_SOURCES += parser.cc parser.h
  16. libkea_eval_la_SOURCES += lexer.cc
  17. libkea_eval_la_SOURCES += location.hh position.hh stack.hh
  18. libkea_eval_la_SOURCES += eval_context.cc eval_context.h eval_context_decl.h
  19. nodist_libkea_eval_la_SOURCES = eval_messages.h eval_messages.cc
  20. libkea_eval_la_CXXFLAGS = $(AM_CXXFLAGS)
  21. libkea_eval_la_CPPFLAGS = $(AM_CPPFLAGS)
  22. libkea_eval_la_LIBADD = $(top_builddir)/src/lib/exceptions/libkea-exceptions.la
  23. libkea_eval_la_LIBADD += $(top_builddir)/src/lib/dhcp/libkea-dhcp++.la
  24. libkea_eval_la_LIBADD += $(top_builddir)/src/lib/log/libkea-log.la
  25. libkea_eval_la_LIBADD += $(top_builddir)/src/lib/util/libkea-util.la
  26. libkea_eval_la_LIBADD += $(LOG4CPLUS_LIBS) $(CRYPTO_LIBS)
  27. libkea_eval_la_LDFLAGS = -no-undefined -version-info 3:0:0
  28. libkea_eval_la_LDFLAGS += $(CRYPTO_LDFLAGS)
  29. EXTRA_DIST = eval.dox
  30. EXTRA_DIST += eval_messages.mes
  31. EXTRA_DIST += lexer.ll parser.yy
  32. # Define rule to build logging source files from message file
  33. eval_messages.h eval_messages.cc: s-messages
  34. s-messages: eval_messages.mes
  35. $(top_builddir)/src/lib/log/compiler/message $(top_srcdir)/src/lib/eval/eval_messages.mes
  36. touch $@
  37. # Tell Automake that the eval_messages.{cc,h} source files are created in the
  38. # build process, so it must create these before doing anything else. Although
  39. # they are a dependency of the library (so will be created from the
  40. # message file anyway), there is no guarantee as to exactly _when_ in the build
  41. # they will be created. As the .h file is included in other sources file (so
  42. # must be present when they are compiled), the safest option is to create it
  43. # first.
  44. BUILT_SOURCES = eval_messages.h eval_messages.cc
  45. CLEANFILES = eval_messages.h eval_messages.cc s-messages
  46. # If we want to get rid of all flex/bison generated files, we need to use
  47. # make maintainer-clean. The proper way to introduce custom commands for
  48. # that operation is to define maintainer-clean-local target. However,
  49. # make maintainer-clean also removes Makefile, so running configure script
  50. # is required. To make it easy to rebuild flex/bison without going through
  51. # reconfigure, a new target parser-clean has been added.
  52. maintainer-clean-local:
  53. rm -f location.hh lexer.cc parser.cc parser.h position.hh stack.hh
  54. # To regenerate flex/bison files, one can do:
  55. #
  56. # make parser-clean
  57. # make parser
  58. #
  59. # This is needed only when the lexer.ll or parser.yy files are modified.
  60. # Make sure you have both flex and bison installed.
  61. parser-clean: maintainer-clean-local
  62. if GENERATE_PARSER
  63. parser: lexer.cc location.hh position.hh stack.hh parser.cc parser.h
  64. @echo "Flex/bison files regenerated"
  65. # --- Flex/Bison stuff below --------------------------------------------------
  66. location.hh position.hh stack.hh parser.cc parser.h: parser.yy
  67. $(YACC) --defines=parser.h -o parser.cc parser.yy
  68. lexer.cc: lexer.ll
  69. $(LEX) -o lexer.cc lexer.ll
  70. else
  71. parser location.hh position.hh stack.hh parser.cc parser.h lexer.cc:
  72. @echo Parser generation disabled. Configure with --enable-generate-parser to enable it.
  73. endif