diff --git a/build/bakefiles/Bakefiles.bkgen b/build/bakefiles/Bakefiles.bkgen
index 358c96d55d..97c32e6071 100644
--- a/build/bakefiles/Bakefiles.bkgen
+++ b/build/bakefiles/Bakefiles.bkgen
@@ -21,9 +21,11 @@
be placed into build/msw(?) directory and store object files
in its subdirectory and it must copy setup.h as others do.
cbx_unix - Doesn't integrate well and won't be used by most Unix people.
+ dmars, dmars_smake, msevc4prj - These are generated at release time and
+ we don't want to clutter the source tree with these files.
-->
- cbx_unix,cbuilderx
+ dmars,dmars_smake,msevc4prj,cbx_unix,cbuilderx
diff --git a/distrib/scripts/Bakefiles.release.bkgen b/distrib/scripts/Bakefiles.release.bkgen
new file mode 100644
index 0000000000..2495c3c75c
--- /dev/null
+++ b/distrib/scripts/Bakefiles.release.bkgen
@@ -0,0 +1,6 @@
+
+
+ Ê
+ Ê
+ Ê dmars,dmars_smake,msevc4prj
+
\ No newline at end of file
diff --git a/distrib/scripts/pre-flight.sh b/distrib/scripts/pre-flight.sh
index 3b296a51ff..c728d9cfbb 100755
--- a/distrib/scripts/pre-flight.sh
+++ b/distrib/scripts/pre-flight.sh
@@ -43,7 +43,7 @@ fi
#re-bake the bakefiles
if [ $rebake = "yes" ]; then
cd $WX_SRC_DIR/build/bakefiles
- bakefile_gen
+ bakefile_gen -d ../../distrib/scripts/Bakefiles.release.bkgen
fi
cd $WX_SRC_DIR