de-duplicate code for writing dummy makefiles
as a side effect, this fixes the generators that were more bitrotted (nmake and even more mingw). Task-number: QTBUG-30644 #close Change-Id: Iefa3f07125884412d091aa12b44935e5b1fb858a Reviewed-by: Rafael Roquetto <rafael.roquetto@kdab.com> Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
This commit is contained in:
parent
ad4bda8b75
commit
b7f7edfae4
@ -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
|
bool
|
||||||
MakefileGenerator::writeStubMakefile(QTextStream &t)
|
MakefileGenerator::writeStubMakefile(QTextStream &t)
|
||||||
{
|
{
|
||||||
|
@ -104,6 +104,7 @@ protected:
|
|||||||
void writeExtraTargets(QTextStream &t);
|
void writeExtraTargets(QTextStream &t);
|
||||||
void writeExtraCompilerTargets(QTextStream &t);
|
void writeExtraCompilerTargets(QTextStream &t);
|
||||||
void writeExtraCompilerVariables(QTextStream &t);
|
void writeExtraCompilerVariables(QTextStream &t);
|
||||||
|
bool writeDummyMakefile(QTextStream &t);
|
||||||
virtual bool writeStubMakefile(QTextStream &t);
|
virtual bool writeStubMakefile(QTextStream &t);
|
||||||
virtual bool writeMakefile(QTextStream &t);
|
virtual bool writeMakefile(QTextStream &t);
|
||||||
|
|
||||||
|
@ -80,19 +80,8 @@ UnixMakefileGenerator::writeMakefile(QTextStream &t)
|
|||||||
{
|
{
|
||||||
|
|
||||||
writeHeader(t);
|
writeHeader(t);
|
||||||
if(!project->values("QMAKE_FAILED_REQUIREMENTS").isEmpty()) {
|
if (writeDummyMakefile(t))
|
||||||
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;
|
return true;
|
||||||
}
|
|
||||||
|
|
||||||
if (project->values("TEMPLATE").first() == "app" ||
|
if (project->values("TEMPLATE").first() == "app" ||
|
||||||
project->values("TEMPLATE").first() == "lib" ||
|
project->values("TEMPLATE").first() == "lib" ||
|
||||||
|
@ -114,14 +114,8 @@ bool MingwMakefileGenerator::findLibraries()
|
|||||||
bool MingwMakefileGenerator::writeMakefile(QTextStream &t)
|
bool MingwMakefileGenerator::writeMakefile(QTextStream &t)
|
||||||
{
|
{
|
||||||
writeHeader(t);
|
writeHeader(t);
|
||||||
if(!project->values("QMAKE_FAILED_REQUIREMENTS").isEmpty()) {
|
if (writeDummyMakefile(t))
|
||||||
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);
|
|
||||||
return true;
|
return true;
|
||||||
}
|
|
||||||
|
|
||||||
if(project->first("TEMPLATE") == "app" ||
|
if(project->first("TEMPLATE") == "app" ||
|
||||||
project->first("TEMPLATE") == "lib" ||
|
project->first("TEMPLATE") == "lib" ||
|
||||||
|
@ -58,17 +58,8 @@ bool
|
|||||||
NmakeMakefileGenerator::writeMakefile(QTextStream &t)
|
NmakeMakefileGenerator::writeMakefile(QTextStream &t)
|
||||||
{
|
{
|
||||||
writeHeader(t);
|
writeHeader(t);
|
||||||
if(!project->values("QMAKE_FAILED_REQUIREMENTS").isEmpty()) {
|
if (writeDummyMakefile(t))
|
||||||
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);
|
|
||||||
return true;
|
return true;
|
||||||
}
|
|
||||||
|
|
||||||
if(project->first("TEMPLATE") == "app" ||
|
if(project->first("TEMPLATE") == "app" ||
|
||||||
project->first("TEMPLATE") == "lib" ||
|
project->first("TEMPLATE") == "lib" ||
|
||||||
|
Loading…
Reference in New Issue
Block a user