-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sh
executable file
·48 lines (42 loc) · 822 Bytes
/
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
#!/bin/bash
set -e
LPR=$1
if [[ $LPR == "" ]]
then
LPR=microbitdemo
fi
CONF=$2
if [[ $CONF == "" ]]
then
CONF=RPI3
fi
case $CONF in
RPI)
PROC=RPIB
ARCH=ARMV6
KERNEL=kernel.img
;;
RPI2)
PROC=RPI2B
ARCH=ARMV7a
KERNEL=kernel7.img
;;
RPI3)
PROC=RPI3B
ARCH=ARMV7a
KERNEL=kernel7.img
;;
esac
echo build.sh $LPR $CONF
ULTIBO=$HOME/ultibo/core
ULTIBOBIN=$ULTIBO/fpc/bin
REPO=prototype-microbit-as-ultibo-peripheral
export PATH=$ULTIBOBIN:$PATH
for f in *.lpr *.pas
do
ptop -l 1000 -i 1 -c ptop.cfg $f $f.formatted
mv $f.formatted $f
done
rm -rf lib/ *.o
fpc -dBUILD_$CONF -B -O2 -Tultibo -Parm -Cp$ARCH -Wp$PROC -Fi$ULTIBO/source/rtl/ultibo/extras -Fi$ULTIBO/source/rtl/ultibo/core @$ULTIBOBIN/$CONF.CFG $LPR.lpr >& errors.log
mv $KERNEL $LPR-kernel-$CONF.img