Makefile 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. # Makefile --- GNU Makefile to build guile modules
  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. MODULES = \
  20. $(MODULES_DIR)/daemon-config.scm \
  21. $(MODULES_DIR)/daemon-config/osd.scm \
  22. $(MODULES_DIR)/daemon-config/osd/global.scm \
  23. $(MODULES_DIR)/daemon-config/osd/text.scm \
  24. $(MODULES_DIR)/daemon-config/osd/sound.scm \
  25. $(MODULES_DIR)/daemon-config/osd/clock.scm \
  26. $(MODULES_DIR)/daemon-config/osd/sleep.scm \
  27. $(MODULES_DIR)/daemon-config/lirc/client.scm \
  28. $(MODULES_DIR)/daemon-config/lirc/keys.scm
  29. GO_FILES = $(MODULES:%.scm=%.go)
  30. GUILEC_ENV = \
  31. GUILE_AUTO_COMPILE=0
  32. GUILEC_OPTS = \
  33. -Warity-mismatch \
  34. -Wformat \
  35. -Wunbound-variable
  36. GUILEC_ENV += \
  37. GUILE_LOAD_PATH="$(MODULES_DIR):$$GUILE_LOAD_PATH" \
  38. GUILE_LOAD_COMPILED_PATH="$(MODULES_DIR):$$GUILE_LOAD_COMPILED_PATH"
  39. all: $(GO_FILES)
  40. $(GO_FILES): %.go: %.scm
  41. @$(GUILEC_ENV) guild compile $(GUILEC_OPTS) --output=$@ $<
  42. clean:
  43. $(RM) -f $(GO_FILES)
  44. .PHONY: clean
  45. # Makefile ends here