3cec2e35f4
Arduino is an open-source electronics prototyping platform based on flexible, easy-to-use hardware and software. It's intended for artists, designers, hobbyists, and anyone interested in creating interactive objects or environments. [..] This package contains the libraries, header files and tools to develop Arduino sketches. It does not include the Arduino IDE frontend. based on work from and ok ckuethe@
58 lines
1.7 KiB
Bash
58 lines
1.7 KiB
Bash
#!/bin/sh
|
|
|
|
# $OpenBSD: arduinoproject,v 1.1.1.1 2011/09/17 16:41:30 jasper Exp $
|
|
# Copyright (c) 2011 Chris Kuethe <ckuethe@openbsd.org>
|
|
#
|
|
# Permission to use, copy, modify, and distribute this software for any
|
|
# purpose with or without fee is hereby granted, provided that the above
|
|
# copyright notice and this permission notice appear in all copies.
|
|
#
|
|
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
|
|
L=${TRUEPREFIX}
|
|
AS="${L}/share"
|
|
ASA="${AS}/arduino"
|
|
ASD="${AS}/doc/arduino"
|
|
ASE="${AS}/examples/arduino"
|
|
|
|
if [ $# -ne 1 -o "x$1" = "x-h" ] ; then
|
|
cat << EOH
|
|
usage: $0 <projectname>
|
|
|
|
This will populate a new directory with a makefile and a template
|
|
source file. If you have an existing source - one of the examples,
|
|
perhaps - you can copy it over the template and run "make".
|
|
|
|
|
|
EOH
|
|
exit 1
|
|
fi
|
|
|
|
P=$(echo -n "$1" | tr -c -s "A-Za-z0-9_-." "_")
|
|
|
|
if [ -d "$P" ] ; then
|
|
echo "using existing $P directory"
|
|
else
|
|
if [ -e "$P" ] ; then
|
|
echo "sorry, $P exists and is not a directory"
|
|
exit 1
|
|
fi
|
|
T=`mktemp -d arduino.XXXXXXXXXX` || exit 1
|
|
echo "creating new arduino project '$P'"
|
|
mv $T "$P"
|
|
fi
|
|
cd $P || exit 1
|
|
|
|
D=`date "+.%s"`
|
|
cmp -s ${ASE}/Makefile.in Makefile || \
|
|
install -b -B $D -S ${ASE}/BSDmakefile BSDmakefile
|
|
cmp -s ${ASE}/template.pde "${P}.pde" || \
|
|
install -b -B $D -S ${ASE}/template.pde "${P}.pde"
|
|
mkdir -p applet
|