Makefile.am 2.7 KB

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