#!/bin/sh

# set this to your klibc source path
KLIBC=.
PREFIX=mips-unknown-linux-musl
CFLAGS="-march=mips2 -Os -fno-pic -mno-abicalls -nostdlib"
INCLUDES="-I$KLIBC/include -I$KLIBC/include/bits32"
LIBC_BITS="$KLIBC/klibc/crt0.o $KLIBC/klibc/libc.a"

${PREFIX}gcc $CFLAGS $INCLUDES -D__KLIBC__ getdvhoff.c $LIBC_BITS -o getdvhoff -N
${PREFIX}strip getdvhoff
