summaryrefslogtreecommitdiffstats
path: root/qmake
diff options
context:
space:
mode:
Diffstat (limited to 'qmake')
-rw-r--r--qmake/Makefile.unix75
-rw-r--r--qmake/Makefile.win3219
-rw-r--r--qmake/generators/mac/pbuilder_pbx.cpp39
-rw-r--r--qmake/generators/mac/pbuilder_pbx.h7
-rw-r--r--qmake/generators/makefile.cpp440
-rw-r--r--qmake/generators/makefile.h18
-rw-r--r--qmake/generators/makefiledeps.cpp186
-rw-r--r--qmake/generators/makefiledeps.h19
-rw-r--r--qmake/generators/metamakefile.cpp80
-rw-r--r--qmake/generators/projectgenerator.cpp20
-rw-r--r--qmake/generators/projectgenerator.h5
-rw-r--r--qmake/generators/unix/unixmake.cpp51
-rw-r--r--qmake/generators/unix/unixmake.h12
-rw-r--r--qmake/generators/unix/unixmake2.cpp257
-rw-r--r--qmake/generators/win32/mingw_make.cpp62
-rw-r--r--qmake/generators/win32/mingw_make.h6
-rw-r--r--qmake/generators/win32/msbuild_objectmodel.cpp16
-rw-r--r--qmake/generators/win32/msvc_nmake.cpp23
-rw-r--r--qmake/generators/win32/msvc_nmake.h11
-rw-r--r--qmake/generators/win32/msvc_objectmodel.cpp1
-rw-r--r--qmake/generators/win32/msvc_objectmodel.h2
-rw-r--r--qmake/generators/win32/msvc_vcproj.cpp22
-rw-r--r--qmake/generators/win32/winmakefile.cpp169
-rw-r--r--qmake/generators/win32/winmakefile.h10
-rw-r--r--qmake/generators/xmloutput.cpp6
-rw-r--r--qmake/library/ioutils.cpp1
-rw-r--r--qmake/library/proitems.cpp4
-rw-r--r--qmake/library/proitems.h7
-rw-r--r--qmake/library/qmakebuiltins.cpp15
-rw-r--r--qmake/library/qmakeevaluator.cpp32
-rw-r--r--qmake/library/qmakeevaluator.h15
-rw-r--r--qmake/library/qmakeevaluator_p.h2
-rw-r--r--qmake/library/qmakeglobals.cpp1
-rw-r--r--qmake/library/qmakeparser.cpp2
-rw-r--r--qmake/library/qmakeparser.h1
-rw-r--r--qmake/option.cpp8
-rw-r--r--qmake/option.h1
-rw-r--r--qmake/project.cpp8
-rw-r--r--qmake/project.h6
-rw-r--r--qmake/qmake.pro24
40 files changed, 776 insertions, 907 deletions
diff --git a/qmake/Makefile.unix b/qmake/Makefile.unix
index 0f69b6b487..4d4f05e78a 100644
--- a/qmake/Makefile.unix
+++ b/qmake/Makefile.unix
@@ -27,10 +27,11 @@ QOBJS = \
qjsonarray.o qjson.o qjsondocument.o qjsonobject.o qjsonparser.o qjsonvalue.o \
qmetatype.o qsystemerror.o qvariant.o \
quuid.o \
- qarraydata.o qbitarray.o qbytearray.o qbytearraymatcher.o \
- qcryptographichash.o qdatetime.o qhash.o qlinkedlist.o qlist.o \
+ qarraydata.o qbitarray.o qbytearray.o qbytearraylist.o qbytearraymatcher.o \
+ qcalendar.o qgregoriancalendar.o qromancalendar.o \
+ qcryptographichash.o qdatetime.o qhash.o qlist.o \
qlocale.o qlocale_tools.o qmap.o qregexp.o qringbuffer.o \
- qstringbuilder.o qstring_compat.o qstring.o qstringlist.o qversionnumber.o \
+ qstringbuilder.o qstring.o qstringlist.o qversionnumber.o \
qvsnprintf.o qxmlstream.o qxmlutils.o \
$(QTOBJS) $(QTOBJS2)
# QTOBJS and QTOBJS2 are populated by Makefile.unix.* as for QTSRC (see below).
@@ -105,26 +106,28 @@ DEPEND_SRC = \
$(SOURCE_PATH)/src/corelib/serialization/qtextstream.cpp \
$(SOURCE_PATH)/src/corelib/serialization/qxmlstream.cpp \
$(SOURCE_PATH)/src/corelib/serialization/qxmlutils.cpp \
+ $(SOURCE_PATH)/src/corelib/text/qbytearray.cpp \
+ $(SOURCE_PATH)/src/corelib/text/qbytearraylist.cpp \
+ $(SOURCE_PATH)/src/corelib/text/qbytearraymatcher.cpp \
+ $(SOURCE_PATH)/src/corelib/text/qlocale.cpp \
+ $(SOURCE_PATH)/src/corelib/text/qlocale_tools.cpp \
+ $(SOURCE_PATH)/src/corelib/text/qregexp.cpp \
+ $(SOURCE_PATH)/src/corelib/text/qstringbuilder.cpp \
+ $(SOURCE_PATH)/src/corelib/text/qstring.cpp \
+ $(SOURCE_PATH)/src/corelib/text/qstringlist.cpp \
+ $(SOURCE_PATH)/src/corelib/text/qvsnprintf.cpp \
+ $(SOURCE_PATH)/src/corelib/time/qcalendar.cpp \
+ $(SOURCE_PATH)/src/corelib/time/qdatetime.cpp \
+ $(SOURCE_PATH)/src/corelib/time/qgregoriancalendar.cpp \
+ $(SOURCE_PATH)/src/corelib/time/qromancalendar.cpp \
$(SOURCE_PATH)/src/corelib/tools/qarraydata.cpp \
$(SOURCE_PATH)/src/corelib/tools/qbitarray.cpp \
- $(SOURCE_PATH)/src/corelib/tools/qbytearray.cpp\
- $(SOURCE_PATH)/src/corelib/tools/qbytearraymatcher.cpp \
$(SOURCE_PATH)/src/corelib/tools/qcryptographichash.cpp \
- $(SOURCE_PATH)/src/corelib/tools/qdatetime.cpp \
$(SOURCE_PATH)/src/corelib/tools/qhash.cpp \
- $(SOURCE_PATH)/src/corelib/tools/qlinkedlist.cpp \
$(SOURCE_PATH)/src/corelib/tools/qlist.cpp \
- $(SOURCE_PATH)/src/corelib/tools/qlocale.cpp \
- $(SOURCE_PATH)/src/corelib/tools/qlocale_tools.cpp \
$(SOURCE_PATH)/src/corelib/tools/qmap.cpp \
- $(SOURCE_PATH)/src/corelib/tools/qregexp.cpp \
$(SOURCE_PATH)/src/corelib/tools/qringbuffer.cpp \
- $(SOURCE_PATH)/src/corelib/tools/qstringbuilder.cpp \
- $(SOURCE_PATH)/src/corelib/tools/qstring_compat.cpp \
- $(SOURCE_PATH)/src/corelib/tools/qstring.cpp \
- $(SOURCE_PATH)/src/corelib/tools/qstringlist.cpp \
$(SOURCE_PATH)/src/corelib/tools/qversionnumber.cpp \
- $(SOURCE_PATH)/src/corelib/tools/qvsnprintf.cpp \
$(QTSRCS) $(QTSRCS2)
# QTSRCS and QTSRCS2 come from Makefile.unix.* (concatenated with this
# by configure); QTSRCS2 may include *.mm entries on macOS.
@@ -304,13 +307,16 @@ qglobal.o: $(SOURCE_PATH)/src/corelib/global/qglobal.cpp
qarraydata.o: $(SOURCE_PATH)/src/corelib/tools/qarraydata.cpp
$(CXX) -c -o $@ $(CXXFLAGS) $<
-qbytearray.o: $(SOURCE_PATH)/src/corelib/tools/qbytearray.cpp
+qbytearray.o: $(SOURCE_PATH)/src/corelib/text/qbytearray.cpp
$(CXX) -c -o $@ $(CXXFLAGS) $<
-qvsnprintf.o: $(SOURCE_PATH)/src/corelib/tools/qvsnprintf.cpp
+qbytearraylist.o: $(SOURCE_PATH)/src/corelib/text/qbytearraylist.cpp
$(CXX) -c -o $@ $(CXXFLAGS) $<
-qbytearraymatcher.o: $(SOURCE_PATH)/src/corelib/tools/qbytearraymatcher.cpp
+qvsnprintf.o: $(SOURCE_PATH)/src/corelib/text/qvsnprintf.cpp
+ $(CXX) -c -o $@ $(CXXFLAGS) $<
+
+qbytearraymatcher.o: $(SOURCE_PATH)/src/corelib/text/qbytearraymatcher.cpp
$(CXX) -c -o $@ $(CXXFLAGS) $<
qmetatype.o: $(SOURCE_PATH)/src/corelib/kernel/qmetatype.cpp
@@ -340,25 +346,22 @@ qcore_foundation.o: $(SOURCE_PATH)/src/corelib/kernel/qcore_foundation.mm
qutfcodec.o: $(SOURCE_PATH)/src/corelib/codecs/qutfcodec.cpp
$(CXX) -c -o $@ $(CXXFLAGS) $<
-qstring.o: $(SOURCE_PATH)/src/corelib/tools/qstring.cpp
- $(CXX) -c -o $@ $(CXXFLAGS) $<
-
-qstring_compat.o: $(SOURCE_PATH)/src/corelib/tools/qstring_compat.cpp
+qstring.o: $(SOURCE_PATH)/src/corelib/text/qstring.cpp
$(CXX) -c -o $@ $(CXXFLAGS) $<
-qstringbuilder.o: $(SOURCE_PATH)/src/corelib/tools/qstringbuilder.cpp
+qstringbuilder.o: $(SOURCE_PATH)/src/corelib/text/qstringbuilder.cpp
$(CXX) -c -o $@ $(CXXFLAGS) $<
-qlocale.o: $(SOURCE_PATH)/src/corelib/tools/qlocale.cpp
+qlocale.o: $(SOURCE_PATH)/src/corelib/text/qlocale.cpp
$(CXX) -c -o $@ $(CXXFLAGS) $<
-qlocale_tools.o: $(SOURCE_PATH)/src/corelib/tools/qlocale_tools.cpp
+qlocale_tools.o: $(SOURCE_PATH)/src/corelib/text/qlocale_tools.cpp
$(CXX) -c -o $@ $(CXXFLAGS) $<
-qlocale_unix.o: $(SOURCE_PATH)/src/corelib/tools/qlocale_unix.cpp
+qlocale_unix.o: $(SOURCE_PATH)/src/corelib/text/qlocale_unix.cpp
$(CXX) -c -o $@ $(CXXFLAGS) $<
-qlocale_win.o: $(SOURCE_PATH)/src/corelib/tools/qlocale_win.cpp
+qlocale_win.o: $(SOURCE_PATH)/src/corelib/text/qlocale_win.cpp
$(CXX) -c -o $@ $(CXXFLAGS) $<
qversionnumber.o: $(SOURCE_PATH)/src/corelib/tools/qversionnumber.cpp
@@ -412,7 +415,7 @@ qabstractfileengine.o: $(SOURCE_PATH)/src/corelib/io/qabstractfileengine.cpp
qtemporaryfile.o: $(SOURCE_PATH)/src/corelib/io/qtemporaryfile.cpp
$(CXX) -c -o $@ $(CXXFLAGS) $<
-qregexp.o: $(SOURCE_PATH)/src/corelib/tools/qregexp.cpp
+qregexp.o: $(SOURCE_PATH)/src/corelib/text/qregexp.cpp
$(CXX) -c -o $@ $(CXXFLAGS) $<
qbitarray.o: $(SOURCE_PATH)/src/corelib/tools/qbitarray.cpp
@@ -430,19 +433,25 @@ quuid.o: $(SOURCE_PATH)/src/corelib/plugin/quuid.cpp
qfileinfo.o: $(SOURCE_PATH)/src/corelib/io/qfileinfo.cpp
$(CXX) -c -o $@ $(CXXFLAGS) $<
-qdatetime.o: $(SOURCE_PATH)/src/corelib/tools/qdatetime.cpp
+qdatetime.o: $(SOURCE_PATH)/src/corelib/time/qdatetime.cpp
$(CXX) -c -o $@ $(CXXFLAGS) $<
-qstringlist.o: $(SOURCE_PATH)/src/corelib/tools/qstringlist.cpp
+qcalendar.o: $(SOURCE_PATH)/src/corelib/time/qcalendar.cpp
$(CXX) -c -o $@ $(CXXFLAGS) $<
-qmap.o: $(SOURCE_PATH)/src/corelib/tools/qmap.cpp
+qgregoriancalendar.o: $(SOURCE_PATH)/src/corelib/time/qgregoriancalendar.cpp
$(CXX) -c -o $@ $(CXXFLAGS) $<
-qhash.o: $(SOURCE_PATH)/src/corelib/tools/qhash.cpp
+qromancalendar.o: $(SOURCE_PATH)/src/corelib/time/qromancalendar.cpp
$(CXX) -c -o $@ $(CXXFLAGS) $<
-qlinkedlist.o: $(SOURCE_PATH)/src/corelib/tools/qlinkedlist.cpp
+qstringlist.o: $(SOURCE_PATH)/src/corelib/text/qstringlist.cpp
+ $(CXX) -c -o $@ $(CXXFLAGS) $<
+
+qmap.o: $(SOURCE_PATH)/src/corelib/tools/qmap.cpp
+ $(CXX) -c -o $@ $(CXXFLAGS) $<
+
+qhash.o: $(SOURCE_PATH)/src/corelib/tools/qhash.cpp
$(CXX) -c -o $@ $(CXXFLAGS) $<
qcryptographichash.o: $(SOURCE_PATH)/src/corelib/tools/qcryptographichash.cpp
diff --git a/qmake/Makefile.win32 b/qmake/Makefile.win32
index 506e9deb19..7324817af2 100644
--- a/qmake/Makefile.win32
+++ b/qmake/Makefile.win32
@@ -24,10 +24,8 @@ LINKER = link
CFLAGS_EXTRA = /MP /wd4577 $(CFLAGS_CRT)
!endif # !win32-icc
-!if "$(QMAKESPEC)" != "win32-clang-msvc"
CFLAGS_PCH = -Yuqmake_pch.h -FIqmake_pch.h -Fpqmake_pch.pch
PCH_OBJECT = qmake_pch.obj
-!endif
CFLAGS_BARE = -c -Fo./ -Fdqmake.pdb \
-W2 -nologo -O2 \
@@ -71,8 +69,10 @@ QTOBJS= \
qfsfileengine_iterator.obj \
qarraydata.obj \
qbytearray.obj \
+ qbytearraylist.obj \
qvsnprintf.obj \
qbytearraymatcher.obj \
+ qcalendar.obj \
qdatetime.obj \
qdir.obj \
qdiriterator.obj \
@@ -85,12 +85,12 @@ QTOBJS= \
qfileinfo.obj \
qendian.obj \
qglobal.obj \
+ qgregoriancalendar.obj \
qhash.obj \
qiodevice.obj \
qringbuffer.obj \
qdebug.obj \
qlist.obj \
- qlinkedlist.obj \
qlocale.obj \
qlocale_tools.obj \
qlocale_win.obj \
@@ -100,9 +100,9 @@ QTOBJS= \
qoperatingsystemversion.obj \
qoperatingsystemversion_win.obj \
qregexp.obj \
+ qromancalendar.obj \
qutfcodec.obj \
qstring.obj \
- qstring_compat.obj \
qstringlist.obj \
qstringbuilder.obj \
qsystemerror.obj \
@@ -200,13 +200,16 @@ qmake_pch.obj:
{$(SOURCE_PATH)\src\corelib\serialization}.cpp{}.obj::
$(CXX) $(CXXFLAGS) $<
-{$(SOURCE_PATH)\src\corelib\tools}.cpp{}.obj::
+{$(SOURCE_PATH)\src\corelib\text}.cpp{}.obj::
+ $(CXX) $(CXXFLAGS) $<
+
+{$(SOURCE_PATH)\src\corelib\time}.cpp{}.obj::
$(CXX) $(CXXFLAGS) $<
-# Make sure qstring_compat.obj and qlibraryinfo.obj aren't compiled with PCH enabled
-qstring_compat.obj: $(SOURCE_PATH)\src\corelib\tools\qstring_compat.cpp
- $(CXX) -c $(CXXFLAGS_BARE) $(SOURCE_PATH)\src\corelib\tools\qstring_compat.cpp
+{$(SOURCE_PATH)\src\corelib\tools}.cpp{}.obj::
+ $(CXX) $(CXXFLAGS) $<
+# Make sure qlibraryinfo.obj isn't compiled with PCH enabled
qlibraryinfo.obj: $(SOURCE_PATH)\src\corelib\global\qlibraryinfo.cpp
$(CXX) $(CXXFLAGS_BARE) -DQT_BUILD_QMAKE_BOOTSTRAP $(SOURCE_PATH)\src\corelib\global\qlibraryinfo.cpp
diff --git a/qmake/generators/mac/pbuilder_pbx.cpp b/qmake/generators/mac/pbuilder_pbx.cpp
index 8f3eb738b4..24e69444c9 100644
--- a/qmake/generators/mac/pbuilder_pbx.cpp
+++ b/qmake/generators/mac/pbuilder_pbx.cpp
@@ -60,11 +60,6 @@ static QString qtSha1(const QByteArray &src)
return QString::fromLatin1(digest.toHex());
}
-ProjectBuilderMakefileGenerator::ProjectBuilderMakefileGenerator() : UnixMakefileGenerator()
-{
-
-}
-
bool
ProjectBuilderMakefileGenerator::writeMakefile(QTextStream &t)
{
@@ -590,7 +585,7 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t)
debug_msg(1, "pbuilder: Creating file: %s", mkfile.toLatin1().constData());
QTextStream mkt(&mkf);
writeHeader(mkt);
- mkt << "QMAKE = " << var("QMAKE_QMAKE") << endl;
+ mkt << "QMAKE = " << var("QMAKE_QMAKE") << Qt::endl;
project->values("QMAKE_MAKE_QMAKE_EXTRA_COMMANDS")
<< "@echo 'warning: Xcode project has been regenerated, custom settings have been lost. " \
"Use CONFIG+=no_autoqmake to prevent this behavior in the future, " \
@@ -788,15 +783,15 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t)
debug_msg(1, "pbuilder: Creating file: %s", mkfile.toLatin1().constData());
QTextStream mkt(&mkf);
writeHeader(mkt);
- mkt << "MOC = " << var("QMAKE_MOC") << endl;
- mkt << "UIC = " << var("QMAKE_UIC") << endl;
- mkt << "LEX = " << var("QMAKE_LEX") << endl;
- mkt << "LEXFLAGS = " << var("QMAKE_LEXFLAGS") << endl;
- mkt << "YACC = " << var("QMAKE_YACC") << endl;
- mkt << "YACCFLAGS = " << var("QMAKE_YACCFLAGS") << endl;
+ mkt << "MOC = " << var("QMAKE_MOC") << Qt::endl;
+ mkt << "UIC = " << var("QMAKE_UIC") << Qt::endl;
+ mkt << "LEX = " << var("QMAKE_LEX") << Qt::endl;
+ mkt << "LEXFLAGS = " << var("QMAKE_LEXFLAGS") << Qt::endl;
+ mkt << "YACC = " << var("QMAKE_YACC") << Qt::endl;
+ mkt << "YACCFLAGS = " << var("QMAKE_YACCFLAGS") << Qt::endl;
mkt << "DEFINES = "
<< varGlue("PRL_EXPORT_DEFINES","-D"," -D"," ")
- << varGlue("DEFINES","-D"," -D","") << endl;
+ << varGlue("DEFINES","-D"," -D","") << Qt::endl;
mkt << "INCPATH =";
{
const ProStringList &incs = project->values("INCLUDEPATH");
@@ -805,9 +800,9 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t)
}
if(!project->isEmpty("QMAKE_FRAMEWORKPATH_FLAGS"))
mkt << " " << var("QMAKE_FRAMEWORKPATH_FLAGS");
- mkt << endl;
- mkt << "DEL_FILE = " << var("QMAKE_DEL_FILE") << endl;
- mkt << "MOVE = " << var("QMAKE_MOVE") << endl << endl;
+ mkt << Qt::endl;
+ mkt << "DEL_FILE = " << var("QMAKE_DEL_FILE") << Qt::endl;
+ mkt << "MOVE = " << var("QMAKE_MOVE") << Qt::endl << Qt::endl;
mkt << "preprocess: compilers\n";
mkt << "clean preprocess_clean: compiler_clean\n\n";
writeExtraTargets(mkt);
@@ -837,7 +832,7 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t)
}
}
}
- mkt << endl;
+ mkt << Qt::endl;
writeExtraCompilerTargets(mkt);
writingUnixMakefileGenerator = false;
}
@@ -1019,12 +1014,12 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t)
tmp = project->values("SUBLIBS");
for(int i = 0; i < tmp.count(); i++)
t << escapeFilePath("tmp/lib" + tmp[i] + ".a") << ' ';
- t << endl << endl;
+ t << Qt::endl << Qt::endl;
mkt << "sublibs: $(SUBLIBS)\n\n";
tmp = project->values("SUBLIBS");
for(int i = 0; i < tmp.count(); i++)
t << escapeFilePath("tmp/lib" + tmp[i] + ".a") + ":\n\t"
- << var(ProKey("MAKELIB" + tmp[i])) << endl << endl;
+ << var(ProKey("MAKELIB" + tmp[i])) << Qt::endl << Qt::endl;
mkt.flush();
mkf.close();
writingUnixMakefileGenerator = false;
@@ -1261,9 +1256,7 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t)
<< "\t\t\t" << writeSettings("runOnlyForDeploymentPostprocessing", "0", SettingsNoQuote) << ";\n"
<< "\t\t};\n";
- QMapIterator<ProString, ProStringList> it(embedded_plugins);
- while (it.hasNext()) {
- it.next();
+ for (auto it = embedded_plugins.cbegin(), end = embedded_plugins.cend(); it != end; ++it) {
QString suffix = !it.key().isEmpty() ? (" (" + it.key() + ")") : QString();
QString grp3("Embed PlugIns" + suffix), key3 = keyFor(grp3);
project->values("QMAKE_PBX_BUILDPHASES").append(key3);
@@ -1499,7 +1492,7 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t)
<< "\t\t\t" << writeSettings("name", "Qt Test") << ";\n"
<< "\t\t};\n";
- QLatin1Literal testTargetID("TestTargetID");
+ QLatin1String testTargetID("TestTargetID");
project->values(ProKey("QMAKE_PBX_TARGET_ATTRIBUTES_" + testTargetKey + "_" + testTargetID)).append(keyFor(pbx_dir + "QMAKE_PBX_TARGET"));
project->values(ProKey("QMAKE_PBX_TARGET_ATTRIBUTES_" + testTargetKey)).append(ProKey(testTargetID));
}
diff --git a/qmake/generators/mac/pbuilder_pbx.h b/qmake/generators/mac/pbuilder_pbx.h
index a7b21a0dab..1b90a3bbeb 100644
--- a/qmake/generators/mac/pbuilder_pbx.h
+++ b/qmake/generators/mac/pbuilder_pbx.h
@@ -63,19 +63,12 @@ class ProjectBuilderMakefileGenerator : public UnixMakefileGenerator
QString writeSettings(const QString &var, const ProStringList &vals, int flags=0, int indent_level=0);
public:
- ProjectBuilderMakefileGenerator();
- ~ProjectBuilderMakefileGenerator();
-
bool supportsMetaBuild() override { return false; }
bool openOutput(QFile &, const QString &) const override;
protected:
bool doPrecompiledHeaders() const override { return false; }
bool doDepends() const override { return writingUnixMakefileGenerator && UnixMakefileGenerator::doDepends(); }
};
-
-inline ProjectBuilderMakefileGenerator::~ProjectBuilderMakefileGenerator()
-{ }
-
QT_END_NAMESPACE
#endif // PBUILDER_PBX_H
diff --git a/qmake/generators/makefile.cpp b/qmake/generators/makefile.cpp
index 22ac7bf534..ed7d057a88 100644
--- a/qmake/generators/makefile.cpp
+++ b/qmake/generators/makefile.cpp
@@ -94,13 +94,6 @@ bool MakefileGenerator::mkdir(const QString &in_path) const
return QDir().mkpath(path);
}
-// ** base makefile generator
-MakefileGenerator::MakefileGenerator() :
- no_io(false), project(nullptr)
-{
-}
-
-
void
MakefileGenerator::verifyCompilers()
{
@@ -174,14 +167,8 @@ MakefileGenerator::initOutPaths()
ProString &pathRef = v[dkey].first();
pathRef = fileFixify(pathRef.toQString(), FileFixifyFromOutdir);
-#ifdef Q_OS_WIN
- // We don't want to add a separator for DLLDESTDIR on Windows (###why?)
- if (dkey != "DLLDESTDIR")
-#endif
- {
- if(!pathRef.endsWith(Option::dir_sep))
- pathRef += Option::dir_sep;
- }
+ if (!pathRef.endsWith(Option::dir_sep))
+ pathRef += Option::dir_sep;
if (noIO() || (project->first("TEMPLATE") == "subdirs"))
continue;
@@ -206,7 +193,6 @@ MakefileGenerator::initOutPaths()
ProStringList &inputs = project->values((*it2).toKey());
for (ProStringList::Iterator input = inputs.begin(); input != inputs.end(); ++input) {
QString finp = fileFixify((*input).toQString(), FileFixifyFromOutdir);
- *input = ProString(finp);
QString path = replaceExtraCompilerVariables(tmp_out, finp, QString(), NoShell);
path = Option::normalizePath(path);
int slash = path.lastIndexOf('/');
@@ -778,27 +764,13 @@ MakefileGenerator::init()
ProStringList incDirs = v["DEPENDPATH"] + v["QMAKE_ABSOLUTE_SOURCE_PATH"];
if(project->isActiveConfig("depend_includepath"))
incDirs += v["INCLUDEPATH"];
- QList<QMakeLocalFileName> deplist;
+ QVector<QMakeLocalFileName> deplist;
deplist.reserve(incDirs.size());
for (ProStringList::Iterator it = incDirs.begin(); it != incDirs.end(); ++it)
deplist.append(QMakeLocalFileName((*it).toQString()));
QMakeSourceFileInfo::setDependencyPaths(deplist);
debug_msg(1, "Dependency Directories: %s",
incDirs.join(QString(" :: ")).toLatin1().constData());
- //cache info
- if(project->isActiveConfig("qmake_cache")) {
- QString cache_file;
- if(!project->isEmpty("QMAKE_INTERNAL_CACHE_FILE")) {
- cache_file = QDir::fromNativeSeparators(project->first("QMAKE_INTERNAL_CACHE_FILE").toQString());
- } else {
- cache_file = ".qmake.internal.cache";
- if(project->isActiveConfig("build_pass"))
- cache_file += ".BUILD." + project->first("BUILD_PASS");
- }
- if(cache_file.indexOf('/') == -1)
- cache_file.prepend(Option::output_dir + '/');
- QMakeSourceFileInfo::setCacheFile(cache_file);
- }
//add to dependency engine
for(x = 0; x < compilers.count(); ++x) {
@@ -994,25 +966,25 @@ MakefileGenerator::writePrlFile(QTextStream &t)
QString bdir = Option::output_dir;
if(bdir.isEmpty())
bdir = qmake_getpwd();
- t << "QMAKE_PRL_BUILD_DIR =" << qv(bdir) << endl;
+ t << "QMAKE_PRL_BUILD_DIR =" << qv(bdir) << Qt::endl;
- t << "QMAKE_PRO_INPUT =" << qv(project->projectFile().section('/', -1)) << endl;
+ t << "QMAKE_PRO_INPUT =" << qv(project->projectFile().section('/', -1)) << Qt::endl;
if(!project->isEmpty("QMAKE_ABSOLUTE_SOURCE_PATH"))
- t << "QMAKE_PRL_SOURCE_DIR =" << qv(project->first("QMAKE_ABSOLUTE_SOURCE_PATH")) << endl;
- t << "QMAKE_PRL_TARGET =" << qv(project->first("LIB_TARGET")) << endl;
+ t << "QMAKE_PRL_SOURCE_DIR =" << qv(project->first("QMAKE_ABSOLUTE_SOURCE_PATH")) << Qt::endl;
+ t << "QMAKE_PRL_TARGET =" << qv(project->first("LIB_TARGET")) << Qt::endl;
if(!project->isEmpty("PRL_EXPORT_DEFINES"))
- t << "QMAKE_PRL_DEFINES =" << qv(project->values("PRL_EXPORT_DEFINES")) << endl;
+ t << "QMAKE_PRL_DEFINES =" << qv(project->values("PRL_EXPORT_DEFINES")) << Qt::endl;
if(!project->isEmpty("PRL_EXPORT_CFLAGS"))
- t << "QMAKE_PRL_CFLAGS =" << qv(project->values("PRL_EXPORT_CFLAGS")) << endl;
+ t << "QMAKE_PRL_CFLAGS =" << qv(project->values("PRL_EXPORT_CFLAGS")) << Qt::endl;
if(!project->isEmpty("PRL_EXPORT_CXXFLAGS"))
- t << "QMAKE_PRL_CXXFLAGS =" << qv(project->values("PRL_EXPORT_CXXFLAGS")) << endl;
+ t << "QMAKE_PRL_CXXFLAGS =" << qv(project->values("PRL_EXPORT_CXXFLAGS")) << Qt::endl;
if(!project->isEmpty("CONFIG"))
- t << "QMAKE_PRL_CONFIG =" << qv(project->values("CONFIG")) << endl;
+ t << "QMAKE_PRL_CONFIG =" << qv(project->values("CONFIG")) << Qt::endl;
if(!project->isEmpty("TARGET_VERSION_EXT"))
- t << "QMAKE_PRL_VERSION = " << project->first("TARGET_VERSION_EXT") << endl;
+ t << "QMAKE_PRL_VERSION = " << project->first("TARGET_VERSION_EXT") << Qt::endl;
else if(!project->isEmpty("VERSION"))
- t << "QMAKE_PRL_VERSION = " << project->first("VERSION") << endl;
+ t << "QMAKE_PRL_VERSION = " << project->first("VERSION") << Qt::endl;
if(project->isActiveConfig("staticlib") || project->isActiveConfig("explicitlib")) {
ProStringList libs;
if (!project->isActiveConfig("staticlib"))
@@ -1022,7 +994,7 @@ MakefileGenerator::writePrlFile(QTextStream &t)
t << "QMAKE_PRL_LIBS =";
for (ProStringList::Iterator it = libs.begin(); it != libs.end(); ++it)
t << qv(project->values((*it).toKey()));
- t << endl;
+ t << Qt::endl;
t << "QMAKE_PRL_LIBS_FOR_CMAKE = ";
QString sep;
@@ -1030,7 +1002,7 @@ MakefileGenerator::writePrlFile(QTextStream &t)
t << sep << project->values((*it).toKey()).join(';').replace('\\', "\\\\");
sep = ';';
}
- t << endl;
+ t << Qt::endl;
}
}
@@ -1061,17 +1033,17 @@ MakefileGenerator::writeProjectMakefile()
//install
t << "install: ";
- for(it = targets.begin(); it != targets.end(); ++it)
- t << (*it)->target << "-install ";
- t << endl;
+ for (SubTarget *s : qAsConst(targets))
+ t << s->target << '-';
+ t << "install " << Qt::endl;
//uninstall
t << "uninstall: ";
for(it = targets.begin(); it != targets.end(); ++it)
t << (*it)->target << "-uninstall ";
- t << endl;
+ t << Qt::endl;
} else {
- t << "first: " << targets.first()->target << endl
+ t << "first: " << targets.first()->target << Qt::endl
<< "install: " << targets.first()->target << "-install\n"
<< "uninstall: " << targets.first()->target << "-uninstall\n";
}
@@ -1080,7 +1052,7 @@ MakefileGenerator::writeProjectMakefile()
if(!project->isActiveConfig("no_autoqmake")) {
QString mkf = escapeDependencyPath(fileFixify(Option::output.fileName()));
for(QList<SubTarget*>::Iterator it = targets.begin(); it != targets.end(); ++it)
- t << escapeDependencyPath((*it)->makefile) << ": " << mkf << endl;
+ t << escapeDependencyPath((*it)->makefile) << ": " << mkf << Qt::endl;
}
qDeleteAll(targets);
return true;
@@ -1195,7 +1167,7 @@ MakefileGenerator::writeObj(QTextStream &t, const char *src)
p.replace(stringObj, escapeFilePath(dstf));
t << "\n\t" << p;
}
- t << endl << endl;
+ t << Qt::endl << Qt::endl;
}
}
@@ -1310,9 +1282,9 @@ MakefileGenerator::writeInstalls(QTextStream &t, bool noBuild)
dst_file += fi.fileName();
QString cmd;
if (is_target || (!fi.isDir() && fi.isExecutable()))
- cmd = QLatin1String("-$(QINSTALL_PROGRAM)");
+ cmd = QLatin1String("$(QINSTALL_PROGRAM)");
else
- cmd = QLatin1String("-$(QINSTALL)");
+ cmd = QLatin1String("$(QINSTALL)");
cmd += " " + escapeFilePath(wild) + " " + escapeFilePath(dst_file);
inst << cmd;
if (!noStrip && !project->isActiveConfig("debug_info") && !project->isActiveConfig("nostrip") &&
@@ -1332,9 +1304,9 @@ MakefileGenerator::writeInstalls(QTextStream &t, bool noBuild)
dst_file += filestr;
QString cmd;
if (installConfigValues.contains("executable"))
- cmd = QLatin1String("-$(QINSTALL_PROGRAM)");
+ cmd = QLatin1String("$(QINSTALL_PROGRAM)");
else
- cmd = QLatin1String("-$(QINSTALL)");
+ cmd = QLatin1String("$(QINSTALL)");
cmd += " " + escapeFilePath(wild) + " " + escapeFilePath(dst_file);
inst << cmd;
uninst.append(rm_dir_contents + " " + escapeFilePath(filePrefixRoot(root, fileFixify(dst_dir + filestr, FileFixifyAbsolute, false))));
@@ -1347,7 +1319,7 @@ MakefileGenerator::writeInstalls(QTextStream &t, bool noBuild)
if (!dst_file.endsWith(Option::dir_sep))
dst_file += Option::dir_sep;
dst_file += fi.fileName();
- QString cmd = QLatin1String("-$(QINSTALL) ") +
+ QString cmd = QLatin1String("$(QINSTALL) ") +
escapeFilePath(dirstr + file) + " " + escapeFilePath(dst_file);
inst << cmd;
if (!noStrip && !project->isActiveConfig("debug_info") && !project->isActiveConfig("nostrip") &&
@@ -1389,14 +1361,14 @@ MakefileGenerator::writeInstalls(QTextStream &t, bool noBuild)
QString tmp_dst = fileFixify((*pit).toQString(), FileFixifyAbsolute, false);
t << mkdir_p_asstring(filePrefixRoot(root, tmp_dst)) << "\n\t";
}
- t << target << endl << endl;
+ t << target << Qt::endl << Qt::endl;
if(!uninst.isEmpty()) {
t << "uninstall_" << (*it) << ": FORCE";
for (int i = uninst.size(); --i >= 0; )
t << "\n\t" << uninst.at(i);
t << "\n\t-$(DEL_DIR) " << escapeFilePath(filePrefixRoot(root, dst)) << " \n\n";
}
- t << endl;
+ t << Qt::endl;
if (installConfigValues.indexOf("no_default_install") == -1) {
all_installs += QString("install_") + (*it) + " ";
@@ -1833,7 +1805,7 @@ MakefileGenerator::writeExtraTargets(QTextStream &t)
t << escapeDependencyPath(targ) << ":" << deps;
if(!cmd.isEmpty())
t << "\n\t" << cmd;
- t << endl << endl;
+ t << Qt::endl << Qt::endl;
}
}
@@ -1853,7 +1825,7 @@ static QStringList splitDeps(const QString &indeps, bool lineMode)
QString MakefileGenerator::resolveDependency(const QDir &outDir, const QString &file)
{
- const QList<QMakeLocalFileName> &depdirs = QMakeSourceFileInfo::dependencyPaths();
+ const QVector<QMakeLocalFileName> &depdirs = QMakeSourceFileInfo::dependencyPaths();
for (const auto &depdir : depdirs) {
const QString &local = depdir.local();
QString lf = outDir.absoluteFilePath(local + '/' + file);
@@ -1878,6 +1850,58 @@ QString MakefileGenerator::resolveDependency(const QDir &outDir, const QString &
return {};
}
+void MakefileGenerator::callExtraCompilerDependCommand(const ProString &extraCompiler,
+ const QString &dep_cd_cmd,
+ const QString &tmp_dep_cmd,
+ const QString &inpf,
+ const QString &tmp_out,
+ bool dep_lines,
+ QStringList *deps,
+ bool existingDepsOnly)
+{
+ char buff[256];
+ QString dep_cmd = replaceExtraCompilerVariables(tmp_dep_cmd, inpf, tmp_out, LocalShell);
+ dep_cmd = dep_cd_cmd + fixEnvVariables(dep_cmd);
+ if (FILE *proc = QT_POPEN(dep_cmd.toLatin1().constData(), QT_POPEN_READ)) {
+ QByteArray depData;
+ while (int read_in = feof(proc) ? 0 : (int)fread(buff, 1, 255, proc))
+ depData.append(buff, read_in);
+ QT_PCLOSE(proc);
+ const QString indeps = QString::fromLocal8Bit(depData);
+ if (indeps.isEmpty())
+ return;
+ QDir outDir(Option::output_dir);
+ QStringList dep_cmd_deps = splitDeps(indeps, dep_lines);
+ for (int i = 0; i < dep_cmd_deps.count(); ++i) {
+ QString &file = dep_cmd_deps[i];
+ const QString absFile = outDir.absoluteFilePath(file);
+ if (absFile == file) {
+ // already absolute; don't do any checks.
+ } else if (exists(absFile)) {
+ file = absFile;
+ } else {
+ const QString localFile = resolveDependency(outDir, file);
+ if (localFile.isEmpty()) {
+ if (exists(file)) {
+ warn_msg(WarnDeprecated, ".depend_command for extra compiler %s"
+ " prints paths relative to source directory",
+ extraCompiler.toLatin1().constData());
+ } else if (existingDepsOnly) {
+ file.clear();
+ } else {
+ file = absFile; // fallback for generated resources
+ }
+ } else {
+ file = localFile;
+ }
+ }
+ if (!file.isEmpty())
+ file = fileFixify(file);
+ }
+ deps->append(dep_cmd_deps);
+ }
+}
+
void
MakefileGenerator::writeExtraCompilerTargets(QTextStream &t)
{
@@ -1925,7 +1949,7 @@ MakefileGenerator::writeExtraCompilerTargets(QTextStream &t)
FileFixifyFromOutdir));
}
}
- t << endl;
+ t << Qt::endl;
if (config.indexOf("no_clean") == -1) {
QStringList raw_clean = project->values(ProKey(*it + ".clean")).toQStringList();
@@ -1990,7 +2014,7 @@ MakefileGenerator::writeExtraCompilerTargets(QTextStream &t)
}
}
}
- t << endl;
+ t << Qt::endl;
}
const bool existingDepsOnly = config.contains("dep_existing_only");
QStringList tmp_dep = project->values(ProKey(*it + ".depends")).toQStringList();
@@ -2008,46 +2032,8 @@ MakefileGenerator::writeExtraCompilerTargets(QTextStream &t)
deps += findDependencies(inpf);
inputs += Option::fixPathToTargetOS(inpf, false);
if(!tmp_dep_cmd.isEmpty() && doDepends()) {
- char buff[256];
- QString dep_cmd = replaceExtraCompilerVariables(tmp_dep_cmd, inpf, tmp_out, LocalShell);
- dep_cmd = dep_cd_cmd + fixEnvVariables(dep_cmd);
- if (FILE *proc = QT_POPEN(dep_cmd.toLatin1().constData(), QT_POPEN_READ)) {
- QByteArray depData;
- while (int read_in = feof(proc) ? 0 : (int)fread(buff, 1, 255, proc))
- depData.append(buff, read_in);
- QT_PCLOSE(proc);
- const QString indeps = QString::fromLocal8Bit(depData);
- if(!indeps.isEmpty()) {
- QDir outDir(Option::output_dir);
- QStringList dep_cmd_deps = splitDeps(indeps, dep_lines);
- for(int i = 0; i < dep_cmd_deps.count(); ++i) {
- QString &file = dep_cmd_deps[i];
- QString absFile = outDir.absoluteFilePath(file);
- if (absFile == file) {
- // already absolute; don't do any checks.
- } else if (exists(absFile)) {
- file = absFile;
- } else {
- QString localFile = resolveDependency(outDir, file);
- if (localFile.isEmpty()) {
- if (exists(file))
- warn_msg(WarnDeprecated, ".depend_command for extra compiler %s"
- " prints paths relative to source directory",
- (*it).toLatin1().constData());
- else if (existingDepsOnly)
- file.clear();
- else
- file = absFile; // fallback for generated resources
- } else {
- file = localFile;
- }
- }
- if(!file.isEmpty())
- file = fileFixify(file);
- }
- deps += dep_cmd_deps;
- }
- }
+ callExtraCompilerDependCommand(*it, dep_cd_cmd, tmp_dep_cmd, inpf,
+ tmp_out, dep_lines, &deps, existingDepsOnly);
}
}
for(int i = 0; i < inputs.size(); ) {
@@ -2074,7 +2060,7 @@ MakefileGenerator::writeExtraCompilerTargets(QTextStream &t)
} else {
t << " " << valList(escapeDependencyPaths(inputs)) << " " << valList(finalizeDependencyPaths(deps));
}
- t << "\n\t" << cmd << endl << endl;
+ t << "\n\t" << cmd << Qt::endl << Qt::endl;
continue;
}
for (ProStringList::ConstIterator input = tmp_inputs.cbegin(); input != tmp_inputs.cend(); ++input) {
@@ -2095,46 +2081,8 @@ MakefileGenerator::writeExtraCompilerTargets(QTextStream &t)
for (ProStringList::ConstIterator it3 = vars.constBegin(); it3 != vars.constEnd(); ++it3)
cmd.replace("$(" + (*it3) + ")", "$(QMAKE_COMP_" + (*it3)+")");
if(!tmp_dep_cmd.isEmpty() && doDepends()) {
- char buff[256];
- QString dep_cmd = replaceExtraCompilerVariables(tmp_dep_cmd, inpf, out, LocalShell);
- dep_cmd = dep_cd_cmd + fixEnvVariables(dep_cmd);
- if (FILE *proc = QT_POPEN(dep_cmd.toLatin1().constData(), QT_POPEN_READ)) {
- QByteArray depData;
- while (int read_in = feof(proc) ? 0 : (int)fread(buff, 1, 255, proc))
- depData.append(buff, read_in);
- QT_PCLOSE(proc);
- const QString indeps = QString::fromLocal8Bit(depData);
- if(!indeps.isEmpty()) {
- QDir outDir(Option::output_dir);
- QStringList dep_cmd_deps = splitDeps(indeps, dep_lines);
- for(int i = 0; i < dep_cmd_deps.count(); ++i) {
- QString &file = dep_cmd_deps[i];
- QString absFile = outDir.absoluteFilePath(file);
- if (absFile == file) {
- // already absolute; don't do any checks.
- } else if (exists(absFile)) {
- file = absFile;
- } else {
- QString localFile = resolveDependency(outDir, file);
- if (localFile.isEmpty()) {
- if (exists(file))
- warn_msg(WarnDeprecated, ".depend_command for extra compiler %s"
- " prints paths relative to source directory",
- (*it).toLatin1().constData());
- else if (existingDepsOnly)
- file.clear();
- else
- file = absFile; // fallback for generated resources
- } else {
- file = localFile;
- }
- }
- if(!file.isEmpty())
- file = fileFixify(file);
- }
- deps += dep_cmd_deps;
- }
- }
+ callExtraCompilerDependCommand(*it, dep_cd_cmd, tmp_dep_cmd, inpf,
+ tmp_out, dep_lines, &deps, existingDepsOnly);
//use the depend system to find includes of these included files
QStringList inc_deps;
for(int i = 0; i < deps.size(); ++i) {
@@ -2185,10 +2133,10 @@ MakefileGenerator::writeExtraCompilerTargets(QTextStream &t)
++i;
}
t << escapeDependencyPath(out) << ": " << valList(finalizeDependencyPaths(deps)) << "\n\t"
- << cmd << endl << endl;
+ << cmd << Qt::endl << Qt::endl;
}
}
- t << "compiler_clean: " << clean_targets << endl << endl;
+ t << "compiler_clean: " << clean_targets << Qt::endl << Qt::endl;
}
void
@@ -2204,17 +2152,17 @@ MakefileGenerator::writeExtraCompilerVariables(QTextStream &t)
first = false;
}
t << "QMAKE_COMP_" << (*varit) << " = "
- << valList(project->values((*varit).toKey())) << endl;
+ << valList(project->values((*varit).toKey())) << Qt::endl;
}
}
if(!first)
- t << endl;
+ t << Qt::endl;
}
void
MakefileGenerator::writeExtraVariables(QTextStream &t)
{
- t << endl;
+ t << Qt::endl;
ProStringList outlist;
const ProValueMap &vars = project->variables();
@@ -2228,7 +2176,7 @@ MakefileGenerator::writeExtraVariables(QTextStream &t)
}
if (!outlist.isEmpty()) {
t << "####### Custom Variables\n";
- t << outlist.join('\n') << endl << endl;
+ t << outlist.join('\n') << Qt::endl << Qt::endl;
}
}
@@ -2244,11 +2192,11 @@ MakefileGenerator::writeExportedVariables(QTextStream &t)
const ProString &name = project->first(ProKey(exp + ".name"));
const ProString &value = project->first(ProKey(exp + ".value"));
if (!value.isEmpty())
- t << name << " = " << value << endl;
+ t << name << " = " << value << Qt::endl;
else
t << name << " =\n";
}
- t << endl;
+ t << Qt::endl;
}
bool
@@ -2256,7 +2204,7 @@ MakefileGenerator::writeDummyMakefile(QTextStream &t)
{
if (project->values("QMAKE_FAILED_REQUIREMENTS").isEmpty())
return false;
- t << "QMAKE = " << var("QMAKE_QMAKE") << endl;
+ t << "QMAKE = " << var("QMAKE_QMAKE") << Qt::endl;
const ProStringList &qut = project->values("QMAKE_EXTRA_TARGETS");
for (ProStringList::ConstIterator it = qut.begin(); it != qut.end(); ++it)
t << *it << " ";
@@ -2270,21 +2218,6 @@ MakefileGenerator::writeDummyMakefile(QTextStream &t)
}
bool
-MakefileGenerator::writeStubMakefile(QTextStream &t)
-{
- t << "QMAKE = " << var("QMAKE_QMAKE") << endl;
- const ProStringList &qut = project->values("QMAKE_EXTRA_TARGETS");
- for (ProStringList::ConstIterator it = qut.begin(); it != qut.end(); ++it)
- t << *it << " ";
- //const QString ofile = Option::fixPathToTargetOS(fileFixify(Option::output.fileName()));
- t << "first all clean install distclean uninstall: qmake\n"
- << "qmake_all:\n";
- writeMakeQmake(t);
- t << "FORCE:\n\n";
- return true;
-}
-
-bool
MakefileGenerator::writeMakefile(QTextStream &t)
{
t << "####### Compile\n\n";
@@ -2301,22 +2234,22 @@ MakefileGenerator::writeMakefile(QTextStream &t)
void
MakefileGenerator::writeDefaultVariables(QTextStream &t)
{
- t << "QMAKE = " << var("QMAKE_QMAKE") << endl;
- t << "DEL_FILE = " << var("QMAKE_DEL_FILE") << endl;
- t << "CHK_DIR_EXISTS= " << var("QMAKE_CHK_DIR_EXISTS") << endl;
- t << "MKDIR = " << var("QMAKE_MKDIR") << endl;
- t << "COPY = " << var("QMAKE_COPY") << endl;
- t << "COPY_FILE = " << var("QMAKE_COPY_FILE") << endl;
- t << "COPY_DIR = " << var("QMAKE_COPY_DIR") << endl;
- t << "INSTALL_FILE = " << var("QMAKE_INSTALL_FILE") << endl;
- t << "INSTALL_PROGRAM = " << var("QMAKE_INSTALL_PROGRAM") << endl;
- t << "INSTALL_DIR = " << var("QMAKE_INSTALL_DIR") << endl;
- t << "QINSTALL = " << var("QMAKE_QMAKE") << " -install qinstall" << endl;
- t << "QINSTALL_PROGRAM = " << var("QMAKE_QMAKE") << " -install qinstall -exe" << endl;
- t << "DEL_FILE = " << var("QMAKE_DEL_FILE") << endl;
- t << "SYMLINK = " << var("QMAKE_SYMBOLIC_LINK") << endl;
- t << "DEL_DIR = " << var("QMAKE_DEL_DIR") << endl;
- t << "MOVE = " << var("QMAKE_MOVE") << endl;
+ t << "QMAKE = " << var("QMAKE_QMAKE") << Qt::endl;
+ t << "DEL_FILE = " << var("QMAKE_DEL_FILE") << Qt::endl;
+ t << "CHK_DIR_EXISTS= " << var("QMAKE_CHK_DIR_EXISTS") << Qt::endl;
+ t << "MKDIR = " << var("QMAKE_MKDIR") << Qt::endl;
+ t << "COPY = " << var("QMAKE_COPY") << Qt::endl;
+ t << "COPY_FILE = " << var("QMAKE_COPY_FILE") << Qt::endl;
+ t << "COPY_DIR = " << var("QMAKE_COPY_DIR") << Qt::endl;
+ t << "INSTALL_FILE = " << var("QMAKE_INSTALL_FILE") << Qt::endl;
+ t << "INSTALL_PROGRAM = " << var("QMAKE_INSTALL_PROGRAM") << Qt::endl;
+ t << "INSTALL_DIR = " << var("QMAKE_INSTALL_DIR") << Qt::endl;
+ t << "QINSTALL = " << var("QMAKE_QMAKE") << " -install qinstall" << Qt::endl;
+ t << "QINSTALL_PROGRAM = " << var("QMAKE_QMAKE") << " -install qinstall -exe" << Qt::endl;
+ t << "DEL_FILE = " << var("QMAKE_DEL_FILE") << Qt::endl;
+ t << "SYMLINK = " << var("QMAKE_SYMBOLIC_LINK") << Qt::endl;
+ t << "DEL_DIR = " << var("QMAKE_DEL_DIR") << Qt::endl;
+ t << "MOVE = " << var("QMAKE_MOVE") << Qt::endl;
}
QString MakefileGenerator::buildArgs(bool withExtra)
@@ -2335,9 +2268,9 @@ QString MakefileGenerator::buildArgs(bool withExtra)
//could get stored argv, but then it would have more options than are
//probably necesary this will try to guess the bare minimum..
-QString MakefileGenerator::build_args()
+QString MakefileGenerator::fullBuildArgs()
{
- QString ret = "$(QMAKE)";
+ QString ret;
//output
QString ofile = fileFixify(Option::output.fileName());
@@ -2357,18 +2290,18 @@ void
MakefileGenerator::writeHeader(QTextStream &t)
{
t << "#############################################################################\n";
- t << "# Makefile for building: " << escapeFilePath(var("TARGET")) << endl;
+ t << "# Makefile for building: " << escapeFilePath(var("TARGET")) << Qt::endl;
t << "# Generated by qmake (" QMAKE_VERSION_STR ") (Qt " QT_VERSION_STR ")\n";
- t << "# Project: " << fileFixify(project->projectFile()) << endl;
- t << "# Template: " << var("TEMPLATE") << endl;
+ t << "# Project: " << fileFixify(project->projectFile()) << Qt::endl;
+ t << "# Template: " << var("TEMPLATE") << Qt::endl;
if(!project->isActiveConfig("build_pass"))
- t << "# Command: " << build_args().replace(QLatin1String("$(QMAKE)"), var("QMAKE_QMAKE")) << endl;
+ t << "# Command: " << var("QMAKE_QMAKE") << fullBuildArgs() << Qt::endl;
t << "#############################################################################\n";
- t << endl;
+ t << Qt::endl;
QString ofile = Option::fixPathToTargetOS(Option::output.fileName());
if (ofile.lastIndexOf(Option::dir_sep) != -1)
ofile.remove(0, ofile.lastIndexOf(Option::dir_sep) +1);
- t << "MAKEFILE = " << escapeFilePath(ofile) << endl << endl;
+ t << "MAKEFILE = " << escapeFilePath(ofile) << Qt::endl << Qt::endl;
t << "EQ = =\n\n";
}
@@ -2507,7 +2440,7 @@ MakefileGenerator::writeSubDirs(QTextStream &t)
void MakefileGenerator::writeSubMakeCall(QTextStream &t, const QString &callPrefix,
const QString &makeArguments)
{
- t << callPrefix << "$(MAKE)" << makeArguments << endl;
+ t << callPrefix << "$(MAKE)" << makeArguments << Qt::endl;
}
void
@@ -2526,20 +2459,30 @@ MakefileGenerator::writeSubTargetCall(QTextStream &t,
writeSubMakeCall(t, out_directory_cdin + pfx, makefilein);
}
+static void chopEndLines(QString *s)
+{
+ while (!s->isEmpty()) {
+ const ushort c = s->at(s->size() - 1).unicode();
+ if (c != '\n' && c != '\r')
+ break;
+ s->chop(1);
+ }
+}
+
void
MakefileGenerator::writeSubTargets(QTextStream &t, QList<MakefileGenerator::SubTarget*> targets, int flags)
{
// blasted includes
const ProStringList &qeui = project->values("QMAKE_EXTRA_INCLUDES");
for (ProStringList::ConstIterator qeui_it = qeui.begin(); qeui_it != qeui.end(); ++qeui_it)
- t << "include " << (*qeui_it) << endl;
+ t << "include " << (*qeui_it) << Qt::endl;
if (!(flags & SubTargetSkipDefaultVariables)) {
writeDefaultVariables(t);
t << "SUBTARGETS = "; // subtargets are sub-directory
for(int target = 0; target < targets.size(); ++target)
t << " \\\n\t\t" << targets.at(target)->target;
- t << endl << endl;
+ t << Qt::endl << Qt::endl;
}
writeExtraVariables(t);
@@ -2551,6 +2494,14 @@ MakefileGenerator::writeSubTargets(QTextStream &t, QList<MakefileGenerator::SubT
<< QString((flags & SubTargetInstalls) ? "uninstall_subtargets" : "uninstall");
}
+ struct SequentialInstallData
+ {
+ QString targetPrefix;
+ QString commands;
+ QTextStream commandsStream;
+ SequentialInstallData() : commandsStream(&commands) {}
+ };
+ std::unique_ptr<SequentialInstallData> sequentialInstallData;
bool dont_recurse = project->isActiveConfig("dont_recurse");
// generate target rules
@@ -2595,7 +2546,7 @@ MakefileGenerator::writeSubTargets(QTextStream &t, QList<MakefileGenerator::SubT
if (!dont_recurse)
writeSubMakeCall(t, out_directory_cdin, makefilein + " qmake_all");
else
- t << endl;
+ t << Qt::endl;
}
{ //actually compile
@@ -2619,6 +2570,16 @@ MakefileGenerator::writeSubTargets(QTextStream &t, QList<MakefileGenerator::SubT
else if(s == "make_first")
s = QString();
+ if (project->isActiveConfig("build_all") && s == "install") {
+ if (!sequentialInstallData)
+ sequentialInstallData.reset(new SequentialInstallData);
+ sequentialInstallData->targetPrefix += subtarget->target + '-';
+ writeSubTargetCall(sequentialInstallData->commandsStream, in_directory, in,
+ out_directory, out, out_directory_cdin,
+ makefilein + " " + s);
+ chopEndLines(&sequentialInstallData->commands);
+ }
+
if(flags & SubTargetOrdered) {
t << subtarget->target << "-" << targetSuffixes.at(suffix) << "-ordered:";
if(target)
@@ -2636,7 +2597,12 @@ MakefileGenerator::writeSubTargets(QTextStream &t, QList<MakefileGenerator::SubT
out_directory_cdin, makefilein + " " + s);
}
}
- t << endl;
+ t << Qt::endl;
+
+ if (sequentialInstallData) {
+ t << sequentialInstallData->targetPrefix << "install: FORCE"
+ << sequentialInstallData->commands << Qt::endl << Qt::endl;
+ }
if (!(flags & SubTargetSkipDefaultTargets)) {
writeMakeQmake(t, true);
@@ -2685,7 +2651,7 @@ MakefileGenerator::writeSubTargets(QTextStream &t, QList<MakefileGenerator::SubT
} else if(suffix == "distclean") {
QString ofile = fileFixify(Option::output.fileName());
if(!ofile.isEmpty())
- t << "\t-$(DEL_FILE) " << escapeFilePath(ofile) << endl;
+ t << "\t-$(DEL_FILE) " << escapeFilePath(ofile) << Qt::endl;
t << fixFileVarGlue("QMAKE_DISTCLEAN", "\t-$(DEL_FILE) ", " ", "\n");
}
}
@@ -2698,7 +2664,7 @@ MakefileGenerator::writeSubTargets(QTextStream &t, QList<MakefileGenerator::SubT
cmd = var(ProKey(*qut_it + ".commands")), deps;
if(targ.isEmpty())
targ = (*qut_it).toQString();
- t << endl;
+ t << Qt::endl;
const ProStringList &deplist = project->values(ProKey(*qut_it + ".depends"));
for (ProStringList::ConstIterator dep_it = deplist.begin(); dep_it != deplist.end(); ++dep_it) {
@@ -2711,7 +2677,8 @@ MakefileGenerator::writeSubTargets(QTextStream &t, QList<MakefileGenerator::SubT
QSet<QString> recurse;
const ProKey rkey(*qut_it + ".recurse");
if (project->isSet(rkey)) {
- recurse = project->values(rkey).toQStringList().toSet();
+ const QStringList values = project->values(rkey).toQStringList();
+ recurse = QSet<QString>(values.begin(), values.end());
} else {
for(int target = 0; target < targets.size(); ++target)
recurse.insert(targets.at(target)->name);
@@ -2773,7 +2740,7 @@ MakefileGenerator::writeSubTargets(QTextStream &t, QList<MakefileGenerator::SubT
deps += " FORCE";
t << escapeDependencyPath(Option::fixPathToTargetOS(targ, false)) << ":" << deps << "\n";
if(!cmd.isEmpty())
- t << "\t" << cmd << endl;
+ t << "\t" << cmd << Qt::endl;
}
if(flags & SubTargetInstalls) {
@@ -2791,10 +2758,10 @@ MakefileGenerator::writeMakeQmake(QTextStream &t, bool noDummyQmakeAll)
if(project->isEmpty("QMAKE_FAILED_REQUIREMENTS") && !project->isEmpty("QMAKE_INTERNAL_PRL_FILE")) {
QStringList files = escapeFilePaths(fileFixify(Option::mkfile::project_files));
t << escapeDependencyPath(project->first("QMAKE_INTERNAL_PRL_FILE").toQString()) << ": \n\t"
- << "@$(QMAKE) -prl " << files.join(' ') << ' ' << buildArgs(true) << endl;
+ << "@$(QMAKE) -prl " << files.join(' ') << ' ' << buildArgs(true) << Qt::endl;
}
- QString qmake = build_args();
+ QString qmake = "$(QMAKE)" + fullBuildArgs();
if(!ofile.isEmpty() && !project->isActiveConfig("no_autoqmake")) {
t << escapeDependencyPath(ofile) << ": "
<< escapeDependencyPath(fileFixify(project->projectFile())) << " ";
@@ -2810,10 +2777,10 @@ MakefileGenerator::writeMakeQmake(QTextStream &t, bool noDummyQmakeAll)
}
const ProStringList &included = escapeDependencyPaths(project->values("QMAKE_INTERNAL_INCLUDED_FILES"));
t << included.join(QString(" \\\n\t\t")) << "\n\t"
- << qmake << endl;
+ << qmake << Qt::endl;
const ProStringList &extraCommands = project->values("QMAKE_MAKE_QMAKE_EXTRA_COMMANDS");
if (!extraCommands.isEmpty())
- t << "\t" << extraCommands.join(QString("\n\t")) << endl;
+ t << "\t" << extraCommands.join(QString("\n\t")) << Qt::endl;
for(int include = 0; include < included.size(); ++include) {
const ProString &i = included.at(include);
if(!i.isEmpty())
@@ -2821,7 +2788,7 @@ MakefileGenerator::writeMakeQmake(QTextStream &t, bool noDummyQmakeAll)
}
}
if(project->first("QMAKE_ORIG_TARGET") != "qmake") {
- t << "qmake: FORCE\n\t@" << qmake << endl << endl;
+ t << "qmake: FORCE\n\t@" << qmake << Qt::endl << Qt::endl;
if (!noDummyQmakeAll)
t << "qmake_all: FORCE\n\n";
}
@@ -3128,7 +3095,7 @@ MakefileGenerator::findFileForDep(const QMakeLocalFileName &dep, const QMakeLoca
if(Option::output_dir != qmake_getpwd()
&& QDir::isRelativePath(dep.real())) { //is it from the shadow tree
- QList<QMakeLocalFileName> depdirs = QMakeSourceFileInfo::dependencyPaths();
+ QVector<QMakeLocalFileName> depdirs = QMakeSourceFileInfo::dependencyPaths();
depdirs.prepend(fileInfo(file.real()).absoluteDir().path());
QString pwd = qmake_getpwd();
if(pwd.at(pwd.length()-1) != '/')
@@ -3313,11 +3280,11 @@ MakefileGenerator::writePkgConfigFile()
if(includeDir.isEmpty())
includeDir = prefix + "/include";
- t << "prefix=" << prefix << endl;
+ t << "prefix=" << prefix << Qt::endl;
t << "exec_prefix=${prefix}\n"
<< "libdir=" << pkgConfigFixPath(libDir) << "\n"
- << "includedir=" << pkgConfigFixPath(includeDir) << endl;
- t << endl;
+ << "includedir=" << pkgConfigFixPath(includeDir) << Qt::endl;
+ t << Qt::endl;
//extra PKGCONFIG variables
const ProStringList &pkgconfig_vars = project->values("QMAKE_PKGCONFIG_VARIABLES");
@@ -3338,17 +3305,17 @@ MakefileGenerator::writePkgConfigFile()
}
}
if (!val.isEmpty())
- t << var << "=" << val << endl;
+ t << var << "=" << val << Qt::endl;
}
- t << endl;
+ t << Qt::endl;
QString name = project->first("QMAKE_PKGCONFIG_NAME").toQString();
if(name.isEmpty()) {
name = project->first("QMAKE_ORIG_TARGET").toQString().toLower();
name.replace(0, 1, name[0].toUpper());
}
- t << "Name: " << name << endl;
+ t << "Name: " << name << Qt::endl;
QString desc = project->values("QMAKE_PKGCONFIG_DESCRIPTION").join(' ');
if(desc.isEmpty()) {
if(name.isEmpty()) {
@@ -3366,12 +3333,12 @@ MakefileGenerator::writePkgConfigFile()
desc += " Application";
}
}
- t << "Description: " << desc << endl;
+ t << "Description: " << desc << Qt::endl;
ProString version = project->first("QMAKE_PKGCONFIG_VERSION");
if (version.isEmpty())
version = project->first("VERSION");
if (!version.isEmpty())
- t << "Version: " << version << endl;
+ t << "Version: " << version << Qt::endl;
if (project->first("TEMPLATE") == "lib") {
// libs
@@ -3409,7 +3376,7 @@ MakefileGenerator::writePkgConfigFile()
t << "Libs.private:";
for (ProStringList::ConstIterator it = libs.cbegin(); it != libs.cend(); ++it)
t << ' ' << fixLibFlags((*it).toKey()).join(' ');
- t << endl;
+ t << Qt::endl;
}
}
@@ -3428,15 +3395,15 @@ MakefileGenerator::writePkgConfigFile()
&& libDir != QLatin1String("/Library/Frameworks")) {
t << " -F${libdir}";
}
- t << endl;
+ t << Qt::endl;
// requires
const QString requiresString = project->values("QMAKE_PKGCONFIG_REQUIRES").join(' ');
if (!requiresString.isEmpty()) {
- t << "Requires: " << requiresString << endl;
+ t << "Requires: " << requiresString << Qt::endl;
}
- t << endl;
+ t << Qt::endl;
}
static QString windowsifyPath(const QString &str)
@@ -3451,7 +3418,7 @@ QString MakefileGenerator::installMetaFile(const ProKey &replace_rule, const QSt
QString ret;
if (project->isEmpty(replace_rule)
|| project->isActiveConfig("no_sed_meta_install")) {
- ret += "-$(INSTALL_FILE) " + escapeFilePath(src) + ' ' + escapeFilePath(dst);
+ ret += "$(INSTALL_FILE) " + escapeFilePath(src) + ' ' + escapeFilePath(dst);
} else {
QString sedargs;
const ProStringList &replace_rules = project->values(replace_rule);
@@ -3466,9 +3433,9 @@ QString MakefileGenerator::installMetaFile(const ProKey &replace_rule, const QSt
}
}
if (sedargs.isEmpty()) {
- ret += "-$(INSTALL_FILE) " + escapeFilePath(src) + ' ' + escapeFilePath(dst);
+ ret += "$(INSTALL_FILE) " + escapeFilePath(src) + ' ' + escapeFilePath(dst);
} else {
- ret += "-$(SED) " + sedargs + ' ' + escapeFilePath(src) + " > " + escapeFilePath(dst);
+ ret += "$(SED) " + sedargs + ' ' + escapeFilePath(src) + " > " + escapeFilePath(dst);
}
}
return ret;
@@ -3479,4 +3446,37 @@ QString MakefileGenerator::shellQuote(const QString &str)
return isWindowsShell() ? IoUtils::shellQuoteWin(str) : IoUtils::shellQuoteUnix(str);
}
+/*
+ * Returns the name of the variable that contains the fully resolved target
+ * (including DESTDIR) of this generator.
+ */
+ProKey MakefileGenerator::fullTargetVariable() const
+{
+ return "TARGET";
+}
+
+void MakefileGenerator::createResponseFile(const QString &fileName, const ProStringList &objList)
+{
+ QString filePath = Option::output_dir + QDir::separator() + fileName;
+ QFile file(filePath);
+ if (file.open(QIODevice::WriteOnly | QIODevice::Text)) {
+ QTextStream t(&file);
+ for (ProStringList::ConstIterator it = objList.constBegin(); it != objList.constEnd(); ++it) {
+ QString path = (*it).toQString();
+ // In response files, whitespace and special characters are
+ // escaped with a backslash; backslashes themselves can either
+ // be escaped into double backslashes, or, as this is a list of
+ // path names, converted to forward slashes.
+ path.replace(QLatin1Char('\\'), QLatin1String("/"))
+ .replace(QLatin1Char(' '), QLatin1String("\\ "))
+ .replace(QLatin1Char('\t'), QLatin1String("\\\t"))
+ .replace(QLatin1Char('"'), QLatin1String("\\\""))
+ .replace(QLatin1Char('\''), QLatin1String("\\'"));
+ t << path << Qt::endl;
+ }
+ t.flush();
+ file.close();
+ }
+}
+
QT_END_NAMESPACE
diff --git a/qmake/generators/makefile.h b/qmake/generators/makefile.h
index 350ebd377a..47e4c7531c 100644
--- a/qmake/generators/makefile.h
+++ b/qmake/generators/makefile.h
@@ -54,11 +54,11 @@ struct ReplaceExtraCompilerCacheKey;
class MakefileGenerator : protected QMakeSourceFileInfo
{
QString spec;
- bool no_io;
+ bool no_io = false;
bool resolveDependenciesInFrameworks = false;
QHash<QString, bool> init_compiler_already;
QString makedir, chkexists;
- QString build_args();
+ QString fullBuildArgs();
//internal caches
mutable QHash<QString, QMakeLocalFileName> depHeuristicsCache;
@@ -84,10 +84,13 @@ protected:
void writeExtraVariables(QTextStream &t);
void writeExtraTargets(QTextStream &t);
QString resolveDependency(const QDir &outDir, const QString &file);
+ void callExtraCompilerDependCommand(const ProString &extraCompiler, const QString &dep_cd_cmd,
+ const QString &tmp_dep_cmd, const QString &inpf,
+ const QString &tmp_out, bool dep_lines, QStringList *deps,
+ bool existingDepsOnly);
void writeExtraCompilerTargets(QTextStream &t);
void writeExtraCompilerVariables(QTextStream &t);
bool writeDummyMakefile(QTextStream &t);
- virtual bool writeStubMakefile(QTextStream &t);
virtual bool writeMakefile(QTextStream &t);
virtual void writeDefaultVariables(QTextStream &t);
@@ -131,7 +134,7 @@ protected:
QMakeLocalFileName fixPathForFile(const QMakeLocalFileName &, bool) override;
QMakeLocalFileName findFileForDep(const QMakeLocalFileName &, const QMakeLocalFileName &) override;
QFileInfo findFileInfo(const QMakeLocalFileName &) override;
- QMakeProject *project;
+ QMakeProject *project = nullptr;
//escape
virtual QString escapeFilePath(const QString &path) const = 0;
@@ -254,10 +257,9 @@ protected:
const QStringRef &fixedBase, int slashOff);
bool processPrlFileCore(QString &origFile, const QStringRef &origName,
const QString &fixedFile);
+ void createResponseFile(const QString &fileName, const ProStringList &objList);
public:
- MakefileGenerator();
- ~MakefileGenerator();
QMakeProject *projectFile() const;
void setProjectFile(QMakeProject *p);
@@ -276,6 +278,7 @@ public:
virtual bool openOutput(QFile &, const QString &build) const;
bool isWindowsShell() const { return Option::dir_sep == QLatin1String("\\"); }
QString shellQuote(const QString &str);
+ virtual ProKey fullTargetVariable() const;
};
Q_DECLARE_TYPEINFO(MakefileGenerator::Compiler, Q_MOVABLE_TYPE);
Q_DECLARE_OPERATORS_FOR_FLAGS(MakefileGenerator::FileFixifyTypes)
@@ -295,9 +298,6 @@ inline QString MakefileGenerator::installRoot() const
inline bool MakefileGenerator::findLibraries(bool, bool)
{ return true; }
-inline MakefileGenerator::~MakefileGenerator()
-{ }
-
struct ReplaceExtraCompilerCacheKey
{
mutable uint hash;
diff --git a/qmake/generators/makefiledeps.cpp b/qmake/generators/makefiledeps.cpp
index 1995cf63ba..d68539814e 100644
--- a/qmake/generators/makefiledeps.cpp
+++ b/qmake/generators/makefiledeps.cpp
@@ -60,8 +60,6 @@ QT_BEGIN_NAMESPACE
inline bool qmake_endOfLine(const char &c) { return (c == '\r' || c == '\n'); }
#endif
-//#define QMAKE_USE_CACHE
-
QMakeLocalFileName::QMakeLocalFileName(const QString &name) : is_null(name.isNull())
{
if(!name.isEmpty()) {
@@ -199,10 +197,10 @@ void QMakeSourceFileInfo::dependTreeWalker(SourceFile *node, SourceDependChildre
}
}
-void QMakeSourceFileInfo::setDependencyPaths(const QList<QMakeLocalFileName> &l)
+void QMakeSourceFileInfo::setDependencyPaths(const QVector<QMakeLocalFileName> &l)
{
// Ensure that depdirs does not contain the same paths several times, to minimize the stats
- QList<QMakeLocalFileName> ll;
+ QVector<QMakeLocalFileName> ll;
for (int i = 0; i < l.count(); ++i) {
if (!ll.contains(l.at(i)))
ll.append(l.at(i));
@@ -265,19 +263,10 @@ QMakeSourceFileInfo::QMakeSourceFileInfo(const QString &cf)
//buffer
spare_buffer = nullptr;
spare_buffer_size = 0;
-
- //cache
- cachefile = cf;
- if(!cachefile.isEmpty())
- loadCache(cachefile);
}
QMakeSourceFileInfo::~QMakeSourceFileInfo()
{
- //cache
- if(!cachefile.isEmpty() /*&& files_changed*/)
- saveCache(cachefile);
-
//buffer
if(spare_buffer) {
free(spare_buffer);
@@ -290,12 +279,6 @@ QMakeSourceFileInfo::~QMakeSourceFileInfo()
delete includes;
}
-void QMakeSourceFileInfo::setCacheFile(const QString &cf)
-{
- cachefile = cf;
- loadCache(cachefile);
-}
-
void QMakeSourceFileInfo::addSourceFiles(const ProStringList &l, uchar seek,
QMakeSourceFileInfo::SourceFileType type)
{
@@ -853,8 +836,8 @@ bool QMakeSourceFileInfo::findDeps(SourceFile *file)
}
}
if(!exists) { //path lookup
- for(QList<QMakeLocalFileName>::Iterator it = depdirs.begin(); it != depdirs.end(); ++it) {
- QMakeLocalFileName f((*it).real() + Option::dir_sep + lfn.real());
+ for (const QMakeLocalFileName &depdir : qAsConst(depdirs)) {
+ QMakeLocalFileName f(depdir.real() + Option::dir_sep + lfn.real());
QFileInfo fi(findFileInfo(f));
if(fi.exists() && !fi.isDir()) {
lfn = fixPathForFile(f);
@@ -946,10 +929,12 @@ bool QMakeSourceFileInfo::findMocs(SourceFile *file)
debug_msg(2, "findMocs: %s", file->file.local().toLatin1().constData());
int line_count = 1;
- bool ignore[3] = { false, false, false }; // [0] for Q_OBJECT, [1] for Q_GADGET, [2] for Q_NAMESPACE
+ // [0] for Q_OBJECT, [1] for Q_GADGET, [2] for Q_NAMESPACE, [3] for Q_NAMESPACE_EXPORT
+ bool ignore[4] = { false, false, false, false };
/* qmake ignore Q_GADGET */
/* qmake ignore Q_OBJECT */
/* qmake ignore Q_NAMESPACE */
+ /* qmake ignore Q_NAMESPACE_EXPORT */
for(int x = 0; x < buffer_len; x++) {
#define SKIP_BSNL(pos) skipEscapedLineEnds(buffer, buffer_len, (pos), &line_count)
x = SKIP_BSNL(x);
@@ -988,6 +973,12 @@ bool QMakeSourceFileInfo::findMocs(SourceFile *file)
file->file.real().toLatin1().constData(), line_count);
x += 23;
ignore[2] = true;
+ } else if (buffer_len >= (x + 30) &&
+ !strncmp(buffer + x + 1, "make ignore Q_NAMESPACE_EXPORT", 30)) {
+ debug_msg(2, "Mocgen: %s:%d Found \"qmake ignore Q_NAMESPACE_EXPORT\"",
+ file->file.real().toLatin1().constData(), line_count);
+ x += 30;
+ ignore[3] = true;
}
} else if (buffer[x] == '*') {
extralines = 0;
@@ -1015,8 +1006,8 @@ bool QMakeSourceFileInfo::findMocs(SourceFile *file)
int morelines = 0;
int y = skipEscapedLineEnds(buffer, buffer_len, x + 1, &morelines);
if (buffer[y] == 'Q') {
- static const char interesting[][12] = { "Q_OBJECT", "Q_GADGET", "Q_NAMESPACE"};
- for (int interest = 0; interest < 3; ++interest) {
+ static const char interesting[][19] = { "Q_OBJECT", "Q_GADGET", "Q_NAMESPACE", "Q_NAMESPACE_EXPORT" };
+ for (int interest = 0; interest < 4; ++interest) {
if (ignore[interest])
continue;
@@ -1046,151 +1037,4 @@ bool QMakeSourceFileInfo::findMocs(SourceFile *file)
return true;
}
-
-void QMakeSourceFileInfo::saveCache(const QString &cf)
-{
-#ifdef QMAKE_USE_CACHE
- if(cf.isEmpty())
- return;
-
- QFile file(QMakeLocalFileName(cf).local());
- if(file.open(QIODevice::WriteOnly)) {
- QTextStream stream(&file);
- stream << QMAKE_VERSION_STR << endl << endl; //version
- { //cache verification
- QMap<QString, QStringList> verify = getCacheVerification();
- stream << verify.count() << endl;
- for(QMap<QString, QStringList>::iterator it = verify.begin();
- it != verify.end(); ++it) {
- stream << it.key() << endl << it.value().join(';') << endl;
- }
- stream << endl;
- }
- if(files->nodes) {
- for(int file = 0; file < files->num_nodes; ++file) {
- for(SourceFiles::SourceFileNode *node = files->nodes[file]; node; node = node->next) {
- stream << node->file->file.local() << endl; //source
- stream << node->file->type << endl; //type
-
- //depends
- stream << ";";
- if(node->file->deps) {
- for(int depend = 0; depend < node->file->deps->used_nodes; ++depend) {
- if(depend)
- stream << ";";
- stream << node->file->deps->children[depend]->file.local();
- }
- }
- stream << endl;
-
- stream << node->file->mocable << endl; //mocable
- stream << endl; //just for human readability
- }
- }
- }
- stream.flush();
- file.close();
- }
-#else
- Q_UNUSED(cf);
-#endif
-}
-
-void QMakeSourceFileInfo::loadCache(const QString &cf)
-{
- if(cf.isEmpty())
- return;
-
-#ifdef QMAKE_USE_CACHE
- QMakeLocalFileName cache_file(cf);
- int fd = open(QMakeLocalFileName(cf).local().toLatin1(), O_RDONLY);
- if(fd == -1)
- return;
- QFileInfo cache_fi = findFileInfo(cache_file);
- if(!cache_fi.exists() || cache_fi.isDir())
- return;
-
- QFile file;
- if (!file.open(fd, QIODevice::ReadOnly))
- return;
- QTextStream stream(&file);
-
- if (stream.readLine() == QMAKE_VERSION_STR) { //version check
- stream.skipWhiteSpace();
-
- bool verified = true;
- { //cache verification
- QMap<QString, QStringList> verify;
- int len = stream.readLine().toInt();
- for(int i = 0; i < len; ++i) {
- QString var = stream.readLine();
- QString val = stream.readLine();
- verify.insert(var, val.split(';', QString::SkipEmptyParts));
- }
- verified = verifyCache(verify);
- }
- if(verified) {
- stream.skipWhiteSpace();
- if(!files)
- files = new SourceFiles;
- while(!stream.atEnd()) {
- QString source = stream.readLine();
- QString type = stream.readLine();
- QString depends = stream.readLine();
- QString mocable = stream.readLine();
- stream.skipWhiteSpace();
-
- QMakeLocalFileName fn(source);
- QFileInfo fi = findFileInfo(fn);
-
- SourceFile *file = files->lookupFile(fn);
- if(!file) {
- file = new SourceFile;
- file->file = fn;
- files->addFile(file);
- file->type = (SourceFileType)type.toInt();
- file->exists = fi.exists();
- }
- if(fi.exists() && fi.lastModified() < cache_fi.lastModified()) {
- if(!file->dep_checked) { //get depends
- if(!file->deps)
- file->deps = new SourceDependChildren;
- file->dep_checked = true;
- QStringList depend_list = depends.split(";", QString::SkipEmptyParts);
- for(int depend = 0; depend < depend_list.size(); ++depend) {
- QMakeLocalFileName dep_fn(depend_list.at(depend));
- QFileInfo dep_fi(findFileInfo(dep_fn));
- SourceFile *dep = files->lookupFile(dep_fn);
- if(!dep) {
- dep = new SourceFile;
- dep->file = dep_fn;
- dep->exists = dep_fi.exists();
- dep->type = QMakeSourceFileInfo::TYPE_UNKNOWN;
- files->addFile(dep);
- }
- dep->included_count++;
- file->deps->addChild(dep);
- }
- }
- if(!file->moc_checked) { //get mocs
- file->moc_checked = true;
- file->mocable = mocable.toInt();
- }
- }
- }
- }
- }
-#endif
-}
-
-QMap<QString, QStringList> QMakeSourceFileInfo::getCacheVerification()
-{
- return QMap<QString, QStringList>();
-}
-
-bool QMakeSourceFileInfo::verifyCache(const QMap<QString, QStringList> &v)
-{
- return v == getCacheVerification();
-}
-
QT_END_NAMESPACE
diff --git a/qmake/generators/makefiledeps.h b/qmake/generators/makefiledeps.h
index 034197fd31..66b87bf470 100644
--- a/qmake/generators/makefiledeps.h
+++ b/qmake/generators/makefiledeps.h
@@ -33,6 +33,7 @@
#include <qstringlist.h>
#include <qfileinfo.h>
+#include <qvector.h>
QT_BEGIN_NAMESPACE
@@ -42,7 +43,8 @@ class SourceFiles;
class QMakeLocalFileName {
bool is_null;
- mutable QString real_name, local_name;
+ QString real_name;
+ mutable QString local_name;
public:
QMakeLocalFileName() : is_null(true) {}
QMakeLocalFileName(const QString &);
@@ -64,7 +66,7 @@ private:
//quick project lookups
SourceFiles *files, *includes;
bool files_changed;
- QList<QMakeLocalFileName> depdirs;
+ QVector<QMakeLocalFileName> depdirs;
QStringList systemIncludes;
//sleezy buffer code
@@ -77,9 +79,6 @@ private:
bool findDeps(SourceFile *);
void dependTreeWalker(SourceFile *, SourceDependChildren *);
- //cache
- QString cachefile;
-
protected:
virtual QMakeLocalFileName fixPathForFile(const QMakeLocalFileName &, bool forOpen=false);
virtual QMakeLocalFileName findFileForDep(const QMakeLocalFileName &, const QMakeLocalFileName &);
@@ -90,8 +89,8 @@ public:
QMakeSourceFileInfo(const QString &cachefile="");
virtual ~QMakeSourceFileInfo();
- QList<QMakeLocalFileName> dependencyPaths() const { return depdirs; }
- void setDependencyPaths(const QList<QMakeLocalFileName> &);
+ QVector<QMakeLocalFileName> dependencyPaths() const { return depdirs; }
+ void setDependencyPaths(const QVector<QMakeLocalFileName> &);
enum DependencyMode { Recursive, NonRecursive };
inline void setDependencyMode(DependencyMode mode) { dep_mode = mode; }
@@ -112,12 +111,6 @@ public:
bool mocable(const QString &file);
- virtual QMap<QString, QStringList> getCacheVerification();
- virtual bool verifyCache(const QMap<QString, QStringList> &);
- void setCacheFile(const QString &cachefile); //auto caching
- void loadCache(const QString &cf);
- void saveCache(const QString &cf);
-
private:
DependencyMode dep_mode;
};
diff --git a/qmake/generators/metamakefile.cpp b/qmake/generators/metamakefile.cpp
index 8ebd0c61ce..7776d77008 100644
--- a/qmake/generators/metamakefile.cpp
+++ b/qmake/generators/metamakefile.cpp
@@ -27,13 +27,16 @@
****************************************************************************/
#include "metamakefile.h"
-#include "qregexp.h"
#include "qdir.h"
#include "qdebug.h"
#include "makefile.h"
#include "project.h"
#include "cachekeys.h"
+#include <algorithm>
+#include <iterator>
+#include <utility>
+
#define BUILDSMETATYPE 1
#define SUBDIRSMETATYPE 2
@@ -58,6 +61,8 @@ private:
QList<Build *> makefiles;
void clearBuilds();
MakefileGenerator *processBuild(const ProString &);
+ void accumulateVariableFromBuilds(const ProKey &name, Build *build) const;
+ void checkForConflictingTargets() const;
public:
@@ -96,9 +101,6 @@ BuildsMetaMakefileGenerator::init()
if(builds.count() > 1 && Option::output.fileName() == "-") {
use_single_build = true;
warn_msg(WarnLogic, "Cannot direct to stdout when using multiple BUILDS.");
- } else if(0 && !use_single_build && project->first("TEMPLATE") == "subdirs") {
- use_single_build = true;
- warn_msg(WarnLogic, "Cannot specify multiple builds with TEMPLATE subdirs.");
}
if(!use_single_build) {
for(int i = 0; i < builds.count(); i++) {
@@ -139,7 +141,8 @@ bool
BuildsMetaMakefileGenerator::write()
{
Build *glue = nullptr;
- if(!makefiles.isEmpty() && !makefiles.first()->build.isNull()) {
+ if(!makefiles.isEmpty() && !makefiles.first()->build.isNull()
+ && Option::qmake_mode != Option::QMAKE_GENERATE_PRL) {
glue = new Build;
glue->name = name;
glue->makefile = createMakefileGenerator(project, true);
@@ -189,6 +192,8 @@ BuildsMetaMakefileGenerator::write()
if(!build->makefile) {
ret = false;
} else if(build == glue) {
+ checkForConflictingTargets();
+ accumulateVariableFromBuilds("QMAKE_INTERNAL_INCLUDED_FILES", build);
ret = build->makefile->writeProjectMakefile();
} else {
ret = build->makefile->write();
@@ -231,6 +236,53 @@ MakefileGenerator
return nullptr;
}
+void BuildsMetaMakefileGenerator::accumulateVariableFromBuilds(const ProKey &name, Build *dst) const
+{
+ ProStringList &values = dst->makefile->projectFile()->values(name);
+ for (auto build : makefiles) {
+ if (build != dst)
+ values += build->makefile->projectFile()->values(name);
+ }
+ values.removeDuplicates();
+}
+
+void BuildsMetaMakefileGenerator::checkForConflictingTargets() const
+{
+ if (makefiles.count() < 3) {
+ // Checking for conflicts only makes sense if we have more than one BUILD,
+ // and the last entry in makefiles is the "glue" Build.
+ return;
+ }
+ if (!project->isActiveConfig("build_all")) {
+ // Only complain if we're about to build all configurations.
+ return;
+ }
+ using TargetInfo = std::pair<Build *, ProString>;
+ QVector<TargetInfo> targets;
+ const int last = makefiles.count() - 1;
+ targets.resize(last);
+ for (int i = 0; i < last; ++i) {
+ Build *b = makefiles.at(i);
+ auto mkf = b->makefile;
+ auto prj = mkf->projectFile();
+ targets[i] = std::make_pair(b, prj->first(mkf->fullTargetVariable()));
+ }
+ std::stable_sort(targets.begin(), targets.end(),
+ [](const TargetInfo &lhs, const TargetInfo &rhs)
+ {
+ return lhs.second < rhs.second;
+ });
+ for (auto prev = targets.begin(), it = std::next(prev); it != targets.end(); ++prev, ++it) {
+ if (prev->second == it->second) {
+ warn_msg(WarnLogic, "Targets of builds '%s' and '%s' conflict: %s.",
+ qPrintable(prev->first->build),
+ qPrintable(it->first->build),
+ qPrintable(prev->second.toQString()));
+ break;
+ }
+ }
+}
+
class SubdirsMetaMakefileGenerator : public MetaMakefileGenerator
{
protected:
@@ -328,17 +380,13 @@ SubdirsMetaMakefileGenerator::init()
hasError |= tmpError;
}
sub->makefile = MetaMakefileGenerator::createMetaGenerator(sub_proj, sub_name);
- if(0 && sub->makefile->type() == SUBDIRSMETATYPE) {
- subs.append(sub);
- } else {
- const QString output_name = Option::output.fileName();
- Option::output.setFileName(sub->output_file);
- hasError |= !sub->makefile->write();
- delete sub;
- qmakeClearCaches();
- sub = nullptr;
- Option::output.setFileName(output_name);
- }
+ const QString output_name = Option::output.fileName();
+ Option::output.setFileName(sub->output_file);
+ hasError |= !sub->makefile->write();
+ delete sub;
+ qmakeClearCaches();
+ sub = nullptr;
+ Option::output.setFileName(output_name);
Option::output_dir = old_output_dir;
qmake_setpwd(oldpwd);
diff --git a/qmake/generators/projectgenerator.cpp b/qmake/generators/projectgenerator.cpp
index 19acc09e85..613c97fb85 100644
--- a/qmake/generators/projectgenerator.cpp
+++ b/qmake/generators/projectgenerator.cpp
@@ -50,10 +50,6 @@ static QString project_builtin_regx() //calculate the builtin regular expression
return ret;
}
-ProjectGenerator::ProjectGenerator() : MakefileGenerator()
-{
-}
-
void
ProjectGenerator::init()
{
@@ -219,7 +215,7 @@ ProjectGenerator::init()
}
//setup deplist
- QList<QMakeLocalFileName> deplist;
+ QVector<QMakeLocalFileName> deplist;
{
const ProStringList &d = v["DEPENDPATH"];
for(int i = 0; i < d.size(); ++i)
@@ -324,14 +320,14 @@ ProjectGenerator::init()
bool
ProjectGenerator::writeMakefile(QTextStream &t)
{
- t << "######################################################################" << endl;
- t << "# Automatically generated by qmake (" QMAKE_VERSION_STR ") " << QDateTime::currentDateTime().toString() << endl;
- t << "######################################################################" << endl << endl;
+ t << "######################################################################" << Qt::endl;
+ t << "# Automatically generated by qmake (" QMAKE_VERSION_STR ") " << QDateTime::currentDateTime().toString() << Qt::endl;
+ t << "######################################################################" << Qt::endl << Qt::endl;
if (!Option::globals->extra_cmds[QMakeEvalBefore].isEmpty())
- t << Option::globals->extra_cmds[QMakeEvalBefore] << endl;
+ t << Option::globals->extra_cmds[QMakeEvalBefore] << Qt::endl;
t << getWritableVar("TEMPLATE_ASSIGN", false);
if(project->first("TEMPLATE_ASSIGN") == "subdirs") {
- t << endl << "# Directories" << "\n"
+ t << Qt::endl << "# Directories" << "\n"
<< getWritableVar("SUBDIRS");
} else {
//figure out target
@@ -343,7 +339,7 @@ ProjectGenerator::writeMakefile(QTextStream &t)
t << getWritableVar("TARGET_ASSIGN")
<< getWritableVar("CONFIG", false)
<< getWritableVar("CONFIG_REMOVE", false)
- << getWritableVar("INCLUDEPATH") << endl;
+ << getWritableVar("INCLUDEPATH") << Qt::endl;
t << "# You can make your code fail to compile if you use deprecated APIs.\n"
"# In order to do so, uncomment the following line.\n"
@@ -362,7 +358,7 @@ ProjectGenerator::writeMakefile(QTextStream &t)
<< getWritableVar("TRANSLATIONS");
}
if (!Option::globals->extra_cmds[QMakeEvalAfter].isEmpty())
- t << Option::globals->extra_cmds[QMakeEvalAfter] << endl;
+ t << Option::globals->extra_cmds[QMakeEvalAfter] << Qt::endl;
return true;
}
diff --git a/qmake/generators/projectgenerator.h b/qmake/generators/projectgenerator.h
index 02a331bd4f..374bad98c7 100644
--- a/qmake/generators/projectgenerator.h
+++ b/qmake/generators/projectgenerator.h
@@ -46,15 +46,10 @@ protected:
QString escapeFilePath(const QString &) const override { Q_ASSERT(false); return QString(); }
public:
- ProjectGenerator();
- ~ProjectGenerator();
bool supportsMetaBuild() override { return false; }
bool openOutput(QFile &, const QString &) const override;
};
-inline ProjectGenerator::~ProjectGenerator()
-{ }
-
QT_END_NAMESPACE
#endif // PROJECTGENERATOR_H
diff --git a/qmake/generators/unix/unixmake.cpp b/qmake/generators/unix/unixmake.cpp
index d7c9413290..e56e8c41b6 100644
--- a/qmake/generators/unix/unixmake.cpp
+++ b/qmake/generators/unix/unixmake.cpp
@@ -28,7 +28,6 @@
#include "unixmake.h"
#include "option.h"
-#include <qregexp.h>
#include <qfile.h>
#include <qhash.h>
#include <qdir.h>
@@ -199,9 +198,8 @@ UnixMakefileGenerator::init()
QString headerSuffix;
if (project->isActiveConfig("clang_pch_style"))
headerSuffix = project->first("QMAKE_PCH_OUTPUT_EXT").toQString();
- else
- pchBaseName += project->first("QMAKE_PCH_OUTPUT_EXT").toQString();
+ pchBaseName += project->first("QMAKE_PCH_OUTPUT_EXT").toQString();
pchBaseName += Option::dir_sep;
ProString language = project->first(ProKey("QMAKE_LANGUAGE_" + compiler));
@@ -320,8 +318,7 @@ QStringList
if(!project->isEmpty("PRECOMPILED_DIR"))
header_prefix = project->first("PRECOMPILED_DIR").toQString();
header_prefix += project->first("QMAKE_ORIG_TARGET").toQString();
- if (!project->isActiveConfig("clang_pch_style"))
- header_prefix += project->first("QMAKE_PCH_OUTPUT_EXT").toQString();
+ header_prefix += project->first("QMAKE_PCH_OUTPUT_EXT").toQString();
if (project->isActiveConfig("icc_pch_style")) {
// icc style
ProStringList pchArchs = project->values("QMAKE_PCH_ARCHS");
@@ -393,7 +390,7 @@ UnixMakefileGenerator::fixLibFlag(const ProString &lib)
bool
UnixMakefileGenerator::findLibraries(bool linkPrl, bool mergeLflags)
{
- QList<QMakeLocalFileName> libdirs, frameworkdirs;
+ QVector<QMakeLocalFileName> libdirs, frameworkdirs;
int libidx = 0, fwidx = 0;
for (const ProString &dlib : project->values("QMAKE_DEFAULT_LIBDIRS"))
libdirs.append(QMakeLocalFileName(dlib.toQString()));
@@ -419,9 +416,8 @@ UnixMakefileGenerator::findLibraries(bool linkPrl, bool mergeLflags)
libdirs.insert(libidx++, f);
} else if(opt.startsWith("-l")) {
QString lib = opt.mid(2);
- for (QList<QMakeLocalFileName>::Iterator dep_it = libdirs.begin();
- dep_it != libdirs.end(); ++dep_it) {
- QString libBase = (*dep_it).local() + '/'
+ for (const QMakeLocalFileName &libdir : qAsConst(libdirs)) {
+ QString libBase = libdir.local() + '/'
+ project->first("QMAKE_PREFIX_SHLIB") + lib;
if (linkPrl && processPrlFile(libBase, true))
goto found;
@@ -435,12 +431,9 @@ UnixMakefileGenerator::findLibraries(bool linkPrl, bool mergeLflags)
QMakeLocalFileName f(opt.mid(2));
if (!frameworkdirs.contains(f))
frameworkdirs.insert(fwidx++, f);
- } else if (target_mode == TARG_MAC_MODE && opt.startsWith("-framework")) {
+ } else if (target_mode == TARG_MAC_MODE && opt == "-framework") {
if (linkPrl) {
- if (opt.length() == 10)
- opt = (*++it).toQString();
- else
- opt = opt.mid(10).trimmed();
+ opt = (*++it).toQString();
static const QChar suffixMarker = ',';
const int suffixPosition = opt.indexOf(suffixMarker);
const bool hasSuffix = suffixPosition >= 0;
@@ -450,15 +443,21 @@ UnixMakefileGenerator::findLibraries(bool linkPrl, bool mergeLflags)
opt.remove(suffixMarker); // Apply suffix by removing marker
}
for (const QMakeLocalFileName &dir : qAsConst(frameworkdirs)) {
+ auto processPrlIfFound = [&](QString directory) {
+ QString suffixedPrl = directory + opt;
+ if (processPrlFile(suffixedPrl, true))
+ return true;
+ if (hasSuffix) {
+ QString unsuffixedPrl = directory + frameworkName;
+ if (processPrlFile(unsuffixedPrl, true))
+ return true;
+ }
+ return false;
+ };
QString frameworkDirectory = dir.local() + "/" + frameworkName + + ".framework/";
- QString suffixedPrl = frameworkDirectory + opt;
- if (processPrlFile(suffixedPrl, true))
+ if (processPrlIfFound(frameworkDirectory + "Resources/")
+ || processPrlIfFound(frameworkDirectory))
break;
- if (hasSuffix) {
- QString unsuffixedPrl = frameworkDirectory + frameworkName;
- if (processPrlFile(unsuffixedPrl, true))
- break;
- }
}
} else {
if (opt.length() == 10)
@@ -604,7 +603,7 @@ UnixMakefileGenerator::defaultInstall(const QString &t)
dst = escapeFilePath(filePrefixRoot(root, targetdir + src.section('/', -1)));
if(!ret.isEmpty())
ret += "\n\t";
- ret += "-$(QINSTALL) " + escapeFilePath(Option::fixPathToTargetOS(src, false)) + ' ' + dst;
+ ret += "$(QINSTALL) " + escapeFilePath(Option::fixPathToTargetOS(src, false)) + ' ' + dst;
if(!uninst.isEmpty())
uninst.append("\n\t");
uninst.append("-$(DEL_FILE) " + dst);
@@ -640,16 +639,16 @@ UnixMakefileGenerator::defaultInstall(const QString &t)
QString copy_cmd;
if (bundle == SolidBundle) {
- copy_cmd += "-$(QINSTALL) " + src_targ + ' ' + plain_targ;
+ copy_cmd += "$(QINSTALL) " + src_targ + ' ' + plain_targ;
} else if (project->first("TEMPLATE") == "lib" && project->isActiveConfig("staticlib")) {
- copy_cmd += "-$(QINSTALL) " + src_targ + ' ' + dst_targ;
+ copy_cmd += "$(QINSTALL) " + src_targ + ' ' + dst_targ;
} else if (!isAux) {
if (bundle == SlicedBundle) {
if (!ret.isEmpty())
ret += "\n\t";
ret += mkdir_p_asstring("\"`dirname " + dst_targ + "`\"", false);
}
- copy_cmd += "-$(QINSTALL_PROGRAM) " + src_targ + ' ' + dst_targ;
+ copy_cmd += "$(QINSTALL_PROGRAM) " + src_targ + ' ' + dst_targ;
}
if(project->first("TEMPLATE") == "lib" && !project->isActiveConfig("staticlib")
&& project->values(ProKey(t + ".CONFIG")).indexOf("fix_rpath") != -1) {
@@ -702,7 +701,7 @@ UnixMakefileGenerator::defaultInstall(const QString &t)
ret += "\n\t";
ret += mkdir_p_asstring("\"`dirname " + dst + "`\"", false) + "\n\t";
ret += "-$(DEL_FILE) " + dst + "\n\t"; // Can't overwrite symlinks to directories
- ret += "-$(QINSTALL) " + escapeFilePath(src) + " " + dst;
+ ret += "$(QINSTALL) " + escapeFilePath(src) + " " + dst;
if (!uninst.isEmpty())
uninst.append("\n\t");
uninst.append("-$(DEL_FILE) " + dst);
diff --git a/qmake/generators/unix/unixmake.h b/qmake/generators/unix/unixmake.h
index 5b0766855b..28302b4f15 100644
--- a/qmake/generators/unix/unixmake.h
+++ b/qmake/generators/unix/unixmake.h
@@ -35,18 +35,13 @@ QT_BEGIN_NAMESPACE
class UnixMakefileGenerator : public MakefileGenerator
{
- bool include_deps;
+ bool include_deps = false;
QString libtoolFileName(bool fixify=true);
void writeLibtoolFile(); // for libtool
void writePrlFile(QTextStream &) override;
-public:
- UnixMakefileGenerator();
- ~UnixMakefileGenerator();
-
protected:
virtual bool doPrecompiledHeaders() const { return project->isActiveConfig("precompile_header"); }
- bool doDepends() const override { return !Option::mkfile::do_stub_makefile && MakefileGenerator::doDepends(); }
#ifdef Q_OS_WIN // MinGW x-compiling for QNX
QString installRoot() const override;
#endif
@@ -63,15 +58,12 @@ protected:
void writeSubTargets(QTextStream &t, QList<SubTarget*> subtargets, int flags) override;
void writeMakeParts(QTextStream &);
bool writeMakefile(QTextStream &) override;
-
+ std::pair<bool, QString> writeObjectsPart(QTextStream &, bool do_incremental);
private:
void init2();
ProStringList libdirToFlags(const ProKey &key);
};
-inline UnixMakefileGenerator::~UnixMakefileGenerator()
-{ }
-
QT_END_NAMESPACE
#endif // UNIXMAKE_H
diff --git a/qmake/generators/unix/unixmake2.cpp b/qmake/generators/unix/unixmake2.cpp
index 9888b4816a..20f2c88444 100644
--- a/qmake/generators/unix/unixmake2.cpp
+++ b/qmake/generators/unix/unixmake2.cpp
@@ -39,11 +39,6 @@
QT_BEGIN_NAMESPACE
-UnixMakefileGenerator::UnixMakefileGenerator() : MakefileGenerator(), include_deps(false)
-{
-
-}
-
void
UnixMakefileGenerator::writePrlFile(QTextStream &t)
{
@@ -71,8 +66,6 @@ UnixMakefileGenerator::writeMakefile(QTextStream &t)
if (project->first("TEMPLATE") == "app" ||
project->first("TEMPLATE") == "lib" ||
project->first("TEMPLATE") == "aux") {
- if(Option::mkfile::do_stub_makefile && MakefileGenerator::writeStubMakefile(t))
- return true;
writeMakeParts(t);
return MakefileGenerator::writeMakefile(t);
} else if (project->first("TEMPLATE") == "subdirs") {
@@ -86,8 +79,8 @@ void
UnixMakefileGenerator::writeDefaultVariables(QTextStream &t)
{
MakefileGenerator::writeDefaultVariables(t);
- t << "TAR = " << var("QMAKE_TAR") << endl;
- t << "COMPRESS = " << var("QMAKE_GZIP") << endl;
+ t << "TAR = " << var("QMAKE_TAR") << Qt::endl;
+ t << "COMPRESS = " << var("QMAKE_GZIP") << Qt::endl;
if (project->isEmpty("QMAKE_DISTNAME")) {
ProString distname = project->first("QMAKE_ORIG_TARGET");
@@ -95,13 +88,13 @@ UnixMakefileGenerator::writeDefaultVariables(QTextStream &t)
distname += project->first("VERSION");
project->values("QMAKE_DISTNAME") = distname;
}
- t << "DISTNAME = " << fileVar("QMAKE_DISTNAME") << endl;
+ t << "DISTNAME = " << fileVar("QMAKE_DISTNAME") << Qt::endl;
if (project->isEmpty("QMAKE_DISTDIR"))
project->values("QMAKE_DISTDIR") = project->first("QMAKE_DISTNAME");
t << "DISTDIR = " << escapeFilePath(fileFixify(
(project->isEmpty("OBJECTS_DIR") ? ProString(".tmp/") : project->first("OBJECTS_DIR")) + project->first("QMAKE_DISTDIR"),
- FileFixifyFromOutdir | FileFixifyAbsolute)) << endl;
+ FileFixifyFromOutdir | FileFixifyAbsolute)) << Qt::endl;
}
void
@@ -109,10 +102,10 @@ UnixMakefileGenerator::writeSubTargets(QTextStream &t, QList<MakefileGenerator::
{
MakefileGenerator::writeSubTargets(t, targets, flags);
- t << "dist: distdir FORCE" << endl;
+ t << "dist: distdir FORCE" << Qt::endl;
t << "\t(cd `dirname $(DISTDIR)` && $(TAR) $(DISTNAME).tar $(DISTNAME) && $(COMPRESS) $(DISTNAME).tar)"
" && $(MOVE) `dirname $(DISTDIR)`/$(DISTNAME).tar.gz . && $(DEL_FILE) -r $(DISTDIR)";
- t << endl << endl;
+ t << Qt::endl << Qt::endl;
t << "distdir:";
for (int target = 0; target < targets.size(); ++target) {
@@ -121,7 +114,7 @@ UnixMakefileGenerator::writeSubTargets(QTextStream &t, QList<MakefileGenerator::
}
t << " FORCE\n\t"
<< mkdir_p_asstring("$(DISTDIR)", false) << "\n\t"
- << "$(COPY_FILE) --parents " << fileVar("DISTFILES") << " $(DISTDIR)" << Option::dir_sep << endl << endl;
+ << "$(COPY_FILE) --parents " << fileVar("DISTFILES") << " $(DISTDIR)" << Option::dir_sep << Qt::endl << Qt::endl;
const QString abs_source_path = project->first("QMAKE_ABSOLUTE_SOURCE_PATH").toQString();
for (int target = 0; target < targets.size(); ++target) {
@@ -154,7 +147,7 @@ UnixMakefileGenerator::writeSubTargets(QTextStream &t, QList<MakefileGenerator::
t << subtarget->target << "-distdir: FORCE";
writeSubTargetCall(t, in_directory, in, out_directory, escapeFilePath(out),
out_directory_cdin, makefilein);
- t << endl;
+ t << Qt::endl;
}
}
@@ -196,11 +189,11 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
writeExportedVariables(t);
t << "####### Compiler, tools and options\n\n";
- t << "CC = " << var("QMAKE_CC") << endl;
- t << "CXX = " << var("QMAKE_CXX") << endl;
+ t << "CC = " << var("QMAKE_CC") << Qt::endl;
+ t << "CXX = " << var("QMAKE_CXX") << Qt::endl;
t << "DEFINES = "
<< varGlue("PRL_EXPORT_DEFINES","-D"," -D"," ")
- << varGlue("DEFINES","-D"," -D","") << endl;
+ << varGlue("DEFINES","-D"," -D","") << Qt::endl;
t << "CFLAGS = " << var("QMAKE_CFLAGS") << " $(DEFINES)\n";
t << "CXXFLAGS = " << var("QMAKE_CXXFLAGS") << " $(DEFINES)\n";
t << "INCPATH =";
@@ -221,104 +214,74 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
}
if(!project->isEmpty("QMAKE_FRAMEWORKPATH_FLAGS"))
t << " " << var("QMAKE_FRAMEWORKPATH_FLAGS");
- t << endl;
+ t << Qt::endl;
writeDefaultVariables(t);
if(!project->isActiveConfig("staticlib")) {
- t << "LINK = " << var("QMAKE_LINK") << endl;
- t << "LFLAGS = " << var("QMAKE_LFLAGS") << endl;
+ t << "LINK = " << var("QMAKE_LINK") << Qt::endl;
+ t << "LFLAGS = " << var("QMAKE_LFLAGS") << Qt::endl;
t << "LIBS = $(SUBLIBS) " << fixLibFlags("LIBS").join(' ') << ' '
<< fixLibFlags("LIBS_PRIVATE").join(' ') << ' '
<< fixLibFlags("QMAKE_LIBS").join(' ') << ' '
- << fixLibFlags("QMAKE_LIBS_PRIVATE").join(' ') << endl;
+ << fixLibFlags("QMAKE_LIBS_PRIVATE").join(' ') << Qt::endl;
}
- t << "AR = " << var("QMAKE_AR") << endl;
- t << "RANLIB = " << var("QMAKE_RANLIB") << endl;
- t << "SED = " << var("QMAKE_STREAM_EDITOR") << endl;
- t << "STRIP = " << var("QMAKE_STRIP") << endl;
+ t << "AR = " << var("QMAKE_AR") << Qt::endl;
+ t << "RANLIB = " << var("QMAKE_RANLIB") << Qt::endl;
+ t << "SED = " << var("QMAKE_STREAM_EDITOR") << Qt::endl;
+ t << "STRIP = " << var("QMAKE_STRIP") << Qt::endl;
- t << endl;
+ t << Qt::endl;
t << "####### Output directory\n\n";
// This is used in commands by some .prf files.
if (! project->values("OBJECTS_DIR").isEmpty())
- t << "OBJECTS_DIR = " << escapeDir(fileVar("OBJECTS_DIR")) << endl;
+ t << "OBJECTS_DIR = " << escapeDir(fileVar("OBJECTS_DIR")) << Qt::endl;
else
t << "OBJECTS_DIR = ./\n";
- t << endl;
+ t << Qt::endl;
/* files */
t << "####### Files\n\n";
// This is used by the dist target.
- t << "SOURCES = " << fileVarList("SOURCES") << ' ' << fileVarList("GENERATED_SOURCES") << endl;
- if(do_incremental) {
- const ProStringList &objs = project->values("OBJECTS");
- const ProStringList &incrs = project->values("QMAKE_INCREMENTAL");
- ProStringList incrs_out;
- t << "OBJECTS = ";
- for (ProStringList::ConstIterator objit = objs.begin(); objit != objs.end(); ++objit) {
- bool increment = false;
- for (ProStringList::ConstIterator incrit = incrs.begin(); incrit != incrs.end(); ++incrit) {
- if ((*objit).toQString().indexOf(QRegExp((*incrit).toQString(), Qt::CaseSensitive,
- QRegExp::Wildcard)) != -1) {
- increment = true;
- incrs_out.append((*objit));
- break;
- }
- }
- if(!increment)
- t << "\\\n\t\t" << (*objit);
- }
- if(incrs_out.count() == objs.count()) { //we just switched places, no real incrementals to be done!
- t << escapeFilePaths(incrs_out).join(QString(" \\\n\t\t")) << endl;
- } else if(!incrs_out.count()) {
- t << endl;
- } else {
- src_incremental = true;
- t << endl;
- t << "INCREMENTAL_OBJECTS = "
- << escapeFilePaths(incrs_out).join(QString(" \\\n\t\t")) << endl;
- }
- } else {
- // Used all over the place in both deps and commands.
- t << "OBJECTS = " << valList(escapeDependencyPaths(project->values("OBJECTS"))) << endl;
- }
+ t << "SOURCES = " << fileVarList("SOURCES") << ' ' << fileVarList("GENERATED_SOURCES") << Qt::endl;
+ auto objectParts = writeObjectsPart(t, do_incremental);
+ src_incremental = objectParts.first;
if(do_incremental && !src_incremental)
do_incremental = false;
t << "DIST = " << valList(fileFixify(project->values("DISTFILES").toQStringList())) << " "
- << fileVarList("HEADERS") << ' ' << fileVarList("SOURCES") << endl;
- t << "QMAKE_TARGET = " << fileVar("QMAKE_ORIG_TARGET") << endl;
- t << "DESTDIR = " << escapeDir(fileVar("DESTDIR")) << endl;
- t << "TARGET = " << fileVar("TARGET") << endl;
+ << fileVarList("HEADERS") << ' ' << fileVarList("SOURCES") << Qt::endl;
+ t << "QMAKE_TARGET = " << fileVar("QMAKE_ORIG_TARGET") << Qt::endl;
+ t << "DESTDIR = " << escapeDir(fileVar("DESTDIR")) << Qt::endl;
+ t << "TARGET = " << fileVar("TARGET") << Qt::endl;
if(project->isActiveConfig("plugin")) {
- t << "TARGETD = " << fileVar("TARGET") << endl;
+ t << "TARGETD = " << fileVar("TARGET") << Qt::endl;
} else if(!project->isActiveConfig("staticlib") && project->values("QMAKE_APP_FLAG").isEmpty()) {
- t << "TARGETA = " << fileVar("TARGETA") << endl;
+ t << "TARGETA = " << fileVar("TARGETA") << Qt::endl;
if(!project->isEmpty("QMAKE_BUNDLE")) {
- t << "TARGETD = " << fileVar("TARGET_x.y") << endl;
- t << "TARGET0 = " << fileVar("TARGET_") << endl;
+ t << "TARGETD = " << fileVar("TARGET_x.y") << Qt::endl;
+ t << "TARGET0 = " << fileVar("TARGET_") << Qt::endl;
} else if (!project->isActiveConfig("unversioned_libname")) {
- t << "TARGET0 = " << fileVar("TARGET_") << endl;
+ t << "TARGET0 = " << fileVar("TARGET_") << Qt::endl;
if (project->isEmpty("QMAKE_HPUX_SHLIB")) {
- t << "TARGETD = " << fileVar("TARGET_x.y.z") << endl;
- t << "TARGET1 = " << fileVar("TARGET_x") << endl;
- t << "TARGET2 = " << fileVar("TARGET_x.y") << endl;
+ t << "TARGETD = " << fileVar("TARGET_x.y.z") << Qt::endl;
+ t << "TARGET1 = " << fileVar("TARGET_x") << Qt::endl;
+ t << "TARGET2 = " << fileVar("TARGET_x.y") << Qt::endl;
} else {
- t << "TARGETD = " << fileVar("TARGET_x") << endl;
+ t << "TARGETD = " << fileVar("TARGET_x") << Qt::endl;
}
}
}
writeExtraCompilerVariables(t);
writeExtraVariables(t);
- t << endl;
+ t << Qt::endl;
// blasted includes
const ProStringList &qeui = project->values("QMAKE_EXTRA_INCLUDES");
ProStringList::ConstIterator it;
for(it = qeui.begin(); it != qeui.end(); ++it)
- t << "include " << escapeDependencyPath(*it) << endl;
+ t << "include " << escapeDependencyPath(*it) << Qt::endl;
/* rules */
t << "first:" << (!project->isActiveConfig("no_default_goal_deps") ? " all" : "") << "\n";
@@ -328,7 +291,7 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
ProStringList objects = project->values("OBJECTS");
for (ProStringList::Iterator it = objects.begin(); it != objects.end(); ++it) {
QString d_file = (*it).toQString().replace(QRegExp(Option::obj_ext + "$"), ".d");
- t << "-include " << escapeDependencyPath(d_file) << endl;
+ t << "-include " << escapeDependencyPath(d_file) << Qt::endl;
project->values("QMAKE_DISTCLEAN") << d_file;
}
} else {
@@ -386,8 +349,8 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
QStringList deps = findDependencies((*it).toQString()).filter(QRegExp(
"((^|/)" + Option::h_moc_mod + "|" + Option::cpp_moc_ext + "$)"));
if(!deps.isEmpty())
- t << d_file_d << ": " << finalizeDependencyPaths(deps).join(' ') << endl;
- t << "-include " << d_file_d << endl;
+ t << d_file_d << ": " << finalizeDependencyPaths(deps).join(' ') << Qt::endl;
+ t << "-include " << d_file_d << Qt::endl;
project->values("QMAKE_DISTCLEAN") += d_file;
}
}
@@ -406,7 +369,7 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
for (ProStringList::ConstIterator it = l.begin(); it != l.end(); ++it)
t << escapeFilePath(libdir + project->first("QMAKE_PREFIX_STATICLIB") + (*it) + '.'
+ project->first("QMAKE_EXTENSION_STATICLIB")) << ' ';
- t << endl << endl;
+ t << Qt::endl << Qt::endl;
}
QString target_deps;
if ((project->isActiveConfig("depend_prl") || project->isActiveConfig("fast_depend_prl"))
@@ -511,7 +474,7 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
t << "$(LINK) $(LFLAGS) " << var("QMAKE_LINK_O_FLAG") << "$(TARGET) " << incr_deps << " " << incr_objs << " $(OBJCOMP) $(LIBS)";
if(!project->isEmpty("QMAKE_POST_LINK"))
t << "\n\t" << var("QMAKE_POST_LINK");
- t << endl << endl;
+ t << Qt::endl << Qt::endl;
} else {
t << depVar("TARGET") << ": " << depVar("PRE_TARGETDEPS") << " $(OBJECTS) "
<< target_deps << ' ' << depVar("POST_TARGETDEPS") << "\n\t";
@@ -520,11 +483,12 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
t << mkdir_p_asstring(destdir) << "\n\t";
if (!project->isEmpty("QMAKE_PRE_LINK"))
t << var("QMAKE_PRE_LINK") << "\n\t";
- t << "$(LINK) $(LFLAGS) " << var("QMAKE_LINK_O_FLAG") << "$(TARGET) $(OBJECTS) $(OBJCOMP) $(LIBS)";
+ t << "$(LINK) $(LFLAGS) " << var("QMAKE_LINK_O_FLAG") << "$(TARGET) "
+ << objectParts.second << " $(OBJCOMP) $(LIBS)";
if (!project->isEmpty("QMAKE_POST_LINK"))
t << "\n\t" << var("QMAKE_POST_LINK");
}
- t << endl << endl;
+ t << Qt::endl << Qt::endl;
}
allDeps = ' ' + depVar("TARGET");
} else if(!project->isActiveConfig("staticlib")) {
@@ -555,7 +519,7 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
//actual target
const QString link_deps = "$(OBJECTS) ";
t << incr_target_dir_d << ": " << link_deps << "\n\t"
- << "ld -r -o " << incr_target_dir_f << ' ' << link_deps << endl;
+ << "ld -r -o " << incr_target_dir_f << ' ' << link_deps << Qt::endl;
//communicated below
ProStringList &cmd = project->values("QMAKE_LINK_SHLIB_CMD");
cmd[0] = cmd.at(0).toQString().replace(QLatin1String("$(OBJECTS) "), QLatin1String("$(INCREMENTAL_OBJECTS)")); //ick
@@ -613,7 +577,7 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
<< "-$(MOVE) $(TARGET) " << destdir << "$(TARGET)";
if(!project->isEmpty("QMAKE_POST_LINK"))
t << "\n\t" << var("QMAKE_POST_LINK");
- t << endl << endl;
+ t << Qt::endl << Qt::endl;
} else if(!project->isEmpty("QMAKE_BUNDLE")) {
bundledFiles << destdir_r + var("TARGET");
t << "\n\t"
@@ -627,7 +591,7 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
" Versions/Current/$(TARGET) $(DESTDIR)$(TARGET0)") << "\n\t";
if(!project->isEmpty("QMAKE_POST_LINK"))
t << "\n\t" << var("QMAKE_POST_LINK");
- t << endl << endl;
+ t << Qt::endl << Qt::endl;
} else if(project->isEmpty("QMAKE_HPUX_SHLIB")) {
t << "\n\t";
@@ -661,7 +625,7 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
}
if(!project->isEmpty("QMAKE_POST_LINK"))
t << "\n\t" << var("QMAKE_POST_LINK");
- t << endl << endl;
+ t << Qt::endl << Qt::endl;
} else {
t << "\n\t"
<< "-$(DEL_FILE) $(TARGET) $(TARGET0)\n\t"
@@ -675,9 +639,9 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
<< "-$(MOVE) $(TARGET0) " << destdir << "$(TARGET0)\n\t";
if(!project->isEmpty("QMAKE_POST_LINK"))
t << "\n\t" << var("QMAKE_POST_LINK");
- t << endl << endl;
+ t << Qt::endl << Qt::endl;
}
- t << endl << endl;
+ t << Qt::endl << Qt::endl;
if (! project->isActiveConfig("plugin")) {
t << "staticlib: " << depVar("TARGETA") << "\n\n";
@@ -695,7 +659,7 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
t << "\n\t" << var("QMAKE_POST_LINK");
if(!project->isEmpty("QMAKE_RANLIB"))
t << "\n\t$(RANLIB) $(TARGETA)";
- t << endl << endl;
+ t << Qt::endl << Qt::endl;
}
} else {
QString destdir_r = project->first("DESTDIR").toQString();
@@ -715,7 +679,7 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
t << "\t" << var("QMAKE_POST_LINK") << "\n";
if (!project->isEmpty("QMAKE_RANLIB"))
t << "\t$(RANLIB) " << destdir << "$(TARGET)\n";
- t << endl << endl;
+ t << Qt::endl << Qt::endl;
}
writeMakeQmake(t);
@@ -729,7 +693,7 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
}
if(!meta_files.isEmpty())
t << escapeDependencyPaths(meta_files).join(" ") << ": \n\t"
- << "@$(QMAKE) -prl " << escapeFilePath(project->projectFile()) << ' ' << buildArgs(true) << endl;
+ << "@$(QMAKE) -prl " << escapeFilePath(project->projectFile()) << ' ' << buildArgs(true) << Qt::endl;
}
if (!project->isEmpty("QMAKE_BUNDLE")) {
@@ -750,7 +714,7 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
<< "@echo \"APPL"
<< (project->isEmpty("QMAKE_PKGINFO_TYPEINFO")
? QString::fromLatin1("????") : project->first("QMAKE_PKGINFO_TYPEINFO").left(4))
- << "\" > " << pkginfo_f << endl;
+ << "\" > " << pkginfo_f << Qt::endl;
}
if (!project->first("QMAKE_BUNDLE_RESOURCE_FILE").isEmpty()) {
ProString resources = project->first("QMAKE_BUNDLE_RESOURCE_FILE");
@@ -859,7 +823,7 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
<< "-e \"s,\\$${EXECUTABLE_NAME}," << (app_bundle_name.isEmpty() ? app_bundle_name : plugin_bundle_name) << ",g\" "
<< "-e \"s,@TYPEINFO@,"<< typeInfo << ",g\" "
<< "-e \"s,\\$${QMAKE_PKGINFO_TYPEINFO},"<< typeInfo << ",g\" "
- << "" << info_plist << " >" << info_plist_out << endl;
+ << "" << info_plist << " >" << info_plist_out << Qt::endl;
//copy the icon
if (!project->isEmpty("ICON")) {
QString dir = bundle_dir + "Contents/Resources/";
@@ -870,7 +834,7 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
t << escapeDependencyPath(icon_path) << ": " << escapeDependencyPath(icon) << "\n\t"
<< mkdir_p_asstring(dir) << "\n\t"
<< "@$(DEL_FILE) " << icon_path_f << "\n\t"
- << "@$(COPY_FILE) " << escapeFilePath(icon) << ' ' << icon_path_f << endl;
+ << "@$(COPY_FILE) " << escapeFilePath(icon) << ' ' << icon_path_f << Qt::endl;
}
} else {
ProString lib_bundle_name = var("QMAKE_FRAMEWORK_BUNDLE_NAME");
@@ -887,7 +851,7 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
<< "-e \"s,\\$${EXECUTABLE_NAME}," << lib_bundle_name << ",g\" "
<< "-e \"s,@TYPEINFO@," << typeInfo << ",g\" "
<< "-e \"s,\\$${QMAKE_PKGINFO_TYPEINFO}," << typeInfo << ",g\" "
- << "" << info_plist << " >" << info_plist_out << endl;
+ << "" << info_plist << " >" << info_plist_out << Qt::endl;
}
break;
} // project->isActiveConfig("no_plist")
@@ -931,10 +895,10 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
QFileInfo fi(fileInfo(fn));
if(fi.isDir())
t << "@$(DEL_FILE) -r " << dst << "\n\t"
- << "@$(COPY_DIR) " << src << " " << dst << endl;
+ << "@$(COPY_DIR) " << src << " " << dst << Qt::endl;
else
t << "@$(DEL_FILE) " << dst << "\n\t"
- << "@$(COPY_FILE) " << src << " " << dst << endl;
+ << "@$(COPY_FILE) " << src << " " << dst << Qt::endl;
}
}
}
@@ -947,7 +911,7 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
alldeps << symIt.key();
t << escapeDependencyPath(symIt.key()) << ":\n\t"
<< mkdir_p_asstring(bundle_dir) << "\n\t"
- << "@$(SYMLINK) " << escapeFilePath(symIt.value()) << ' ' << bundle_dir_f << endl;
+ << "@$(SYMLINK) " << escapeFilePath(symIt.value()) << ' ' << bundle_dir_f << Qt::endl;
}
if (!project->isActiveConfig("shallow_bundle")) {
@@ -959,24 +923,24 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
<< mkdir_p_asstring(bundle_dir + "Versions") << "\n\t"
<< "@-$(DEL_FILE) " << currentLink_f << "\n\t"
<< "@$(SYMLINK) " << project->first("QMAKE_FRAMEWORK_VERSION")
- << ' ' << currentLink_f << endl;
+ << ' ' << currentLink_f << Qt::endl;
}
}
}
- t << endl << "all: " << deps
+ t << Qt::endl << "all: " << deps
<< valGlue(escapeDependencyPaths(project->values("ALL_DEPS")), " \\\n\t\t", " \\\n\t\t", "")
- << allDeps << endl << endl;
+ << allDeps << Qt::endl << Qt::endl;
t << "dist: distdir FORCE\n\t";
t << "(cd `dirname $(DISTDIR)` && $(TAR) $(DISTNAME).tar $(DISTNAME) && $(COMPRESS) $(DISTNAME).tar)"
" && $(MOVE) `dirname $(DISTDIR)`" << Option::dir_sep << "$(DISTNAME).tar.gz ."
" && $(DEL_FILE) -r $(DISTDIR)";
- t << endl << endl;
+ t << Qt::endl << Qt::endl;
t << "distdir: FORCE\n\t"
<< mkdir_p_asstring("$(DISTDIR)", false) << "\n\t"
- << "$(COPY_FILE) --parents $(DIST) $(DISTDIR)" << Option::dir_sep << endl;
+ << "$(COPY_FILE) --parents $(DIST) $(DISTDIR)" << Option::dir_sep << Qt::endl;
if(!project->isEmpty("QMAKE_EXTRA_COMPILERS")) {
const ProStringList &quc = project->values("QMAKE_EXTRA_COMPILERS");
for (ProStringList::ConstIterator it = quc.begin(); it != quc.end(); ++it) {
@@ -986,20 +950,20 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
if(val.isEmpty())
continue;
t << "\t$(COPY_FILE) --parents " << escapeFilePaths(val).join(' ')
- << " $(DISTDIR)" << Option::dir_sep << endl;
+ << " $(DISTDIR)" << Option::dir_sep << Qt::endl;
}
}
}
if(!project->isEmpty("TRANSLATIONS"))
- t << "\t$(COPY_FILE) --parents " << fileVar("TRANSLATIONS") << " $(DISTDIR)" << Option::dir_sep << endl;
- t << endl << endl;
+ t << "\t$(COPY_FILE) --parents " << fileVar("TRANSLATIONS") << " $(DISTDIR)" << Option::dir_sep << Qt::endl;
+ t << Qt::endl << Qt::endl;
QString clean_targets = " compiler_clean " + depVar("CLEAN_DEPS");
if(do_incremental) {
t << "incrclean:\n";
if(src_incremental)
t << "\t-$(DEL_FILE) $(INCREMENTAL_OBJECTS)\n";
- t << endl;
+ t << Qt::endl;
}
t << "clean:" << clean_targets << "\n\t";
@@ -1013,8 +977,7 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
if(!project->isEmpty("PRECOMPILED_DIR"))
precomph_out_dir = project->first("PRECOMPILED_DIR");
precomph_out_dir += project->first("QMAKE_ORIG_TARGET");
- if (!project->isActiveConfig("clang_pch_style"))
- precomph_out_dir += project->first("QMAKE_PCH_OUTPUT_EXT");
+ precomph_out_dir += project->first("QMAKE_PCH_OUTPUT_EXT");
if (project->isActiveConfig("icc_pch_style")) {
// icc style
@@ -1067,7 +1030,7 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
t << "-$(DEL_FILE) $(INCREMENTAL_OBJECTS)\n\t";
t << fileVarGlue("QMAKE_CLEAN","-$(DEL_FILE) "," ","\n\t")
<< "-$(DEL_FILE) *~ core *.core\n"
- << fileVarGlue("CLEAN_FILES","\t-$(DEL_FILE) "," ","") << endl << endl;
+ << fileVarGlue("CLEAN_FILES","\t-$(DEL_FILE) "," ","") << Qt::endl << Qt::endl;
ProString destdir = project->first("DESTDIR");
if (!destdir.isEmpty() && !destdir.endsWith(Option::dir_sep))
@@ -1075,7 +1038,7 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
t << "distclean: clean " << depVar("DISTCLEAN_DEPS") << '\n';
if(!project->isEmpty("QMAKE_BUNDLE")) {
QString bundlePath = escapeFilePath(destdir + project->first("QMAKE_BUNDLE"));
- t << "\t-$(DEL_FILE) -r " << bundlePath << endl;
+ t << "\t-$(DEL_FILE) -r " << bundlePath << Qt::endl;
} else if (project->isActiveConfig("staticlib") || project->isActiveConfig("plugin")) {
t << "\t-$(DEL_FILE) " << escapeFilePath(destdir) << "$(TARGET) \n";
} else if (project->values("QMAKE_APP_FLAG").isEmpty()) {
@@ -1094,9 +1057,9 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
{
QString ofile = fileFixify(Option::output.fileName());
if(!ofile.isEmpty())
- t << "\t-$(DEL_FILE) " << escapeFilePath(ofile) << endl;
+ t << "\t-$(DEL_FILE) " << escapeFilePath(ofile) << Qt::endl;
}
- t << endl << endl;
+ t << Qt::endl << Qt::endl;
t << "####### Sub-libraries\n\n";
if (!project->values("SUBLIBS").isEmpty()) {
@@ -1107,7 +1070,7 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
for (it = l.begin(); it != l.end(); ++it)
t << escapeDependencyPath(libdir + project->first("QMAKE_PREFIX_STATICLIB") + (*it) + '.'
+ project->first("QMAKE_EXTENSION_STATICLIB")) << ":\n\t"
- << var(ProKey("MAKELIB" + *it)) << endl << endl;
+ << var(ProKey("MAKELIB" + *it)) << Qt::endl << Qt::endl;
}
if(doPrecompiledHeaders() && !project->isEmpty("PRECOMPILED_HEADER")) {
@@ -1133,8 +1096,7 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
if(!project->isEmpty("PRECOMPILED_DIR"))
pchOutput = project->first("PRECOMPILED_DIR");
pchOutput += pchBaseName;
- if (!project->isActiveConfig("clang_pch_style"))
- pchOutput += project->first("QMAKE_PCH_OUTPUT_EXT");
+ pchOutput += project->first("QMAKE_PCH_OUTPUT_EXT");
if (!project->isActiveConfig("icc_pch_style")) {
// gcc style (including clang_pch_style)
@@ -1191,7 +1153,7 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
compilerExecutable = "$(CXX)";
// compile command
- t << "\n\t" << compilerExecutable << cflags << " $(INCPATH) " << pchArchFlags << endl << endl;
+ t << "\n\t" << compilerExecutable << cflags << " $(INCPATH) " << pchArchFlags << Qt::endl << Qt::endl;
}
}
}
@@ -1237,8 +1199,9 @@ void UnixMakefileGenerator::init2()
else
ar_cmd.append("$(AR) $(TARGETA) $(OBJECTS)");
if (!project->isEmpty("QMAKE_BUNDLE")) {
- project->values("PRL_TARGET").prepend(
- project->first("QMAKE_BUNDLE") + Option::dir_sep + project->first("TARGET"));
+ project->values("PRL_TARGET").prepend(project->first("QMAKE_BUNDLE") +
+ "/Versions/" + project->first("QMAKE_FRAMEWORK_VERSION") +
+ "/Resources/" + project->first("TARGET"));
ProString bundle_loc = project->first("QMAKE_BUNDLE_LOCATION");
if(!bundle_loc.isEmpty() && !bundle_loc.startsWith("/"))
bundle_loc.prepend("/");
@@ -1553,4 +1516,56 @@ UnixMakefileGenerator::writeLibtoolFile()
"libdir='" << Option::fixPathToTargetOS(install_dir.toQString(), false) << "'\n";
}
+std::pair<bool, QString> UnixMakefileGenerator::writeObjectsPart(QTextStream &t, bool do_incremental)
+{
+ bool src_incremental = false;
+ QString objectsLinkLine;
+ const ProStringList &objs = project->values("OBJECTS");
+ if (do_incremental) {
+ const ProStringList &incrs = project->values("QMAKE_INCREMENTAL");
+ ProStringList incrs_out;
+ t << "OBJECTS = ";
+ for (ProStringList::ConstIterator objit = objs.begin(); objit != objs.end(); ++objit) {
+ bool increment = false;
+ for (ProStringList::ConstIterator incrit = incrs.begin(); incrit != incrs.end(); ++incrit) {
+ if ((*objit).toQString().indexOf(QRegExp((*incrit).toQString(), Qt::CaseSensitive,
+ QRegExp::Wildcard)) != -1) {
+ increment = true;
+ incrs_out.append((*objit));
+ break;
+ }
+ }
+ if (!increment)
+ t << "\\\n\t\t" << (*objit);
+ }
+ if (incrs_out.count() == objs.count()) { //we just switched places, no real incrementals to be done!
+ t << escapeFilePaths(incrs_out).join(QString(" \\\n\t\t")) << endl;
+ } else if (!incrs_out.count()) {
+ t << endl;
+ } else {
+ src_incremental = true;
+ t << endl;
+ t << "INCREMENTAL_OBJECTS = "
+ << escapeFilePaths(incrs_out).join(QString(" \\\n\t\t")) << endl;
+ }
+ } else {
+ const ProString &objMax = project->first("QMAKE_LINK_OBJECT_MAX");
+ // Used all over the place in both deps and commands.
+ if (objMax.isEmpty() || project->values("OBJECTS").count() < objMax.toInt()) {
+ objectsLinkLine = "$(OBJECTS)";
+ } else {
+ QString ld_response_file = fileVar("OBJECTS_DIR");
+ ld_response_file += var("QMAKE_LINK_OBJECT_SCRIPT") + "." + var("TARGET");
+ if (!var("BUILD_NAME").isEmpty())
+ ld_response_file += "." + var("BUILD_NAME");
+ if (!var("MAKEFILE").isEmpty())
+ ld_response_file += "." + var("MAKEFILE");
+ createResponseFile(ld_response_file, objs);
+ objectsLinkLine = "@" + escapeFilePath(ld_response_file);
+ }
+ t << "OBJECTS = " << valList(escapeDependencyPaths(objs)) << endl;
+ }
+ return std::make_pair(src_incremental, objectsLinkLine);
+}
+
QT_END_NAMESPACE
diff --git a/qmake/generators/win32/mingw_make.cpp b/qmake/generators/win32/mingw_make.cpp
index 2175841264..096b041056 100644
--- a/qmake/generators/win32/mingw_make.cpp
+++ b/qmake/generators/win32/mingw_make.cpp
@@ -38,10 +38,6 @@
QT_BEGIN_NAMESPACE
-MingwMakefileGenerator::MingwMakefileGenerator() : Win32MakefileGenerator()
-{
-}
-
QString MingwMakefileGenerator::escapeDependencyPath(const QString &path) const
{
QString ret = path;
@@ -97,18 +93,6 @@ bool MingwMakefileGenerator::writeMakefile(QTextStream &t)
project->first("TEMPLATE") == "aux") {
if(project->isActiveConfig("create_pc") && project->first("TEMPLATE") == "lib")
writePkgConfigFile();
-
- if(Option::mkfile::do_stub_makefile) {
- t << "QMAKE = " << var("QMAKE_QMAKE") << endl;
- const ProStringList &qut = project->values("QMAKE_EXTRA_TARGETS");
- for (ProStringList::ConstIterator it = qut.begin(); it != qut.end(); ++it)
- t << escapeDependencyPath(*it) << ' ';
- t << "first all clean install distclean uninstall: qmake\n"
- << "qmake_all:\n";
- writeMakeQmake(t);
- t << "FORCE:\n\n";
- return true;
- }
writeMingwParts(t);
return MakefileGenerator::writeMakefile(t);
}
@@ -131,30 +115,6 @@ QString MingwMakefileGenerator::installRoot() const
return QStringLiteral("$(INSTALL_ROOT:@msyshack@%=%)");
}
-static void createResponseFile(const QString &fileName, const ProStringList &objList)
-{
- QString filePath = Option::output_dir + QDir::separator() + fileName;
- QFile file(filePath);
- if (file.open(QIODevice::WriteOnly | QIODevice::Text)) {
- QTextStream t(&file);
- for (ProStringList::ConstIterator it = objList.constBegin(); it != objList.constEnd(); ++it) {
- QString path = (*it).toQString();
- // In response files, whitespace and special characters are
- // escaped with a backslash; backslashes themselves can either
- // be escaped into double backslashes, or, as this is a list of
- // path names, converted to forward slashes.
- path.replace(QLatin1Char('\\'), QLatin1String("/"))
- .replace(QLatin1Char(' '), QLatin1String("\\ "))
- .replace(QLatin1Char('\t'), QLatin1String("\\\t"))
- .replace(QLatin1Char('"'), QLatin1String("\\\""))
- .replace(QLatin1Char('\''), QLatin1String("\\'"));
- t << path << endl;
- }
- t.flush();
- file.close();
- }
-}
-
void MingwMakefileGenerator::writeMingwParts(QTextStream &t)
{
writeStandardParts(t);
@@ -166,13 +126,13 @@ void MingwMakefileGenerator::writeMingwParts(QTextStream &t)
<< finalizeDependencyPaths(findDependencies(header)).join(" \\\n\t\t")
<< "\n\t" << mkdir_p_asstring(preCompHeaderOut)
<< "\n\t$(CC) -x c-header -c $(CFLAGS) $(INCPATH) -o " << escapeFilePath(cHeader)
- << ' ' << escapeFilePath(header) << endl << endl;
+ << ' ' << escapeFilePath(header) << Qt::endl << Qt::endl;
QString cppHeader = preCompHeaderOut + Option::dir_sep + "c++";
t << escapeDependencyPath(cppHeader) << ": " << escapeDependencyPath(header) << " "
<< finalizeDependencyPaths(findDependencies(header)).join(" \\\n\t\t")
<< "\n\t" << mkdir_p_asstring(preCompHeaderOut)
<< "\n\t$(CXX) -x c++-header -c $(CXXFLAGS) $(INCPATH) -o " << escapeFilePath(cppHeader)
- << ' ' << escapeFilePath(header) << endl << endl;
+ << ' ' << escapeFilePath(header) << Qt::endl << Qt::endl;
}
}
@@ -257,21 +217,21 @@ void MingwMakefileGenerator::writeIncPart(QTextStream &t)
t << "-I";
t << escapeFilePath(inc) << ' ';
}
- t << endl;
+ t << Qt::endl;
}
void MingwMakefileGenerator::writeLibsPart(QTextStream &t)
{
if(project->isActiveConfig("staticlib") && project->first("TEMPLATE") == "lib") {
- t << "LIB = " << var("QMAKE_LIB") << endl;
+ t << "LIB = " << var("QMAKE_LIB") << Qt::endl;
} else {
- t << "LINKER = " << var("QMAKE_LINK") << endl;
- t << "LFLAGS = " << var("QMAKE_LFLAGS") << endl;
+ t << "LINKER = " << var("QMAKE_LINK") << Qt::endl;
+ t << "LFLAGS = " << var("QMAKE_LFLAGS") << Qt::endl;
t << "LIBS = "
<< fixLibFlags("LIBS").join(' ') << ' '
<< fixLibFlags("LIBS_PRIVATE").join(' ') << ' '
<< fixLibFlags("QMAKE_LIBS").join(' ') << ' '
- << fixLibFlags("QMAKE_LIBS_PRIVATE").join(' ') << endl;
+ << fixLibFlags("QMAKE_LIBS_PRIVATE").join(' ') << Qt::endl;
}
}
@@ -332,7 +292,7 @@ void MingwMakefileGenerator::writeBuildRulesPart(QTextStream &t)
}
if(!project->isEmpty("QMAKE_POST_LINK"))
t << "\n\t" <<var("QMAKE_POST_LINK");
- t << endl;
+ t << Qt::endl;
}
void MingwMakefileGenerator::writeRcFilePart(QTextStream &t)
@@ -358,7 +318,11 @@ void MingwMakefileGenerator::writeRcFilePart(QTextStream &t)
if (defines.isEmpty())
defines = ProString(" $(DEFINES)");
- t << escapeDependencyPath(var("RES_FILE")) << ": " << escapeDependencyPath(rc_file) << "\n\t"
+ addSourceFile(rc_file, QMakeSourceFileInfo::SEEK_DEPS);
+ const QStringList rcDeps = QStringList(rc_file) << dependencies(rc_file);
+
+ t << escapeDependencyPath(var("RES_FILE")) << ": "
+ << escapeDependencyPaths(rcDeps).join(' ') << "\n\t"
<< var("QMAKE_RC") << " -i " << escapeFilePath(rc_file) << " -o " << fileVar("RES_FILE")
<< incPathStr << defines << "\n\n";
}
diff --git a/qmake/generators/win32/mingw_make.h b/qmake/generators/win32/mingw_make.h
index 5da5b24088..8cae28a78b 100644
--- a/qmake/generators/win32/mingw_make.h
+++ b/qmake/generators/win32/mingw_make.h
@@ -35,9 +35,6 @@ QT_BEGIN_NAMESPACE
class MingwMakefileGenerator : public Win32MakefileGenerator
{
-public:
- MingwMakefileGenerator();
- ~MingwMakefileGenerator();
protected:
using MakefileGenerator::escapeDependencyPath;
QString escapeDependencyPath(const QString &path) const override;
@@ -65,9 +62,6 @@ private:
QString objectsLinkLine;
};
-inline MingwMakefileGenerator::~MingwMakefileGenerator()
-{ }
-
QT_END_NAMESPACE
#endif // MINGW_MAKE_H
diff --git a/qmake/generators/win32/msbuild_objectmodel.cpp b/qmake/generators/win32/msbuild_objectmodel.cpp
index 08a8c2168d..0515c7404f 100644
--- a/qmake/generators/win32/msbuild_objectmodel.cpp
+++ b/qmake/generators/win32/msbuild_objectmodel.cpp
@@ -34,6 +34,7 @@
#include <qscopedpointer.h>
#include <qstringlist.h>
#include <qfileinfo.h>
+#include <qregexp.h>
QT_BEGIN_NAMESPACE
@@ -299,14 +300,17 @@ inline XmlOutput::xml_output valueTagT( const triState v)
return valueTag(v == _True ? "true" : "false");
}
-static QString vcxCommandSeparator()
+static QString commandLinesForOutput(QStringList commands)
{
// MSBuild puts the contents of the custom commands into a batch file and calls it.
// As we want every sub-command to be error-checked (as is done by makefile-based
// backends), we insert the checks ourselves, using the undocumented jump target.
- static QString cmdSep =
- QLatin1String("&#x000D;&#x000A;if errorlevel 1 goto VCEnd&#x000D;&#x000A;");
- return cmdSep;
+ static QString errchk = QStringLiteral("if errorlevel 1 goto VCEnd");
+ for (int i = commands.count() - 2; i >= 0; --i) {
+ if (!commands.at(i).startsWith("rem", Qt::CaseInsensitive))
+ commands.insert(i + 1, errchk);
+ }
+ return commands.join('\n');
}
static QString unquote(const QString &value)
@@ -1657,7 +1661,7 @@ void VCXProjectWriter::write(XmlOutput &xml, const VCCustomBuildTool &tool)
{
xml << tag("Command")
<< attrTag("Condition", condition)
- << valueTag(tool.CommandLine.join(vcxCommandSeparator()));
+ << valueTag(commandLinesForOutput(tool.CommandLine));
}
if ( !tool.Description.isEmpty() )
@@ -1711,7 +1715,7 @@ void VCXProjectWriter::write(XmlOutput &xml, const VCEventTool &tool)
{
xml
<< tag(tool.EventName)
- << tag(_Command) << valueTag(tool.CommandLine.join(vcxCommandSeparator()))
+ << tag(_Command) << valueTag(commandLinesForOutput(tool.CommandLine))
<< tag(_Message) << valueTag(tool.Description)
<< closetag(tool.EventName);
}
diff --git a/qmake/generators/win32/msvc_nmake.cpp b/qmake/generators/win32/msvc_nmake.cpp
index fd90cfcb2a..2fb24201bd 100644
--- a/qmake/generators/win32/msvc_nmake.cpp
+++ b/qmake/generators/win32/msvc_nmake.cpp
@@ -38,11 +38,6 @@
QT_BEGIN_NAMESPACE
-NmakeMakefileGenerator::NmakeMakefileGenerator() : usePCH(false), usePCHC(false)
-{
-
-}
-
bool
NmakeMakefileGenerator::writeMakefile(QTextStream &t)
{
@@ -53,10 +48,6 @@ NmakeMakefileGenerator::writeMakefile(QTextStream &t)
if(project->first("TEMPLATE") == "app" ||
project->first("TEMPLATE") == "lib" ||
project->first("TEMPLATE") == "aux") {
-#if 0
- if(Option::mkfile::do_stub_makefile)
- return MakefileGenerator::writeStubMakefile(t);
-#endif
writeNmakeParts(t);
return MakefileGenerator::writeMakefile(t);
}
@@ -143,7 +134,7 @@ void NmakeMakefileGenerator::writeNmakeParts(QTextStream &t)
t << escapeDependencyPath(precompObj) << ": " << escapeDependencyPath(precompH) << ' '
<< finalizeDependencyPaths(findDependencies(precompH)).join(" \\\n\t\t")
<< "\n\t$(CXX) " + precompRule +" $(CXXFLAGS) $(INCPATH) -TP "
- << escapeFilePath(precompH) << endl << endl;
+ << escapeFilePath(precompH) << Qt::endl << Qt::endl;
}
if (usePCHC) {
QString precompRuleC = QString("-c -Yc -Fp%1 -Fo%2")
@@ -151,7 +142,7 @@ void NmakeMakefileGenerator::writeNmakeParts(QTextStream &t)
t << escapeDependencyPath(precompObjC) << ": " << escapeDependencyPath(precompH) << ' '
<< finalizeDependencyPaths(findDependencies(precompH)).join(" \\\n\t\t")
<< "\n\t$(CC) " + precompRuleC +" $(CFLAGS) $(INCPATH) -TC "
- << escapeFilePath(precompH) << endl << endl;
+ << escapeFilePath(precompH) << Qt::endl << Qt::endl;
}
}
@@ -310,7 +301,7 @@ void NmakeMakefileGenerator::writeImplicitRulesPart(QTextStream &t)
t << " " << (*cit);
for(QStringList::Iterator cppit = Option::cpp_ext.begin(); cppit != Option::cpp_ext.end(); ++cppit)
t << " " << (*cppit);
- t << endl << endl;
+ t << Qt::endl << Qt::endl;
bool useInferenceRules = !project->isActiveConfig("no_batch");
QSet<QString> source_directories;
@@ -342,7 +333,7 @@ void NmakeMakefileGenerator::writeImplicitRulesPart(QTextStream &t)
QHash<QString, QString> fileNames;
bool duplicatesFound = false;
const QStringList sourceFilesFilter = sourceFilesForImplicitRulesFilter();
- QStringList fixifiedSourceDirs = fileFixify(source_directories.toList(), FileFixifyAbsolute);
+ QStringList fixifiedSourceDirs = fileFixify(QList<QString>(source_directories.constBegin(), source_directories.constEnd()), FileFixifyAbsolute);
fixifiedSourceDirs.removeDuplicates();
for (const QString &sourceDir : qAsConst(fixifiedSourceDirs)) {
QDirIterator dit(sourceDir, sourceFilesFilter, QDir::Files | QDir::NoDotAndDotDot);
@@ -389,9 +380,9 @@ void NmakeMakefileGenerator::writeImplicitRulesPart(QTextStream &t)
}
} else {
for(QStringList::Iterator cppit = Option::cpp_ext.begin(); cppit != Option::cpp_ext.end(); ++cppit)
- t << (*cppit) << Option::obj_ext << ":\n\t" << var("QMAKE_RUN_CXX_IMP") << endl << endl;
+ t << (*cppit) << Option::obj_ext << ":\n\t" << var("QMAKE_RUN_CXX_IMP") << Qt::endl << Qt::endl;
for(QStringList::Iterator cit = Option::c_ext.begin(); cit != Option::c_ext.end(); ++cit)
- t << (*cit) << Option::obj_ext << ":\n\t" << var("QMAKE_RUN_CC_IMP") << endl << endl;
+ t << (*cit) << Option::obj_ext << ":\n\t" << var("QMAKE_RUN_CC_IMP") << Qt::endl << Qt::endl;
}
}
@@ -494,7 +485,7 @@ void NmakeMakefileGenerator::writeBuildRulesPart(QTextStream &t)
if(!project->isEmpty("QMAKE_POST_LINK")) {
t << "\n\t" << var("QMAKE_POST_LINK");
}
- t << endl;
+ t << Qt::endl;
}
void NmakeMakefileGenerator::writeLinkCommand(QTextStream &t, const QString &extraFlags, const QString &extraInlineFileContent)
diff --git a/qmake/generators/win32/msvc_nmake.h b/qmake/generators/win32/msvc_nmake.h
index 5bfdba2bbc..3064f06521 100644
--- a/qmake/generators/win32/msvc_nmake.h
+++ b/qmake/generators/win32/msvc_nmake.h
@@ -54,17 +54,10 @@ protected:
QString var(const ProKey &value) const override;
QString precompH, precompObj, precompPch;
QString precompObjC, precompPchC;
- bool usePCH, usePCHC;
-
-public:
- NmakeMakefileGenerator();
- ~NmakeMakefileGenerator();
-
+ bool usePCH = false;
+ bool usePCHC = false;
};
-inline NmakeMakefileGenerator::~NmakeMakefileGenerator()
-{ }
-
QT_END_NAMESPACE
#endif // MSVC_NMAKE_H
diff --git a/qmake/generators/win32/msvc_objectmodel.cpp b/qmake/generators/win32/msvc_objectmodel.cpp
index 5fb6bfb320..5396eba72e 100644
--- a/qmake/generators/win32/msvc_objectmodel.cpp
+++ b/qmake/generators/win32/msvc_objectmodel.cpp
@@ -34,6 +34,7 @@
#include <qscopedpointer.h>
#include <qfileinfo.h>
+#include <qregexp.h>
using namespace QMakeInternal;
diff --git a/qmake/generators/win32/msvc_objectmodel.h b/qmake/generators/win32/msvc_objectmodel.h
index b356f1bb73..33eff0d914 100644
--- a/qmake/generators/win32/msvc_objectmodel.h
+++ b/qmake/generators/win32/msvc_objectmodel.h
@@ -923,7 +923,7 @@ struct VCFilterFile
inline QDebug operator<<(QDebug dbg, const VCFilterFile &p)
{
dbg.nospace() << "VCFilterFile(file(" << p.file
- << ") excludeFromBuild(" << p.excludeFromBuild << "))" << endl;
+ << ") excludeFromBuild(" << p.excludeFromBuild << "))" << Qt::endl;
return dbg.space();
}
#endif
diff --git a/qmake/generators/win32/msvc_vcproj.cpp b/qmake/generators/win32/msvc_vcproj.cpp
index 51d8002324..404088aa4a 100644
--- a/qmake/generators/win32/msvc_vcproj.cpp
+++ b/qmake/generators/win32/msvc_vcproj.cpp
@@ -209,7 +209,9 @@ bool VcprojGenerator::writeProjectMakefile()
struct VcsolutionDepend {
QString uuid;
- QString vcprojFile, orig_target, target;
+ QString vcprojFile;
+ QString projectName;
+ QString target;
Target targetType;
QStringList dependencies;
};
@@ -433,7 +435,8 @@ ProStringList VcprojGenerator::collectDependencies(QMakeProject *proj, QHash<QSt
Option::qmake_mode = old_mode;
// We assume project filename is [QMAKE_PROJECT_NAME].vcproj
- QString vcproj = tmp_vcproj.project->first("QMAKE_PROJECT_NAME") + project->first("VCPROJ_EXTENSION");
+ const ProString projectName = tmp_vcproj.project->first("QMAKE_PROJECT_NAME");
+ const QString vcproj = projectName + project->first("VCPROJ_EXTENSION");
QString vcprojDir = Option::output_dir;
// If file doesn't exsist, then maybe the users configuration
@@ -445,14 +448,14 @@ ProStringList VcprojGenerator::collectDependencies(QMakeProject *proj, QHash<QSt
VcsolutionDepend *newDep = new VcsolutionDepend;
newDep->vcprojFile = vcprojDir + Option::dir_sep + vcproj;
- newDep->orig_target = tmp_proj.first("QMAKE_ORIG_TARGET").toQString();
+ newDep->projectName = projectName.toQString();
newDep->target = tmp_proj.first("MSVCPROJ_TARGET").toQString().section(Option::dir_sep, -1);
newDep->targetType = tmp_vcproj.projectTarget;
newDep->uuid = tmp_proj.isEmpty("QMAKE_UUID") ? getProjectUUID(Option::fixPathToLocalOS(vcprojDir + QDir::separator() + vcproj)).toString().toUpper(): tmp_proj.first("QMAKE_UUID").toQString();
// We want to store it as the .lib name.
if (newDep->target.endsWith(".dll"))
newDep->target = newDep->target.left(newDep->target.length()-3) + "lib";
- projGuids.insert(newDep->orig_target, newDep->target);
+ projGuids.insert(newDep->projectName, newDep->target);
if (tmpList.size()) {
const ProStringList depends = tmpList;
@@ -591,7 +594,7 @@ void VcprojGenerator::writeSubDirs(QTextStream &t)
for (QList<VcsolutionDepend*>::Iterator it = solution_cleanup.begin(); it != solution_cleanup.end(); ++it) {
// ### quoting rules?
t << _slnProjectBeg << _slnMSVCvcprojGUID << _slnProjectMid
- << "\"" << (*it)->orig_target << "\", \"" << (*it)->vcprojFile
+ << "\"" << (*it)->projectName << "\", \"" << (*it)->vcprojFile
<< "\", \"" << (*it)->uuid << "\"";
debug_msg(1, "Project %s has dependencies: %s", (*it)->target.toLatin1().constData(), (*it)->dependencies.join(" ").toLatin1().constData());
@@ -937,6 +940,15 @@ void VcprojGenerator::initProject()
vcProject.SccProjectName = project->first("SCCPROJECTNAME").toQString();
vcProject.SccLocalPath = project->first("SCCLOCALPATH").toQString();
vcProject.flat_files = project->isActiveConfig("flat");
+
+ // Set up the full target path for target conflict checking.
+ const QChar slash = QLatin1Char('/');
+ QString destdir = QDir::fromNativeSeparators(var("DESTDIR"));
+ if (!destdir.endsWith(slash))
+ destdir.append(slash);
+ project->values("DEST_TARGET") = ProStringList(destdir
+ + project->first("TARGET")
+ + project->first("TARGET_EXT"));
}
void VcprojGenerator::initConfiguration()
diff --git a/qmake/generators/win32/winmakefile.cpp b/qmake/generators/win32/winmakefile.cpp
index 266bae7e64..86d10c213c 100644
--- a/qmake/generators/win32/winmakefile.cpp
+++ b/qmake/generators/win32/winmakefile.cpp
@@ -38,11 +38,9 @@
#include <qdir.h>
#include <stdlib.h>
-QT_BEGIN_NAMESPACE
+#include <algorithm>
-Win32MakefileGenerator::Win32MakefileGenerator() : MakefileGenerator()
-{
-}
+QT_BEGIN_NAMESPACE
ProString Win32MakefileGenerator::fixLibFlag(const ProString &lib)
{
@@ -77,16 +75,37 @@ Win32MakefileGenerator::parseLibFlag(const ProString &flag, ProString *arg)
return LibFlagFile;
}
+class LibrarySearchPath : public QMakeLocalFileName
+{
+public:
+ LibrarySearchPath() = default;
+
+ LibrarySearchPath(const QString &s)
+ : QMakeLocalFileName(s)
+ {
+ }
+
+ LibrarySearchPath(QString &&s, bool isDefault = false)
+ : QMakeLocalFileName(std::move(s)), _default(isDefault)
+ {
+ }
+
+ bool isDefault() const { return _default; }
+
+private:
+ bool _default = false;
+};
+
bool
Win32MakefileGenerator::findLibraries(bool linkPrl, bool mergeLflags)
{
ProStringList impexts = project->values("QMAKE_LIB_EXTENSIONS");
if (impexts.isEmpty())
impexts = project->values("QMAKE_EXTENSION_STATICLIB");
- QList<QMakeLocalFileName> dirs;
+ QVector<LibrarySearchPath> dirs;
int libidx = 0;
for (const ProString &dlib : project->values("QMAKE_DEFAULT_LIBDIRS"))
- dirs.append(QMakeLocalFileName(dlib.toQString()));
+ dirs.append(LibrarySearchPath(dlib.toQString(), true));
static const char * const lflags[] = { "LIBS", "LIBS_PRIVATE",
"QMAKE_LIBS", "QMAKE_LIBS_PRIVATE", nullptr };
for (int i = 0; lflags[i]; i++) {
@@ -96,20 +115,27 @@ Win32MakefileGenerator::findLibraries(bool linkPrl, bool mergeLflags)
ProString arg;
LibFlagType type = parseLibFlag(opt, &arg);
if (type == LibFlagPath) {
- QMakeLocalFileName lp(arg.toQString());
- int idx = dirs.indexOf(lp);
+ const QString argqstr = arg.toQString();
+ auto dit = std::find_if(dirs.cbegin(), dirs.cend(),
+ [&argqstr](const LibrarySearchPath &p)
+ {
+ return p.real() == argqstr;
+ });
+ int idx = dit == dirs.cend()
+ ? -1
+ : std::distance(dirs.cbegin(), dit);
if (idx >= 0 && idx < libidx) {
it = l.erase(it);
continue;
}
+ const LibrarySearchPath lp(argqstr);
dirs.insert(libidx++, lp);
(*it) = "-L" + lp.real();
} else if (type == LibFlagLib) {
QString lib = arg.toQString();
ProString verovr =
project->first(ProKey("QMAKE_" + lib.toUpper() + "_VERSION_OVERRIDE"));
- for (QList<QMakeLocalFileName>::Iterator dir_it = dirs.begin();
- dir_it != dirs.end(); ++dir_it) {
+ for (auto dir_it = dirs.begin(); dir_it != dirs.end(); ++dir_it) {
QString cand = (*dir_it).real() + Option::dir_sep + lib;
if (linkPrl && processPrlFile(cand, true)) {
(*it) = cand;
@@ -119,7 +145,8 @@ Win32MakefileGenerator::findLibraries(bool linkPrl, bool mergeLflags)
for (ProStringList::ConstIterator extit = impexts.cbegin();
extit != impexts.cend(); ++extit) {
if (exists(libBase + '.' + *extit)) {
- (*it) = cand + verovr + '.' + *extit;
+ *it = (dir_it->isDefault() ? lib : cand)
+ + verovr + '.' + *extit;
goto found;
}
}
@@ -132,8 +159,7 @@ Win32MakefileGenerator::findLibraries(bool linkPrl, bool mergeLflags)
if (processPrlFile(lib, false))
(*it) = lib;
} else {
- for (QList<QMakeLocalFileName>::Iterator dir_it = dirs.begin();
- dir_it != dirs.end(); ++dir_it) {
+ for (auto dir_it = dirs.begin(); dir_it != dirs.end(); ++dir_it) {
QString cand = (*dir_it).real() + Option::dir_sep + lib;
if (processPrlFile(cand, false)) {
(*it) = cand;
@@ -320,11 +346,11 @@ void Win32MakefileGenerator::processRcFileVar()
int rcCodePage = project->intValue("RC_CODEPAGE", 1200); // default: Unicode
ts << "#include <windows.h>\n";
- ts << endl;
+ ts << Qt::endl;
if (!rcIcons.isEmpty()) {
for (int i = 0; i < rcIcons.size(); ++i)
- ts << QString("IDI_ICON%1\tICON\tDISCARDABLE\t%2").arg(i + 1).arg(cQuoted(rcIcons[i])) << endl;
- ts << endl;
+ ts << QString("IDI_ICON%1\tICON\tDISCARDABLE\t%2").arg(i + 1).arg(cQuoted(rcIcons[i])) << Qt::endl;
+ ts << Qt::endl;
}
if (!manifestFile.isEmpty()) {
QString manifestResourceId;
@@ -335,8 +361,8 @@ void Win32MakefileGenerator::processRcFileVar()
ts << manifestResourceId << " RT_MANIFEST \"" << manifestFile << "\"\n";
}
ts << "VS_VERSION_INFO VERSIONINFO\n";
- ts << "\tFILEVERSION " << QString(versionString).replace(".", ",") << endl;
- ts << "\tPRODUCTVERSION " << QString(versionString).replace(".", ",") << endl;
+ ts << "\tFILEVERSION " << QString(versionString).replace(".", ",") << Qt::endl;
+ ts << "\tPRODUCTVERSION " << QString(versionString).replace(".", ",") << Qt::endl;
ts << "\tFILEFLAGSMASK 0x3fL\n";
ts << "#ifdef _DEBUG\n";
ts << "\tFILEFLAGS VS_FF_DEBUG\n";
@@ -369,11 +395,11 @@ void Win32MakefileGenerator::processRcFileVar()
ts << "\t\tBEGIN\n";
ts << "\t\t\tVALUE \"Translation\", "
<< QString("0x%1").arg(rcLang, 4, 16, QLatin1Char('0'))
- << ", " << QString("%1").arg(rcCodePage, 4) << endl;
+ << ", " << QString("%1").arg(rcCodePage, 4) << Qt::endl;
ts << "\t\tEND\n";
ts << "\tEND\n";
ts << "/* End of Version info */\n";
- ts << endl;
+ ts << Qt::endl;
ts.flush();
@@ -470,7 +496,7 @@ void Win32MakefileGenerator::writeCleanParts(QTextStream &t)
}
}
}
- t << endl << endl;
+ t << Qt::endl << Qt::endl;
t << "distclean: clean " << depVar("DISTCLEAN_DEPS");
{
@@ -503,9 +529,9 @@ void Win32MakefileGenerator::writeCleanParts(QTextStream &t)
{
QString ofile = fileFixify(Option::output.fileName());
if(!ofile.isEmpty())
- t << "\t-$(DEL_FILE) " << escapeFilePath(ofile) << endl;
+ t << "\t-$(DEL_FILE) " << escapeFilePath(ofile) << Qt::endl;
}
- t << endl;
+ t << Qt::endl;
}
void Win32MakefileGenerator::writeIncPart(QTextStream &t)
@@ -519,7 +545,7 @@ void Win32MakefileGenerator::writeIncPart(QTextStream &t)
if(!inc.isEmpty())
t << "-I" << escapeFilePath(inc) << ' ';
}
- t << endl;
+ t << Qt::endl;
}
void Win32MakefileGenerator::writeStandardParts(QTextStream &t)
@@ -527,51 +553,29 @@ void Win32MakefileGenerator::writeStandardParts(QTextStream &t)
writeExportedVariables(t);
t << "####### Compiler, tools and options\n\n";
- t << "CC = " << var("QMAKE_CC") << endl;
- t << "CXX = " << var("QMAKE_CXX") << endl;
+ t << "CC = " << var("QMAKE_CC") << Qt::endl;
+ t << "CXX = " << var("QMAKE_CXX") << Qt::endl;
t << "DEFINES = "
<< varGlue("PRL_EXPORT_DEFINES","-D"," -D"," ")
- << varGlue("DEFINES","-D"," -D","") << endl;
+ << varGlue("DEFINES","-D"," -D","") << Qt::endl;
t << "CFLAGS = " << var("QMAKE_CFLAGS") << " $(DEFINES)\n";
t << "CXXFLAGS = " << var("QMAKE_CXXFLAGS") << " $(DEFINES)\n";
writeIncPart(t);
writeLibsPart(t);
-
- t << "QMAKE = " << var("QMAKE_QMAKE") << endl;
- t << "IDC = " << (project->isEmpty("QMAKE_IDC") ? QString("idc") : var("QMAKE_IDC"))
- << endl;
- t << "IDL = " << (project->isEmpty("QMAKE_IDL") ? QString("midl") : var("QMAKE_IDL"))
- << endl;
- t << "ZIP = " << var("QMAKE_ZIP") << endl;
- t << "DEF_FILE = " << fileVar("DEF_FILE") << endl;
- t << "RES_FILE = " << fileVar("RES_FILE") << endl; // Not on mingw, can't see why not though...
- t << "COPY = " << var("QMAKE_COPY") << endl;
- t << "SED = " << var("QMAKE_STREAM_EDITOR") << endl;
- t << "COPY_FILE = " << var("QMAKE_COPY_FILE") << endl;
- t << "COPY_DIR = " << var("QMAKE_COPY_DIR") << endl;
- t << "DEL_FILE = " << var("QMAKE_DEL_FILE") << endl;
- t << "DEL_DIR = " << var("QMAKE_DEL_DIR") << endl;
- t << "MOVE = " << var("QMAKE_MOVE") << endl;
- t << "CHK_DIR_EXISTS= " << var("QMAKE_CHK_DIR_EXISTS") << endl;
- t << "MKDIR = " << var("QMAKE_MKDIR") << endl;
- t << "INSTALL_FILE = " << var("QMAKE_INSTALL_FILE") << endl;
- t << "INSTALL_PROGRAM = " << var("QMAKE_INSTALL_PROGRAM") << endl;
- t << "INSTALL_DIR = " << var("QMAKE_INSTALL_DIR") << endl;
- t << "QINSTALL = " << var("QMAKE_QMAKE") << " -install qinstall" << endl;
- t << "QINSTALL_PROGRAM = " << var("QMAKE_QMAKE") << " -install qinstall -exe" << endl;
- t << endl;
+ writeDefaultVariables(t);
+ t << Qt::endl;
t << "####### Output directory\n\n";
if(!project->values("OBJECTS_DIR").isEmpty())
- t << "OBJECTS_DIR = " << escapeFilePath(var("OBJECTS_DIR").remove(QRegExp("\\\\$"))) << endl;
+ t << "OBJECTS_DIR = " << escapeFilePath(var("OBJECTS_DIR").remove(QRegExp("\\\\$"))) << Qt::endl;
else
t << "OBJECTS_DIR = . \n";
- t << endl;
+ t << Qt::endl;
t << "####### Files\n\n";
t << "SOURCES = " << valList(escapeFilePaths(project->values("SOURCES")))
- << " " << valList(escapeFilePaths(project->values("GENERATED_SOURCES"))) << endl;
+ << " " << valList(escapeFilePaths(project->values("GENERATED_SOURCES"))) << Qt::endl;
// do this here so we can set DEST_TARGET to be the complete path to the final target if it is needed.
QString orgDestDir = var("DESTDIR");
@@ -587,14 +591,14 @@ void Win32MakefileGenerator::writeStandardParts(QTextStream &t)
writeExtraVariables(t);
t << "DIST = " << fileVarList("DISTFILES") << ' '
- << fileVarList("HEADERS") << ' ' << fileVarList("SOURCES") << endl;
- t << "QMAKE_TARGET = " << fileVar("QMAKE_ORIG_TARGET") << endl; // unused
+ << fileVarList("HEADERS") << ' ' << fileVarList("SOURCES") << Qt::endl;
+ t << "QMAKE_TARGET = " << fileVar("QMAKE_ORIG_TARGET") << Qt::endl; // unused
// The comment is important to maintain variable compatibility with Unix
// Makefiles, while not interpreting a trailing-slash as a linebreak
t << "DESTDIR = " << escapeFilePath(destDir) << " #avoid trailing-slash linebreak\n";
- t << "TARGET = " << escapeFilePath(target) << endl;
- t << "DESTDIR_TARGET = " << fileVar("DEST_TARGET") << endl;
- t << endl;
+ t << "TARGET = " << escapeFilePath(target) << Qt::endl;
+ t << "DESTDIR_TARGET = " << fileVar("DEST_TARGET") << Qt::endl;
+ t << Qt::endl;
writeImplicitRulesPart(t);
@@ -606,10 +610,10 @@ void Win32MakefileGenerator::writeStandardParts(QTextStream &t)
const ProStringList &dlldirs = project->values("DLLDESTDIR");
for (ProStringList::ConstIterator dlldir = dlldirs.begin(); dlldir != dlldirs.end(); ++dlldir) {
t << "\t-$(COPY_FILE) $(DESTDIR_TARGET) "
- << escapeFilePath(Option::fixPathToTargetOS((*dlldir).toQString(), false)) << endl;
+ << escapeFilePath(Option::fixPathToTargetOS((*dlldir).toQString(), false)) << Qt::endl;
}
}
- t << endl;
+ t << Qt::endl;
writeRcFilePart(t);
}
@@ -642,33 +646,33 @@ void Win32MakefileGenerator::writeStandardParts(QTextStream &t)
}
}
}
- t << endl << endl;
+ t << Qt::endl << Qt::endl;
writeCleanParts(t);
writeExtraTargets(t);
writeExtraCompilerTargets(t);
- t << endl << endl;
+ t << Qt::endl << Qt::endl;
}
void Win32MakefileGenerator::writeLibsPart(QTextStream &t)
{
if(project->isActiveConfig("staticlib") && project->first("TEMPLATE") == "lib") {
- t << "LIBAPP = " << var("QMAKE_LIB") << endl;
- t << "LIBFLAGS = " << var("QMAKE_LIBFLAGS") << endl;
+ t << "LIBAPP = " << var("QMAKE_LIB") << Qt::endl;
+ t << "LIBFLAGS = " << var("QMAKE_LIBFLAGS") << Qt::endl;
} else {
- t << "LINKER = " << var("QMAKE_LINK") << endl;
- t << "LFLAGS = " << var("QMAKE_LFLAGS") << endl;
+ t << "LINKER = " << var("QMAKE_LINK") << Qt::endl;
+ t << "LFLAGS = " << var("QMAKE_LFLAGS") << Qt::endl;
t << "LIBS = " << fixLibFlags("LIBS").join(' ') << ' '
<< fixLibFlags("LIBS_PRIVATE").join(' ') << ' '
<< fixLibFlags("QMAKE_LIBS").join(' ') << ' '
- << fixLibFlags("QMAKE_LIBS_PRIVATE").join(' ') << endl;
+ << fixLibFlags("QMAKE_LIBS_PRIVATE").join(' ') << Qt::endl;
}
}
void Win32MakefileGenerator::writeObjectsPart(QTextStream &t)
{
// Used in both deps and commands.
- t << "OBJECTS = " << valList(escapeDependencyPaths(project->values("OBJECTS"))) << endl;
+ t << "OBJECTS = " << valList(escapeDependencyPaths(project->values("OBJECTS"))) << Qt::endl;
}
void Win32MakefileGenerator::writeImplicitRulesPart(QTextStream &)
@@ -695,6 +699,9 @@ void Win32MakefileGenerator::writeRcFilePart(QTextStream &t)
incPathStr += escapeFilePath(path);
}
+ addSourceFile(rc_file, QMakeSourceFileInfo::SEEK_DEPS);
+ const QStringList rcDeps = QStringList(rc_file) << dependencies(rc_file);
+
// The resource tool may use defines. This might be the same defines passed in as the
// compiler, since you may use these defines in the .rc file itself.
// As the escape syntax for the command line defines for RC is different from that for CL,
@@ -706,11 +713,12 @@ void Win32MakefileGenerator::writeRcFilePart(QTextStream &t)
// Also, we need to add the _DEBUG define manually since the compiler defines this symbol
// by itself, and we use it in the automatically created rc file when VERSION is defined
// in the .pro file.
- t << escapeDependencyPath(res_file) << ": " << escapeDependencyPath(rc_file) << "\n\t"
+ t << escapeDependencyPath(res_file) << ": "
+ << escapeDependencyPaths(rcDeps).join(' ') << "\n\t"
<< var("QMAKE_RC") << (project->isActiveConfig("debug") ? " -D_DEBUG" : "")
<< defines << incPathStr << " -fo " << escapeFilePath(res_file)
<< ' ' << escapeFilePath(rc_file);
- t << endl << endl;
+ t << Qt::endl << Qt::endl;
}
}
@@ -789,6 +797,20 @@ QString Win32MakefileGenerator::defaultInstall(const QString &t)
return ret;
}
+void Win32MakefileGenerator::writeDefaultVariables(QTextStream &t)
+{
+ MakefileGenerator::writeDefaultVariables(t);
+ t << "IDC = " << (project->isEmpty("QMAKE_IDC") ? QString("idc") : var("QMAKE_IDC"))
+ << Qt::endl;
+ t << "IDL = " << (project->isEmpty("QMAKE_IDL") ? QString("midl") : var("QMAKE_IDL"))
+ << Qt::endl;
+ t << "ZIP = " << var("QMAKE_ZIP") << Qt::endl;
+ t << "DEF_FILE = " << fileVar("DEF_FILE") << Qt::endl;
+ t << "RES_FILE = " << fileVar("RES_FILE") << Qt::endl; // Not on mingw, can't see why not though...
+ t << "SED = " << var("QMAKE_STREAM_EDITOR") << Qt::endl;
+ t << "MOVE = " << var("QMAKE_MOVE") << Qt::endl;
+}
+
QString Win32MakefileGenerator::escapeFilePath(const QString &path) const
{
QString ret = path;
@@ -827,4 +849,9 @@ QString Win32MakefileGenerator::getManifestFileForRcFile() const
return QString();
}
+ProKey Win32MakefileGenerator::fullTargetVariable() const
+{
+ return "DEST_TARGET";
+}
+
QT_END_NAMESPACE
diff --git a/qmake/generators/win32/winmakefile.h b/qmake/generators/win32/winmakefile.h
index 4416951a09..09984fe355 100644
--- a/qmake/generators/win32/winmakefile.h
+++ b/qmake/generators/win32/winmakefile.h
@@ -35,11 +35,9 @@ QT_BEGIN_NAMESPACE
class Win32MakefileGenerator : public MakefileGenerator
{
-public:
- Win32MakefileGenerator();
- ~Win32MakefileGenerator();
protected:
QString defaultInstall(const QString &) override;
+ void writeDefaultVariables(QTextStream &t) override;
virtual void writeCleanParts(QTextStream &t);
virtual void writeStandardParts(QTextStream &t);
virtual void writeIncPart(QTextStream &t);
@@ -66,10 +64,10 @@ protected:
void processRcFileVar();
static QString cQuoted(const QString &str);
virtual QString getManifestFileForRcFile() const;
-};
-inline Win32MakefileGenerator::~Win32MakefileGenerator()
-{ }
+public:
+ ProKey fullTargetVariable() const override;
+};
QT_END_NAMESPACE
diff --git a/qmake/generators/xmloutput.cpp b/qmake/generators/xmloutput.cpp
index 5d96128442..7fc1b081c7 100644
--- a/qmake/generators/xmloutput.cpp
+++ b/qmake/generators/xmloutput.cpp
@@ -241,7 +241,7 @@ void XmlOutput::newTagOpen(const QString &tag)
closeOpen();
if (format == NewLine)
- xmlFile << endl << currentIndent;
+ xmlFile << Qt::endl << currentIndent;
xmlFile << '<' << doConversion(tag);
currentState = Attribute;
tagStack.append(tag);
@@ -275,7 +275,7 @@ void XmlOutput::closeTag()
case Tag:
decreaseIndent(); // <--- Pre-decrease indent
if (format == NewLine)
- xmlFile << endl << currentIndent;
+ xmlFile << Qt::endl << currentIndent;
xmlFile << "</" << doConversion(tagStack.last()) << '>';
tagStack.pop_back();
break;
@@ -347,7 +347,7 @@ void XmlOutput::addAttribute(const QString &attribute, const QString &value)
break;
}
if (format == NewLine)
- xmlFile << endl;
+ xmlFile << Qt::endl;
xmlFile << currentIndent << doConversion(attribute) << "=\"" << doConversion(value) << "\"";
}
diff --git a/qmake/library/ioutils.cpp b/qmake/library/ioutils.cpp
index 3e49a99cd5..d2171274d8 100644
--- a/qmake/library/ioutils.cpp
+++ b/qmake/library/ioutils.cpp
@@ -30,6 +30,7 @@
#include <qdir.h>
#include <qfile.h>
+#include <qregexp.h>
#ifdef Q_OS_WIN
# include <windows.h>
diff --git a/qmake/library/proitems.cpp b/qmake/library/proitems.cpp
index 41bed69f00..9330c2b1bf 100644
--- a/qmake/library/proitems.cpp
+++ b/qmake/library/proitems.cpp
@@ -238,7 +238,7 @@ ProString &ProString::append(const ProString &other, bool *pending)
QChar *ptr;
if (pending && !*pending) {
ptr = prepareExtend(1 + other.m_length, 0, m_length);
- *ptr++ = 32;
+ *ptr++ = QLatin1Char(' ');
} else {
ptr = prepareExtend(other.m_length, 0, m_length);
}
@@ -276,7 +276,7 @@ ProString &ProString::append(const ProStringList &other, bool *pending, bool ski
QChar *ptr = prepareExtend(totalLength, 0, m_length);
for (int i = startIdx; i < sz; ++i) {
if (putSpace)
- *ptr++ = 32;
+ *ptr++ = QLatin1Char(' ');
else
putSpace = true;
const ProString &str = other.at(i);
diff --git a/qmake/library/proitems.h b/qmake/library/proitems.h
index 936c729ff8..4569d7c3ff 100644
--- a/qmake/library/proitems.h
+++ b/qmake/library/proitems.h
@@ -68,6 +68,7 @@ class ProString {
public:
ProString();
ProString(const ProString &other);
+ ProString &operator=(const ProString &) = default;
PROITEM_EXPLICIT ProString(const QString &str);
PROITEM_EXPLICIT ProString(const QStringRef &str);
PROITEM_EXPLICIT ProString(const char *str);
@@ -430,7 +431,7 @@ class ProFunctionDef {
public:
ProFunctionDef(ProFile *pro, int offset) : m_pro(pro), m_offset(offset) { m_pro->ref(); }
ProFunctionDef(const ProFunctionDef &o) : m_pro(o.m_pro), m_offset(o.m_offset) { m_pro->ref(); }
- ProFunctionDef(ProFunctionDef &&other) Q_DECL_NOTHROW
+ ProFunctionDef(ProFunctionDef &&other) noexcept
: m_pro(other.m_pro), m_offset(other.m_offset) { other.m_pro = nullptr; }
~ProFunctionDef() { if (m_pro) m_pro->deref(); }
ProFunctionDef &operator=(const ProFunctionDef &o)
@@ -444,13 +445,13 @@ public:
}
return *this;
}
- ProFunctionDef &operator=(ProFunctionDef &&other) Q_DECL_NOTHROW
+ ProFunctionDef &operator=(ProFunctionDef &&other) noexcept
{
ProFunctionDef moved(std::move(other));
swap(moved);
return *this;
}
- void swap(ProFunctionDef &other) Q_DECL_NOTHROW
+ void swap(ProFunctionDef &other) noexcept
{
qSwap(m_pro, other.m_pro);
qSwap(m_offset, other.m_offset);
diff --git a/qmake/library/qmakebuiltins.cpp b/qmake/library/qmakebuiltins.cpp
index dd7766c8e0..866915bdfd 100644
--- a/qmake/library/qmakebuiltins.cpp
+++ b/qmake/library/qmakebuiltins.cpp
@@ -882,8 +882,7 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::evaluateBuiltinExpand(
ret += values(map(args.at(0)));
break;
case E_LIST: {
- QString tmp;
- tmp.sprintf(".QMAKE_INTERNAL_TMP_variableName_%d", m_listCount++);
+ QString tmp(QString::asprintf(".QMAKE_INTERNAL_TMP_variableName_%d", m_listCount++));
ret = ProStringList(ProString(tmp));
ProStringList lst;
for (const ProString &arg : args)
@@ -1458,15 +1457,15 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::evaluateBuiltinConditional(
}
case T_EXPORT: {
const ProKey &var = map(args.at(0));
- for (ProValueMapStack::Iterator vmi = m_valuemapStack.end();
+ for (ProValueMapStack::iterator vmi = m_valuemapStack.end();
--vmi != m_valuemapStack.begin(); ) {
ProValueMap::Iterator it = (*vmi).find(var);
if (it != (*vmi).end()) {
if (it->constBegin() == statics.fakeValue.constBegin()) {
// This is stupid, but qmake doesn't propagate deletions
- m_valuemapStack.first()[var] = ProStringList();
+ m_valuemapStack.front()[var] = ProStringList();
} else {
- m_valuemapStack.first()[var] = *it;
+ m_valuemapStack.front()[var] = *it;
}
(*vmi).erase(it);
while (--vmi != m_valuemapStack.begin())
@@ -1477,7 +1476,7 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::evaluateBuiltinConditional(
return ReturnTrue;
}
case T_DISCARD_FROM: {
- if (m_valuemapStack.count() != 1) {
+ if (m_valuemapStack.size() != 1) {
evalError(fL1S("discard_from() cannot be called from functions."));
return ReturnFalse;
}
@@ -1487,7 +1486,7 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::evaluateBuiltinConditional(
int pro = m_vfs->idForFileName(fn, flags | QMakeVfs::VfsAccessedOnly);
if (!pro)
return ReturnFalse;
- ProValueMap &vmap = m_valuemapStack.first();
+ ProValueMap &vmap = m_valuemapStack.front();
for (auto vit = vmap.begin(); vit != vmap.end(); ) {
if (!vit->isEmpty()) {
auto isFrom = [pro](const ProString &s) {
@@ -1515,7 +1514,7 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::evaluateBuiltinConditional(
else
++fit;
}
- ProStringList &iif = m_valuemapStack.first()[ProKey("QMAKE_INTERNAL_INCLUDED_FILES")];
+ ProStringList &iif = m_valuemapStack.front()[ProKey("QMAKE_INTERNAL_INCLUDED_FILES")];
int idx = iif.indexOf(ProString(fn));
if (idx >= 0)
iif.removeAt(idx);
diff --git a/qmake/library/qmakeevaluator.cpp b/qmake/library/qmakeevaluator.cpp
index ade8e15a39..70897214b2 100644
--- a/qmake/library/qmakeevaluator.cpp
+++ b/qmake/library/qmakeevaluator.cpp
@@ -601,14 +601,16 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::visitProBlock(
case TokBypassNesting:
blockLen = getBlockLen(tokPtr);
if ((m_cumulative || okey != or_op) && blockLen) {
- ProValueMapStack savedValuemapStack = m_valuemapStack;
+ ProValueMapStack savedValuemapStack = std::move(m_valuemapStack);
m_valuemapStack.clear();
- m_valuemapStack.append(savedValuemapStack.takeFirst());
+ m_valuemapStack.splice(m_valuemapStack.end(),
+ savedValuemapStack, savedValuemapStack.begin());
traceMsg("visiting nesting-bypassing block");
ret = visitProBlock(tokPtr);
traceMsg("visited nesting-bypassing block");
- savedValuemapStack.prepend(m_valuemapStack.first());
- m_valuemapStack = savedValuemapStack;
+ savedValuemapStack.splice(savedValuemapStack.begin(),
+ m_valuemapStack, m_valuemapStack.begin());
+ m_valuemapStack = std::move(savedValuemapStack);
} else {
traceMsg("skipped nesting-bypassing block");
ret = ReturnTrue;
@@ -1439,7 +1441,7 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::visitProFile(
for (ProValueMap::ConstIterator it = m_extraVars.constBegin();
it != m_extraVars.constEnd(); ++it)
- m_valuemapStack.first().insert(it.key(), it.value());
+ m_valuemapStack.front().insert(it.key(), it.value());
// In case default_pre needs to make decisions based on the current
// build pass configuration.
@@ -1568,8 +1570,8 @@ void QMakeEvaluator::updateFeaturePaths()
}
for (int i = 0; i < feature_roots.count(); ++i)
- if (!feature_roots.at(i).endsWith((ushort)'/'))
- feature_roots[i].append((ushort)'/');
+ if (!feature_roots.at(i).endsWith(QLatin1Char('/')))
+ feature_roots[i].append(QLatin1Char('/'));
feature_roots.removeDuplicates();
@@ -1707,9 +1709,9 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::evaluateFunction(
{
VisitReturn vr;
- if (m_valuemapStack.count() >= 100) {
+ if (m_valuemapStack.size() >= 100) {
evalError(fL1S("Ran into infinite recursion (depth > 100)."));
- vr = ReturnFalse;
+ vr = ReturnError;
} else {
m_valuemapStack.push(ProValueMap());
m_locationStack.push(m_current);
@@ -1859,7 +1861,7 @@ static bool isFunctParam(const ProKey &variableName)
ProValueMap *QMakeEvaluator::findValues(const ProKey &variableName, ProValueMap::Iterator *rit)
{
- ProValueMapStack::Iterator vmi = m_valuemapStack.end();
+ ProValueMapStack::iterator vmi = m_valuemapStack.end();
for (bool first = true; ; first = false) {
--vmi;
ProValueMap::Iterator it = (*vmi).find(variableName);
@@ -1886,7 +1888,7 @@ ProStringList &QMakeEvaluator::valuesRef(const ProKey &variableName)
return *it;
}
if (!isFunctParam(variableName)) {
- ProValueMapStack::Iterator vmi = m_valuemapStack.end();
+ ProValueMapStack::iterator vmi = m_valuemapStack.end();
if (--vmi != m_valuemapStack.begin()) {
do {
--vmi;
@@ -1905,7 +1907,7 @@ ProStringList &QMakeEvaluator::valuesRef(const ProKey &variableName)
ProStringList QMakeEvaluator::values(const ProKey &variableName) const
{
- ProValueMapStack::ConstIterator vmi = m_valuemapStack.constEnd();
+ ProValueMapStack::const_iterator vmi = m_valuemapStack.cend();
for (bool first = true; ; first = false) {
--vmi;
ProValueMap::ConstIterator it = (*vmi).constFind(variableName);
@@ -1914,7 +1916,7 @@ ProStringList QMakeEvaluator::values(const ProKey &variableName) const
break;
return *it;
}
- if (vmi == m_valuemapStack.constBegin())
+ if (vmi == m_valuemapStack.cbegin())
break;
if (first && isFunctParam(variableName))
break;
@@ -1942,7 +1944,7 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::evaluateFile(
m_current = m_locationStack.pop();
pro->deref();
if (ok == ReturnTrue && !(flags & LoadHidden)) {
- ProStringList &iif = m_valuemapStack.first()[ProKey("QMAKE_INTERNAL_INCLUDED_FILES")];
+ ProStringList &iif = m_valuemapStack.front()[ProKey("QMAKE_INTERNAL_INCLUDED_FILES")];
ProString ifn(fileName);
if (!iif.contains(ifn))
iif << ifn;
@@ -2071,7 +2073,7 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::evaluateFileInto(
return ret;
*values = visitor.m_valuemapStack.top();
ProKey qiif("QMAKE_INTERNAL_INCLUDED_FILES");
- ProStringList &iif = m_valuemapStack.first()[qiif];
+ ProStringList &iif = m_valuemapStack.front()[qiif];
const auto ifns = values->value(qiif);
for (const ProString &ifn : ifns)
if (!iif.contains(ifn))
diff --git a/qmake/library/qmakeevaluator.h b/qmake/library/qmakeevaluator.h
index f617681cbb..9f702b9182 100644
--- a/qmake/library/qmakeevaluator.h
+++ b/qmake/library/qmakeevaluator.h
@@ -38,7 +38,6 @@
#include "ioutils.h"
#include <qlist.h>
-#include <qlinkedlist.h>
#include <qmap.h>
#include <qset.h>
#include <qstack.h>
@@ -54,6 +53,8 @@
# include <qmutex.h>
#endif
+#include <list>
+
QT_BEGIN_NAMESPACE
class QMakeGlobals;
@@ -94,15 +95,15 @@ public:
#endif
};
-// We use a QLinkedList based stack instead of a QVector based one (QStack), so that
+// We use a list-based stack instead of a vector-based one, so that
// the addresses of value maps stay constant. The qmake generators rely on that.
-class QMAKE_EXPORT ProValueMapStack : public QLinkedList<ProValueMap>
+class QMAKE_EXPORT ProValueMapStack : public std::list<ProValueMap>
{
public:
- inline void push(const ProValueMap &t) { append(t); }
- inline ProValueMap pop() { return takeLast(); }
- ProValueMap &top() { return last(); }
- const ProValueMap &top() const { return last(); }
+ inline void push(const ProValueMap &t) { push_back(t); }
+ inline ProValueMap pop() { auto r = std::move(back()); pop_back(); return r; }
+ ProValueMap &top() { return back(); }
+ const ProValueMap &top() const { return back(); }
};
namespace QMakeInternal { struct QMakeBuiltin; }
diff --git a/qmake/library/qmakeevaluator_p.h b/qmake/library/qmakeevaluator_p.h
index f888bc5765..da83ff0de2 100644
--- a/qmake/library/qmakeevaluator_p.h
+++ b/qmake/library/qmakeevaluator_p.h
@@ -31,8 +31,6 @@
#include "proitems.h"
-#include <qregexp.h>
-
#define debugMsg if (!m_debugLevel) {} else debugMsgInternal
#define traceMsg if (!m_debugLevel) {} else traceMsgInternal
#ifdef PROEVALUATOR_DEBUG
diff --git a/qmake/library/qmakeglobals.cpp b/qmake/library/qmakeglobals.cpp
index daf4707779..1d76cecc45 100644
--- a/qmake/library/qmakeglobals.cpp
+++ b/qmake/library/qmakeglobals.cpp
@@ -38,7 +38,6 @@
#include <qfile.h>
#include <qfileinfo.h>
#include <qlist.h>
-#include <qregexp.h>
#include <qset.h>
#include <qstack.h>
#include <qstring.h>
diff --git a/qmake/library/qmakeparser.cpp b/qmake/library/qmakeparser.cpp
index 4c8360b459..ffe90ebda7 100644
--- a/qmake/library/qmakeparser.cpp
+++ b/qmake/library/qmakeparser.cpp
@@ -621,7 +621,7 @@ void QMakeParser::read(ProFile *pro, const QStringRef &in, int line, SubGrammar
if (c != term) {
parseError(fL1S("Missing %1 terminator [found %2]")
.arg(QChar(term))
- .arg(c ? QString(c) : QString::fromLatin1("end-of-line")));
+ .arg(c ? QString(QChar(c)) : QString::fromLatin1("end-of-line")));
m_inError = true;
// Just parse on, as if there was a terminator ...
} else {
diff --git a/qmake/library/qmakeparser.h b/qmake/library/qmakeparser.h
index 7b96d4e88f..c8c5c7718e 100644
--- a/qmake/library/qmakeparser.h
+++ b/qmake/library/qmakeparser.h
@@ -111,7 +111,6 @@ private:
struct BlockScope {
BlockScope() : start(nullptr), braceLevel(0), special(false), inBranch(false), nest(NestNone) {}
- BlockScope(const BlockScope &other) { *this = other; }
ushort *start; // Where this block started; store length here
int braceLevel; // Nesting of braces in scope
bool special; // Single-line conditionals inside loops, etc. cannot have else branches
diff --git a/qmake/option.cpp b/qmake/option.cpp
index 626a2cec0d..9ec2fe6411 100644
--- a/qmake/option.cpp
+++ b/qmake/option.cpp
@@ -93,7 +93,6 @@ bool Option::mkfile::do_deps = true;
bool Option::mkfile::do_mocs = true;
bool Option::mkfile::do_dep_heuristics = true;
bool Option::mkfile::do_preprocess = false;
-bool Option::mkfile::do_stub_makefile = false;
QStringList Option::mkfile::project_files;
static Option::QMAKE_MODE default_mode(QString progname)
@@ -253,8 +252,6 @@ Option::parseCommandLine(QStringList &args, QMakeCmdLineParserState &state)
Option::mkfile::do_deps = false;
} else if (arg == "-nomoc") {
Option::mkfile::do_mocs = false;
- } else if (arg == "-createstub") {
- Option::mkfile::do_stub_makefile = true;
} else if (arg == "-nodependheuristics") {
Option::mkfile::do_dep_heuristics = false;
} else if (arg == "-E") {
@@ -661,4 +658,9 @@ QString qmake_libraryInfoFile()
return QString();
}
+QString qmake_abslocation()
+{
+ return Option::globals->qmake_abslocation;
+}
+
QT_END_NAMESPACE
diff --git a/qmake/option.h b/qmake/option.h
index 25b2d64aaa..d7f4e87c70 100644
--- a/qmake/option.h
+++ b/qmake/option.h
@@ -189,7 +189,6 @@ struct Option
static bool do_mocs;
static bool do_dep_heuristics;
static bool do_preprocess;
- static bool do_stub_makefile;
static int cachefile_depth;
static QStringList project_files;
};
diff --git a/qmake/project.cpp b/qmake/project.cpp
index 1bc9b352b5..931a337b71 100644
--- a/qmake/project.cpp
+++ b/qmake/project.cpp
@@ -143,15 +143,15 @@ ProString QMakeProject::expand(const QString &expr, const QString &where, int li
bool QMakeProject::isEmpty(const ProKey &v) const
{
- ProValueMap::ConstIterator it = m_valuemapStack.first().constFind(v);
- return it == m_valuemapStack.first().constEnd() || it->isEmpty();
+ ProValueMap::ConstIterator it = m_valuemapStack.front().constFind(v);
+ return it == m_valuemapStack.front().constEnd() || it->isEmpty();
}
void QMakeProject::dump() const
{
QStringList out;
- for (ProValueMap::ConstIterator it = m_valuemapStack.first().begin();
- it != m_valuemapStack.first().end(); ++it) {
+ for (ProValueMap::ConstIterator it = m_valuemapStack.front().begin();
+ it != m_valuemapStack.front().end(); ++it) {
if (!it.key().startsWith('.')) {
QString str = it.key() + " =";
for (const ProString &v : it.value())
diff --git a/qmake/project.h b/qmake/project.h
index d7a5852bed..071b62424f 100644
--- a/qmake/project.h
+++ b/qmake/project.h
@@ -58,12 +58,12 @@ public:
{ m_current.clear(); return evaluateConditional(QStringRef(&v), file, line) == ReturnTrue; }
bool test(const ProKey &func, const QList<ProStringList> &args);
- bool isSet(const ProKey &v) const { return m_valuemapStack.first().contains(v); }
+ bool isSet(const ProKey &v) const { return m_valuemapStack.front().contains(v); }
bool isEmpty(const ProKey &v) const;
ProStringList &values(const ProKey &v) { return valuesRef(v); }
int intValue(const ProKey &v, int defaultValue = 0) const;
- const ProValueMap &variables() const { return m_valuemapStack.first(); }
- ProValueMap &variables() { return m_valuemapStack.first(); }
+ const ProValueMap &variables() const { return m_valuemapStack.front(); }
+ ProValueMap &variables() { return m_valuemapStack.front(); }
bool isActiveConfig(const QString &config, bool regex = false)
{ return QMakeEvaluator::isActiveConfig(QStringRef(&config), regex); }
diff --git a/qmake/qmake.pro b/qmake/qmake.pro
index 5399e8c298..a9d8b58da8 100644
--- a/qmake/qmake.pro
+++ b/qmake/qmake.pro
@@ -96,7 +96,7 @@ HEADERS += \
bp = $$shadowed(..)
INCLUDEPATH += \
$$bp/include $$bp/include/QtCore \
- $$bp/include/QtCore/$$QT_VERSION $$bp/include/QtCore/$$QT_VERSION/QtCore
+ $$bp/include/QtCore/$$QT_VERSION $$bp/include/QtCore/$$QT_VERSION/QtCore \
$$bp/src/corelib/global
VPATH += \
@@ -115,6 +115,7 @@ SOURCES += \
qbuffer.cpp \
qbytearray.cpp \
qbytearraymatcher.cpp \
+ qcalendar.cpp \
qcryptographichash.cpp \
qdatetime.cpp \
qdir.cpp \
@@ -127,6 +128,7 @@ SOURCES += \
qfsfileengine.cpp \
qfsfileengine_iterator.cpp \
qglobal.cpp \
+ qgregoriancalendar.cpp \
qhash.cpp \
qiodevice.cpp \
qjson.cpp \
@@ -136,7 +138,6 @@ SOURCES += \
qjsonparser.cpp \
qjsonvalue.cpp \
qlibraryinfo.cpp \
- qlinkedlist.cpp \
qlist.cpp \
qlocale.cpp \
qlocale_tools.cpp \
@@ -146,9 +147,9 @@ SOURCES += \
qmetatype.cpp \
qnumeric.cpp \
qregexp.cpp \
+ qromancalendar.cpp \
qsettings.cpp \
qstring.cpp \
- qstring_compat.cpp \
qstringlist.cpp \
qsystemerror.cpp \
qtemporaryfile.cpp \
@@ -170,6 +171,9 @@ HEADERS += \
qbuffer.h \
qbytearray.h \
qbytearraymatcher.h \
+ qcalendar.h \
+ qcalendarbackend_p.h \
+ qcalendarmath_p.h \
qchar.h \
qcryptographichash.h \
qdatetime.h \
@@ -180,36 +184,36 @@ HEADERS += \
qfile.h \
qfileinfo.h \
qglobal.h \
+ qgregoriancalendar_p.h \
qhash.h \
qiodevice.h \
- qjson.h \
+ qjson_p.h \
qjsonarray.h \
qjsondocument.h \
qjsonobject.h \
- qjsonparser.h \
+ qjsonparser_p.h \
qjsonvalue.h \
- qjsonwriter.h \
- qlinkedlist.h \
+ qjsonwriter_p.h \
qlist.h \
qlocale.h \
qlocale_tools_p.h \
- qmalloc.h \
qmap.h \
qmetatype.h \
qnumeric.h \
qregexp.h \
+ qromancalendar_p.h \
qstring.h \
qstringlist.h \
qstringmatcher.h \
qsystemerror_p.h \
qtemporaryfile.h \
qtextstream.h \
- qutfcodec.h \
+ qutfcodec_p.h \
quuid.h \
qvector.h \
qversionnumber.h \
qxmlstream.h \
- qxmlutils.h
+ qxmlutils_p.h
unix {
SOURCES += \