1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

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

This commit is contained in:
Loïc Dauphin 2018-01-17 18:12:17 +01:00
parent 982f36cdb0
commit 86dec1b762
3 changed files with 31 additions and 42 deletions

View File

@ -0,0 +1 @@
teensy_loader

30
dist/tools/teensy-loader-cli/Makefile vendored Normal file
View File

@ -0,0 +1,30 @@
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

View File

@ -1,42 +0,0 @@
#!/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