# This requires the DLL tools to be installed.
# Shared image and stubs are placed in sharedlib/ directory. Do make install
# to install them.

export VERSION='1.1.7'

make installheaders
echo If there might be static library object files lying around, stop this.
export JUMP_DIR=`pwd`/jump/
export JUMP_LIB=libvga
export DLLFLAGS=-B/usr/dll/jump/	# used by makefiles
(cd src; make libvga.a; cd ..)
(cd gl; make libvgagl.a; cd ..)
mv -f src/libvga.a .	# Stupid mkstubs syntax makes this necessary
mv -f gl/libvgagl.a .
mkstubs -a 0x63b00000 -l libvga -v $VERSION -j 0x00001000 -g 4096 \
	-- libvga
mkstubs -a 0x63b00000 -l libvga -v $VERSION -j 0x00001000 -g 4096 \
	-- libvgagl
mkimage -a 0x63b00000 -l libvga -v $VERSION -j 0x00001000 -g 4096 \
	-- libvga.a libvgagl.a `gcc --print` -lc	# for libc >= 4.5.8
rm -f libvga.a
rm -f libvgagl.a
strip libvga.so.$VERSION
mv -f libvga.so.$VERSION sharedlib/libvga.so.$VERSION
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 everywhere before building static libraries.
