#!/bin/sh

rm -f *.so
rm -f *.dll
rm -f *.o

_INCLUDES="-I$JAVA_HOME/include -I$JAVA_HOME/include/linux -I../src/zlib"

# cd ./bin

gcc $_OPTS $_INCLUDES -m64 -fpic  -c ../src/zlib/adler32.c
gcc $_OPTS $_INCLUDES -m64 -fpic  -c ../src/zlib/compress.c
gcc $_OPTS $_INCLUDES -m64 -fpic  -c ../src/zlib/crc32.c
gcc $_OPTS $_INCLUDES -m64 -fpic  -c ../src/zlib/gzio.c
gcc $_OPTS $_INCLUDES -m64 -fpic  -c ../src/zlib/uncompr.c
gcc $_OPTS $_INCLUDES -m64 -fpic  -c ../src/zlib/deflate.c
gcc $_OPTS $_INCLUDES -m64 -fpic  -c ../src/zlib/trees.c
gcc $_OPTS $_INCLUDES -m64 -fpic  -c ../src/zlib/zutil.c
gcc $_OPTS $_INCLUDES -m64 -fpic  -c ../src/zlib/inflate.c
gcc $_OPTS $_INCLUDES -m64 -fpic  -c ../src/zlib/infback.c
gcc $_OPTS $_INCLUDES -m64 -fpic  -c ../src/zlib/inftrees.c
gcc $_OPTS $_INCLUDES -m64 -fpic  -c ../src/zlib/inffast.c

g++ $_INCLUDES -m64 -fpic -D ZLIB -D LOOKUP_OBJ -D USE_SOCKETS $_OPTS -shared -o libjbossInspector.so ../src/jbossInspector.cc *.o
