diff options
author | Loïc Hoguin <[email protected]> | 2015-10-22 23:23:18 +0200 |
---|---|---|
committer | Loïc Hoguin <[email protected]> | 2015-10-22 23:23:18 +0200 |
commit | d7b4e589f1716e2de5087a491ea1701d294dccbc (patch) | |
tree | 8df323b5a46e67dc9cb07ca67db7e1f5a6304384 /test/plugin_shell.mk | |
parent | a9dd1a433c0a3ba4f9c82bfff17924d9d4702eee (diff) | |
download | erlang.mk-d7b4e589f1716e2de5087a491ea1701d294dccbc.tar.gz erlang.mk-d7b4e589f1716e2de5087a491ea1701d294dccbc.tar.bz2 erlang.mk-d7b4e589f1716e2de5087a491ea1701d294dccbc.zip |
Add shell chapter and tests
Diffstat (limited to 'test/plugin_shell.mk')
-rw-r--r-- | test/plugin_shell.mk | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/test/plugin_shell.mk b/test/plugin_shell.mk new file mode 100644 index 0000000..474ef92 --- /dev/null +++ b/test/plugin_shell.mk @@ -0,0 +1,37 @@ +# Shell plugin. + +SHELL_CASES = default kjell +SHELL_TARGETS = $(addprefix shell-,$(SHELL_CASES)) +SHELL_CLEAN_TARGETS = $(addprefix clean-,$(SHELL_TARGETS)) + +.PHONY: shell $(C_SRC_TARGETS) clean-shell $(SHELL_CLEAN_TARGETS) + +clean-shell: $(SHELL_CLEAN_TARGETS) + +$(SHELL_CLEAN_TARGETS): + $t rm -rf $(APP_TO_CLEAN)/ + +shell: $(SHELL_TARGETS) + +shell-default: build clean-shell-default + + $i "Bootstrap a new OTP library named $(APP)" + $t mkdir $(APP)/ + $t cp ../erlang.mk $(APP)/ + $t $(MAKE) -C $(APP) -f erlang.mk bootstrap-lib $v + + $i "Run the shell" + $t $(MAKE) -C $(APP) shell SHELL_OPTS="-eval 'halt()'" $v + +shell-kjell: build clean-shell-kjell + + $i "Bootstrap a new OTP library named $(APP)" + $t mkdir $(APP)/ + $t cp ../erlang.mk $(APP)/ + $t $(MAKE) -C $(APP) -f erlang.mk bootstrap-lib $v + + $i "Add Kjell to the list of shell dependencies and set as default shell" + $t perl -ni.bak -e 'print;if ($$.==1) {print "SHELL_DEPS = kjell\nSHELL_ERL = \$$(DEPS_DIR)/kjell/bin/kjell\n"}' $(APP)/Makefile + + $i "Run the shell" + $t $(MAKE) -C $(APP) shell SHELL_OPTS="-eval 'halt()'" $v |