Skip to content
Snippets Groups Projects
Commit 86dec1b7 authored by Loïc Dauphin's avatar Loïc Dauphin
Browse files

dist/tools: make teensy-loader-cli work on MACOSX

parent 982f36cd
No related branches found
No related tags found
No related merge requests found
teensy_loader
PKG_NAME=teensy-loader-cli
PKG_LICENSE=GPL-3
PKG_BUILDDIR=$(CURDIR)/bin
# resolv build host in a hacky way
UNAME=$(shell uname)
TARGET=WINDOWS
ifeq ("$(UNAME)","Linux")
TARGET=LINUX
else ifeq ("$(UNAME)","Darwin")
TARGET=MACOSX
endif
# get sources from repository
ifeq ("$(TARGET)","MACOSX")
# hacked version to make it work on MACOSX
PKG_URL=https://github.com/alswl/teensy_loader_cli.git
PKG_VERSION=9c16bb0add3ba847df5509328ad6bd5bc09d9ecd
else
PKG_URL=https://github.com/PaulStoffregen/teensy_loader_cli.git
PKG_VERSION=76921edbdd81ae99b869b104404c16c06b0a266f
endif
.PHONY: all
all: git-download
env -i PATH=$(PATH) TERM=$(TERM) "$(MAKE)" -C $(PKG_BUILDDIR)
mv $(PKG_BUILDDIR)/teensy_loader_cli ./teensy_loader
include $(RIOTBASE)/pkg/pkg.mk
#!/usr/bin/env sh
#
# Copyright (c) 2015 Nick v. IJzendoorn <nijzendoorn@engineering-spirit.nl>
#
# A simple script to fetch and build the teensy_loader_cli tool used for the
# Teensy boards.
# For more information see: https://www.pjrc.com/teensy/loader_cli.html
#
# get sources from repository
git clone https://github.com/PaulStoffregen/teensy_loader_cli.git
cd teensy_loader_cli
# resolv build host in a hacky way
UNAME=`uname`
TARGET="WINDOWS";
if [ "x$UNAME" = "xLinux" ]; then
TARGET="LINUX";
elif [ "x$UNAME" = "xDarwin" ]; then
TARGET="MACOSX";
fi;
# check if the library exists
if [ "x$TARGET" = "xLINUX" ] && ! ldconfig -p | grep 'libusb' > /dev/null; then
echo "please install libusb-dev";
exit 1;
elif [ "x$TARGET" = "xMACOSX" ] && ! pkg-config --list-all | grep 'libusb' > /dev/null; then
echo "please install libusb-dev";
exit 1;
elif [ "x$TARGET" = "xWINDOWS" ]; then
echo "can't build for windows... yet";
exit 1;
fi;
# build the application
OS=$TARGET make
# copy the tool to the base directory
mv teensy_loader_cli ../teensy_loader
cd ..
rm -rf teensy_loader_cli
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment