summaryrefslogtreecommitdiffstats
path: root/qmake/generators/makefile.cpp
diff options
context:
space:
mode:
authorSamuel Rødal <samuel.rodal@digia.com>2013-03-21 08:18:12 +0100
committerOswald Buddenhagen <oswald.buddenhagen@digia.com>2013-03-21 08:49:01 +0100
commit2ab9b747fcc5aa50e8cca758f7780158e734a222 (patch)
tree7017007823d54c2d658079e928f7220a1f57a852 /qmake/generators/makefile.cpp
parentf1e681bed21e131864fe1e1c91679f7a56b06823 (diff)
parent8bfbaa41783dad66976fc83d4ca8c7e2673f5629 (diff)
Merge remote-tracking branch 'gerrit/release' into stable
Conflicts: configure mkspecs/features/qt_module_headers.prf mkspecs/features/qt_tool.prf src/angle/angle.pro src/tools/bootstrap/bootstrap.pro tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp Change-Id: Ide5759fe419a50f1c944211a48f7c66f662684e0
Diffstat (limited to 'qmake/generators/makefile.cpp')
-rw-r--r--qmake/generators/makefile.cpp36
1 files changed, 15 insertions, 21 deletions
diff --git a/qmake/generators/makefile.cpp b/qmake/generators/makefile.cpp
index 3cac073d72..5a5f259358 100644
--- a/qmake/generators/makefile.cpp
+++ b/qmake/generators/makefile.cpp
@@ -92,18 +92,8 @@ bool MakefileGenerator::canExecute(const QStringList &cmdline, int *a) const
QString MakefileGenerator::mkdir_p_asstring(const QString &dir, bool escape) const
{
- QString ret = "@" + chkdir + " ";
- if(escape)
- ret += escapeFilePath(dir);
- else
- ret += dir;
- ret += " " + chkglue + "$(MKDIR) ";
- if(escape)
- ret += escapeFilePath(dir);
- else
- ret += dir;
- ret += " ";
- return ret;
+ QString edir = escape ? escapeFilePath(dir) : dir;
+ return "@" + makedir.arg(edir);
}
bool MakefileGenerator::mkdir(const QString &in_path) const
@@ -440,13 +430,17 @@ MakefileGenerator::init()
if (v["TARGET"].isEmpty())
warn_msg(WarnLogic, "TARGET is empty");
- chkdir = v["QMAKE_CHK_DIR_EXISTS"].join(' ');
- chkfile = v["QMAKE_CHK_FILE_EXISTS"].join(' ');
- if (chkfile.isEmpty()) // Backwards compat with Qt4 specs
- chkfile = isWindowsShell() ? "if not exist" : "test -f";
- chkglue = v["QMAKE_CHK_EXISTS_GLUE"].join(' ');
- if (chkglue.isEmpty()) // Backwards compat with Qt4 specs
- chkglue = isWindowsShell() ? "" : "|| ";
+ makedir = v["QMAKE_MKDIR_CMD"].join(' ');
+ chkexists = v["QMAKE_CHK_EXISTS"].join(' ');
+ if (makedir.isEmpty()) { // Backwards compat with Qt < 5.0.2 specs
+ if (isWindowsShell()) {
+ makedir = "if not exist %1 mkdir %1 & if not exist %1 exit 1";
+ chkexists = "if not exist %1";
+ } else {
+ makedir = "test -d %1 || mkdir -p %1";
+ chkexists = "test -e %1 ||";
+ }
+ }
if (v["QMAKE_LINK_O_FLAG"].isEmpty())
v["QMAKE_LINK_O_FLAG"].append("-o ");
@@ -2401,8 +2395,8 @@ MakefileGenerator::writeSubTargetCall(QTextStream &t,
if (!in.isEmpty()) {
if (!in_directory.isEmpty())
t << "\n\t" << mkdir_p_asstring(out_directory);
- pfx = "( " + chkfile + " " + out + " " + chkglue
- + "$(QMAKE) " + in + buildArgs() + " -o " + out
+ pfx = "( " + chkexists.arg(out) +
+ + " $(QMAKE) " + in + buildArgs() + " -o " + out
+ " ) && ";
}
writeSubMakeCall(t, out_directory_cdin + pfx, makefilein);