From 5290f6df89027374248e8c117ceb6f9165370f60 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Fri, 18 May 2012 20:44:01 +0200 Subject: [PATCH] introduce $$QMAKE_CHK_EXISTS_GLUE instead of hard-coding platform differences, use a variable. Change-Id: I20e98811ad5f07429148c6f88aedbabc3ba58fff Reviewed-by: Joerg Bornemann --- mkspecs/common/shell-unix.conf | 1 + mkspecs/common/shell-win32.conf | 1 + qmake/generators/makefile.cpp | 10 ++++------ qmake/generators/makefile.h | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/mkspecs/common/shell-unix.conf b/mkspecs/common/shell-unix.conf index a89486723f..967a658cff 100644 --- a/mkspecs/common/shell-unix.conf +++ b/mkspecs/common/shell-unix.conf @@ -8,5 +8,6 @@ QMAKE_MOVE = mv -f QMAKE_DEL_FILE = rm -f QMAKE_DEL_DIR = rmdir QMAKE_CHK_DIR_EXISTS = test -d +QMAKE_CHK_EXISTS_GLUE = "|| " QMAKE_MKDIR = mkdir -p QMAKE_STREAM_EDITOR = sed diff --git a/mkspecs/common/shell-win32.conf b/mkspecs/common/shell-win32.conf index ee137544dc..16f86e5e27 100644 --- a/mkspecs/common/shell-win32.conf +++ b/mkspecs/common/shell-win32.conf @@ -6,4 +6,5 @@ QMAKE_MOVE = move QMAKE_DEL_FILE = del QMAKE_DEL_DIR = rmdir QMAKE_CHK_DIR_EXISTS = if not exist +QMAKE_CHK_EXISTS_GLUE = QMAKE_MKDIR = mkdir diff --git a/qmake/generators/makefile.cpp b/qmake/generators/makefile.cpp index 7b296151f2..a14e7233f6 100644 --- a/qmake/generators/makefile.cpp +++ b/qmake/generators/makefile.cpp @@ -98,12 +98,7 @@ QString MakefileGenerator::mkdir_p_asstring(const QString &dir, bool escape) con ret += escapeFilePath(dir); else ret += dir; - ret += " "; - if(isWindowsShell()) - ret += "$(MKDIR)"; - else - ret += "|| $(MKDIR)"; - ret += " "; + ret += " " + chkglue + "$(MKDIR) "; if(escape) ret += escapeFilePath(dir); else @@ -433,6 +428,9 @@ MakefileGenerator::init() QHash &v = project->variables(); chkdir = v["QMAKE_CHK_DIR_EXISTS"].join(" "); + chkglue = v["QMAKE_CHK_EXISTS_GLUE"].join(" "); + if (chkglue.isEmpty()) // Backwards compat with Qt4 specs + chkglue = isWindowsShell() ? "" : "|| "; QStringList &quc = v["QMAKE_EXTRA_COMPILERS"]; diff --git a/qmake/generators/makefile.h b/qmake/generators/makefile.h index 44fba2d93b..3a41fb4a9a 100644 --- a/qmake/generators/makefile.h +++ b/qmake/generators/makefile.h @@ -81,7 +81,7 @@ class MakefileGenerator : protected QMakeSourceFileInfo QString spec; bool init_opath_already, init_already, no_io; QHash init_compiler_already; - QString chkdir; + QString chkdir, chkglue; QString build_args(const QString &outdir=QString()); void checkMultipleDefinition(const QString &, const QString &);