Makefile.am 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. # Makefile.am --- GNU Automake file to build guile modules
  2. # Copyright © 2016–2017 Alex Kost <alezost@gmail.com>
  3. # This file is part of Guile-Daemon.
  4. # Guile-Daemon 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-Daemon 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-Daemon. If not, see <http://www.gnu.org/licenses/>.
  16. AM_V_GUILEC = $(AM_V_GUILEC_$(V))
  17. AM_V_GUILEC_ = $(AM_V_GUILEC_$(AM_DEFAULT_VERBOSITY))
  18. AM_V_GUILEC_0 = @echo " GUILEC " $@;
  19. MODULES = \
  20. daemon/defaults.scm \
  21. daemon/utils.scm \
  22. daemon/ui.scm \
  23. daemon.scm
  24. CONFIG_SCM = daemon/config.scm
  25. CONFIG_GO = $(CONFIG_SCM:%.scm=%.go)
  26. GO_FILES = $(CONFIG_GO) $(MODULES:%.scm=%.go)
  27. nobase_dist_guilemodule_DATA = $(MODULES)
  28. nobase_nodist_guilemodule_DATA = $(CONFIG_SCM)
  29. nobase_nodist_guileccache_DATA = $(GO_FILES)
  30. # Make sure source files are installed first, so that the mtime of
  31. # installed compiled files is greater than that of installed source
  32. # files. See
  33. # <http://lists.gnu.org/archive/html/guile-devel/2010-07/msg00125.html>.
  34. guile_daemon_install_go_files = install-nobase_nodist_guileccacheDATA
  35. $(guile_daemon_install_go_files): install-nobase_dist_guilemoduleDATA
  36. $(guile_daemon_install_go_files): install-nobase_nodist_guilemoduleDATA
  37. # Add both srcdir and builddir to GUILE_LOAD_PATH because the generated
  38. # "config.scm" file is placed in the builddir.
  39. GUILEC_ENV = \
  40. GUILE_AUTO_COMPILE=0 \
  41. GUILE_LOAD_PATH="$(abs_srcdir):$(abs_builddir)" \
  42. GUILE_LOAD_COMPILED_PATH="$(abs_builddir)"
  43. GUILEC_OPTS = \
  44. -Warity-mismatch \
  45. -Wformat \
  46. -Wunbound-variable \
  47. -Wunused-variable
  48. $(GO_FILES): %.go: %.scm
  49. -$(AM_V_GUILEC) $(GUILEC_ENV) \
  50. $(GUILD) compile $(GUILEC_OPTS) --output=$@ $<
  51. CLEANFILES = $(GO_FILES)
  52. clean-go:
  53. -$(RM) -f $(GO_FILES)
  54. .PHONY: clean-go
  55. # Makefile.am ends here