From 18a36fd6eccf97b46e0c28d4deaf0edb42d523fc Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Tue, 10 Dec 2013 19:28:26 -0800 Subject: PCH stands for "precompiled header", not "prefix" Change-Id: Ied8148be931992247e446719a0eaeec0dc868330 Reviewed-by: Oswald Buddenhagen --- qmake/generators/unix/unixmake2.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'qmake/generators/unix/unixmake2.cpp') diff --git a/qmake/generators/unix/unixmake2.cpp b/qmake/generators/unix/unixmake2.cpp index 7ed89e23d73..c25bd3ca084 100644 --- a/qmake/generators/unix/unixmake2.cpp +++ b/qmake/generators/unix/unixmake2.cpp @@ -936,7 +936,7 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t) if(doPrecompiledHeaders() && !project->isEmpty("PRECOMPILED_HEADER")) { QString pchInput = project->first("PRECOMPILED_HEADER").toQString(); - t << "###### Prefix headers\n"; + t << "###### Precompiled headers\n"; QString comps[] = { "C", "CXX", "OBJC", "OBJCXX", QString() }; for(int i = 0; !comps[i].isNull(); i++) { QString pchFlags = var(ProKey("QMAKE_" + comps[i] + "FLAGS_PRECOMPILE")); -- cgit v1.2.3 From 8fb497d1f49d382cd0a26e396bc17d1edd615fb4 Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Thu, 19 Dec 2013 15:12:00 +0100 Subject: qmake: do not include GENERATED_SOURCES to dist Task-number: QTBUG-21910 Change-Id: I4cc3f75f5ee4672f89b0b965055a02ac24c16cc8 Reviewed-by: Oswald Buddenhagen --- qmake/generators/unix/unixmake2.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'qmake/generators/unix/unixmake2.cpp') diff --git a/qmake/generators/unix/unixmake2.cpp b/qmake/generators/unix/unixmake2.cpp index c25bd3ca084..2ded28b64a9 100644 --- a/qmake/generators/unix/unixmake2.cpp +++ b/qmake/generators/unix/unixmake2.cpp @@ -210,7 +210,8 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t) } if(do_incremental && !src_incremental) do_incremental = false; - t << "DIST = " << valList(fileFixify(project->values("DISTFILES").toQStringList())) << endl; + t << "DIST = " << valList(fileFixify(project->values("DISTFILES").toQStringList())) << " " + << valList(escapeFilePaths(project->values("SOURCES"))) << endl; t << "QMAKE_TARGET = " << var("QMAKE_ORIG_TARGET") << endl; // The comment is important for mingw32-make.exe on Windows as otherwise trailing slashes // would be interpreted as line continuation. The lack of spacing between the value and the @@ -809,7 +810,7 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t) Option::output_dir, Option::output_dir)); t << "dist: \n\t" << mkdir_p_asstring(ddir_c, false) << "\n\t" - << "$(COPY_FILE) --parents $(SOURCES) $(DIST) " << ddir_c << Option::dir_sep << " && "; + << "$(COPY_FILE) --parents $(DIST) " << ddir_c << Option::dir_sep << " && "; if(!project->isEmpty("QMAKE_EXTRA_COMPILERS")) { const ProStringList &quc = project->values("QMAKE_EXTRA_COMPILERS"); for (ProStringList::ConstIterator it = quc.begin(); it != quc.end(); ++it) { -- cgit v1.2.3 From 154b5394657d6520cd5490000afb3e99de626096 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Tue, 10 Dec 2013 19:27:39 -0800 Subject: Move the SUBLIBS target from qmake away from between clean/distclean Right now, the sublib targets, if any, show up between clean and distclean targets. That's silly. I doubt anyone is using sublib targets anyway, but... Change-Id: I2beffc69f68fa7626ff4aa4a7cc1169b2c6c69a7 Reviewed-by: Oswald Buddenhagen --- qmake/generators/unix/unixmake2.cpp | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) (limited to 'qmake/generators/unix/unixmake2.cpp') diff --git a/qmake/generators/unix/unixmake2.cpp b/qmake/generators/unix/unixmake2.cpp index 2ded28b64a9..f905d40d4e9 100644 --- a/qmake/generators/unix/unixmake2.cpp +++ b/qmake/generators/unix/unixmake2.cpp @@ -898,17 +898,6 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t) t << varGlue("QMAKE_CLEAN","-$(DEL_FILE) "," ","\n\t") << "-$(DEL_FILE) *~ core *.core\n" << varGlue("CLEAN_FILES","\t-$(DEL_FILE) "," ","") << endl << endl; - t << "####### Sub-libraries\n\n"; - if (!project->values("SUBLIBS").isEmpty()) { - ProString libdir = "tmp/"; - if(!project->isEmpty("SUBLIBS_DIR")) - libdir = project->first("SUBLIBS_DIR"); - const ProStringList &l = project->values("SUBLIBS"); - for(it = l.begin(); it != l.end(); ++it) - t << libdir << project->first("QMAKE_PREFIX_STATICLIB") << (*it) << "." - << project->first("QMAKE_EXTENSION_STATICLIB") << ":\n\t" - << var(ProKey("MAKELIB" + *it)) << endl << endl; - } ProString destdir = project->first("DESTDIR"); if (!destdir.isEmpty() && !destdir.endsWith(Option::dir_sep)) @@ -935,6 +924,18 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t) } t << endl << endl; + t << "####### Sub-libraries\n\n"; + if (!project->values("SUBLIBS").isEmpty()) { + ProString libdir = "tmp/"; + if (!project->isEmpty("SUBLIBS_DIR")) + libdir = project->first("SUBLIBS_DIR"); + const ProStringList &l = project->values("SUBLIBS"); + for (it = l.begin(); it != l.end(); ++it) + t << libdir << project->first("QMAKE_PREFIX_STATICLIB") << (*it) << "." + << project->first("QMAKE_EXTENSION_STATICLIB") << ":\n\t" + << var(ProKey("MAKELIB" + *it)) << endl << endl; + } + if(doPrecompiledHeaders() && !project->isEmpty("PRECOMPILED_HEADER")) { QString pchInput = project->first("PRECOMPILED_HEADER").toQString(); t << "###### Precompiled headers\n"; -- cgit v1.2.3 From 882bf3475c8926abe62ed71e6719458b024caac0 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Mon, 13 Jan 2014 15:48:44 +0100 Subject: expand tabs and related whitespace fixes in *.{cpp,h,qdoc} the diff -w for this commit is empty. Started-by: Thiago Macieira Change-Id: I77bb84e71c63ce75e0709e5b94bee18e3ce6ab9e Reviewed-by: Thiago Macieira --- qmake/generators/unix/unixmake2.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'qmake/generators/unix/unixmake2.cpp') diff --git a/qmake/generators/unix/unixmake2.cpp b/qmake/generators/unix/unixmake2.cpp index f905d40d4e9..d0a4fbb683a 100644 --- a/qmake/generators/unix/unixmake2.cpp +++ b/qmake/generators/unix/unixmake2.cpp @@ -1316,7 +1316,7 @@ UnixMakefileGenerator::writeLibtoolFile() t << "# " << lname << " - a libtool library file\n"; t << "# Generated by qmake/libtool (" QMAKE_VERSION_STR ") (Qt " << QT_VERSION_STR << ") on: " << QDateTime::currentDateTime().toString(); - t << "\n"; + t << "\n"; t << "# The name that we can dlopen(3).\n" << "dlname='" << var(project->isActiveConfig("plugin") ? "TARGET" : "TARGET_x") -- cgit v1.2.3 From 24634002e33d9cda641305b21886b81292664e5c Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Sat, 7 Dec 2013 21:34:38 +0100 Subject: qmake: prepare TARGET/VERSION/DISTFILES for sub targets This is a preparation step for 'make dist' target for subdir projects. UnixMakefileGenerator needs these variables while extending writeSubTargets() and writeDefaultVariables() for 'make dist'. Partial cherry-pick of https://qt.gitorious.org/qt/jpnurmi-qt/commit/8c4ef19 Task-number: QTBUG-21910 Change-Id: I02a616a98448bc3041ef0f4fd034bfb4c2199e41 Reviewed-by: Oswald Buddenhagen --- qmake/generators/unix/unixmake2.cpp | 10 ---------- 1 file changed, 10 deletions(-) (limited to 'qmake/generators/unix/unixmake2.cpp') diff --git a/qmake/generators/unix/unixmake2.cpp b/qmake/generators/unix/unixmake2.cpp index d0a4fbb683a..1444161ca95 100644 --- a/qmake/generators/unix/unixmake2.cpp +++ b/qmake/generators/unix/unixmake2.cpp @@ -1015,16 +1015,6 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t) void UnixMakefileGenerator::init2() { - //version handling - if(project->isEmpty("VERSION")) - project->values("VERSION").append("1.0." + - (project->isEmpty("VER_PAT") ? QString("0") : - project->first("VER_PAT"))); - QStringList l = project->first("VERSION").toQString().split('.'); - l << "0" << "0"; //make sure there are three - project->values("VER_MAJ").append(l[0]); - project->values("VER_MIN").append(l[1]); - project->values("VER_PAT").append(l[2]); if(project->isEmpty("QMAKE_FRAMEWORK_VERSION")) project->values("QMAKE_FRAMEWORK_VERSION").append(project->values("VER_MAJ").first()); -- cgit v1.2.3 From 0b144bc76a368ecc6c5c1121a1b51e888a0621ac Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Mon, 9 Dec 2013 10:56:31 -0800 Subject: Add support for using -isystem in qmake This commit will make qmake use -isystem automatically for any compilers that declare support for it for any paths that are listed in QMAKE_DEFAULT_INCDIRS. Change-Id: I36fefc6d5bba61671f65669f0ea42704b3c3cf31 Reviewed-by: Oswald Buddenhagen --- qmake/generators/unix/unixmake2.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'qmake/generators/unix/unixmake2.cpp') diff --git a/qmake/generators/unix/unixmake2.cpp b/qmake/generators/unix/unixmake2.cpp index 1444161ca95..8e18f69c03c 100644 --- a/qmake/generators/unix/unixmake2.cpp +++ b/qmake/generators/unix/unixmake2.cpp @@ -125,10 +125,16 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t) t << " -I" << pwd; } { + QString isystem = var("QMAKE_CFLAGS_ISYSTEM"); const ProStringList &incs = project->values("INCLUDEPATH"); for(int i = 0; i < incs.size(); ++i) { ProString inc = escapeFilePath(incs.at(i)); - if(!inc.isEmpty()) + if (inc.isEmpty()) + continue; + + if (!isystem.isEmpty() && isSystemInclude(inc.toQString())) + t << ' ' << isystem << ' ' << inc; + else t << " -I" << inc; } } -- cgit v1.2.3 From 08841c1c2f436fb304b3766114c4525ba21c63ba Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Tue, 10 Dec 2013 20:10:10 -0800 Subject: Don't scan system includes for dependencies and don't list them Assume that C and C++ headers found in system paths will not change, so we don't need to tell Make about them, nor do we need to scan their contents either. The previous qmake behavior matched gcc's -M switch; it now matches the -MM switch: -M Instead of outputting the result of preprocessing, output a rule suitable for make describing the dependencies of the main source file. -MM Like -M but do not mention header files that are found in system header directories, nor header files that are included, directly or indirectly, from such a header. This goes hand-in-hand with our use of -isystem to pass system paths to the compiler. Change-Id: I3346b6da496fe6495ac89c5286d066b343116f0e Reviewed-by: Oswald Buddenhagen --- qmake/generators/unix/unixmake2.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'qmake/generators/unix/unixmake2.cpp') diff --git a/qmake/generators/unix/unixmake2.cpp b/qmake/generators/unix/unixmake2.cpp index 8e18f69c03c..eb68614fe6c 100644 --- a/qmake/generators/unix/unixmake2.cpp +++ b/qmake/generators/unix/unixmake2.cpp @@ -1229,8 +1229,10 @@ void UnixMakefileGenerator::init2() } if (include_deps && project->isActiveConfig("gcc_MD_depends")) { - project->values("QMAKE_CFLAGS") += "-MD"; - project->values("QMAKE_CXXFLAGS") += "-MD"; + // use -MMD if we know about -isystem too + ProString MD_flag(project->values("QMAKE_CFLAGS_ISYSTEM").isEmpty() ? "-MD" : "-MMD"); + project->values("QMAKE_CFLAGS") += MD_flag; + project->values("QMAKE_CXXFLAGS") += MD_flag; } if(!project->isEmpty("QMAKE_BUNDLE")) { -- cgit v1.2.3 From 604849018dc48736b7304521ecc04aa26a053ce4 Mon Sep 17 00:00:00 2001 From: Andrew Knight Date: Wed, 29 Jan 2014 16:19:51 +0200 Subject: qmake: Add DISTCLEAN_DEPS variable This variable works like CLEAN_DEPS, but applies to the distclean target. Change-Id: Ia30e8932b9acd6529298728dd5d0e038b0208d66 Reviewed-by: Friedemann Kleint Reviewed-by: Oswald Buddenhagen --- qmake/generators/unix/unixmake2.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'qmake/generators/unix/unixmake2.cpp') diff --git a/qmake/generators/unix/unixmake2.cpp b/qmake/generators/unix/unixmake2.cpp index eb68614fe6c..2ee9110b019 100644 --- a/qmake/generators/unix/unixmake2.cpp +++ b/qmake/generators/unix/unixmake2.cpp @@ -908,7 +908,7 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t) ProString destdir = project->first("DESTDIR"); if (!destdir.isEmpty() && !destdir.endsWith(Option::dir_sep)) destdir += Option::dir_sep; - t << "distclean: clean\n"; + t << "distclean: clean " << var("DISTCLEAN_DEPS") << '\n'; if(!project->isEmpty("QMAKE_BUNDLE")) { QString bundlePath = escapeFilePath(destdir + project->first("QMAKE_BUNDLE")); t << "\t-$(DEL_FILE) -r " << bundlePath << endl; -- cgit v1.2.3