Makefile.am 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. # Guile-GCC
  2. # Copyright (C) 2012 Ludovic Courtès <ludo@gnu.org>
  3. #
  4. # Guile-GCC is free software: you can redistribute it and/or modify
  5. # it under the terms of the GNU General Public License as published by
  6. # the Free Software Foundation, either version 3 of the License, or
  7. # (at your option) any later version.
  8. #
  9. # Guile-GCC is distributed in the hope that it will be useful,
  10. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. # GNU General Public License for more details.
  13. #
  14. # You should have received a copy of the GNU General Public License
  15. # along with Guile-GCC. If not, see <http://www.gnu.org/licenses/>.
  16. # `LIBRARIES' would be more appropriate than `LTLIBRARIES' but it
  17. # requires a name prefixed by `lib'.
  18. gccplugin_LTLIBRARIES = guile.la
  19. BUILT_SOURCES = src/guile.x src/cgraph.x src/gimple.x
  20. CLEANFILES = \
  21. $(BUILT_SOURCES) call-graph.dot \
  22. examples/*.c.[0-9]*.gimple
  23. dist_noinst_HEADERS = src/ggcc-utils.h
  24. guile_la_SOURCES = src/guile.c src/cgraph.c src/gimple.c
  25. guile_la_LDFLAGS = -module
  26. guile_la_LIBADD = $(GUILE_LIBS)
  27. guile_la_CFLAGS = \
  28. -I$(builddir)/src -I$(srcdir)/src \
  29. -I$(GCC_PLUGIN_INCLUDE_DIR) $(GUILE_CFLAGS) -Wall
  30. .c.x:
  31. $(GUILE_SNARF) -o "$@" "$<" $(guile_la_CFLAGS)
  32. # `nobase_' cannot be used because of the leading `src/', so handle
  33. # that manually.
  34. gccguilemoduledir = $(guilemoduledir)/gcc
  35. dist_guilemodule_DATA = src/gcc.scm
  36. dist_gccguilemodule_DATA = \
  37. src/gcc/cpp.scm \
  38. src/gcc/cgraph.scm \
  39. src/gcc/gimple.scm
  40. #
  41. # Programs.
  42. #
  43. ggcc_cflags = \
  44. -fplugin="$(top_builddir)/.libs/guile.so" \
  45. -fplugin-arg-guile-module-directory="$(top_srcdir)/src"
  46. nobase_noinst_PROGRAMS = \
  47. examples/birthday \
  48. examples/meta \
  49. examples/call-graph
  50. dist_noinst_DATA = \
  51. examples/birthday.scm \
  52. examples/meta.scm \
  53. examples/call-graph.scm
  54. TESTS_ENVIRONMENT = \
  55. GUILE_LOAD_PATH="$(abs_top_srcdir)/tests:$GUILE_LOAD_PATH" \
  56. ./tests/run-test
  57. TESTS = \
  58. tests/pragma.c \
  59. tests/cgraph.c
  60. TEST_PLUGINS = \
  61. tests/pragma.scm \
  62. tests/cgraph.scm
  63. CLEANFILES += \
  64. *.gimple \
  65. tests/pragma \
  66. tests/cgraph.o
  67. EXTRA_DIST = $(TESTS) $(TEST_PLUGINS)
  68. # Files the example programs depend on.
  69. example_deps = guile.la $(nobase_dist_guilemodule_DATA)
  70. $(examples_birthday_OBJECTS): examples/birthday.scm $(example_deps)
  71. examples_birthday_CFLAGS = \
  72. $(ggcc_cflags) \
  73. -fplugin-arg-guile-load=$(srcdir)/examples/birthday.scm
  74. $(examples_meta_OBJECTS): examples/meta.scm $(example_deps)
  75. examples_meta_CFLAGS = \
  76. $(ggcc_cflags) \
  77. -fdump-tree-gimple \
  78. -fplugin-arg-guile-load=$(srcdir)/examples/meta.scm
  79. $(examples_call_graph_OBJECTS): examples/call-graph.scm $(example_deps)
  80. examples_call_graph_CFLAGS = \
  81. $(ggcc_cflags) \
  82. -fdump-tree-gimple \
  83. -fplugin-arg-guile-load=$(srcdir)/examples/call-graph.scm \
  84. -fplugin-arg-guile-dot-file="$(builddir)/call-graph.dot"
  85. ACLOCAL_AMFLAGS = -I m4
  86. .PHONY: gen-ChangeLog
  87. gen-ChangeLog:
  88. if test -d .git; then \
  89. $(top_srcdir)/build-aux/gitlog-to-changelog \
  90. > $(distdir)/cl-t; \
  91. rm -f $(distdir)/ChangeLog; \
  92. mv $(distdir)/cl-t $(distdir)/ChangeLog; \
  93. fi
  94. dist-hook: gen-ChangeLog