-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sh
executable file
·67 lines (62 loc) · 1.2 KB
/
build.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#!/bin/sh
#
# run this script in this directory (the top level propgcc)
#
#
# ADJUST THE FOLLOWING VARIABLES IF NECESSARY
#
PREFIX=/opt/parallax
export PREFIX
#
# attempt to auto-detect the OS
UNAME=`uname -s`
if test NAME`echo $UNAME | grep "[_-]"` != NAME
then
# if system has [-_] try uname -o ... Cygwin for example
UNAME=`uname -o`
fi
echo "OS '$UNAME' detected."
if test x$UNAME = xDarwin
then
OS=macosx
PORT=/dev/cu.usbserial-A8004ILf
BOARD=hub
elif test x$UNAME = xCygwin
then
OS=cygwin
PORT=COM16
BOARD=c3
elif test x$UNAME = xMsys
then
OS=msys
PORT=COM16
BOARD=c3
elif test x$UNAME = xLinux
then
OS=linux
PORT=/dev/ttyUSB0
BOARD=c3
else
echo "Unknown system: " $UNAME
exit 1
fi
#
# We have a valid system. export variables.
# Bourne shell must set and export separately for some linux.
# This seems to be an issue with debian ....
#
export OS
export PORT
export BOARD
#
# build propeller-load
#
make TARGET=../../../build/loader clean
make TARGET=../../../build/loader
make TARGET=../../../build/loader install
echo "cp ./bin/${OS}/* ${PREFIX}/bin/."
cp ./bin/${OS}/* ${PREFIX}/bin/.
ls -l ${PREFIX}/bin/bin2c*
ls -l ${PREFIX}/bin/propeller-load*
echo "Build complete."
exit 0