diff --git a/dist/tools/teensy-loader-cli/.gitignore b/dist/tools/teensy-loader-cli/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..552fed5265141b3157ecc283a0d19734e2c4adab --- /dev/null +++ b/dist/tools/teensy-loader-cli/.gitignore @@ -0,0 +1 @@ +teensy_loader diff --git a/dist/tools/teensy-loader-cli/Makefile b/dist/tools/teensy-loader-cli/Makefile new file mode 100644 index 0000000000000000000000000000000000000000..eec2e614c68f0d8f3d592dba87ceb797e0118786 --- /dev/null +++ b/dist/tools/teensy-loader-cli/Makefile @@ -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 diff --git a/dist/tools/teensy-loader-cli/build.sh b/dist/tools/teensy-loader-cli/build.sh deleted file mode 100755 index 080a2d70e4e594572659c89e4a02c109f69671f9..0000000000000000000000000000000000000000 --- a/dist/tools/teensy-loader-cli/build.sh +++ /dev/null @@ -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