Files
RTOS/build_test.sh
T
root ca13734bf0 Add full automotive RTOS project
Add kernel (Cortex-M0/M3/M4, Tricore, S32K, RISC-V ports), drivers,
middleware (CAN stack, diagnostics, safety), applications, board
support, build/test tooling, and documentation.
2026-08-23 03:35:29 -04:00

43 lines
1012 B
Bash
Executable File

#!/bin/bash
# Project root
PROJECT_ROOT="$(pwd)"
# Toolchain paths (adjust based on your system)
TOOLCHAIN_BIN="/opt/homebrew/bin"
NEWLIB_INCLUDE="/opt/homebrew/opt/arm-none-eabi-newlib/arm-none-eabi/include"
GCC_INCLUDE="/opt/homebrew/Cellar/arm-none-eabi-gcc/16.2.0/lib/gcc/arm-none-eabi/16.2.0/include"
# Project include paths
INCLUDE_PATHS=(
"-I${PROJECT_ROOT}/kernel/include"
"-I${PROJECT_ROOT}/drivers/include"
"-I${PROJECT_ROOT}/middleware"
"-I${PROJECT_ROOT}/middleware/can_stack/include"
"-I${PROJECT_ROOT}/middleware/diagnostics/include"
"-I${PROJECT_ROOT}/config"
"-I${NEWLIB_INCLUDE}"
"-I${GCC_INCLUDE}"
)
# Test compilation
echo "Testing compilation..."
arm-none-eabi-gcc \
-mcpu=cortex-m4 \
-mthumb \
-O0 \
-g \
-Wall \
-Wextra \
"${INCLUDE_PATHS[@]}" \
-c kernel/src/kernel_init.c \
-o test.o
if [ $? -eq 0 ]; then
echo "✓ Compilation successful!"
rm -f test.o
else
echo "✗ Compilation failed"
exit 1
fi