--- /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=GreenCard \r
+# foo$ cd gc-<version>\r
+# foo$ ../distrib/prep-bin-dist-mingw-greencard <ghc-dir>\r
+#\r
+\r
+echo "In prep-bin-dist-mingw-greencard $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 ghc-<version> ; ../distrib/prep-bin-dist-mingw-greencard <ghc-bin-dist-dir>"\r
+ exit 1;\r
+fi;\r
+\r
+echo "rejig bin/"\r
+cp bin/i386-unknown-mingw32/green-card.exe $binary_dir/bin\r
+strip $binary_dir/bin/green-card.exe\r
+\r
+echo "rejig lib/"\r
+cp lib/i386-unknown-mingw32/* $binary_dir\r
+\r
+echo "rejig share/"\r
+cp share/* $binary_dir\r