shell.mk 846 B

123456789101112131415161718192021222324252627282930
  1. # Copyright (c) 2014, M Robert Martin <rob@version2beta.com>
  2. # Copyright (c) 2015, Loïc Hoguin <essen@ninenines.eu>
  3. # This file is contributed to erlang.mk and subject to the terms of the ISC License.
  4. .PHONY: shell
  5. # Configuration.
  6. SHELL_ERL ?= erl
  7. SHELL_PATHS ?= $(CURDIR)/ebin $(APPS_DIR)/*/ebin $(DEPS_DIR)/*/ebin
  8. SHELL_OPTS ?=
  9. ALL_SHELL_DEPS_DIRS = $(addprefix $(DEPS_DIR)/,$(SHELL_DEPS))
  10. # Core targets
  11. help::
  12. $(verbose) printf "%s\n" "" \
  13. "Shell targets:" \
  14. " shell Run an erlang shell with SHELL_OPTS or reasonable default"
  15. # Plugin-specific targets.
  16. $(foreach dep,$(SHELL_DEPS),$(eval $(call dep_target,$(dep))))
  17. build-shell-deps: $(ALL_SHELL_DEPS_DIRS)
  18. $(verbose) for dep in $(ALL_SHELL_DEPS_DIRS) ; do $(MAKE) -C $$dep ; done
  19. shell: build-shell-deps
  20. $(gen_verbose) $(SHELL_ERL) -pa $(SHELL_PATHS) $(SHELL_OPTS)