+if PLATFORM_WIN32
+plat_bindir = $(shell cygpath -m $(libdir))
+mono_one_instdir = $(shell cygpath -m $(libdir))/mono/1.0
+monO_two_instdir = $(shell cygpath -m $(libdir))/mono/2.0
+else
+plat_bindir = $(bindir)
+mono_one_instdir = $(libdir)/mono/1.0
+mono_two_instdir = $(libdir)/mono/2.0
+endif
+
+REWRITE = sed \
+ -e 's,@''bindir@,$(bindir),g' \
+ -e 's,@''plat_bindir@,$(plat_bindir),g' \
+ -e 's,@''mono_one_instdir@,$(mono_one_instdir),g' \
+ -e 's,@''mono_two_instdir@,$(mono_two_instdir),g' \
+ -e 's,@''gtkdir@,$(gtkdir),g' \
+ -e 's,@''mono_interp@,$(MONO_INTERP),g'
+
+$(bin_SCRIPTS): Makefile.am
+ $(REWRITE) $(srcdir)/$@.in > $@.tmp
+ mv $@.tmp $@
+