diff --git a/Makefile b/Makefile index 349d3ce59..6f99f95d6 100644 --- a/Makefile +++ b/Makefile @@ -1,14 +1,18 @@ .PHONY: all +PREFIX = '/usr/local' + all: @ echo "Building escript..." @ rebar3 escriptize @ rebar3 as dap escriptize +.PHONY: install install: all @ echo "Installing escript..." - @ cp _build/default/bin/erlang_ls /usr/local/bin - @ cp _build/dap/bin/els_dap /usr/local/bin + @ mkdir -p '${PREFIX}/bin' + @ cp _build/default/bin/erlang_ls ${PREFIX}/bin + @ cp _build/dap/bin/els_dap ${PREFIX}/bin .PHONY: clean clean: diff --git a/README.md b/README.md index 7c314c25b..09c64eb78 100644 --- a/README.md +++ b/README.md @@ -22,6 +22,10 @@ To install the produced `erlang_ls` escript in `/usr/local/bin`: make install +To install to a different directory set the `PREFIX` environment variable: + + PREFIX=/path/to/directory make -e install + ## Command-line Arguments These are the command-line arguments that can be provided to the