Index: trunk/qmake/generators/win32/winmakefile.cpp
===================================================================
--- trunk/qmake/generators/win32/winmakefile.cpp	(revision 36)
+++ trunk/qmake/generators/win32/winmakefile.cpp	(revision 37)
@@ -486,4 +486,15 @@
 void Win32MakefileGenerator::writeCleanParts(QTextStream &t)
 {
+    const QString del_statement("-$(DEL_FILE)");
+    const QString del_suffix =
+        Option::target_mode == Option::TARG_OS2_MODE ?
+        QString(" >nul 2>&1"): // reduce noise
+        QString::null;
+
+    const int commandlineLimit =
+        Option::target_mode == Option::TARG_OS2_MODE ?
+        1024: // OS/2 CMD.EXE limit
+        2047; // NT limit, expanded
+
     t << "clean: compiler_clean " << var("CLEAN_DEPS");
     {
@@ -491,16 +502,15 @@
         for(int i = 0; clean_targets[i]; ++i) {
             const QStringList &list = project->values(clean_targets[i]);
-            const QString del_statement("-$(DEL_FILE)");
             if(project->isActiveConfig("no_delete_multiple_files")) {
                 for(QStringList::ConstIterator it = list.begin(); it != list.end(); ++it)
-                    t << "\n\t" << del_statement << " " << escapeFilePath((*it));
+                    t << "\n\t" << del_statement << " " << escapeFilePath((*it)) << del_suffix;
             } else {
                 QString files, file;
-                const int commandlineLimit = 2047; // NT limit, expanded
                 for(QStringList::ConstIterator it = list.begin(); it != list.end(); ++it) {
                     file = " " + escapeFilePath((*it));
                     if(del_statement.length() + files.length() +
-                       qMax(fixEnvVariables(file).length(), file.length()) > commandlineLimit) {
-                        t << "\n\t" << del_statement << files;
+                       qMax(fixEnvVariables(file).length(), file.length()) > commandlineLimit &&
+                       !files.isEmpty()) {
+                        t << "\n\t" << del_statement << files << del_suffix;
                         files.clear();
                     }
@@ -508,5 +518,5 @@
                 }
                 if(!files.isEmpty())
-                    t << "\n\t" << del_statement << files;
+                    t << "\n\t" << del_statement << files << del_suffix;
             }
         }
@@ -519,16 +529,15 @@
         for(int i = 0; clean_targets[i]; ++i) {
             const QStringList &list = project->values(clean_targets[i]);
-            const QString del_statement("-$(DEL_FILE)");
             if(project->isActiveConfig("no_delete_multiple_files")) {
                 for(QStringList::ConstIterator it = list.begin(); it != list.end(); ++it)
-                    t << "\n\t" << del_statement << " " << escapeFilePath((*it));
+                    t << "\n\t" << del_statement << " " << escapeFilePath((*it)) << del_suffix;
             } else {
                 QString files, file;
-                const int commandlineLimit = 2047; // NT limit, expanded
                 for(QStringList::ConstIterator it = list.begin(); it != list.end(); ++it) {
                     file = " " + escapeFilePath((*it));
                     if(del_statement.length() + files.length() +
-                       qMax(fixEnvVariables(file).length(), file.length()) > commandlineLimit) {
-                        t << "\n\t" << del_statement << files;
+                       qMax(fixEnvVariables(file).length(), file.length()) > commandlineLimit &&
+                       !files.isEmpty()) {
+                        t << "\n\t" << del_statement << files << del_suffix;
                         files.clear();
                     }
@@ -536,13 +545,13 @@
                 }
                 if(!files.isEmpty())
-                    t << "\n\t" << del_statement << files;
+                    t << "\n\t" << del_statement << files << del_suffix;
             }
         }
     }
-    t << "\n\t-$(DEL_FILE) $(DESTDIR_TARGET)" << endl;
+    t << "\n\t" << del_statement << " $(DESTDIR_TARGET)" << del_suffix << endl;
     {
         QString ofile = Option::fixPathToTargetOS(fileFixify(Option::output.fileName()));
         if(!ofile.isEmpty())
-            t << "\t-$(DEL_FILE) " << ofile << endl;
+            t << "\t" << del_statement << " " << ofile << del_suffix << endl;
     }
     t << endl;
