Makefile.am 2.7 KB

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