Skip to content
Snippets Groups Projects
Commit db63660c authored by Damien George's avatar Damien George
Browse files

Add pip-micropython to unix make install.

Also add -t/--target option to pip-micropython to allowing installing to
the pyboard.

Thanks to turbinenreiter/Sebastian Plamauer for the patch.
parent 3bb7efc9
No related branches found
No related tags found
No related merge requests found
...@@ -5,19 +5,34 @@ ...@@ -5,19 +5,34 @@
# complete library snapshot to be deployed on a device for baremetal # complete library snapshot to be deployed on a device for baremetal
# ports (if PIP_MICROPY_DEST environment var is set). # ports (if PIP_MICROPY_DEST environment var is set).
# #
# Currently supported usage:
#
# pip-micropython install [-t/--target <dir>] <packages>
# parse command
if [ "$1" != "install" ]; then if [ "$1" != "install" ]; then
echo "Only install command is supported currently" echo "Only install command is supported currently"
exit 1 exit 1
fi fi
shift shift
# parse options
targetdest=''
if [ "$1" == "-t" -o "$1" == "--target" ]; then
targetdest="$2"
shift
shift
fi
if [ -z "$TMPDIR" ]; then if [ -z "$TMPDIR" ]; then
TMPDIR=/tmp TMPDIR=/tmp
fi fi
TMPVENV="$TMPDIR/pip-micropy-venv" TMPVENV="$TMPDIR/pip-micropy-venv"
if [ -n "$PIP_MICROPY_DEST" ]; then if [ -n "$targetdest" ]; then
dest="$targetdest"
echo "Destination snapshot directory: $dest"
elif [ -n "$PIP_MICROPY_DEST" ]; then
dest="$PIP_MICROPY_DEST" dest="$PIP_MICROPY_DEST"
echo "Destination snapshot directory: $dest" echo "Destination snapshot directory: $dest"
elif [ -n "$MICROPYPATH" ]; then elif [ -n "$MICROPYPATH" ]; then
......
...@@ -106,10 +106,14 @@ test: $(PROG) ../tests/run-tests ...@@ -106,10 +106,14 @@ test: $(PROG) ../tests/run-tests
TARGET = micropython TARGET = micropython
PREFIX = $(DESTDIR)/usr/local PREFIX = $(DESTDIR)/usr/local
BINDIR = $(PREFIX)/bin BINDIR = $(PREFIX)/bin
PIPSRC = ../tools/pip-micropython
PIPTARGET = pip-micropython
install: micropython install: micropython
install -D $(TARGET) $(BINDIR)/$(TARGET) install -D $(TARGET) $(BINDIR)/$(TARGET)
install -D $(PIPSRC) $(BINDIR)/$(PIPTARGET)
# uninstall micropython # uninstall micropython
uninstall: uninstall:
-rm $(BINDIR)/$(TARGET) -rm $(BINDIR)/$(TARGET)
-rm $(BINDIR)/$(PIPTARGET)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment