Просмотр исходного кода

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
Loïc Hoguin 7 лет назад
Родитель
Сommit
fb4e8687f2
1 измененных файлов с 18 добавлено и 0 удалено
  1. 18 0
      Makefile

+ 18 - 0
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