plugin_shell.mk 865 B

12345678910111213141516171819202122232425262728293031
  1. # Shell plugin.
  2. SHELL_CASES = default kjell
  3. SHELL_TARGETS = $(addprefix shell-,$(SHELL_CASES))
  4. .PHONY: shell $(C_SRC_TARGETS)
  5. shell: $(SHELL_TARGETS)
  6. shell-default: build clean
  7. $i "Bootstrap a new OTP library named $(APP)"
  8. $t mkdir $(APP)/
  9. $t cp ../erlang.mk $(APP)/
  10. $t $(MAKE) -C $(APP) -f erlang.mk bootstrap-lib $v
  11. $i "Run the shell"
  12. $t $(MAKE) -C $(APP) shell SHELL_OPTS="-eval 'halt()'" $v
  13. shell-kjell: build clean
  14. $i "Bootstrap a new OTP library named $(APP)"
  15. $t mkdir $(APP)/
  16. $t cp ../erlang.mk $(APP)/
  17. $t $(MAKE) -C $(APP) -f erlang.mk bootstrap-lib $v
  18. $i "Add Kjell to the list of shell dependencies and set as default shell"
  19. $t perl -ni.bak -e 'print;if ($$.==1) {print "SHELL_DEPS = kjell\nSHELL_ERL = \$$(DEPS_DIR)/kjell/bin/kjell\n"}' $(APP)/Makefile
  20. $i "Run the shell"
  21. $t $(MAKE) -C $(APP) shell SHELL_OPTS="-eval 'halt()'" $v