diff options
Diffstat (limited to 'qmake/generators/unix')
-rw-r--r-- | qmake/generators/unix/unixmake.cpp | 14 | ||||
-rw-r--r-- | qmake/generators/unix/unixmake.h | 24 | ||||
-rw-r--r-- | qmake/generators/unix/unixmake2.cpp | 35 |
3 files changed, 39 insertions, 34 deletions
diff --git a/qmake/generators/unix/unixmake.cpp b/qmake/generators/unix/unixmake.cpp index 894020d2bd..4fe1a54501 100644 --- a/qmake/generators/unix/unixmake.cpp +++ b/qmake/generators/unix/unixmake.cpp @@ -420,7 +420,7 @@ UnixMakefileGenerator::findLibraries(bool linkPrl, bool mergeLflags) libdirs.append(QMakeLocalFileName(dlib.toQString())); frameworkdirs.append(QMakeLocalFileName("/System/Library/Frameworks")); frameworkdirs.append(QMakeLocalFileName("/Library/Frameworks")); - static const char * const lflags[] = { "QMAKE_LIBS", "QMAKE_LIBS_PRIVATE", 0 }; + static const char * const lflags[] = { "QMAKE_LIBS", "QMAKE_LIBS_PRIVATE", nullptr }; for (int i = 0; lflags[i]; i++) { ProStringList &l = project->values(lflags[i]); for (ProStringList::Iterator it = l.begin(); it != l.end(); ) { @@ -443,7 +443,7 @@ UnixMakefileGenerator::findLibraries(bool linkPrl, bool mergeLflags) dep_it != libdirs.end(); ++dep_it) { QString libBase = (*dep_it).local() + '/' + project->first("QMAKE_PREFIX_SHLIB") + lib; - if (linkPrl && processPrlFile(libBase)) + if (linkPrl && processPrlFile(libBase, true)) goto found; for (ProStringList::Iterator extit = extens.begin(); extit != extens.end(); ++extit) { if (exists(libBase + '.' + (*extit))) @@ -471,12 +471,12 @@ UnixMakefileGenerator::findLibraries(bool linkPrl, bool mergeLflags) } for (const QMakeLocalFileName &dir : qAsConst(frameworkdirs)) { QString frameworkDirectory = dir.local() + "/" + frameworkName + + ".framework/"; - QString suffixedPrl = frameworkDirectory + opt + Option::prl_ext; - if (processPrlFile(suffixedPrl)) + QString suffixedPrl = frameworkDirectory + opt; + if (processPrlFile(suffixedPrl, true)) break; if (hasSuffix) { - QString unsuffixedPrl = frameworkDirectory + frameworkName + Option::prl_ext; - if (processPrlFile(unsuffixedPrl)) + QString unsuffixedPrl = frameworkDirectory + frameworkName; + if (processPrlFile(unsuffixedPrl, true)) break; } } @@ -487,7 +487,7 @@ UnixMakefileGenerator::findLibraries(bool linkPrl, bool mergeLflags) } } } else if (linkPrl) { - processPrlFile(opt); + processPrlFile(opt, false); } ProStringList &prl_libs = project->values("QMAKE_CURRENT_PRL_LIBS"); diff --git a/qmake/generators/unix/unixmake.h b/qmake/generators/unix/unixmake.h index da5cdb320c..c5e42aa1ae 100644 --- a/qmake/generators/unix/unixmake.h +++ b/qmake/generators/unix/unixmake.h @@ -38,7 +38,7 @@ class UnixMakefileGenerator : public MakefileGenerator bool include_deps; QString libtoolFileName(bool fixify=true); void writeLibtoolFile(); // for libtool - void writePrlFile(QTextStream &); + void writePrlFile(QTextStream &) override; public: UnixMakefileGenerator(); @@ -46,23 +46,23 @@ public: protected: virtual bool doPrecompiledHeaders() const { return project->isActiveConfig("precompile_header"); } - virtual bool doDepends() const { return !Option::mkfile::do_stub_makefile && MakefileGenerator::doDepends(); } + bool doDepends() const override { return !Option::mkfile::do_stub_makefile && MakefileGenerator::doDepends(); } #ifdef Q_OS_WIN // MinGW x-compiling for QNX - virtual QString installRoot() const; + QString installRoot() const override; #endif - virtual QString defaultInstall(const QString &); - virtual ProString fixLibFlag(const ProString &lib); + QString defaultInstall(const QString &) override; + ProString fixLibFlag(const ProString &lib) override; - virtual bool findLibraries(bool linkPrl, bool mergeLflags); - virtual QString escapeFilePath(const QString &path) const; + bool findLibraries(bool linkPrl, bool mergeLflags) override; + QString escapeFilePath(const QString &path) const override; ProString escapeFilePath(const ProString &path) const { return MakefileGenerator::escapeFilePath(path); } - virtual QStringList &findDependencies(const QString &); - virtual void init(); + QStringList &findDependencies(const QString &) override; + void init() override; - virtual void writeDefaultVariables(QTextStream &t); - virtual void writeSubTargets(QTextStream &t, QList<SubTarget*> subtargets, int flags); + void writeDefaultVariables(QTextStream &t) override; + void writeSubTargets(QTextStream &t, QList<SubTarget*> subtargets, int flags) override; void writeMakeParts(QTextStream &); - bool writeMakefile(QTextStream &); + bool writeMakefile(QTextStream &) override; private: void init2(); diff --git a/qmake/generators/unix/unixmake2.cpp b/qmake/generators/unix/unixmake2.cpp index ecb0de3b52..ab946fa439 100644 --- a/qmake/generators/unix/unixmake2.cpp +++ b/qmake/generators/unix/unixmake2.cpp @@ -280,11 +280,11 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t) if (destd.endsWith('\\')) destd += '\\'; t << "DESTDIR = " << destd << endl; - t << "TARGET = " << fileVar("TARGET") << endl; // ### mixed use! + t << "TARGET = " << fileVar("TARGET") << endl; if(project->isActiveConfig("plugin")) { t << "TARGETD = " << fileVar("TARGET") << endl; } else if(!project->isActiveConfig("staticlib") && project->values("QMAKE_APP_FLAG").isEmpty()) { - t << "TARGETA = " << fileVar("TARGETA") << endl; // ### mixed use! + t << "TARGETA = " << fileVar("TARGETA") << endl; if(!project->isEmpty("QMAKE_BUNDLE")) { t << "TARGETD = " << fileVar("TARGET_x.y") << endl; t << "TARGET0 = " << fileVar("TARGET_") << endl; @@ -346,7 +346,7 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t) t << mkdir_p_asstring("$(@D)", false) << "\n\t" << "@$(CC) " << cmd << " $< | sed \"s,^\\($(*F).o\\):," << odir << "\\1:,g\" >$@\n\n"; - static const char * const src[] = { "SOURCES", "GENERATED_SOURCES", 0 }; + static const char * const src[] = { "SOURCES", "GENERATED_SOURCES", nullptr }; for (int x = 0; src[x]; x++) { const ProStringList &l = project->values(src[x]); for (ProStringList::ConstIterator it = l.begin(); it != l.end(); ++it) { @@ -502,7 +502,7 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t) t << "\n\t" << var("QMAKE_POST_LINK"); t << endl << endl; } else { - t << "$(TARGET): " << depVar("PRE_TARGETDEPS") << " $(OBJECTS) " + t << depVar("TARGET") << ": " << depVar("PRE_TARGETDEPS") << " $(OBJECTS) " << target_deps << ' ' << depVar("POST_TARGETDEPS") << "\n\t"; if (project->first("TEMPLATE") != "aux") { if (!destdir.isEmpty()) @@ -515,7 +515,7 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t) } t << endl << endl; } - allDeps = " $(TARGET)"; + allDeps = ' ' + depVar("TARGET"); } else if(!project->isActiveConfig("staticlib")) { QString destdir_r = project->first("DESTDIR").toQString(), incr_deps; if(!project->isEmpty("QMAKE_BUNDLE")) { @@ -580,14 +580,14 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t) } //real target - t << destdir_d << "$(TARGET): " << depVar("PRE_TARGETDEPS") << ' ' + t << destdir_d << depVar("TARGET") << ": " << depVar("PRE_TARGETDEPS") << ' ' << incr_deps << " $(SUBLIBS) " << target_deps << ' ' << depVar("POST_TARGETDEPS"); } else { - t << destdir_d << "$(TARGET): " << depVar("PRE_TARGETDEPS") + t << destdir_d << depVar("TARGET") << ": " << depVar("PRE_TARGETDEPS") << " $(OBJECTS) $(SUBLIBS) $(OBJCOMP) " << target_deps << ' ' << depVar("POST_TARGETDEPS"); } - allDeps = ' ' + destdir_d + "$(TARGET)"; + allDeps = ' ' + destdir_d + depVar("TARGET"); if(!destdir.isEmpty()) t << "\n\t" << mkdir_p_asstring(destdir, false); if(!project->isEmpty("QMAKE_PRE_LINK")) @@ -604,7 +604,7 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t) t << "\n\t" << var("QMAKE_POST_LINK"); t << endl << endl; } else if(!project->isEmpty("QMAKE_BUNDLE")) { - bundledFiles << destdir_r + "$(TARGET)"; + bundledFiles << destdir_r + var("TARGET"); t << "\n\t" << "-$(DEL_FILE) $(TARGET) $(TARGET0) $(DESTDIR)$(TARGET0)\n\t" << var("QMAKE_LINK_SHLIB_CMD") << "\n\t" @@ -669,8 +669,8 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t) t << endl << endl; if (! project->isActiveConfig("plugin")) { - t << "staticlib: $(TARGETA)\n\n"; - t << "$(TARGETA): " << depVar("PRE_TARGETDEPS") << " $(OBJECTS) $(OBJCOMP)"; + t << "staticlib: " << depVar("TARGETA") << "\n\n"; + t << depVar("TARGETA") << ": " << depVar("PRE_TARGETDEPS") << " $(OBJECTS) $(OBJCOMP)"; if(do_incremental) t << " $(INCREMENTAL_OBJECTS)"; t << ' ' << depVar("POST_TARGETDEPS") << "\n\t"; @@ -690,11 +690,11 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t) QString destdir_r = project->first("DESTDIR").toQString(); QString destdir_d = escapeDependencyPath(destdir_r); QString destdir = escapeFilePath(destdir_r); - allDeps = ' ' + destdir_d + "$(TARGET)" + allDeps = ' ' + destdir_d + depVar("TARGET") + varGlue("QMAKE_AR_SUBLIBS", ' ' + destdir_d, ' ' + destdir_d, ""); t << "staticlib: " << destdir_d << "$(TARGET)\n\n"; if(project->isEmpty("QMAKE_AR_SUBLIBS")) { - t << destdir_d << "$(TARGET): " << depVar("PRE_TARGETDEPS") + t << destdir_d << depVar("TARGET") << ": " << depVar("PRE_TARGETDEPS") << " $(OBJECTS) $(OBJCOMP) " << depVar("POST_TARGETDEPS") << "\n\t"; if(!destdir.isEmpty()) t << mkdir_p_asstring(destdir, false) << "\n\t"; @@ -719,7 +719,7 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t) QString ar; ProString lib = destdir + escapeFilePath(*libit); if((*libit) == "$(TARGET)") { - t << destdir_d << "$(TARGET): " << depVar("PRE_TARGETDEPS") + t << destdir_d << depVar("TARGET") << ": " << depVar("PRE_TARGETDEPS") << ' ' << depVar("POST_TARGETDEPS") << valList(escapeDependencyPaths(build)) << "\n\t"; ar = project->first("QMAKE_AR_CMD").toQString(); ar.replace(QLatin1String("$(OBJECTS)"), escapeFilePaths(build).join(' ')); @@ -1244,7 +1244,8 @@ void UnixMakefileGenerator::init2() if(!project->isEmpty("TARGET")) project->values("TARGET").first().prepend(project->first("DESTDIR")); } else if (project->isActiveConfig("staticlib")) { - project->values("TARGET").first().prepend(project->first("QMAKE_PREFIX_STATICLIB")); + project->values("PRL_TARGET") = + project->values("TARGET").first().prepend(project->first("QMAKE_PREFIX_STATICLIB")); project->values("TARGET").first() += "." + project->first("QMAKE_EXTENSION_STATICLIB"); if(project->values("QMAKE_AR_CMD").isEmpty()) project->values("QMAKE_AR_CMD").append("$(AR) $(DESTDIR)$(TARGET) $(OBJECTS)"); @@ -1278,6 +1279,7 @@ void UnixMakefileGenerator::init2() QString prefix; if(!project->isActiveConfig("no_plugin_name_prefix")) prefix = "lib"; + project->values("PRL_TARGET").prepend(prefix + project->first("TARGET")); project->values("TARGET_x.y.z").append(prefix + project->first("TARGET") + "." + project->first("QMAKE_EXTENSION_PLUGIN")); @@ -1291,6 +1293,7 @@ void UnixMakefileGenerator::init2() "." + project->first("VER_MAJ")); project->values("TARGET") = project->values("TARGET_x.y.z"); } else if (!project->isEmpty("QMAKE_HPUX_SHLIB")) { + project->values("PRL_TARGET").prepend("lib" + project->first("TARGET")); project->values("TARGET_").append("lib" + project->first("TARGET") + ".sl"); if(project->isActiveConfig("lib_version_first")) project->values("TARGET_x").append("lib" + project->first("VER_MAJ") + "." + @@ -1300,6 +1303,7 @@ void UnixMakefileGenerator::init2() project->first("VER_MAJ")); project->values("TARGET") = project->values("TARGET_x"); } else if (!project->isEmpty("QMAKE_AIX_SHLIB")) { + project->values("PRL_TARGET").prepend("lib" + project->first("TARGET")); project->values("TARGET_").append(project->first("QMAKE_PREFIX_STATICLIB") + project->first("TARGET") + "." + project->first("QMAKE_EXTENSION_STATICLIB")); if(project->isActiveConfig("lib_version_first")) { @@ -1331,6 +1335,7 @@ void UnixMakefileGenerator::init2() } project->values("TARGET") = project->values("TARGET_x.y.z"); } else { + project->values("PRL_TARGET").prepend("lib" + project->first("TARGET")); project->values("TARGET_").append("lib" + project->first("TARGET") + "." + project->first("QMAKE_EXTENSION_SHLIB")); if(project->isActiveConfig("lib_version_first")) { |