Makefile 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. SHELL = bash -Eeuxo pipefail
  2. .DEFAULT_GOAL := run
  3. GUILE_LOAD_PATH_ADDITIONS := .
  4. GUILE_LOAD_PATH_ADDITIONS += lib
  5. GUILE_LOAD_PATH_ADDITIONS += lib/algorithms
  6. GUILE_LOAD_PATH_ADDITIONS += lib/pfds-addons
  7. GUILE_LOAD_PATH_ADDITIONS += lib/graph
  8. # GUILE_LOAD_PATH_ADDITIONS += lib/contracts
  9. GUILE_LOAD_PATH_ARGUMENTS := $(foreach dir,$(GUILE_LOAD_PATH_ADDITIONS),-L $(dir))
  10. # Get the project directory somehow.
  11. # PROJECT_DIR := "$(shell pwd)"
  12. mkfile_path := $(abspath $(lastword $(MAKEFILE_LIST)))
  13. PROJECT_DIR := $(patsubst %/,%,$(dir $(mkfile_path)))
  14. .PHONY: rebuild
  15. rebuild:
  16. guix time-machine \
  17. --channels="$(PROJECT_DIR)/guix-env/channels.scm" -- \
  18. shell \
  19. --development \
  20. --manifest="$(PROJECT_DIR)/guix-env/manifest.scm" -- \
  21. guile \
  22. --fresh-auto-compile \
  23. $(GUILE_LOAD_PATH_ARGUMENTS) \
  24. main.scm
  25. .PHONY: run-a-star
  26. run-a-star:
  27. guix time-machine \
  28. --channels="$(PROJECT_DIR)/guix-env/channels.scm" -- \
  29. shell \
  30. --development \
  31. --manifest="$(PROJECT_DIR)/guix-env/manifest.scm" -- \
  32. guile \
  33. $(GUILE_LOAD_PATH_ARGUMENTS) \
  34. main-a-star.scm
  35. .PHONY: run-dijkstra
  36. run-dijkstra:
  37. guix time-machine \
  38. --channels="$(PROJECT_DIR)/guix-env/channels.scm" -- \
  39. shell \
  40. --development \
  41. --manifest="$(PROJECT_DIR)/guix-env/manifest.scm" -- \
  42. guile \
  43. $(GUILE_LOAD_PATH_ARGUMENTS) \
  44. main-dijkstra.scm
  45. .PHONY: test-shell
  46. test-shell:
  47. exec guix time-machine \
  48. --channels="$(PROJECT_DIR)/guix-env/channels.scm" -- \
  49. shell \
  50. --development \
  51. --manifest="$(PROJECT_DIR)/guix-env/manifest.scm" -- \
  52. guile \
  53. $(GUILE_LOAD_PATH_ARGUMENTS)