...
 
Commits (2)
......@@ -18,6 +18,13 @@ function list_available_tests {
done
}
function compile {
CC=gcc
CFLAGS="${CFLAGS} -Wall -Wextra -Werror -Wfatal-errors"
CFLAGS="${CFLAGS} -fno-stack-protector -mno-red-zone -nostartfiles -nodefaultlibs"
$CC $CFLAGS -c $1 -o $2
}
if [ "$1" == "" ]; then
echo "Must specify one of the following tests to run."
list_available_tests
......@@ -34,21 +41,19 @@ cd src/BareMetal-test
if [ "$extension" == "c" ]; then
cd api && ./build.sh && cd ..
objfile="$sysdir/`basename $filename .c`.o"
CC=gcc
CFLAGS="-Wall -Wextra -Werror -Wfatal-errors -fno-stack-protector -mno-red-zone -nostartfiles -nodefaultlibs"
CFLAGS="${CFLAGS} -I ../BareMetal"
$CC $CFLAGS -c $filename -o $objfile
compile $filename $objfile
compile ../BareMetal/api/libBareMetal.c libBareMetal.o
sysfile="$sysdir/`basename $filename .c`.sys"
LD=ld
LDFLAGS="-T c.ld -L api"
LDFLAGS="-T c.ld"
$LD $LDFLAGS $output_file -lBareMetal -o $sysfile
$LD $LDFLAGS $objfile libBareMetal.o -o $sysfile
cd ../.. && ./install.sh $sysfile
......