#!/bin/sh

set-gcc gcc4

cd core
make clean
make
cd ..

cd modules
make clean
make
cd ..

rm -r haiku-distro/*
mkdir -p haiku-distro/apps/bennugd/lib

cp core/bgdc/src/bgdc haiku-distro/apps/bennugd/
cp core/bgdi/src/.libs/bgdi haiku-distro/apps/bennugd/
cp core/bgdrtm/src/.libs/*.so haiku-distro/apps/bennugd/lib/

cp $(find modules -iname '*.so') haiku-distro/apps/bennugd/lib/

cd haiku-distro
zip -r ../bennugd-haiku-gcc4.zip apps
cd ..
