Files
r36ultra_app/compile_menu.sh
2026-02-01 16:41:07 -03:00

40 lines
1.0 KiB
Bash
Executable File

#!/bin/bash
# Compilation script for menu demo
if [ "$1" == "arm64" ] || [ "$1" == "aarch64" ]; then
echo "Cross-compiling menu demo for ARM64..."
if ! command -v aarch64-linux-gnu-gcc &> /dev/null; then
echo "Error: ARM64 cross-compiler not found!"
echo "Install with: sudo apt-get install gcc-aarch64-linux-gnu"
exit 1
fi
aarch64-linux-gnu-gcc -o menu_demo menu_demo.c -static
if [ $? -eq 0 ]; then
echo "✅ Cross-compilation successful!"
echo "Binary compiled for ARM64 (aarch64)"
echo "Transfer to R36 Ultra and run with: sudo ./menu_demo"
file menu_demo
ls -lh menu_demo
else
echo "❌ Cross-compilation failed!"
exit 1
fi
else
echo "Compiling menu demo (native)..."
gcc -o menu_demo menu_demo.c
if [ $? -eq 0 ]; then
echo "✅ Compilation successful!"
echo "Run with: sudo ./menu_demo"
file menu_demo
ls -lh menu_demo
else
echo "❌ Compilation failed!"
exit 1
fi
fi