Skip to content

Commit

Permalink
qmake: Suppress built-in suffixes for make
Browse files Browse the repository at this point in the history
They cause make to run much slower, and qmake writes everything
explicitly, so they're not really needed.

Change-Id: Ia47674eec8309e120c8264b7b6687677a520d5b9
Reviewed-by: Qt CI Bot <[email protected]>
Reviewed-by: Jörg Bornemann <[email protected]>
  • Loading branch information
orgads committed Mar 31, 2022
1 parent 4114a0e commit 48ef124
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 0 deletions.
9 changes: 9 additions & 0 deletions qmake/generators/makefile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2243,6 +2243,7 @@ MakefileGenerator::writeDummyMakefile(QTextStream &t)
<< "@echo \"Skipped.\"\n\n";
writeMakeQmake(t);
t << "FORCE:\n\n";
suppressBuiltinRules(t);
return true;
}

Expand All @@ -2257,6 +2258,7 @@ MakefileGenerator::writeMakefile(QTextStream &t)
writeInstalls(t);

t << "FORCE:\n\n";
suppressBuiltinRules(t);
return true;
}

Expand Down Expand Up @@ -2778,6 +2780,13 @@ MakefileGenerator::writeSubTargets(QTextStream &t, QList<MakefileGenerator::SubT
writeInstalls(t, true);
}
t << "FORCE:\n\n";
suppressBuiltinRules(t);
}

void
MakefileGenerator::suppressBuiltinRules(QTextStream &t) const
{
t << ".SUFFIXES:\n\n";
}

void
Expand Down
1 change: 1 addition & 0 deletions qmake/generators/makefile.h
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ class MakefileGenerator : protected QMakeSourceFileInfo
void writeSubTargetCall(QTextStream &t,
const QString &in_directory, const QString &in, const QString &out_directory, const QString &out,
const QString &out_directory_cdin, const QString &makefilein);
virtual void suppressBuiltinRules(QTextStream &t) const;
virtual void writeSubMakeCall(QTextStream &t, const QString &outDirectory_cdin,
const QString &makeFileIn);
virtual void writeSubTargets(QTextStream &t, QList<SubTarget*> subtargets, int flags);
Expand Down
4 changes: 4 additions & 0 deletions qmake/generators/win32/msvc_nmake.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,10 @@ QString NmakeMakefileGenerator::var(const ProKey &value) const
return MakefileGenerator::var(value);
}

void NmakeMakefileGenerator::suppressBuiltinRules(QTextStream &t) const
{
}

void NmakeMakefileGenerator::init()
{
/* this should probably not be here, but I'm using it to wrap the .t files */
Expand Down
1 change: 1 addition & 0 deletions qmake/generators/win32/msvc_nmake.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ class NmakeMakefileGenerator : public Win32MakefileGenerator
QString defaultInstall(const QString &t) override;
QStringList &findDependencies(const QString &file) override;
QString var(const ProKey &value) const override;
void suppressBuiltinRules(QTextStream &t) const override;
QString precompH, precompObj, precompPch;
QString precompObjC, precompPchC;
bool usePCH = false;
Expand Down

0 comments on commit 48ef124

Please sign in to comment.