Makefile.am 3.0 KB

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