Commit 67098b38 authored by Jeremy Soller's avatar Jeremy Soller

Cleanup OS X vs Linux

parent 92eb10e3
#!/bin/bash
ROOT="$(cd `dirname $0` && pwd)"
if [ "`uname`" == "Linux" ]
then
C_INCLUDE_PATH="$ROOT/usr/include" \
LIBRARY_PATH="$ROOT/usr/lib" \
gcc -v \
-static -nostartfiles -nostdlib -nodefaultlibs \
--sysroot "$ROOT" \
-undef -imacros "$ROOT/define.h" \
"$@" \
"$ROOT/usr/lib/crt0.o" \
"$ROOT/usr/lib/libm.a" \
"$ROOT/usr/lib/libgcc.a" \
"$ROOT/usr/lib/libc.a"
compiler="gcc"
elif [ "`uname`" == "Darwin" ]
then
C_INCLUDE_PATH="$ROOT/usr/include" \
LIBRARY_PATH="$ROOT/usr/lib" \
x86_64-elf-gcc -v \
-static -nostartfiles -nostdlib -nodefaultlibs \
--sysroot "$ROOT" \
-undef -imacros "$ROOT/define.h" \
"$@" \
"$ROOT/usr/lib/crt0.o" \
"$ROOT/usr/lib/libm.a" \
"$ROOT/usr/lib/libgcc.a" \
"$ROOT/usr/lib/libc.a"
compiler="x86_64-elf-gcc"
else
echo "$0: `uname` not supported"
exit 1
fi
C_INCLUDE_PATH="$ROOT/usr/include" \
LIBRARY_PATH="$ROOT/usr/lib" \
"$compiler" \
-static -nostartfiles -nostdlib -nodefaultlibs \
--sysroot "$ROOT" \
-undef -imacros "$ROOT/define.h" \
"$@" \
"$ROOT/usr/lib/crt0.o" \
"$ROOT/usr/lib/libm.a" \
"$ROOT/usr/lib/libgcc.a" \
"$ROOT/usr/lib/libc.a"
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment