# This requires the DLL tools to be installed (I used v2.8).
# Shared image and stubs are placed in sharedlib/ directory. Do make install
# to install them.
# This assumes the source to be in /usr/src/svgalib.

make installheaders
export JUMP_DIR=/usr/src/svgalib/jump/
export JUMP_LIB=/usr/src/svgalib/libvga
make -f Makefile.shared clean
make -f Makefile.shared libvga.a
#export JUMP_LIB=/usr/src/svgalib/libvgagl
(cd gl; make -f makefile.shared clean; make -f makefile.shared libvgagl.a; cd ..)
mv -f gl/libvgagl.a .
# Generate jump.import from libc stubs
#nm --no-cplus -o /usr/lib/libc.sa | grep __GOT_ | sed 's/ __GOT__/ _/' >jump/jump.import
mkstubs -a 0x63b00000 -l libvga -v 1.0.5 -j 0x00001000 -g 4096 \
	-- libvga
mkstubs -a 0x63b00000 -l libvga -v 1.0.5 -j 0x00001000 -g 4096 \
	-- libvgagl
mkimage -a 0x63b00000 -l libvga -v 1.0.5 -j 0x00001000 -g 4096 \
	-- libvga.a libvgagl.a -lgcc -lc
rm -f libvga.a
rm -f libvgagl.a
strip libvga.so.1.0.5
mv -f libvga.so.1.0.5 sharedlib/libvga.so.1.0.5
mv -f libvga.sa sharedlib/libvga.sa
mv -f libvgagl.sa sharedlib/libvgagl.sa

echo Shared library files are now in sharedlib/. Be sure to do a make clean
echo before building static libraries.
