--- /dev/null
+#!/bin/sh\r
+#\r
+# Running 'binary-dist' gives us a tree which\r
+# isn't quite right for the purposes of creating\r
+# a mingw/win32 install tree. This script rejigs\r
+# the tree.\r
+#\r
+# To use:\r
+#\r
+# foo$ cd <top of fptools build tree>\r
+# foo$ make binary-dist Project=Ghc \r
+# foo$ cd ghc-<version>\r
+# foo$ ../distrib/prep-bin-dist-mingw-hdirect <ghc-bin-dist-dir>\r
+#\r
+\r
+echo "In prep-bin-dist-mingw-hdirect $1"\r
+binary_dir=../$1\r
+\r
+# Play safe\r
+if ! [ -d bin/i386-unknown-mingw32 ] ; then\r
+ echo "Doesn't look as if I'm in the toplevel directory of a mingw tree"\r
+ echo "Usage: cd <project>-<version> ; ../distrib/prep-bin-dist-mingw-hdirect"\r
+ exit 1;\r
+fi;\r
+\r
+echo "rejig bin/"\r
+cp bin/i386-unknown-mingw32/ihc.exe $binary_dir/bin\r
+strip $binary_dir/bin/ihc.exe\r
+\r
+echo "rejig lib/"\r
+cp -r lib/i386-unknown-mingw32/imports/* $binary_dir/imports\r
+cp lib/i386-unknown-mingw32/*.o $binary_dir\r
+cp lib/i386-unknown-mingw32/*.a $binary_dir\r