#! sh

# Frontend for geninclude.pl.
# 
# Copy operation may take a while. To speed up
# use a cache programm.
#
# Please change these paths for your setup.

SOURCEDIR=/gg
DESTDIR=/ram

#
#

echo Generating script for os-includes ...
(cd $SOURCEDIR; find os-include -type d -printf "$DESTDIR/%p\n" | xargs mkdir -p)
(cd $SOURCEDIR; find os-include -iname *.h -printf "perl geninclude.pl >$DESTDIR/%p $SOURCEDIR/%p\n" >T:geninclude)

. /T/geninclude

echo Generating script for ixemul-includes ...
(cd $SOURCEDIR; find include -type d -printf "$DESTDIR/%p\n" | xargs mkdir -p)
(cd $SOURCEDIR; find include -iname *.h -printf "perl geninclude.pl >$DESTDIR/%p $SOURCEDIR/%p\n" | grep -v pragmas | grep -v inline >T:geninclude)
(cd $SOURCEDIR; find include -iname *.def -printf "perl geninclude.pl >$DESTDIR/%p $SOURCEDIR/%p\n" | grep -v pragmas | grep -v inline >>T:geninclude)

. /T/geninclude

echo Done.
echo
echo Don't forget to copy powerup-includes into the include directory

rm -f /T/geninclude
