shell.mk 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. # Copyright (c) 2015-2016, Loïc Hoguin <essen@ninenines.eu>
  2. # Copyright (c) 2014, M Robert Martin <rob@version2beta.com>
  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 $(TEST_DIR)
  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. ifneq ($(SKIP_DEPS),)
  18. build-shell-deps:
  19. else
  20. build-shell-deps: $(ALL_SHELL_DEPS_DIRS)
  21. $(verbose) set -e; for dep in $(ALL_SHELL_DEPS_DIRS) ; do \
  22. if [ -z "$(strip $(FULL))" ] && [ ! -L $$dep ] && [ -f $$dep/ebin/dep_built ]; then \
  23. :; \
  24. else \
  25. $(MAKE) -C $$dep IS_DEP=1; \
  26. if [ ! -L $$dep ] && [ -d $$dep/ebin ]; then touch $$dep/ebin/dep_built; fi; \
  27. fi \
  28. done
  29. endif
  30. shell:: build-shell-deps
  31. $(gen_verbose) $(SHELL_ERL) -pa $(SHELL_PATHS) $(SHELL_OPTS)