aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/shell.mk
diff options
context:
space:
mode:
authorRob Martin <[email protected]>2014-09-03 17:42:53 -0600
committerRob Martin <[email protected]>2014-09-08 09:27:12 -0600
commit889f959855de39323802791d02d0164df21d0a2c (patch)
treec229b703c4b664c3271e136674df239a0e3f812a /plugins/shell.mk
parent3b096b6e500298df128a9295075a98ee46de2d77 (diff)
downloaderlang.mk-889f959855de39323802791d02d0164df21d0a2c.tar.gz
erlang.mk-889f959855de39323802791d02d0164df21d0a2c.tar.bz2
erlang.mk-889f959855de39323802791d02d0164df21d0a2c.zip
Created shell target
Diffstat (limited to 'plugins/shell.mk')
-rw-r--r--plugins/shell.mk28
1 files changed, 28 insertions, 0 deletions
diff --git a/plugins/shell.mk b/plugins/shell.mk
new file mode 100644
index 0000000..9cbee2e
--- /dev/null
+++ b/plugins/shell.mk
@@ -0,0 +1,28 @@
+# Copyright (c) 2014, M Robert Martin <[email protected]>
+# This file is contributed to erlang.mk and subject to the terms of the ISC License.
+
+.PHONY: shell
+
+# Configuration.
+
+SHELL_PATH ?= -pa ../$(PROJECT)/ebin $(DEPS_DIR)/*/ebin
+SHELL_OPTS ?=
+
+ALL_SHELL_DEPS_DIRS = $(addprefix $(DEPS_DIR)/,$(SHELL_DEPS))
+
+# Core targets
+
+help::
+ @printf "%s\n" "" \
+ "Shell targets:" \
+ " shell Run an erlang shell with SHELL_OPTS or reasonable default"
+
+# Plugin-specific targets.
+
+$(foreach dep,$(SHELL_DEPS),$(eval $(call dep_target,$(dep))))
+
+build-shell-deps: $(ALL_SHELL_DEPS_DIRS)
+ @for dep in $(ALL_SHELL_DEPS_DIRS) ; do $(MAKE) -C $$dep ; done
+
+shell: build-shell-deps
+ $(gen_verbose) erl $(SHELL_PATH) $(SHELL_OPTS)