diff --git a/qmake/generators/makefile.cpp b/qmake/generators/makefile.cpp index 98b5a328e4..f68e283862 100644 --- a/qmake/generators/makefile.cpp +++ b/qmake/generators/makefile.cpp @@ -2202,6 +2202,24 @@ MakefileGenerator::writeExtraVariables(QTextStream &t) } } +bool +MakefileGenerator::writeDummyMakefile(QTextStream &t) +{ + if (project->values("QMAKE_FAILED_REQUIREMENTS").isEmpty()) + return false; + t << "QMAKE = " << var("QMAKE_QMAKE") << endl; + const ProStringList &qut = project->values("QMAKE_EXTRA_TARGETS"); + for (ProStringList::ConstIterator it = qut.begin(); it != qut.end(); ++it) + t << *it << " "; + t << "first all clean install distclean uninstall qmake_all:\n\t" + << "@echo \"Some of the required modules (" + << var("QMAKE_FAILED_REQUIREMENTS") << ") are not available.\"\n\t" + << "@echo \"Skipped.\"\n\n"; + writeMakeQmake(t); + t << "FORCE:\n\n"; + return true; +} + bool MakefileGenerator::writeStubMakefile(QTextStream &t) { diff --git a/qmake/generators/makefile.h b/qmake/generators/makefile.h index 47acc8098f..09327c599c 100644 --- a/qmake/generators/makefile.h +++ b/qmake/generators/makefile.h @@ -104,6 +104,7 @@ protected: void writeExtraTargets(QTextStream &t); void writeExtraCompilerTargets(QTextStream &t); void writeExtraCompilerVariables(QTextStream &t); + bool writeDummyMakefile(QTextStream &t); virtual bool writeStubMakefile(QTextStream &t); virtual bool writeMakefile(QTextStream &t); diff --git a/qmake/generators/unix/unixmake2.cpp b/qmake/generators/unix/unixmake2.cpp index cd6f441472..2373059f79 100644 --- a/qmake/generators/unix/unixmake2.cpp +++ b/qmake/generators/unix/unixmake2.cpp @@ -80,19 +80,8 @@ UnixMakefileGenerator::writeMakefile(QTextStream &t) { writeHeader(t); - if(!project->values("QMAKE_FAILED_REQUIREMENTS").isEmpty()) { - t << "QMAKE = " << var("QMAKE_QMAKE") << endl; - const ProStringList &qut = project->values("QMAKE_EXTRA_TARGETS"); - for (ProStringList::ConstIterator it = qut.begin(); it != qut.end(); ++it) - t << *it << " "; - t << "first all clean install distclean uninstall qmake_all:\n\t" - << "@echo \"Some of the required modules (" - << var("QMAKE_FAILED_REQUIREMENTS") << ") are not available.\"\n\t" - << "@echo \"Skipped.\"\n\n"; - writeMakeQmake(t); - t << "FORCE:\n\n"; + if (writeDummyMakefile(t)) return true; - } if (project->values("TEMPLATE").first() == "app" || project->values("TEMPLATE").first() == "lib" || diff --git a/qmake/generators/win32/mingw_make.cpp b/qmake/generators/win32/mingw_make.cpp index 38e6c56bb5..29b27cb7d7 100644 --- a/qmake/generators/win32/mingw_make.cpp +++ b/qmake/generators/win32/mingw_make.cpp @@ -114,14 +114,8 @@ bool MingwMakefileGenerator::findLibraries() bool MingwMakefileGenerator::writeMakefile(QTextStream &t) { writeHeader(t); - if(!project->values("QMAKE_FAILED_REQUIREMENTS").isEmpty()) { - t << "all clean:\n\t" - << "@echo \"Some of the required modules (" - << var("QMAKE_FAILED_REQUIREMENTS") << ") are not available.\"\n\t" - << "@echo \"Skipped.\"\n\n"; - writeMakeQmake(t); + if (writeDummyMakefile(t)) return true; - } if(project->first("TEMPLATE") == "app" || project->first("TEMPLATE") == "lib" || diff --git a/qmake/generators/win32/msvc_nmake.cpp b/qmake/generators/win32/msvc_nmake.cpp index 8af80e572e..f7b85d3621 100644 --- a/qmake/generators/win32/msvc_nmake.cpp +++ b/qmake/generators/win32/msvc_nmake.cpp @@ -58,17 +58,8 @@ bool NmakeMakefileGenerator::writeMakefile(QTextStream &t) { writeHeader(t); - if(!project->values("QMAKE_FAILED_REQUIREMENTS").isEmpty()) { - const ProStringList &qut = project->values("QMAKE_EXTRA_TARGETS"); - for (ProStringList::ConstIterator it = qut.begin(); it != qut.end(); ++it) - t << *it << " "; - t << "all first clean:\n\t" - << "@echo \"Some of the required modules (" - << var("QMAKE_FAILED_REQUIREMENTS") << ") are not available.\"\n\t" - << "@echo \"Skipped.\"\n\n"; - writeMakeQmake(t); + if (writeDummyMakefile(t)) return true; - } if(project->first("TEMPLATE") == "app" || project->first("TEMPLATE") == "lib" ||