#
#
#	Take includes from V/include, fixheader them, and
#	dump them in $destpath.  A real kludge.  -Bryce
#

cd /usr/commodore/amiga/V/include

set dest=/usr/commodore/amiga/V/disk/support/
set destpath=/usr/commodore/amiga/V/disk/support/include.test

rm -r $destpath
mkdir >/dev/null $destpath

foreach dir (clib devices dos exec graphics hardware intuition libraries resources rexx utility workbench)
	echo "Working on directory $dir"
	mkdir $destpath/$dir


	foreach file ($dir/*)

		echo "# Fixing file $file #"
		/usr/commodore/bin/FixHeader $file -o $destpath/$file "2.04" -t

	end

end

echo "------------------- copying fd files -----------------------------------"
mkdir >/dev/null $dest/fd
cp /usr/commodore/amiga/V/fd/* $dest/fd

echo "------------------- copying .libs ---------------------------------------"
mkdir >/dev/null $dest/linker_libs
cp /usr/commodore/amiga/V/lib/amiga.lib $dest/linker_libs
cp /usr/commodore/amiga/V/lib/small.lib $dest/linker_libs
cp /usr/commodore/amiga/V/lib/debug.lib $dest/linker_libs
cp /usr/commodore/amiga/V/lib/ddebug.lib $dest/linker_libs

#echo "------------------There should be no SHORT's in our includes------------"
#cd $destpath
#fgrep -i  "short	" */*.h
#fgrep -i  "short " */*.h

#echo "------------------There should be no enums in our includes--------------"
#cd $destpath
#fgrep enum */*.h
