build.sh: pass OPTS also to linking stage, so -static can be passed
[rofl0r-memcpy-test.git] / build.sh
blob8d4c3194755e025ae5ea7abc60421e5b735ccaab
1 #!/bin/sh
2 if [ -z "$1" ] ; then
3 echo error, pass filename of file containing mymemcpy
4 exit 1
5 fi
7 if test -z "$CC" -o -z "$OPTS" ; then
8 echo "warning: CC or OPTS not set, which is probably not what you want" >&2
9 fi
11 [ -z "$CC" ] && CC=gcc
12 $CC -c dummyfuncs.c -o dummyfuncs.o
13 $CC -D_GNU_SOURCE -D_BSD_SOURCE -O0 -g3 -DFILENAME=\"$1\" -c memcpy_test.c -o memcpy_test.o
14 $CC $OPTS -c "$1" -o mymemcpy.o
15 $CC $OPTS dummyfuncs.o memcpy_test.o mymemcpy.o -o test