diff --git a/qmake/generators/win32/mingw_make.cpp b/qmake/generators/win32/mingw_make.cpp index 8d5a9a7d0fc..b9895fb10dc 100644 --- a/qmake/generators/win32/mingw_make.cpp +++ b/qmake/generators/win32/mingw_make.cpp @@ -36,6 +36,12 @@ #include #include +#ifdef Q_OS_WIN +#define NULL_DEVICE "NUL" +#else +#define NULL_DEVICE "/dev/null" +#endif + QT_BEGIN_NAMESPACE MingwMakefileGenerator::MingwMakefileGenerator() : Win32MakefileGenerator() @@ -318,6 +324,7 @@ void MingwMakefileGenerator::writeBuildRulesPart(QTextStream &t) if(!project->isEmpty("QMAKE_PRE_LINK")) t << "\n\t" <isActiveConfig("staticlib") && project->first("TEMPLATE") == "lib") { + t << "\n\t-$(DEL_FILE) $(DESTDIR_TARGET) 2>" NULL_DEVICE; if (project->values("OBJECTS").count() < var("QMAKE_LINK_OBJECT_MAX").toInt()) { t << "\n\t$(LIB) $(DESTDIR_TARGET) " << objectsLinkLine << " " ; } else {