#! 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=$1
DESTDIR=$2

#
#

echo Generating script for os-includes ...

(cd $SOURCEDIR; find ./ -type d -printf "mkdir -p $DESTDIR/%p\n" >/tmp/geninclude_mscript)
echo Start mkdir script...
sh /tmp/geninclude_mscript

#(cd $SOURCEDIR; find ./ -iname *.h -printf "perl ../emultools/geninclude.pl >$DESTDIR/%p $SOURCEDIR/%p\n" >/tmp/geninclude_script)
(cd $SOURCEDIR; find ./ -iname *.h -printf "perl ../emultools/geninclude.pl >$DESTDIR/%p $SOURCEDIR/%p\n" | grep -v pragmas | grep -v inline >/tmp/geninclude_script)
echo Start convert script...
sh /tmp/geninclude_script

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

#sh ./geninclude_script

echo Done
#rm -f ./geninclude_script







