Makefile.am 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  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 Emacs-Guix.
  4. # Emacs-Guix 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. # Emacs-Guix 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 Emacs-Guix. 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. emacs-guix/utils.scm \
  21. emacs-guix/pack.scm \
  22. emacs-guix/refresh.scm \
  23. emacs-guix/commands.scm \
  24. emacs-guix/licenses.scm \
  25. emacs-guix/packages.scm \
  26. emacs-guix/locations.scm \
  27. emacs-guix/generations.scm \
  28. emacs-guix/system-generations.scm \
  29. emacs-guix/graph.scm \
  30. emacs-guix/lint.scm \
  31. emacs-guix/services.scm \
  32. emacs-guix/actions.scm \
  33. emacs-guix.scm
  34. GO_FILES = $(MODULES:%.scm=%.go)
  35. nobase_dist_guilemodule_DATA = $(MODULES)
  36. nobase_nodist_guileccache_DATA = $(GO_FILES)
  37. # Make sure source files are installed first, so that the mtime of
  38. # installed compiled files is greater than that of installed source
  39. # files. See
  40. # <http://lists.gnu.org/archive/html/guile-devel/2010-07/msg00125.html>.
  41. guile_install_go_files = install-nobase_nodist_guileccacheDATA
  42. $(guile_install_go_files): install-nobase_dist_guilemoduleDATA
  43. GUILEC_ENV = \
  44. GUILE_AUTO_COMPILE=0
  45. GUILEC_OPTS = \
  46. -Warity-mismatch \
  47. -Wformat \
  48. -Wunbound-variable
  49. if GUIX_DIR
  50. guix_module_part=":$(guixmoduledir)"
  51. guix_ccache_part=":$(guixccachedir)"
  52. else
  53. guix_module_part=
  54. guix_ccache_part=
  55. endif
  56. # Guile PATHs shouldn't be unset: some guix modules want to load
  57. # (gnutls) module, that's why 'guix' package propagates 'gnutls', i.e.
  58. # a directory with gnutls module is placed in GUILE_LOAD_PATH.
  59. GUILEC_ENV += \
  60. GUILE_LOAD_PATH="$(abs_srcdir)$(guix_module_part):$$GUILE_LOAD_PATH" \
  61. GUILE_LOAD_COMPILED_PATH="$(abs_builddir)$(guix_ccache_part):$$GUILE_LOAD_COMPILED_PATH"
  62. $(GO_FILES): %.go: %.scm
  63. -$(AM_V_GUILEC) $(GUILEC_ENV) \
  64. $(GUILD) compile $(GUILEC_OPTS) --output=$@ $<
  65. CLEANFILES = $(GO_FILES)
  66. clean-go:
  67. -$(RM) -f $(GO_FILES)
  68. .PHONY: clean-go
  69. # Makefile.am ends here