From 6e2e0e061ff1974b35cd171e085b9920d770e7d9 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Thu, 23 Apr 2015 13:43:30 +0200 Subject: automatically distclean internally generated artifacts specifically, .prl, .pc, and .la files, and QMAKE_SUBSTITUTES outputs. Change-Id: I27685125668f0ec2aa81a8f003d3605accf2ab36 Reviewed-by: Joerg Bornemann --- qmake/generators/makefile.cpp | 10 ++++++++-- qmake/generators/unix/unixmake2.cpp | 4 +++- 2 files changed, 11 insertions(+), 3 deletions(-) (limited to 'qmake') 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(); diff --git a/qmake/generators/unix/unixmake2.cpp b/qmake/generators/unix/unixmake2.cpp index 5058ce2914..50eb93cda9 100644 --- a/qmake/generators/unix/unixmake2.cpp +++ b/qmake/generators/unix/unixmake2.cpp @@ -1411,7 +1411,9 @@ UnixMakefileGenerator::writeLibtoolFile() 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); t << "# " << lname << " - a libtool library file\n"; -- cgit v1.2.3