Makefile 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. # Makefile --- GNU Makefile to build Guile code
  2. # Copyright © 2017 Alex Kost <alezost@gmail.com>
  3. # This program is free software; you can redistribute it and/or modify
  4. # it under the terms of the GNU General Public License as published by
  5. # the Free Software Foundation, either version 3 of the License, or
  6. # (at your option) any later version.
  7. #
  8. # This program is distributed in the hope that it will be useful,
  9. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. # GNU General Public License for more details.
  12. #
  13. # You should have received a copy of the GNU General Public License
  14. # along with this program. If not, see <http://www.gnu.org/licenses/>.
  15. # Commentary:
  16. # The only purpose of this Makefile is to build .scm files to check them
  17. # for potential errors.
  18. MODULES_DIR = modules
  19. SCRIPTS_DIR = scripts
  20. MODULES = \
  21. $(MODULES_DIR)/al/utils.scm \
  22. $(MODULES_DIR)/al/records.scm \
  23. $(MODULES_DIR)/al/plists.scm \
  24. $(MODULES_DIR)/al/processes.scm \
  25. $(MODULES_DIR)/al/files.scm \
  26. $(MODULES_DIR)/al/messages.scm \
  27. $(MODULES_DIR)/al/places.scm \
  28. $(MODULES_DIR)/al/display.scm \
  29. $(MODULES_DIR)/al/sound.scm \
  30. $(MODULES_DIR)/al/lirc.scm \
  31. $(MODULES_DIR)/al/links.scm \
  32. $(MODULES_DIR)/al/sources.scm \
  33. $(MODULES_DIR)/al/configs.scm
  34. SCRIPTS = \
  35. $(SCRIPTS_DIR)/gui \
  36. $(SCRIPTS_DIR)/profile \
  37. $(SCRIPTS_DIR)/runbut \
  38. $(SCRIPTS_DIR)/system \
  39. $(SCRIPTS_DIR)/toggle-tvtime
  40. # SCM_FILES = $(MODULES) $(SCRIPTS)
  41. GO_FILES = $(MODULES:%.scm=%.go)
  42. GUILEC_ENV = \
  43. GUILE_AUTO_COMPILE=0
  44. GUILEC_OPTS = \
  45. -Warity-mismatch \
  46. -Wformat \
  47. -Wunbound-variable
  48. GUILEC_ENV += \
  49. GUILE_WARN_DEPRECATED=detailed \
  50. GUILE_LOAD_PATH="$(MODULES_DIR):$$GUILE_LOAD_PATH" \
  51. GUILE_LOAD_COMPILED_PATH="$(MODULES_DIR):$$GUILE_LOAD_COMPILED_PATH"
  52. all: $(GO_FILES)
  53. $(GO_FILES): %.go: %.scm
  54. @$(GUILEC_ENV) guild compile $(GUILEC_OPTS) --output=$@ $<
  55. scripts:
  56. @$(GUILEC_ENV) guild compile $(GUILEC_OPTS) $(SCRIPTS)
  57. clean:
  58. $(RM) -f $(GO_FILES)
  59. .PHONY: clean scripts
  60. # Makefile ends here