diff options
author | Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> | 2015-04-23 13:43:30 +0200 |
---|---|---|
committer | Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> | 2015-04-23 19:16:54 +0000 |
commit | 6e2e0e061ff1974b35cd171e085b9920d770e7d9 (patch) | |
tree | 668ef6dfea1e9c8b1b2bd4770259aa96567ad648 /qmake/generators/makefile.cpp | |
parent | 0ce189d20f0c7307382c868eafb10c4744347b56 (diff) |
automatically distclean internally generated artifacts
specifically, .prl, .pc, and .la files, and QMAKE_SUBSTITUTES outputs.
Change-Id: I27685125668f0ec2aa81a8f003d3605accf2ab36
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
Diffstat (limited to 'qmake/generators/makefile.cpp')
-rw-r--r-- | qmake/generators/makefile.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/qmake/generators/makefile.cpp b/qmake/generators/makefile.cpp index 2106d0869b..f5e8248af5 100644 --- a/qmake/generators/makefile.cpp +++ b/qmake/generators/makefile.cpp @@ -573,10 +573,12 @@ MakefileGenerator::init() contentBytes = contents.toUtf8(); } QFile out(outn); + QFileInfo outfi(out); if (out.exists() && out.open(QFile::ReadOnly)) { QByteArray old = out.readAll(); if (contentBytes == old) { v["QMAKE_INTERNAL_INCLUDED_FILES"].append(in.fileName()); + v["QMAKE_DISTCLEAN"].append(outfi.absoluteFilePath()); continue; } out.close(); @@ -586,9 +588,10 @@ MakefileGenerator::init() continue; } } - mkdir(QFileInfo(out).absolutePath()); + mkdir(outfi.absolutePath()); if(out.open(QFile::WriteOnly)) { v["QMAKE_INTERNAL_INCLUDED_FILES"].append(in.fileName()); + v["QMAKE_DISTCLEAN"].append(outfi.absoluteFilePath()); out.write(contentBytes); } else { warn_msg(WarnLogic, "Cannot open substitute for output '%s'", @@ -1121,6 +1124,7 @@ MakefileGenerator::writePrlFile() if(ft.open(QIODevice::WriteOnly)) { project->values("ALL_DEPS").append(prl); project->values("QMAKE_INTERNAL_PRL_FILE").append(prl); + project->values("QMAKE_DISTCLEAN").append(prl); QTextStream t(&ft); writePrlFile(t); } @@ -3160,7 +3164,9 @@ MakefileGenerator::writePkgConfigFile() QFile ft(fname); if(!ft.open(QIODevice::WriteOnly)) return; - project->values("ALL_DEPS").append(fileFixify(fname)); + QString ffname(fileFixify(fname)); + project->values("ALL_DEPS").append(ffname); + project->values("QMAKE_DISTCLEAN").append(ffname); QTextStream t(&ft); QString prefix = pkgConfigPrefix(); |