crashtest-r0ket/firmware/applications/mkwrapper
Stefan `Sec` Zehl 6a8da54274 Add APP=loadable, simple loadable module wrapper to run them as app.
Build with "make APP=loadable LAPP=spaceinvaders"
2011-07-19 10:01:00 +02:00

32 lines
441 B
Bash
Executable file

#!/bin/sh
for a in $* ; do
case $a in
*/*) continue;;
esac
base=${a%.o}
echo "void main_$base(void);"
echo "void tick_$base(void);"
done
echo
echo "void wrapper(void){"
for a in $* ; do
case $a in
*/*) continue;;
esac
base=${a%.o}
echo "main_$base();"
done
echo "}"
echo "void tick_wrapper(void){"
for a in $* ; do
base=${a%.o}
grep -q \ tick_$base ${base}.c && echo "tick_$base();"
done
echo "}"