aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2018-03-28 11:54:03 +0200
committerLoïc Hoguin <[email protected]>2018-03-28 12:20:43 +0200
commitfb4e8687f2c5e55ccead797588fed018bcae646b (patch)
tree646e0cdc29afcf98cc4f090a966412450c617ebd /Makefile
parent2e848f337b68fa70b6e9097ce747894146f4141b (diff)
downloaderlang.mk-fb4e8687f2c5e55ccead797588fed018bcae646b.tar.gz
erlang.mk-fb4e8687f2c5e55ccead797588fed018bcae646b.tar.bz2
erlang.mk-fb4e8687f2c5e55ccead797588fed018bcae646b.zip
Add "make install p=$PKG" to install packages locally
This uses the erlang.mk test infrastructure to build the package and the packages are installed by default to XDG_DATA_HOME/erlang.mk/lib. Just add this path to ERL_LIBS and it will be available to all non-release Erlang shells. export ERL_LIBS=$HOME/.local/share/erlang.mk/lib To make them available to releases they need to be started in interactive mode. This can be done via the CODE_LOADING_MODE variable which is used at the release startup. export CODE_LOADING_MODE=interactive
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile18
1 files changed, 18 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index 9242b80..c0be579 100644
--- a/Makefile
+++ b/Makefile
@@ -83,3 +83,21 @@ up:
cd gh-pages && make
cd gh-pages && git push origin gh-pages
rm -rf gh-pages
+
+ifdef p
+XDG_DATA_HOME ?= $(HOME)/.local/share
+INSTALL_DIR ?= $(XDG_DATA_HOME)/erlang.mk/lib
+
+install: check
+ for dep in `ls test/packages/$p_pkg/deps/`; do \
+ rm -rf $(INSTALL_DIR)/$$dep; \
+ mkdir -p $(INSTALL_DIR)/$$dep; \
+ cp -r test/packages/$p_pkg/deps/$$dep/ebin $(INSTALL_DIR)/$$dep/; \
+ if [ -d test/packages/$p_pkg/deps/$$dep/priv ]; then \
+ cp -r test/packages/$p_pkg/deps/$$dep/priv $(INSTALL_DIR)/$$dep/; \
+ fi; \
+ done
+else
+install:
+ @echo "Usage: $(MAKE) install p=<package name>"
+endif