shell.asciidoc 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. == Erlang shell
  2. Erlang.mk provides a convenient target for starting a shell
  3. with all the paths set properly to experiment with your code.
  4. === Configuration
  5. The `SHELL_DEPS` variable can be used to define dependencies
  6. that are only to be used when the `make shell` command is called.
  7. For example, if you want to use _kjell_ as your shell:
  8. [source,make]
  9. SHELL_DEPS = kjell
  10. Dependencies are downloaded and compiled the first time you
  11. run the `make shell` command.
  12. You can customize the executable used to start the Erlang shell.
  13. To continue with our example, if you want to use _kjell_ as your
  14. shell, you also need to change `SHELL_ERL` and point it to the
  15. `kjell` executable:
  16. [source,make]
  17. SHELL_ERL = $(DEPS_DIR)/kjell/bin/kjell
  18. You can specify additional options to be used when starting the
  19. shell using the `SHELL_OPTS` variable:
  20. [source,make]
  21. SHELL_OPTS = -setcookie chocolate
  22. Any of the usual `erl` options can be used, including `-eval`:
  23. [source,make]
  24. SHELL_OPTS = -eval 'my_app:run()'
  25. === Usage
  26. To start the shell, all you need is the following command:
  27. [source,bash]
  28. $ make shell
  29. The shell can be stopped as usual with a double Ctrl+C or the
  30. command `q().`.