-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbuild.sh
More file actions
executable file
·74 lines (62 loc) · 2.32 KB
/
Copy pathbuild.sh
File metadata and controls
executable file
·74 lines (62 loc) · 2.32 KB
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
68
69
70
71
72
73
#!/bin/bash
#
# Quick build script for thingino-accel
#
set -e
# Colors
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
NC='\033[0m' # No Color
echo -e "${GREEN}╔══════════════════════════════════════════════════════════╗${NC}"
echo -e "${GREEN}║ thingino-accel - Build Script ║${NC}"
echo -e "${GREEN}╚══════════════════════════════════════════════════════════╝${NC}"
echo ""
# Detect toolchain
if [ -z "$CROSS_COMPILE" ]; then
# Try to find thingino toolchain (prefer /opt for persistence across reboots)
if [ -d "/opt/thingino-toolchain/host/bin" ]; then
export PATH="/opt/thingino-toolchain/host/bin:$PATH"
export CROSS_COMPILE=mipsel-linux-
echo -e "${YELLOW}Using thingino toolchain from /opt${NC}"
elif [ -d "/home/matteius/output-stable/wyze_camv4_t41nq_gc4653_atbm6062/host/bin" ]; then
export PATH="/home/matteius/output-stable/wyze_camv4_t41nq_gc4653_atbm6062/host/bin:$PATH"
export CROSS_COMPILE=mipsel-linux-
echo -e "${YELLOW}Using thingino toolchain from home directory${NC}"
else
echo -e "${RED}Error: CROSS_COMPILE not set and thingino toolchain not found${NC}"
echo "Please set CROSS_COMPILE environment variable or install toolchain to /opt/thingino-toolchain"
exit 1
fi
fi
# Show configuration
echo "Toolchain: ${CROSS_COMPILE}"
echo "CC: ${CROSS_COMPILE}gcc"
echo ""
# Build
echo -e "${GREEN}[1/3] Building library...${NC}"
make lib
echo ""
echo -e "${GREEN}[2/3] Building examples...${NC}"
make examples
echo ""
echo -e "${GREEN}Building MXUv3 microtests...${NC}"
make mxuv3-tests
echo ""
echo -e "${GREEN}[3/3] Build complete!${NC}"
echo ""
# Show results
echo "Built files:"
ls -lh build/lib/
ls -lh build/bin/
echo ""
# Show deployment instructions
echo -e "${YELLOW}To deploy to device:${NC}"
echo " scp build/lib/libnna.so root@<device-ip>:/usr/lib/"
echo " scp build/bin/test_init root@<device-ip>:/tmp/"
echo ""
echo "To run on device:"
echo " ssh root@<device-ip>"
echo " insmod /lib/modules/soc-nna.ko # if not already loaded"
echo " /tmp/test_init"
echo ""