Skip to content

Commit db63660

Browse files
committed
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.
1 parent 3bb7efc commit db63660

File tree

2 files changed

+20
-1
lines changed

2 files changed

+20
-1
lines changed

tools/pip-micropython

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,34 @@
55
# complete library snapshot to be deployed on a device for baremetal
66
# ports (if PIP_MICROPY_DEST environment var is set).
77
#
8+
# Currently supported usage:
9+
#
10+
# pip-micropython install [-t/--target <dir>] <packages>
811

12+
# parse command
913
if [ "$1" != "install" ]; then
1014
echo "Only install command is supported currently"
1115
exit 1
1216
fi
1317
shift
1418

19+
# parse options
20+
targetdest=''
21+
if [ "$1" == "-t" -o "$1" == "--target" ]; then
22+
targetdest="$2"
23+
shift
24+
shift
25+
fi
26+
1527
if [ -z "$TMPDIR" ]; then
1628
TMPDIR=/tmp
1729
fi
1830
TMPVENV="$TMPDIR/pip-micropy-venv"
1931

20-
if [ -n "$PIP_MICROPY_DEST" ]; then
32+
if [ -n "$targetdest" ]; then
33+
dest="$targetdest"
34+
echo "Destination snapshot directory: $dest"
35+
elif [ -n "$PIP_MICROPY_DEST" ]; then
2136
dest="$PIP_MICROPY_DEST"
2237
echo "Destination snapshot directory: $dest"
2338
elif [ -n "$MICROPYPATH" ]; then

unix/Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,10 +106,14 @@ test: $(PROG) ../tests/run-tests
106106
TARGET = micropython
107107
PREFIX = $(DESTDIR)/usr/local
108108
BINDIR = $(PREFIX)/bin
109+
PIPSRC = ../tools/pip-micropython
110+
PIPTARGET = pip-micropython
109111

110112
install: micropython
111113
install -D $(TARGET) $(BINDIR)/$(TARGET)
114+
install -D $(PIPSRC) $(BINDIR)/$(PIPTARGET)
112115

113116
# uninstall micropython
114117
uninstall:
115118
-rm $(BINDIR)/$(TARGET)
119+
-rm $(BINDIR)/$(PIPTARGET)

0 commit comments

Comments
 (0)