diff --git a/mkspecs/common/shell-unix.conf b/mkspecs/common/shell-unix.conf index a89486723f6..967a658cff8 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 ee137544dc8..16f86e5e271 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 7b296151f2b..a14e7233f69 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 44fba2d93b1..3a41fb4a9a5 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 &);