fix quoting issues. all of them. (*)
instead of quoting more or less random variable contents early, consistently quote everything only right before it is needed. this way we can be sure that everything is correctly quoted, but not over-quoted. this removed the need for the insanity that unescapeFilePath() and similar ad-hoc contraptions were. this had the somewhat counter-intuitive effect that it was possible to remove escapeFilePath() calls from PBX::writeSettings() calls - these were actually only unescaping. [ChangeLog][qmake][Important Behavior Changes] A lot of quoting issues have been fixed. As a side effect, qmake has become more sensitive to over-quoted file names in project files. (*) ok, maybe not. close enough. Task-number: fatal: out of memory Change-Id: I8c51cfffb59ccd156b46bd5c56754c480667443a Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
This commit is contained in:
parent
c0d67bb5c9
commit
e3a7237d82
@ -215,7 +215,7 @@ ProjectBuilderMakefileGenerator::writeSubDirs(QTextStream &t)
|
|||||||
t << "\t\t" << project_key << " = {\n"
|
t << "\t\t" << project_key << " = {\n"
|
||||||
<< "\t\t\t" << writeSettings("isa", "PBXFileReference", SettingsNoQuote) << ";\n"
|
<< "\t\t\t" << writeSettings("isa", "PBXFileReference", SettingsNoQuote) << ";\n"
|
||||||
<< "\t\t\t" << writeSettings("lastKnownFileType", "wrapper.pb-project") << ";\n"
|
<< "\t\t\t" << writeSettings("lastKnownFileType", "wrapper.pb-project") << ";\n"
|
||||||
<< "\t\t\t" << writeSettings("name", escapeFilePath(tmp_proj.first("TARGET") + projectSuffix())) << ";\n"
|
<< "\t\t\t" << writeSettings("name", tmp_proj.first("TARGET") + projectSuffix()) << ";\n"
|
||||||
<< "\t\t\t" << writeSettings("path", pbxproj) << ";\n"
|
<< "\t\t\t" << writeSettings("path", pbxproj) << ";\n"
|
||||||
<< "\t\t\t" << writeSettings("sourceTree", "<absolute>") << ";\n"
|
<< "\t\t\t" << writeSettings("sourceTree", "<absolute>") << ";\n"
|
||||||
<< "\t\t};\n";
|
<< "\t\t};\n";
|
||||||
@ -283,7 +283,7 @@ ProjectBuilderMakefileGenerator::writeSubDirs(QTextStream &t)
|
|||||||
t << "\t\t" << keyFor(grp_it.key()) << " = {\n"
|
t << "\t\t" << keyFor(grp_it.key()) << " = {\n"
|
||||||
<< "\t\t\t" << writeSettings("isa", "PBXGroup", SettingsNoQuote) << ";\n"
|
<< "\t\t\t" << writeSettings("isa", "PBXGroup", SettingsNoQuote) << ";\n"
|
||||||
<< "\t\t\t" << writeSettings("children", grp_it.value(), SettingsAsList, 4) << ";\n"
|
<< "\t\t\t" << writeSettings("children", grp_it.value(), SettingsAsList, 4) << ";\n"
|
||||||
<< "\t\t\t" << writeSettings("name", escapeFilePath(grp_it.key().section(Option::dir_sep, -1))) << ";\n"
|
<< "\t\t\t" << writeSettings("name", grp_it.key().section(Option::dir_sep, -1)) << ";\n"
|
||||||
<< "\t\t\t" << writeSettings("sourceTree", "<Group>") << ";\n"
|
<< "\t\t\t" << writeSettings("sourceTree", "<Group>") << ";\n"
|
||||||
<< "\t\t};\n";
|
<< "\t\t};\n";
|
||||||
}
|
}
|
||||||
@ -626,8 +626,6 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t)
|
|||||||
const QStringList &files = fileFixify(sources.at(source).files(project));
|
const QStringList &files = fileFixify(sources.at(source).files(project));
|
||||||
for(int f = 0; f < files.count(); ++f) {
|
for(int f = 0; f < files.count(); ++f) {
|
||||||
QString file = files[f];
|
QString file = files[f];
|
||||||
if(file.length() >= 2 && (file[0] == '"' || file[0] == '\'') && file[(int) file.length()-1] == file[0])
|
|
||||||
file = file.mid(1, file.length()-2);
|
|
||||||
if(!sources.at(source).compilerName().isNull() &&
|
if(!sources.at(source).compilerName().isNull() &&
|
||||||
!verifyExtraCompiler(sources.at(source).compilerName(), file))
|
!verifyExtraCompiler(sources.at(source).compilerName(), file))
|
||||||
continue;
|
continue;
|
||||||
@ -678,9 +676,9 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t)
|
|||||||
//source reference
|
//source reference
|
||||||
t << "\t\t" << src_key << " = {\n"
|
t << "\t\t" << src_key << " = {\n"
|
||||||
<< "\t\t\t" << writeSettings("isa", "PBXFileReference", SettingsNoQuote) << ";\n"
|
<< "\t\t\t" << writeSettings("isa", "PBXFileReference", SettingsNoQuote) << ";\n"
|
||||||
<< "\t\t\t" << writeSettings("path", escapeFilePath(file)) << ";\n";
|
<< "\t\t\t" << writeSettings("path", file) << ";\n";
|
||||||
if (name != file)
|
if (name != file)
|
||||||
t << "\t\t\t" << writeSettings("name", escapeFilePath(name)) << ";\n";
|
t << "\t\t\t" << writeSettings("name", name) << ";\n";
|
||||||
t << "\t\t\t" << writeSettings("sourceTree", "<absolute>") << ";\n";
|
t << "\t\t\t" << writeSettings("sourceTree", "<absolute>") << ";\n";
|
||||||
QString filetype = xcodeFiletypeForFilename(file);
|
QString filetype = xcodeFiletypeForFilename(file);
|
||||||
if (!filetype.isNull())
|
if (!filetype.isNull())
|
||||||
@ -715,7 +713,7 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t)
|
|||||||
t << "\t\t" << keyFor(grp_it.key()) << " = {\n"
|
t << "\t\t" << keyFor(grp_it.key()) << " = {\n"
|
||||||
<< "\t\t\t" << writeSettings("isa", "PBXGroup", SettingsNoQuote) << ";\n"
|
<< "\t\t\t" << writeSettings("isa", "PBXGroup", SettingsNoQuote) << ";\n"
|
||||||
<< "\t\t\t" << writeSettings("children", grp_it.value(), SettingsAsList, 4) << ";\n"
|
<< "\t\t\t" << writeSettings("children", grp_it.value(), SettingsAsList, 4) << ";\n"
|
||||||
<< "\t\t\t" << writeSettings("name", escapeFilePath(grp_it.key().section(Option::dir_sep, -1))) << ";\n"
|
<< "\t\t\t" << writeSettings("name", grp_it.key().section(Option::dir_sep, -1)) << ";\n"
|
||||||
<< "\t\t\t" << writeSettings("sourceTree", "<Group>") << ";\n"
|
<< "\t\t\t" << writeSettings("sourceTree", "<Group>") << ";\n"
|
||||||
<< "\t\t};\n";
|
<< "\t\t};\n";
|
||||||
}
|
}
|
||||||
@ -773,8 +771,8 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t)
|
|||||||
mkt << "\\\n\t";
|
mkt << "\\\n\t";
|
||||||
++added;
|
++added;
|
||||||
const QString file_name = fileFixify(fn, Option::output_dir, Option::output_dir);
|
const QString file_name = fileFixify(fn, Option::output_dir, Option::output_dir);
|
||||||
mkt << " " << replaceExtraCompilerVariables(
|
mkt << " " << escapeDependencyPath(replaceExtraCompilerVariables(
|
||||||
Option::fixPathToTargetOS(tmp_out.first().toQString(), false), file_name, QString(), NoShell);
|
Option::fixPathToTargetOS(tmp_out.first().toQString(), false), file_name, QString(), NoShell));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -823,8 +821,6 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t)
|
|||||||
bool remove = false;
|
bool remove = false;
|
||||||
QString library, name;
|
QString library, name;
|
||||||
ProString opt = tmp[x].trimmed();
|
ProString opt = tmp[x].trimmed();
|
||||||
if (opt.length() >= 2 && (opt.at(0) == '"' || opt.at(0) == '\'') && opt.endsWith(opt.at(0)))
|
|
||||||
opt = opt.mid(1, opt.length()-2);
|
|
||||||
if(opt.startsWith("-L")) {
|
if(opt.startsWith("-L")) {
|
||||||
QString r = opt.mid(2).toQString();
|
QString r = opt.mid(2).toQString();
|
||||||
fixForOutput(r);
|
fixForOutput(r);
|
||||||
@ -935,8 +931,8 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t)
|
|||||||
bool is_frmwrk = (library.endsWith(".framework"));
|
bool is_frmwrk = (library.endsWith(".framework"));
|
||||||
t << "\t\t" << key << " = {\n"
|
t << "\t\t" << key << " = {\n"
|
||||||
<< "\t\t\t" << writeSettings("isa", "PBXFileReference", SettingsNoQuote) << ";\n"
|
<< "\t\t\t" << writeSettings("isa", "PBXFileReference", SettingsNoQuote) << ";\n"
|
||||||
<< "\t\t\t" << writeSettings("name", escapeFilePath(name)) << ";\n"
|
<< "\t\t\t" << writeSettings("name", name) << ";\n"
|
||||||
<< "\t\t\t" << writeSettings("path", escapeFilePath(library)) << ";\n"
|
<< "\t\t\t" << writeSettings("path", library) << ";\n"
|
||||||
<< "\t\t\t" << writeSettings("refType", QString::number(reftypeForFile(library)), SettingsNoQuote) << ";\n"
|
<< "\t\t\t" << writeSettings("refType", QString::number(reftypeForFile(library)), SettingsNoQuote) << ";\n"
|
||||||
<< "\t\t\t" << writeSettings("sourceTree", "<absolute>") << ";\n";
|
<< "\t\t\t" << writeSettings("sourceTree", "<absolute>") << ";\n";
|
||||||
if (is_frmwrk)
|
if (is_frmwrk)
|
||||||
@ -971,14 +967,15 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t)
|
|||||||
QTextStream mkt(&mkf);
|
QTextStream mkt(&mkf);
|
||||||
writeHeader(mkt);
|
writeHeader(mkt);
|
||||||
mkt << "SUBLIBS= ";
|
mkt << "SUBLIBS= ";
|
||||||
|
// ### This is missing the parametrization found in unixmake2.cpp
|
||||||
tmp = project->values("SUBLIBS");
|
tmp = project->values("SUBLIBS");
|
||||||
for(int i = 0; i < tmp.count(); i++)
|
for(int i = 0; i < tmp.count(); i++)
|
||||||
t << "tmp/lib" << tmp[i] << ".a ";
|
t << escapeFilePath("tmp/lib" + tmp[i] + ".a") << ' ';
|
||||||
t << endl << endl;
|
t << endl << endl;
|
||||||
mkt << "sublibs: $(SUBLIBS)\n\n";
|
mkt << "sublibs: $(SUBLIBS)\n\n";
|
||||||
tmp = project->values("SUBLIBS");
|
tmp = project->values("SUBLIBS");
|
||||||
for(int i = 0; i < tmp.count(); i++)
|
for(int i = 0; i < tmp.count(); i++)
|
||||||
t << "tmp/lib" << tmp[i] << ".a:\n\t"
|
t << escapeFilePath("tmp/lib" + tmp[i] + ".a") + ":\n\t"
|
||||||
<< var(ProKey("MAKELIB" + tmp[i])) << endl << endl;
|
<< var(ProKey("MAKELIB" + tmp[i])) << endl << endl;
|
||||||
mkt.flush();
|
mkt.flush();
|
||||||
mkf.close();
|
mkf.close();
|
||||||
@ -1042,7 +1039,7 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t)
|
|||||||
t << "\t\t" << key << " = {\n"
|
t << "\t\t" << key << " = {\n"
|
||||||
<< "\t\t\t" << writeSettings("children", project->values("QMAKE_PBX_LIBRARIES"), SettingsAsList, 4) << ";\n"
|
<< "\t\t\t" << writeSettings("children", project->values("QMAKE_PBX_LIBRARIES"), SettingsAsList, 4) << ";\n"
|
||||||
<< "\t\t\t" << writeSettings("isa", "PBXGroup", SettingsNoQuote) << ";\n"
|
<< "\t\t\t" << writeSettings("isa", "PBXGroup", SettingsNoQuote) << ";\n"
|
||||||
<< "\t\t\t" << writeSettings("name", escapeFilePath(grp)) << ";\n"
|
<< "\t\t\t" << writeSettings("name", grp) << ";\n"
|
||||||
<< "\t\t\t" << writeSettings("sourceTree", "<Group>") << ";\n"
|
<< "\t\t\t" << writeSettings("sourceTree", "<Group>") << ";\n"
|
||||||
<< "\t\t};\n";
|
<< "\t\t};\n";
|
||||||
}
|
}
|
||||||
@ -1055,7 +1052,7 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t)
|
|||||||
<< "\t\t\t" << writeSettings("files", project->values("QMAKE_PBX_BUILD_LIBRARIES"), SettingsAsList, 4) << ";\n"
|
<< "\t\t\t" << writeSettings("files", project->values("QMAKE_PBX_BUILD_LIBRARIES"), SettingsAsList, 4) << ";\n"
|
||||||
<< "\t\t\t" << writeSettings("isa", "PBXFrameworksBuildPhase", SettingsNoQuote) << ";\n"
|
<< "\t\t\t" << writeSettings("isa", "PBXFrameworksBuildPhase", SettingsNoQuote) << ";\n"
|
||||||
<< "\t\t\t" << writeSettings("runOnlyForDeploymentPostprocessing", "0", SettingsNoQuote) << ";\n"
|
<< "\t\t\t" << writeSettings("runOnlyForDeploymentPostprocessing", "0", SettingsNoQuote) << ";\n"
|
||||||
<< "\t\t\t" << writeSettings("name", escapeFilePath(grp)) << ";\n"
|
<< "\t\t\t" << writeSettings("name", grp) << ";\n"
|
||||||
<< "\t\t};\n";
|
<< "\t\t};\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1090,7 +1087,7 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t)
|
|||||||
<< "\t\t\t" << writeSettings("outputPaths", ProStringList(), SettingsAsList, 4) << ";\n"
|
<< "\t\t\t" << writeSettings("outputPaths", ProStringList(), SettingsAsList, 4) << ";\n"
|
||||||
<< "\t\t\t" << writeSettings("runOnlyForDeploymentPostprocessing", "0", SettingsNoQuote) << ";\n"
|
<< "\t\t\t" << writeSettings("runOnlyForDeploymentPostprocessing", "0", SettingsNoQuote) << ";\n"
|
||||||
<< "\t\t\t" << writeSettings("shellPath", "/bin/sh") << ";\n"
|
<< "\t\t\t" << writeSettings("shellPath", "/bin/sh") << ";\n"
|
||||||
<< "\t\t\t" << writeSettings("shellScript", fixForOutput("cp -r $BUILT_PRODUCTS_DIR/$FULL_PRODUCT_NAME " + escapeFilePath(destDir))) << ";\n"
|
<< "\t\t\t" << writeSettings("shellScript", fixForOutput("cp -r $BUILT_PRODUCTS_DIR/$FULL_PRODUCT_NAME " + IoUtils::shellQuoteUnix(destDir))) << ";\n"
|
||||||
<< "\t\t};\n";
|
<< "\t\t};\n";
|
||||||
}
|
}
|
||||||
bool copyBundleResources = project->isActiveConfig("app_bundle") && project->first("TEMPLATE") == "app";
|
bool copyBundleResources = project->isActiveConfig("app_bundle") && project->first("TEMPLATE") == "app";
|
||||||
@ -1114,7 +1111,7 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t)
|
|||||||
bundle_file_refs += file_ref_key;
|
bundle_file_refs += file_ref_key;
|
||||||
t << "\t\t" << file_ref_key << " = {\n"
|
t << "\t\t" << file_ref_key << " = {\n"
|
||||||
<< "\t\t\t" << writeSettings("isa", "PBXFileReference", SettingsNoQuote) << ";\n"
|
<< "\t\t\t" << writeSettings("isa", "PBXFileReference", SettingsNoQuote) << ";\n"
|
||||||
<< "\t\t\t" << writeSettings("path", escapeFilePath(fn)) << ";\n"
|
<< "\t\t\t" << writeSettings("path", fn) << ";\n"
|
||||||
<< "\t\t\t" << writeSettings("name", name) << ";\n"
|
<< "\t\t\t" << writeSettings("name", name) << ";\n"
|
||||||
<< "\t\t\t" << writeSettings("sourceTree", "<absolute>") << ";\n"
|
<< "\t\t\t" << writeSettings("sourceTree", "<absolute>") << ";\n"
|
||||||
<< "\t\t};\n";
|
<< "\t\t};\n";
|
||||||
@ -1140,7 +1137,7 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t)
|
|||||||
t << "\t\t" << phase_key << " = {\n"
|
t << "\t\t" << phase_key << " = {\n"
|
||||||
<< "\t\t\t" << writeSettings("name", "Copy '" + bundle_data[i] + "' Files to Bundle") << ";\n"
|
<< "\t\t\t" << writeSettings("name", "Copy '" + bundle_data[i] + "' Files to Bundle") << ";\n"
|
||||||
<< "\t\t\t" << writeSettings("buildActionMask", "2147483647", SettingsNoQuote) << ";\n"
|
<< "\t\t\t" << writeSettings("buildActionMask", "2147483647", SettingsNoQuote) << ";\n"
|
||||||
<< "\t\t\t" << writeSettings("dstPath", escapeFilePath(path)) << ";\n"
|
<< "\t\t\t" << writeSettings("dstPath", path) << ";\n"
|
||||||
<< "\t\t\t" << writeSettings("dstSubfolderSpec", "1", SettingsNoQuote) << ";\n"
|
<< "\t\t\t" << writeSettings("dstSubfolderSpec", "1", SettingsNoQuote) << ";\n"
|
||||||
<< "\t\t\t" << writeSettings("isa", "PBXCopyFilesBuildPhase", SettingsNoQuote) << ";\n"
|
<< "\t\t\t" << writeSettings("isa", "PBXCopyFilesBuildPhase", SettingsNoQuote) << ";\n"
|
||||||
<< "\t\t\t" << writeSettings("files", bundle_files, SettingsAsList, 4) << ";\n"
|
<< "\t\t\t" << writeSettings("files", bundle_files, SettingsAsList, 4) << ";\n"
|
||||||
@ -1164,8 +1161,6 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t)
|
|||||||
if (copyBundleResources) {
|
if (copyBundleResources) {
|
||||||
if (!project->isEmpty("ICON")) {
|
if (!project->isEmpty("ICON")) {
|
||||||
ProString icon = project->first("ICON");
|
ProString icon = project->first("ICON");
|
||||||
if (icon.length() >= 2 && (icon.at(0) == '"' || icon.at(0) == '\'') && icon.endsWith(icon.at(0)))
|
|
||||||
icon = icon.mid(1, icon.length() - 2);
|
|
||||||
bundle_resources_files += keyFor(icon + ".BUILDABLE");
|
bundle_resources_files += keyFor(icon + ".BUILDABLE");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1178,7 +1173,7 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t)
|
|||||||
<< "\t\t\t" << writeSettings("files", bundle_resources_files, SettingsAsList, 4) << ";\n"
|
<< "\t\t\t" << writeSettings("files", bundle_resources_files, SettingsAsList, 4) << ";\n"
|
||||||
<< "\t\t\t" << writeSettings("isa", "PBXResourcesBuildPhase", SettingsNoQuote) << ";\n"
|
<< "\t\t\t" << writeSettings("isa", "PBXResourcesBuildPhase", SettingsNoQuote) << ";\n"
|
||||||
<< "\t\t\t" << writeSettings("runOnlyForDeploymentPostprocessing", "0", SettingsNoQuote) << ";\n"
|
<< "\t\t\t" << writeSettings("runOnlyForDeploymentPostprocessing", "0", SettingsNoQuote) << ";\n"
|
||||||
<< "\t\t\t" << writeSettings("name", escapeFilePath(grp)) << ";\n"
|
<< "\t\t\t" << writeSettings("name", grp) << ";\n"
|
||||||
<< "\t\t};\n";
|
<< "\t\t};\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1203,7 +1198,7 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t)
|
|||||||
} else {
|
} else {
|
||||||
t << "\t\t\t" << writeSettings("explicitFileType", "compiled.mach-o.executable") << ";\n";
|
t << "\t\t\t" << writeSettings("explicitFileType", "compiled.mach-o.executable") << ";\n";
|
||||||
}
|
}
|
||||||
t << "\t\t\t" << writeSettings("path", escapeFilePath(targ)) << ";\n";
|
t << "\t\t\t" << writeSettings("path", targ) << ";\n";
|
||||||
} else {
|
} else {
|
||||||
ProString lib = project->first("QMAKE_ORIG_TARGET");
|
ProString lib = project->first("QMAKE_ORIG_TARGET");
|
||||||
if(project->isActiveConfig("staticlib")) {
|
if(project->isActiveConfig("staticlib")) {
|
||||||
@ -1231,7 +1226,7 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t)
|
|||||||
} else {
|
} else {
|
||||||
t << "\t\t\t" << writeSettings("explicitFileType", "compiled.mach-o.dylib") << ";\n";
|
t << "\t\t\t" << writeSettings("explicitFileType", "compiled.mach-o.dylib") << ";\n";
|
||||||
}
|
}
|
||||||
t << "\t\t\t" << writeSettings("path", escapeFilePath(lib)) << ";\n";
|
t << "\t\t\t" << writeSettings("path", lib) << ";\n";
|
||||||
}
|
}
|
||||||
t << "\t\t\t" << writeSettings("sourceTree", "BUILT_PRODUCTS_DIR", SettingsNoQuote) << ";\n"
|
t << "\t\t\t" << writeSettings("sourceTree", "BUILT_PRODUCTS_DIR", SettingsNoQuote) << ";\n"
|
||||||
<< "\t\t};\n";
|
<< "\t\t};\n";
|
||||||
@ -1251,7 +1246,7 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t)
|
|||||||
t << "\t\t" << keyFor("QMAKE_PBX_ROOT_GROUP") << " = {\n"
|
t << "\t\t" << keyFor("QMAKE_PBX_ROOT_GROUP") << " = {\n"
|
||||||
<< "\t\t\t" << writeSettings("children", project->values("QMAKE_PBX_GROUPS"), SettingsAsList, 4) << ";\n"
|
<< "\t\t\t" << writeSettings("children", project->values("QMAKE_PBX_GROUPS"), SettingsAsList, 4) << ";\n"
|
||||||
<< "\t\t\t" << writeSettings("isa", "PBXGroup", SettingsNoQuote) << ";\n"
|
<< "\t\t\t" << writeSettings("isa", "PBXGroup", SettingsNoQuote) << ";\n"
|
||||||
<< "\t\t\t" << writeSettings("name", escapeFilePath(project->first("QMAKE_ORIG_TARGET"))) << ";\n"
|
<< "\t\t\t" << writeSettings("name", project->first("QMAKE_ORIG_TARGET")) << ";\n"
|
||||||
<< "\t\t\t" << writeSettings("sourceTree", "<Group>") << ";\n"
|
<< "\t\t\t" << writeSettings("sourceTree", "<Group>") << ";\n"
|
||||||
<< "\t\t};\n";
|
<< "\t\t};\n";
|
||||||
|
|
||||||
@ -1297,14 +1292,14 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t)
|
|||||||
else
|
else
|
||||||
t << "\t\t\t" << writeSettings("productType", "com.apple.product-type.tool") << ";\n";
|
t << "\t\t\t" << writeSettings("productType", "com.apple.product-type.tool") << ";\n";
|
||||||
}
|
}
|
||||||
t << "\t\t\t" << writeSettings("name", escapeFilePath(project->first("QMAKE_ORIG_TARGET"))) << ";\n"
|
t << "\t\t\t" << writeSettings("name", project->first("QMAKE_ORIG_TARGET")) << ";\n"
|
||||||
<< "\t\t\t" << writeSettings("productName", escapeFilePath(project->first("QMAKE_ORIG_TARGET"))) << ";\n";
|
<< "\t\t\t" << writeSettings("productName", project->first("QMAKE_ORIG_TARGET")) << ";\n";
|
||||||
} else {
|
} else {
|
||||||
ProString lib = project->first("QMAKE_ORIG_TARGET");
|
ProString lib = project->first("QMAKE_ORIG_TARGET");
|
||||||
if(!project->isActiveConfig("lib_bundle") && !project->isActiveConfig("staticlib"))
|
if(!project->isActiveConfig("lib_bundle") && !project->isActiveConfig("staticlib"))
|
||||||
lib.prepend("lib");
|
lib.prepend("lib");
|
||||||
t << "\t\t\t" << writeSettings("name", escapeFilePath(lib)) << ";\n"
|
t << "\t\t\t" << writeSettings("name", lib) << ";\n"
|
||||||
<< "\t\t\t" << writeSettings("productName", escapeFilePath(lib)) << ";\n";
|
<< "\t\t\t" << writeSettings("productName", lib) << ";\n";
|
||||||
if (!project->isEmpty("QMAKE_PBX_PRODUCT_TYPE"))
|
if (!project->isEmpty("QMAKE_PBX_PRODUCT_TYPE"))
|
||||||
t << "\t\t\t" << writeSettings("productType", project->first("QMAKE_PBX_PRODUCT_TYPE")) << ";\n";
|
t << "\t\t\t" << writeSettings("productType", project->first("QMAKE_PBX_PRODUCT_TYPE")) << ";\n";
|
||||||
else if (project->isActiveConfig("staticlib"))
|
else if (project->isActiveConfig("staticlib"))
|
||||||
@ -1315,7 +1310,7 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t)
|
|||||||
t << "\t\t\t" << writeSettings("productType", "com.apple.product-type.library.dynamic") << ";\n";
|
t << "\t\t\t" << writeSettings("productType", "com.apple.product-type.library.dynamic") << ";\n";
|
||||||
}
|
}
|
||||||
if(!project->isEmpty("DESTDIR"))
|
if(!project->isEmpty("DESTDIR"))
|
||||||
t << "\t\t\t" << writeSettings("productInstallPath", escapeFilePath(project->first("DESTDIR"))) << ";\n";
|
t << "\t\t\t" << writeSettings("productInstallPath", project->first("DESTDIR")) << ";\n";
|
||||||
t << "\t\t};\n";
|
t << "\t\t};\n";
|
||||||
//DEBUG/RELEASE
|
//DEBUG/RELEASE
|
||||||
QString defaultConfig;
|
QString defaultConfig;
|
||||||
@ -1353,7 +1348,7 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t)
|
|||||||
ProString lib = project->first("QMAKE_ORIG_TARGET");
|
ProString lib = project->first("QMAKE_ORIG_TARGET");
|
||||||
if (!project->isActiveConfig("lib_bundle") && !project->isActiveConfig("staticlib"))
|
if (!project->isActiveConfig("lib_bundle") && !project->isActiveConfig("staticlib"))
|
||||||
lib.prepend("lib");
|
lib.prepend("lib");
|
||||||
settings.insert("PRODUCT_NAME", escapeFilePath(lib.toQString()));
|
settings.insert("PRODUCT_NAME", lib.toQString());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (project->isActiveConfig("debug") != (bool)as_release)
|
if (project->isActiveConfig("debug") != (bool)as_release)
|
||||||
@ -1423,7 +1418,7 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
t << "\t\t\t\t" << writeSettings("SYMROOT", escapeFilePath(qmake_getpwd())) << ";\n";
|
t << "\t\t\t\t" << writeSettings("SYMROOT", qmake_getpwd()) << ";\n";
|
||||||
|
|
||||||
if (!project->isEmpty("DESTDIR")) {
|
if (!project->isEmpty("DESTDIR")) {
|
||||||
ProString dir = project->first("DESTDIR");
|
ProString dir = project->first("DESTDIR");
|
||||||
@ -1459,11 +1454,11 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t)
|
|||||||
QString var = tmp[i].toQString(), val = QString::fromLocal8Bit(qgetenv(var.toLatin1().constData()));
|
QString var = tmp[i].toQString(), val = QString::fromLocal8Bit(qgetenv(var.toLatin1().constData()));
|
||||||
if (val.isEmpty() && var == "TB")
|
if (val.isEmpty() && var == "TB")
|
||||||
val = "/usr/bin/";
|
val = "/usr/bin/";
|
||||||
t << "\t\t\t\t" << writeSettings(var, escapeFilePath(val)) << ";\n";
|
t << "\t\t\t\t" << writeSettings(var, val) << ";\n";
|
||||||
}
|
}
|
||||||
if (!project->isEmpty("PRECOMPILED_HEADER")) {
|
if (!project->isEmpty("PRECOMPILED_HEADER")) {
|
||||||
t << "\t\t\t\t" << writeSettings("GCC_PRECOMPILE_PREFIX_HEADER", "YES") << ";\n"
|
t << "\t\t\t\t" << writeSettings("GCC_PRECOMPILE_PREFIX_HEADER", "YES") << ";\n"
|
||||||
<< "\t\t\t\t" << writeSettings("GCC_PREFIX_HEADER", escapeFilePath(project->first("PRECOMPILED_HEADER"))) << ";\n";
|
<< "\t\t\t\t" << writeSettings("GCC_PREFIX_HEADER", project->first("PRECOMPILED_HEADER")) << ";\n";
|
||||||
}
|
}
|
||||||
t << "\t\t\t\t" << writeSettings("HEADER_SEARCH_PATHS", fixListForOutput("INCLUDEPATH"), SettingsAsList, 5) << ";\n"
|
t << "\t\t\t\t" << writeSettings("HEADER_SEARCH_PATHS", fixListForOutput("INCLUDEPATH"), SettingsAsList, 5) << ";\n"
|
||||||
<< "\t\t\t\t" << writeSettings("LIBRARY_SEARCH_PATHS", fixListForOutput("QMAKE_PBX_LIBPATHS"), SettingsAsList, 5) << ";\n"
|
<< "\t\t\t\t" << writeSettings("LIBRARY_SEARCH_PATHS", fixListForOutput("QMAKE_PBX_LIBPATHS"), SettingsAsList, 5) << ";\n"
|
||||||
@ -1494,8 +1489,8 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t)
|
|||||||
t << "\t\t\t\t" << writeSettings("OTHER_LDFLAGS",
|
t << "\t\t\t\t" << writeSettings("OTHER_LDFLAGS",
|
||||||
fixListForOutput("SUBLIBS")
|
fixListForOutput("SUBLIBS")
|
||||||
+ fixListForOutput("QMAKE_LFLAGS")
|
+ fixListForOutput("QMAKE_LFLAGS")
|
||||||
+ fixListForOutput("QMAKE_LIBS")
|
+ fixListForOutput(fixLibFlags("QMAKE_LIBS"))
|
||||||
+ fixListForOutput("QMAKE_LIBS_PRIVATE"),
|
+ fixListForOutput(fixLibFlags("QMAKE_LIBS_PRIVATE")),
|
||||||
SettingsAsList, 6) << ";\n";
|
SettingsAsList, 6) << ";\n";
|
||||||
}
|
}
|
||||||
const ProStringList &archs = !project->values("QMAKE_XCODE_ARCHS").isEmpty() ?
|
const ProStringList &archs = !project->values("QMAKE_XCODE_ARCHS").isEmpty() ?
|
||||||
@ -1503,7 +1498,7 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t)
|
|||||||
if (!archs.isEmpty())
|
if (!archs.isEmpty())
|
||||||
t << "\t\t\t\t" << writeSettings("ARCHS", archs) << ";\n";
|
t << "\t\t\t\t" << writeSettings("ARCHS", archs) << ";\n";
|
||||||
if (!project->isEmpty("OBJECTS_DIR"))
|
if (!project->isEmpty("OBJECTS_DIR"))
|
||||||
t << "\t\t\t\t" << writeSettings("OBJROOT", escapeFilePath(project->first("OBJECTS_DIR").toQString())) << ";\n";
|
t << "\t\t\t\t" << writeSettings("OBJROOT", project->first("OBJECTS_DIR")) << ";\n";
|
||||||
} else {
|
} else {
|
||||||
if (project->first("TEMPLATE") == "app") {
|
if (project->first("TEMPLATE") == "app") {
|
||||||
t << "\t\t\t\t" << writeSettings("PRODUCT_NAME", fixForOutput(project->first("QMAKE_ORIG_TARGET").toQString())) << ";\n";
|
t << "\t\t\t\t" << writeSettings("PRODUCT_NAME", fixForOutput(project->first("QMAKE_ORIG_TARGET").toQString())) << ";\n";
|
||||||
@ -1515,7 +1510,7 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t)
|
|||||||
ProString lib = project->first("QMAKE_ORIG_TARGET");
|
ProString lib = project->first("QMAKE_ORIG_TARGET");
|
||||||
if (!project->isActiveConfig("lib_bundle") && !project->isActiveConfig("staticlib"))
|
if (!project->isActiveConfig("lib_bundle") && !project->isActiveConfig("staticlib"))
|
||||||
lib.prepend("lib");
|
lib.prepend("lib");
|
||||||
t << "\t\t\t\t" << writeSettings("PRODUCT_NAME", escapeFilePath(lib)) << ";\n";
|
t << "\t\t\t\t" << writeSettings("PRODUCT_NAME", lib) << ";\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
t << "\t\t\t};\n"
|
t << "\t\t\t};\n"
|
||||||
@ -1561,13 +1556,14 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t)
|
|||||||
QTextStream mkwrapt(&mkwrapf);
|
QTextStream mkwrapt(&mkwrapf);
|
||||||
writeHeader(mkwrapt);
|
writeHeader(mkwrapt);
|
||||||
const char cleans[] = "preprocess_clean ";
|
const char cleans[] = "preprocess_clean ";
|
||||||
|
const QString cmd = escapeFilePath(project->first("QMAKE_ORIG_TARGET") + projectSuffix() + "/") + " && " + pbxbuild();
|
||||||
mkwrapt << "#This is a makefile wrapper for PROJECT BUILDER\n"
|
mkwrapt << "#This is a makefile wrapper for PROJECT BUILDER\n"
|
||||||
<< "all:\n\t"
|
<< "all:\n\t"
|
||||||
<< "cd " << project->first("QMAKE_ORIG_TARGET") << projectSuffix() << "/ && " << pbxbuild() << "\n"
|
<< "cd " << cmd << "\n"
|
||||||
<< "install: all\n\t"
|
<< "install: all\n\t"
|
||||||
<< "cd " << project->first("QMAKE_ORIG_TARGET") << projectSuffix() << "/ && " << pbxbuild() << " install\n"
|
<< "cd " << cmd << " install\n"
|
||||||
<< "distclean clean: preprocess_clean\n\t"
|
<< "distclean clean: preprocess_clean\n\t"
|
||||||
<< "cd " << project->first("QMAKE_ORIG_TARGET") << projectSuffix() << "/ && " << pbxbuild() << " clean\n"
|
<< "cd " << cmd << " clean\n"
|
||||||
<< (!did_preprocess ? cleans : "") << ":\n";
|
<< (!did_preprocess ? cleans : "") << ":\n";
|
||||||
if(did_preprocess)
|
if(did_preprocess)
|
||||||
mkwrapt << cleans << ":\n\t"
|
mkwrapt << cleans << ":\n\t"
|
||||||
@ -1667,7 +1663,6 @@ ProjectBuilderMakefileGenerator::openOutput(QFile &file, const QString &build) c
|
|||||||
output += QDir::separator();
|
output += QDir::separator();
|
||||||
}
|
}
|
||||||
output += QString("project.pbxproj");
|
output += QString("project.pbxproj");
|
||||||
output = unescapeFilePath(output);
|
|
||||||
file.setFileName(output);
|
file.setFileName(output);
|
||||||
}
|
}
|
||||||
bool ret = UnixMakefileGenerator::openOutput(file, build);
|
bool ret = UnixMakefileGenerator::openOutput(file, build);
|
||||||
@ -1724,8 +1719,6 @@ ProjectBuilderMakefileGenerator::pbuilderVersion() const
|
|||||||
else
|
else
|
||||||
version_plist = "/Developer/Applications/Project Builder.app/Contents/version.plist";
|
version_plist = "/Developer/Applications/Project Builder.app/Contents/version.plist";
|
||||||
#endif
|
#endif
|
||||||
} else {
|
|
||||||
version_plist.replace(QRegExp("\""), "");
|
|
||||||
}
|
}
|
||||||
if (ret.isEmpty()) {
|
if (ret.isEmpty()) {
|
||||||
QFile version_file(version_plist);
|
QFile version_file(version_plist);
|
||||||
@ -1786,7 +1779,7 @@ int
|
|||||||
ProjectBuilderMakefileGenerator::reftypeForFile(const QString &where)
|
ProjectBuilderMakefileGenerator::reftypeForFile(const QString &where)
|
||||||
{
|
{
|
||||||
int ret = 0; //absolute is the default..
|
int ret = 0; //absolute is the default..
|
||||||
if(QDir::isRelativePath(unescapeFilePath(where)))
|
if (QDir::isRelativePath(where))
|
||||||
ret = 4; //relative
|
ret = 4; //relative
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
@ -1812,26 +1805,6 @@ ProjectBuilderMakefileGenerator::pbxbuild()
|
|||||||
return (pbuilderVersion() >= 38 ? "xcodebuild" : "pbxbuild");
|
return (pbuilderVersion() >= 38 ? "xcodebuild" : "pbxbuild");
|
||||||
}
|
}
|
||||||
|
|
||||||
QString
|
|
||||||
ProjectBuilderMakefileGenerator::escapeFilePath(const QString &path) const
|
|
||||||
{
|
|
||||||
#if 1
|
|
||||||
//in the middle of generating a Makefile!
|
|
||||||
if(writingUnixMakefileGenerator)
|
|
||||||
return UnixMakefileGenerator::escapeFilePath(path);
|
|
||||||
|
|
||||||
//generating stuff for the xml file!
|
|
||||||
QString ret = path;
|
|
||||||
if(!ret.isEmpty()) {
|
|
||||||
ret = unescapeFilePath(ret);
|
|
||||||
debug_msg(2, "EscapeFilePath: %s -> %s", path.toLatin1().constData(), ret.toLatin1().constData());
|
|
||||||
}
|
|
||||||
return ret;
|
|
||||||
#else
|
|
||||||
return UnixMakefileGenerator::escapeFilePath(path);
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
static QString quotedStringLiteral(const QString &value)
|
static QString quotedStringLiteral(const QString &value)
|
||||||
{
|
{
|
||||||
QString result;
|
QString result;
|
||||||
|
@ -72,8 +72,6 @@ public:
|
|||||||
virtual bool supportsMetaBuild() { return false; }
|
virtual bool supportsMetaBuild() { return false; }
|
||||||
virtual bool openOutput(QFile &, const QString &) const;
|
virtual bool openOutput(QFile &, const QString &) const;
|
||||||
protected:
|
protected:
|
||||||
virtual QString escapeFilePath(const QString &path) const;
|
|
||||||
ProString escapeFilePath(const ProString &path) const { return MakefileGenerator::escapeFilePath(path); }
|
|
||||||
bool doPrecompiledHeaders() const { return false; }
|
bool doPrecompiledHeaders() const { return false; }
|
||||||
virtual bool doDepends() const { return writingUnixMakefileGenerator && UnixMakefileGenerator::doDepends(); }
|
virtual bool doDepends() const { return writingUnixMakefileGenerator && UnixMakefileGenerator::doDepends(); }
|
||||||
};
|
};
|
||||||
|
@ -277,8 +277,6 @@ MakefileGenerator::findFilesInVPATH(ProStringList l, uchar flags, const QString
|
|||||||
}
|
}
|
||||||
if(!(flags & VPATH_NoFixify))
|
if(!(flags & VPATH_NoFixify))
|
||||||
file = fileFixify(file, qmake_getpwd(), Option::output_dir);
|
file = fileFixify(file, qmake_getpwd(), Option::output_dir);
|
||||||
if (file.at(0) == '\"' && file.at(file.length() - 1) == '\"')
|
|
||||||
file = file.mid(1, file.length() - 2);
|
|
||||||
|
|
||||||
if(exists(file)) {
|
if(exists(file)) {
|
||||||
++val_it;
|
++val_it;
|
||||||
@ -774,7 +772,7 @@ MakefileGenerator::init()
|
|||||||
incDirs += v["INCLUDEPATH"];
|
incDirs += v["INCLUDEPATH"];
|
||||||
QList<QMakeLocalFileName> deplist;
|
QList<QMakeLocalFileName> deplist;
|
||||||
for (ProStringList::Iterator it = incDirs.begin(); it != incDirs.end(); ++it)
|
for (ProStringList::Iterator it = incDirs.begin(); it != incDirs.end(); ++it)
|
||||||
deplist.append(QMakeLocalFileName(unescapeFilePath((*it).toQString())));
|
deplist.append(QMakeLocalFileName((*it).toQString()));
|
||||||
QMakeSourceFileInfo::setDependencyPaths(deplist);
|
QMakeSourceFileInfo::setDependencyPaths(deplist);
|
||||||
debug_msg(1, "Dependency Directories: %s", incDirs.join(" :: ").toLatin1().constData());
|
debug_msg(1, "Dependency Directories: %s", incDirs.join(" :: ").toLatin1().constData());
|
||||||
//cache info
|
//cache info
|
||||||
@ -829,7 +827,7 @@ MakefileGenerator::init()
|
|||||||
ProStringList &l = v[fixpaths[path]];
|
ProStringList &l = v[fixpaths[path]];
|
||||||
for (ProStringList::Iterator val_it = l.begin(); val_it != l.end(); ++val_it) {
|
for (ProStringList::Iterator val_it = l.begin(); val_it != l.end(); ++val_it) {
|
||||||
if(!(*val_it).isEmpty())
|
if(!(*val_it).isEmpty())
|
||||||
(*val_it) = escapeDependencyPath(Option::fixPathToTargetOS((*val_it).toQString(), false, false));
|
(*val_it) = Option::fixPathToTargetOS((*val_it).toQString(), false, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1054,9 +1052,9 @@ MakefileGenerator::writeProjectMakefile()
|
|||||||
|
|
||||||
writeSubTargets(t, targets, SubTargetsNoFlags);
|
writeSubTargets(t, targets, SubTargetsNoFlags);
|
||||||
if(!project->isActiveConfig("no_autoqmake")) {
|
if(!project->isActiveConfig("no_autoqmake")) {
|
||||||
|
QString mkf = escapeDependencyPath(Option::fixPathToTargetOS(fileFixify(Option::output.fileName())));
|
||||||
for(QList<SubTarget*>::Iterator it = targets.begin(); it != targets.end(); ++it)
|
for(QList<SubTarget*>::Iterator it = targets.begin(); it != targets.end(); ++it)
|
||||||
t << (*it)->makefile << ": " <<
|
t << escapeDependencyPath((*it)->makefile) << ": " << mkf << endl;
|
||||||
Option::fixPathToTargetOS(fileFixify(Option::output.fileName())) << endl;
|
|
||||||
}
|
}
|
||||||
qDeleteAll(targets);
|
qDeleteAll(targets);
|
||||||
return true;
|
return true;
|
||||||
@ -1208,7 +1206,7 @@ MakefileGenerator::writeInstalls(QTextStream &t, bool noBuild)
|
|||||||
QString dst;
|
QString dst;
|
||||||
if (installConfigValues.indexOf("no_path") == -1 &&
|
if (installConfigValues.indexOf("no_path") == -1 &&
|
||||||
installConfigValues.indexOf("dummy_install") == -1) {
|
installConfigValues.indexOf("dummy_install") == -1) {
|
||||||
dst = fileFixify(unescapeFilePath(project->first(pvar).toQString()), FileFixifyAbsolute, false);
|
dst = fileFixify(project->first(pvar).toQString(), FileFixifyAbsolute, false);
|
||||||
if(!dst.endsWith(Option::dir_sep))
|
if(!dst.endsWith(Option::dir_sep))
|
||||||
dst += Option::dir_sep;
|
dst += Option::dir_sep;
|
||||||
}
|
}
|
||||||
@ -1375,7 +1373,7 @@ MakefileGenerator::writeInstalls(QTextStream &t, bool noBuild)
|
|||||||
t << "uninstall_" << (*it) << ": FORCE";
|
t << "uninstall_" << (*it) << ": FORCE";
|
||||||
for (int i = uninst.size(); --i >= 0; )
|
for (int i = uninst.size(); --i >= 0; )
|
||||||
t << "\n\t" << uninst.at(i);
|
t << "\n\t" << uninst.at(i);
|
||||||
t << "\n\t-$(DEL_DIR) " << filePrefixRoot(root, dst) << " \n\n";
|
t << "\n\t-$(DEL_DIR) " << escapeFilePath(filePrefixRoot(root, dst)) << " \n\n";
|
||||||
}
|
}
|
||||||
t << endl;
|
t << endl;
|
||||||
|
|
||||||
@ -1388,8 +1386,8 @@ MakefileGenerator::writeInstalls(QTextStream &t, bool noBuild)
|
|||||||
debug_msg(1, "no definition for install %s: install target not created",(*it).toLatin1().constData());
|
debug_msg(1, "no definition for install %s: install target not created",(*it).toLatin1().constData());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
t << "install: " << var("INSTALLDEPS") << " " << all_installs
|
t << "install:" << depVar("INSTALLDEPS") << ' ' << all_installs
|
||||||
<< " FORCE\n\nuninstall: " << all_uninstalls << " " << var("UNINSTALLDEPS")
|
<< " FORCE\n\nuninstall: " << all_uninstalls << depVar("UNINSTALLDEPS")
|
||||||
<< " FORCE\n\n";
|
<< " FORCE\n\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1399,6 +1397,24 @@ MakefileGenerator::var(const ProKey &var) const
|
|||||||
return val(project->values(var));
|
return val(project->values(var));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QString
|
||||||
|
MakefileGenerator::fileVar(const ProKey &var) const
|
||||||
|
{
|
||||||
|
return val(escapeFilePaths(project->values(var)));
|
||||||
|
}
|
||||||
|
|
||||||
|
QString
|
||||||
|
MakefileGenerator::fileVarList(const ProKey &var) const
|
||||||
|
{
|
||||||
|
return valList(escapeFilePaths(project->values(var)));
|
||||||
|
}
|
||||||
|
|
||||||
|
QString
|
||||||
|
MakefileGenerator::depVar(const ProKey &var) const
|
||||||
|
{
|
||||||
|
return val(escapeDependencyPaths(project->values(var)));
|
||||||
|
}
|
||||||
|
|
||||||
QString
|
QString
|
||||||
MakefileGenerator::val(const ProStringList &varList) const
|
MakefileGenerator::val(const ProStringList &varList) const
|
||||||
{
|
{
|
||||||
@ -1417,6 +1433,12 @@ MakefileGenerator::varGlue(const ProKey &var, const QString &before, const QStri
|
|||||||
return valGlue(project->values(var), before, glue, after);
|
return valGlue(project->values(var), before, glue, after);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QString
|
||||||
|
MakefileGenerator::fileVarGlue(const ProKey &var, const QString &before, const QString &glue, const QString &after) const
|
||||||
|
{
|
||||||
|
return valGlue(escapeFilePaths(project->values(var)), before, glue, after);
|
||||||
|
}
|
||||||
|
|
||||||
QString
|
QString
|
||||||
MakefileGenerator::fixFileVarGlue(const ProKey &var, const QString &before, const QString &glue, const QString &after) const
|
MakefileGenerator::fixFileVarGlue(const ProKey &var, const QString &before, const QString &glue, const QString &after) const
|
||||||
{
|
{
|
||||||
@ -1644,9 +1666,9 @@ MakefileGenerator::replaceExtraCompilerVariables(
|
|||||||
if(!fullVal.isEmpty())
|
if(!fullVal.isEmpty())
|
||||||
fullVal += " ";
|
fullVal += " ";
|
||||||
if (forShell == LocalShell)
|
if (forShell == LocalShell)
|
||||||
fullVal += IoUtils::shellQuote(Option::fixPathToLocalOS(unescapeFilePath(val.at(i)), false));
|
fullVal += IoUtils::shellQuote(Option::fixPathToLocalOS(val.at(i), false));
|
||||||
else
|
else
|
||||||
fullVal += escapeFilePath(Option::fixPathToTargetOS(unescapeFilePath(val.at(i)), false));
|
fullVal += escapeFilePath(Option::fixPathToTargetOS(val.at(i), false));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
fullVal = val.join(' ');
|
fullVal = val.join(' ');
|
||||||
@ -1833,7 +1855,7 @@ MakefileGenerator::writeExtraCompilerTargets(QTextStream &t)
|
|||||||
t << endl;
|
t << endl;
|
||||||
|
|
||||||
if (config.indexOf("no_clean") == -1) {
|
if (config.indexOf("no_clean") == -1) {
|
||||||
QString tmp_clean = project->values(ProKey(*it + ".clean")).join(' ');
|
QString tmp_clean = escapeFilePaths(project->values(ProKey(*it + ".clean"))).join(' ');
|
||||||
QString tmp_clean_cmds = project->values(ProKey(*it + ".clean_commands")).join(' ');
|
QString tmp_clean_cmds = project->values(ProKey(*it + ".clean_commands")).join(' ');
|
||||||
if(!tmp_inputs.isEmpty())
|
if(!tmp_inputs.isEmpty())
|
||||||
clean_targets += QString("compiler_" + (*it) + "_clean ");
|
clean_targets += QString("compiler_" + (*it) + "_clean ");
|
||||||
@ -1846,7 +1868,7 @@ MakefileGenerator::writeExtraCompilerTargets(QTextStream &t)
|
|||||||
wrote_clean_cmds = true;
|
wrote_clean_cmds = true;
|
||||||
}
|
}
|
||||||
if(tmp_clean.isEmpty())
|
if(tmp_clean.isEmpty())
|
||||||
tmp_clean = tmp_out;
|
tmp_clean = escapeFilePath(tmp_out);
|
||||||
if(tmp_clean.indexOf("${QMAKE_") == -1) {
|
if(tmp_clean.indexOf("${QMAKE_") == -1) {
|
||||||
t << "\n\t-$(DEL_FILE) " << tmp_clean;
|
t << "\n\t-$(DEL_FILE) " << tmp_clean;
|
||||||
wrote_clean = true;
|
wrote_clean = true;
|
||||||
@ -1919,6 +1941,7 @@ MakefileGenerator::writeExtraCompilerTargets(QTextStream &t)
|
|||||||
}
|
}
|
||||||
QT_PCLOSE(proc);
|
QT_PCLOSE(proc);
|
||||||
if(!indeps.isEmpty()) {
|
if(!indeps.isEmpty()) {
|
||||||
|
// ### This is basically fubar. Add 'lines' flag to CONFIG?
|
||||||
QStringList dep_cmd_deps = indeps.replace('\n', ' ').simplified().split(' ');
|
QStringList dep_cmd_deps = indeps.replace('\n', ' ').simplified().split(' ');
|
||||||
for(int i = 0; i < dep_cmd_deps.count(); ++i) {
|
for(int i = 0; i < dep_cmd_deps.count(); ++i) {
|
||||||
QString &file = dep_cmd_deps[i];
|
QString &file = dep_cmd_deps[i];
|
||||||
@ -1985,7 +2008,7 @@ MakefileGenerator::writeExtraCompilerTargets(QTextStream &t)
|
|||||||
QString inpf = (*input).toQString();
|
QString inpf = (*input).toQString();
|
||||||
QString in = Option::fixPathToTargetOS(inpf, false);
|
QString in = Option::fixPathToTargetOS(inpf, false);
|
||||||
QStringList deps = findDependencies(inpf);
|
QStringList deps = findDependencies(inpf);
|
||||||
deps += escapeDependencyPath(in);
|
deps << in;
|
||||||
QString out = Option::fixPathToTargetOS(replaceExtraCompilerVariables(tmp_out, inpf, QString(), NoShell));
|
QString out = Option::fixPathToTargetOS(replaceExtraCompilerVariables(tmp_out, inpf, QString(), NoShell));
|
||||||
if(!tmp_dep.isEmpty()) {
|
if(!tmp_dep.isEmpty()) {
|
||||||
QStringList pre_deps = fileFixify(tmp_dep, Option::output_dir, Option::output_dir);
|
QStringList pre_deps = fileFixify(tmp_dep, Option::output_dir, Option::output_dir);
|
||||||
@ -2010,6 +2033,7 @@ MakefileGenerator::writeExtraCompilerTargets(QTextStream &t)
|
|||||||
}
|
}
|
||||||
QT_PCLOSE(proc);
|
QT_PCLOSE(proc);
|
||||||
if(!indeps.isEmpty()) {
|
if(!indeps.isEmpty()) {
|
||||||
|
// ### This is basically fubar. Add 'lines' flag to CONFIG?
|
||||||
QStringList dep_cmd_deps = indeps.replace('\n', ' ').simplified().split(' ');
|
QStringList dep_cmd_deps = indeps.replace('\n', ' ').simplified().split(' ');
|
||||||
for(int i = 0; i < dep_cmd_deps.count(); ++i) {
|
for(int i = 0; i < dep_cmd_deps.count(); ++i) {
|
||||||
QString &file = dep_cmd_deps[i];
|
QString &file = dep_cmd_deps[i];
|
||||||
@ -2087,7 +2111,7 @@ MakefileGenerator::writeExtraCompilerTargets(QTextStream &t)
|
|||||||
}
|
}
|
||||||
for(int i = 0; i < deps.size(); ) {
|
for(int i = 0; i < deps.size(); ) {
|
||||||
QString &dep = deps[i];
|
QString &dep = deps[i];
|
||||||
dep = Option::fixPathToTargetOS(unescapeFilePath(dep), false);
|
dep = Option::fixPathToTargetOS(dep, false);
|
||||||
if(out == dep)
|
if(out == dep)
|
||||||
deps.removeAt(i);
|
deps.removeAt(i);
|
||||||
else
|
else
|
||||||
@ -2251,7 +2275,7 @@ MakefileGenerator::writeHeader(QTextStream &t)
|
|||||||
QString ofile = Option::fixPathToTargetOS(Option::output.fileName());
|
QString ofile = Option::fixPathToTargetOS(Option::output.fileName());
|
||||||
if (ofile.lastIndexOf(Option::dir_sep) != -1)
|
if (ofile.lastIndexOf(Option::dir_sep) != -1)
|
||||||
ofile.remove(0, ofile.lastIndexOf(Option::dir_sep) +1);
|
ofile.remove(0, ofile.lastIndexOf(Option::dir_sep) +1);
|
||||||
t << "MAKEFILE = " << ofile << endl << endl;
|
t << "MAKEFILE = " << escapeFilePath(ofile) << endl << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
QList<MakefileGenerator::SubTarget*>
|
QList<MakefileGenerator::SubTarget*>
|
||||||
@ -2441,8 +2465,8 @@ MakefileGenerator::writeSubTargets(QTextStream &t, QList<MakefileGenerator::SubT
|
|||||||
out_directory = Option::output_dir + out_directory.mid(abs_source_path.length());
|
out_directory = Option::output_dir + out_directory.mid(abs_source_path.length());
|
||||||
|
|
||||||
QString out_directory_cdin = out_directory.isEmpty() ? "\n\t"
|
QString out_directory_cdin = out_directory.isEmpty() ? "\n\t"
|
||||||
: "\n\tcd " + out_directory + " && ";
|
: "\n\tcd " + escapeFilePath(out_directory) + " && ";
|
||||||
QString makefilein = " -f " + subtarget->makefile;
|
QString makefilein = " -f " + escapeFilePath(subtarget->makefile);
|
||||||
|
|
||||||
//qmake it
|
//qmake it
|
||||||
QString out;
|
QString out;
|
||||||
@ -2452,6 +2476,7 @@ MakefileGenerator::writeSubTargets(QTextStream &t, QList<MakefileGenerator::SubT
|
|||||||
in = escapeFilePath(fileFixify(in_directory + subtarget->profile, FileFixifyAbsolute));
|
in = escapeFilePath(fileFixify(in_directory + subtarget->profile, FileFixifyAbsolute));
|
||||||
if(out.startsWith(in_directory))
|
if(out.startsWith(in_directory))
|
||||||
out = out.mid(in_directory.length());
|
out = out.mid(in_directory.length());
|
||||||
|
out = escapeFilePath(out);
|
||||||
t << subtarget->target << "-qmake_all: ";
|
t << subtarget->target << "-qmake_all: ";
|
||||||
if (flags & SubTargetOrdered) {
|
if (flags & SubTargetOrdered) {
|
||||||
if (target)
|
if (target)
|
||||||
@ -2545,18 +2570,18 @@ MakefileGenerator::writeSubTargets(QTextStream &t, QList<MakefileGenerator::SubT
|
|||||||
t << " " << targetRule;
|
t << " " << targetRule;
|
||||||
}
|
}
|
||||||
if(suffix == "all" || suffix == "make_first")
|
if(suffix == "all" || suffix == "make_first")
|
||||||
t << varGlue("ALL_DEPS"," "," ","");
|
t << depVar("ALL_DEPS");
|
||||||
if(suffix == "clean")
|
if(suffix == "clean")
|
||||||
t << varGlue("CLEAN_DEPS"," "," ","");
|
t << depVar("CLEAN_DEPS");
|
||||||
else if (suffix == "distclean")
|
else if (suffix == "distclean")
|
||||||
t << varGlue("DISTCLEAN_DEPS"," "," ","");
|
t << depVar("DISTCLEAN_DEPS");
|
||||||
t << " FORCE\n";
|
t << " FORCE\n";
|
||||||
if(suffix == "clean") {
|
if(suffix == "clean") {
|
||||||
t << fixFileVarGlue("QMAKE_CLEAN", "\t-$(DEL_FILE) ", "\n\t-$(DEL_FILE) ", "\n");
|
t << fixFileVarGlue("QMAKE_CLEAN", "\t-$(DEL_FILE) ", "\n\t-$(DEL_FILE) ", "\n");
|
||||||
} else if(suffix == "distclean") {
|
} else if(suffix == "distclean") {
|
||||||
QString ofile = Option::fixPathToTargetOS(fileFixify(Option::output.fileName()));
|
QString ofile = Option::fixPathToTargetOS(fileFixify(Option::output.fileName()));
|
||||||
if(!ofile.isEmpty())
|
if(!ofile.isEmpty())
|
||||||
t << "\t-$(DEL_FILE) " << ofile << endl;
|
t << "\t-$(DEL_FILE) " << escapeFilePath(ofile) << endl;
|
||||||
t << fixFileVarGlue("QMAKE_DISTCLEAN", "\t-$(DEL_FILE) ", " ", "\n");
|
t << fixFileVarGlue("QMAKE_DISTCLEAN", "\t-$(DEL_FILE) ", " ", "\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2576,7 +2601,7 @@ MakefileGenerator::writeSubTargets(QTextStream &t, QList<MakefileGenerator::SubT
|
|||||||
QString dep = var(ProKey(*dep_it + ".target"));
|
QString dep = var(ProKey(*dep_it + ".target"));
|
||||||
if(dep.isEmpty())
|
if(dep.isEmpty())
|
||||||
dep = Option::fixPathToTargetOS((*dep_it).toQString(), false);
|
dep = Option::fixPathToTargetOS((*dep_it).toQString(), false);
|
||||||
deps += " " + dep;
|
deps += ' ' + escapeDependencyPath(dep);
|
||||||
}
|
}
|
||||||
if (config.indexOf("recursive") != -1) {
|
if (config.indexOf("recursive") != -1) {
|
||||||
QSet<QString> recurse;
|
QSet<QString> recurse;
|
||||||
@ -2602,8 +2627,8 @@ MakefileGenerator::writeSubTargets(QTextStream &t, QList<MakefileGenerator::SubT
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
QString out_directory_cdin = out_directory.isEmpty() ? "\n\t"
|
QString out_directory_cdin = out_directory.isEmpty() ? "\n\t"
|
||||||
: "\n\tcd " + out_directory + " && ";
|
: "\n\tcd " + escapeFilePath(out_directory) + " && ";
|
||||||
QString makefilein = " -f " + subtarget->makefile;
|
QString makefilein = " -f " + escapeFilePath(subtarget->makefile);
|
||||||
|
|
||||||
QString out;
|
QString out;
|
||||||
QString in;
|
QString in;
|
||||||
@ -2612,6 +2637,7 @@ MakefileGenerator::writeSubTargets(QTextStream &t, QList<MakefileGenerator::SubT
|
|||||||
in = escapeFilePath(fileFixify(in_directory + subtarget->profile, FileFixifyAbsolute));
|
in = escapeFilePath(fileFixify(in_directory + subtarget->profile, FileFixifyAbsolute));
|
||||||
if (out.startsWith(in_directory))
|
if (out.startsWith(in_directory))
|
||||||
out = out.mid(in_directory.length());
|
out = out.mid(in_directory.length());
|
||||||
|
out = escapeFilePath(out);
|
||||||
}
|
}
|
||||||
|
|
||||||
//write the rule/depends
|
//write the rule/depends
|
||||||
@ -2659,14 +2685,14 @@ MakefileGenerator::writeMakeQmake(QTextStream &t, bool noDummyQmakeAll)
|
|||||||
{
|
{
|
||||||
QString ofile = Option::fixPathToTargetOS(fileFixify(Option::output.fileName()));
|
QString ofile = Option::fixPathToTargetOS(fileFixify(Option::output.fileName()));
|
||||||
if(project->isEmpty("QMAKE_FAILED_REQUIREMENTS") && !project->isEmpty("QMAKE_INTERNAL_PRL_FILE")) {
|
if(project->isEmpty("QMAKE_FAILED_REQUIREMENTS") && !project->isEmpty("QMAKE_INTERNAL_PRL_FILE")) {
|
||||||
QStringList files = fileFixify(Option::mkfile::project_files);
|
QStringList files = escapeFilePaths(fileFixify(Option::mkfile::project_files));
|
||||||
t << escapeDependencyPath(project->first("QMAKE_INTERNAL_PRL_FILE").toQString()) << ": \n\t"
|
t << escapeDependencyPath(project->first("QMAKE_INTERNAL_PRL_FILE").toQString()) << ": \n\t"
|
||||||
<< "@$(QMAKE) -prl " << buildArgs() << " " << files.join(' ') << endl;
|
<< "@$(QMAKE) -prl " << buildArgs() << " " << files.join(' ') << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
QString qmake = build_args();
|
QString qmake = build_args();
|
||||||
if(!ofile.isEmpty() && !project->isActiveConfig("no_autoqmake")) {
|
if(!ofile.isEmpty() && !project->isActiveConfig("no_autoqmake")) {
|
||||||
t << escapeFilePath(ofile) << ": "
|
t << escapeDependencyPath(ofile) << ": "
|
||||||
<< escapeDependencyPath(fileFixify(project->projectFile())) << " ";
|
<< escapeDependencyPath(fileFixify(project->projectFile())) << " ";
|
||||||
if (Option::globals->do_cache) {
|
if (Option::globals->do_cache) {
|
||||||
if (!project->confFile().isEmpty())
|
if (!project->confFile().isEmpty())
|
||||||
@ -2678,8 +2704,8 @@ MakefileGenerator::writeMakeQmake(QTextStream &t, bool noDummyQmakeAll)
|
|||||||
if(exists(Option::fixPathToLocalOS(specdir()+QDir::separator()+"qmake.conf")))
|
if(exists(Option::fixPathToLocalOS(specdir()+QDir::separator()+"qmake.conf")))
|
||||||
t << escapeDependencyPath(specdir() + Option::dir_sep + "qmake.conf") << " ";
|
t << escapeDependencyPath(specdir() + Option::dir_sep + "qmake.conf") << " ";
|
||||||
}
|
}
|
||||||
const ProStringList &included = project->values("QMAKE_INTERNAL_INCLUDED_FILES");
|
const ProStringList &included = escapeDependencyPaths(project->values("QMAKE_INTERNAL_INCLUDED_FILES"));
|
||||||
t << escapeDependencyPaths(included).join(" \\\n\t\t") << "\n\t"
|
t << included.join(" \\\n\t\t") << "\n\t"
|
||||||
<< qmake << endl;
|
<< qmake << endl;
|
||||||
for(int include = 0; include < included.size(); ++include) {
|
for(int include = 0; include < included.size(); ++include) {
|
||||||
const ProString &i = included.at(include);
|
const ProString &i = included.at(include);
|
||||||
@ -2714,19 +2740,22 @@ MakefileGenerator::fileInfo(QString file) const
|
|||||||
return fi;
|
return fi;
|
||||||
}
|
}
|
||||||
|
|
||||||
QString
|
ProStringList
|
||||||
MakefileGenerator::unescapeFilePath(const QString &path) const
|
MakefileGenerator::fixLibFlags(const ProKey &var)
|
||||||
{
|
{
|
||||||
QString ret = path;
|
ProStringList in = project->values(var);
|
||||||
ret.replace(QLatin1String("\\ "), QLatin1String(" "));
|
ProStringList ret;
|
||||||
ret.remove(QLatin1Char('\"'));
|
|
||||||
|
ret.reserve(in.length());
|
||||||
|
foreach (const ProString &v, in)
|
||||||
|
ret << fixLibFlag(v);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
ProString
|
ProString MakefileGenerator::fixLibFlag(const ProString &)
|
||||||
MakefileGenerator::unescapeFilePath(const ProString &path) const
|
|
||||||
{
|
{
|
||||||
return ProString(unescapeFilePath(path.toQString()));
|
qFatal("MakefileGenerator::fixLibFlag() called");
|
||||||
|
return ProString();
|
||||||
}
|
}
|
||||||
|
|
||||||
ProString
|
ProString
|
||||||
@ -2753,6 +2782,12 @@ MakefileGenerator::escapeFilePaths(const ProStringList &paths) const
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ProString
|
||||||
|
MakefileGenerator::escapeDependencyPath(const ProString &path) const
|
||||||
|
{
|
||||||
|
return ProString(escapeDependencyPath(path.toQString()));
|
||||||
|
}
|
||||||
|
|
||||||
QStringList
|
QStringList
|
||||||
MakefileGenerator::escapeDependencyPaths(const QStringList &paths) const
|
MakefileGenerator::escapeDependencyPaths(const QStringList &paths) const
|
||||||
{
|
{
|
||||||
@ -2771,24 +2806,6 @@ MakefileGenerator::escapeDependencyPaths(const ProStringList &paths) const
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
QStringList
|
|
||||||
MakefileGenerator::unescapeFilePaths(const QStringList &paths) const
|
|
||||||
{
|
|
||||||
QStringList ret;
|
|
||||||
for(int i = 0; i < paths.size(); ++i)
|
|
||||||
ret.append(unescapeFilePath(paths.at(i)));
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
ProStringList
|
|
||||||
MakefileGenerator::unescapeFilePaths(const ProStringList &paths) const
|
|
||||||
{
|
|
||||||
ProStringList ret;
|
|
||||||
for (int i = 0; i < paths.size(); ++i)
|
|
||||||
ret.append(unescapeFilePath(paths.at(i)));
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
QStringList
|
QStringList
|
||||||
MakefileGenerator::fileFixify(const QStringList& files, const QString &out_dir, const QString &in_dir,
|
MakefileGenerator::fileFixify(const QStringList& files, const QString &out_dir, const QString &in_dir,
|
||||||
FileFixifyType fix, bool canon) const
|
FileFixifyType fix, bool canon) const
|
||||||
@ -2809,7 +2826,7 @@ MakefileGenerator::fileFixify(const QString& file, const QString &out_d, const Q
|
|||||||
{
|
{
|
||||||
if(file.isEmpty())
|
if(file.isEmpty())
|
||||||
return file;
|
return file;
|
||||||
QString ret = unescapeFilePath(file);
|
QString ret = file;
|
||||||
|
|
||||||
//do the fixin'
|
//do the fixin'
|
||||||
QString orig_file = ret;
|
QString orig_file = ret;
|
||||||
@ -3223,9 +3240,9 @@ MakefileGenerator::writePkgConfigFile()
|
|||||||
}
|
}
|
||||||
ProString bundle;
|
ProString bundle;
|
||||||
if (!project->isEmpty("QMAKE_FRAMEWORK_BUNDLE_NAME"))
|
if (!project->isEmpty("QMAKE_FRAMEWORK_BUNDLE_NAME"))
|
||||||
bundle = unescapeFilePath(project->first("QMAKE_FRAMEWORK_BUNDLE_NAME"));
|
bundle = project->first("QMAKE_FRAMEWORK_BUNDLE_NAME");
|
||||||
else
|
else
|
||||||
bundle = unescapeFilePath(project->first("TARGET"));
|
bundle = project->first("TARGET");
|
||||||
int suffix = bundle.lastIndexOf(".framework");
|
int suffix = bundle.lastIndexOf(".framework");
|
||||||
if (suffix != -1)
|
if (suffix != -1)
|
||||||
bundle = bundle.left(suffix);
|
bundle = bundle.left(suffix);
|
||||||
@ -3233,11 +3250,11 @@ MakefileGenerator::writePkgConfigFile()
|
|||||||
} else {
|
} else {
|
||||||
if (!project->values("QMAKE_DEFAULT_LIBDIRS").contains(libDir))
|
if (!project->values("QMAKE_DEFAULT_LIBDIRS").contains(libDir))
|
||||||
t << "-L${libdir} ";
|
t << "-L${libdir} ";
|
||||||
pkgConfiglibName = "-l" + unescapeFilePath(project->first("QMAKE_ORIG_TARGET"));
|
pkgConfiglibName = "-l" + project->first("QMAKE_ORIG_TARGET");
|
||||||
if (project->isActiveConfig("shared"))
|
if (project->isActiveConfig("shared"))
|
||||||
pkgConfiglibName += project->first("TARGET_VERSION_EXT").toQString();
|
pkgConfiglibName += project->first("TARGET_VERSION_EXT").toQString();
|
||||||
}
|
}
|
||||||
t << pkgConfiglibName << " \n";
|
t << shellQuote(pkgConfiglibName) << " \n";
|
||||||
|
|
||||||
ProStringList libs;
|
ProStringList libs;
|
||||||
if(!project->isEmpty("QMAKE_INTERNAL_PRL_LIBS")) {
|
if(!project->isEmpty("QMAKE_INTERNAL_PRL_LIBS")) {
|
||||||
@ -3249,7 +3266,7 @@ MakefileGenerator::writePkgConfigFile()
|
|||||||
libs << "QMAKE_LFLAGS_THREAD"; //not sure about this one, but what about things like -pthread?
|
libs << "QMAKE_LFLAGS_THREAD"; //not sure about this one, but what about things like -pthread?
|
||||||
t << "Libs.private: ";
|
t << "Libs.private: ";
|
||||||
for (ProStringList::ConstIterator it = libs.begin(); it != libs.end(); ++it) {
|
for (ProStringList::ConstIterator it = libs.begin(); it != libs.end(); ++it) {
|
||||||
t << project->values((*it).toKey()).join(' ') << " ";
|
t << fixLibFlags((*it).toKey()).join(' ') << ' ';
|
||||||
}
|
}
|
||||||
t << endl;
|
t << endl;
|
||||||
|
|
||||||
@ -3287,7 +3304,7 @@ QString MakefileGenerator::installMetaFile(const ProKey &replace_rule, const QSt
|
|||||||
QString ret;
|
QString ret;
|
||||||
if (project->isEmpty(replace_rule)
|
if (project->isEmpty(replace_rule)
|
||||||
|| project->isActiveConfig("no_sed_meta_install")) {
|
|| project->isActiveConfig("no_sed_meta_install")) {
|
||||||
ret += "-$(INSTALL_FILE) \"" + src + "\" \"" + dst + "\"";
|
ret += "-$(INSTALL_FILE) " + escapeFilePath(src) + ' ' + escapeFilePath(dst);
|
||||||
} else {
|
} else {
|
||||||
ret += "-$(SED)";
|
ret += "-$(SED)";
|
||||||
const ProStringList &replace_rules = project->values(replace_rule);
|
const ProStringList &replace_rules = project->values(replace_rule);
|
||||||
@ -3301,7 +3318,7 @@ QString MakefileGenerator::installMetaFile(const ProKey &replace_rule, const QSt
|
|||||||
+ "," + windowsifyPath(replace.toQString()) + ",gi");
|
+ "," + windowsifyPath(replace.toQString()) + ",gi");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ret += " \"" + src + "\" >\"" + dst + "\"";
|
ret += ' ' + escapeFilePath(src) + " > " + escapeFilePath(dst);
|
||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@ -133,15 +133,12 @@ protected:
|
|||||||
QMakeProject *project;
|
QMakeProject *project;
|
||||||
|
|
||||||
//escape
|
//escape
|
||||||
virtual QString unescapeFilePath(const QString &path) const;
|
|
||||||
ProString unescapeFilePath(const ProString &path) const;
|
|
||||||
virtual QStringList unescapeFilePaths(const QStringList &path) const;
|
|
||||||
ProStringList unescapeFilePaths(const ProStringList &path) const;
|
|
||||||
virtual QString escapeFilePath(const QString &path) const { return path; }
|
virtual QString escapeFilePath(const QString &path) const { return path; }
|
||||||
ProString escapeFilePath(const ProString &path) const;
|
ProString escapeFilePath(const ProString &path) const;
|
||||||
QStringList escapeFilePaths(const QStringList &paths) const;
|
QStringList escapeFilePaths(const QStringList &paths) const;
|
||||||
ProStringList escapeFilePaths(const ProStringList &paths) const;
|
ProStringList escapeFilePaths(const ProStringList &paths) const;
|
||||||
virtual QString escapeDependencyPath(const QString &path) const { return escapeFilePath(path); }
|
virtual QString escapeDependencyPath(const QString &path) const { return escapeFilePath(path); }
|
||||||
|
ProString escapeDependencyPath(const ProString &path) const;
|
||||||
QStringList escapeDependencyPaths(const QStringList &paths) const;
|
QStringList escapeDependencyPaths(const QStringList &paths) const;
|
||||||
ProStringList escapeDependencyPaths(const ProStringList &paths) const;
|
ProStringList escapeDependencyPaths(const ProStringList &paths) const;
|
||||||
|
|
||||||
@ -211,6 +208,10 @@ protected:
|
|||||||
QString varGlue(const ProKey &var, const QString &before, const QString &glue, const QString &after) const;
|
QString varGlue(const ProKey &var, const QString &before, const QString &glue, const QString &after) const;
|
||||||
QString varList(const ProKey &var) const;
|
QString varList(const ProKey &var) const;
|
||||||
QString fixFileVarGlue(const ProKey &var, const QString &before, const QString &glue, const QString &after) const;
|
QString fixFileVarGlue(const ProKey &var, const QString &before, const QString &glue, const QString &after) const;
|
||||||
|
QString fileVarList(const ProKey &var) const;
|
||||||
|
QString fileVarGlue(const ProKey &var, const QString &before, const QString &glue, const QString &after) const;
|
||||||
|
QString fileVar(const ProKey &var) const;
|
||||||
|
QString depVar(const ProKey &var) const;
|
||||||
QString val(const ProStringList &varList) const;
|
QString val(const ProStringList &varList) const;
|
||||||
QString val(const QStringList &varList) const;
|
QString val(const QStringList &varList) const;
|
||||||
QString valGlue(const QStringList &varList, const QString &before, const QString &glue, const QString &after) const;
|
QString valGlue(const QStringList &varList, const QString &before, const QString &glue, const QString &after) const;
|
||||||
@ -220,6 +221,9 @@ protected:
|
|||||||
|
|
||||||
QString filePrefixRoot(const QString &, const QString &);
|
QString filePrefixRoot(const QString &, const QString &);
|
||||||
|
|
||||||
|
ProStringList fixLibFlags(const ProKey &var);
|
||||||
|
virtual ProString fixLibFlag(const ProString &lib);
|
||||||
|
|
||||||
//file fixification to unify all file names into a single pattern
|
//file fixification to unify all file names into a single pattern
|
||||||
enum FileFixifyType { FileFixifyAbsolute, FileFixifyRelative, FileFixifyDefault };
|
enum FileFixifyType { FileFixifyAbsolute, FileFixifyRelative, FileFixifyDefault };
|
||||||
QString fileFixify(const QString& file, const QString &out_dir=QString(),
|
QString fileFixify(const QString& file, const QString &out_dir=QString(),
|
||||||
|
@ -75,8 +75,6 @@ UnixMakefileGenerator::init()
|
|||||||
if(project->isEmpty("QMAKE_SYMBOLIC_LINK"))
|
if(project->isEmpty("QMAKE_SYMBOLIC_LINK"))
|
||||||
project->values("QMAKE_SYMBOLIC_LINK").append("ln -f -s");
|
project->values("QMAKE_SYMBOLIC_LINK").append("ln -f -s");
|
||||||
|
|
||||||
if (!project->isEmpty("TARGET"))
|
|
||||||
project->values("TARGET") = escapeFilePaths(project->values("TARGET"));
|
|
||||||
project->values("QMAKE_ORIG_TARGET") = project->values("TARGET");
|
project->values("QMAKE_ORIG_TARGET") = project->values("TARGET");
|
||||||
|
|
||||||
//version handling
|
//version handling
|
||||||
@ -111,8 +109,8 @@ UnixMakefileGenerator::init()
|
|||||||
}
|
}
|
||||||
|
|
||||||
project->values("QMAKE_ORIG_DESTDIR") = project->values("DESTDIR");
|
project->values("QMAKE_ORIG_DESTDIR") = project->values("DESTDIR");
|
||||||
project->values("QMAKE_LIBS") += escapeFilePaths(project->values("LIBS"));
|
project->values("QMAKE_LIBS") += project->values("LIBS");
|
||||||
project->values("QMAKE_LIBS_PRIVATE") += escapeFilePaths(project->values("LIBS_PRIVATE"));
|
project->values("QMAKE_LIBS_PRIVATE") += project->values("LIBS_PRIVATE");
|
||||||
if((!project->isEmpty("QMAKE_LIB_FLAG") && !project->isActiveConfig("staticlib")) ||
|
if((!project->isEmpty("QMAKE_LIB_FLAG") && !project->isActiveConfig("staticlib")) ||
|
||||||
(project->isActiveConfig("qt") && project->isActiveConfig("plugin"))) {
|
(project->isActiveConfig("qt") && project->isActiveConfig("plugin"))) {
|
||||||
if(configs.indexOf("dll") == -1) configs.append("dll");
|
if(configs.indexOf("dll") == -1) configs.append("dll");
|
||||||
@ -194,11 +192,13 @@ UnixMakefileGenerator::init()
|
|||||||
pchBaseName += project->first("QMAKE_ORIG_TARGET").toQString();
|
pchBaseName += project->first("QMAKE_ORIG_TARGET").toQString();
|
||||||
|
|
||||||
// replace place holders
|
// replace place holders
|
||||||
pchFlags.replace("${QMAKE_PCH_INPUT}", project->first("PRECOMPILED_HEADER").toQString());
|
pchFlags.replace("${QMAKE_PCH_INPUT}",
|
||||||
pchFlags.replace("${QMAKE_PCH_OUTPUT_BASE}", pchBaseName);
|
escapeFilePath(project->first("PRECOMPILED_HEADER").toQString()));
|
||||||
|
pchFlags.replace("${QMAKE_PCH_OUTPUT_BASE}", escapeFilePath(pchBaseName));
|
||||||
if (project->isActiveConfig("icc_pch_style")) {
|
if (project->isActiveConfig("icc_pch_style")) {
|
||||||
// icc style
|
// icc style
|
||||||
pchFlags.replace("${QMAKE_PCH_OUTPUT}", pchBaseName + project->first("QMAKE_PCH_OUTPUT_EXT"));
|
pchFlags.replace("${QMAKE_PCH_OUTPUT}",
|
||||||
|
escapeFilePath(pchBaseName + project->first("QMAKE_PCH_OUTPUT_EXT")));
|
||||||
} else {
|
} else {
|
||||||
// gcc style (including clang_pch_style)
|
// gcc style (including clang_pch_style)
|
||||||
QString headerSuffix;
|
QString headerSuffix;
|
||||||
@ -222,7 +222,8 @@ UnixMakefileGenerator::init()
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(!pchOutputFile.isEmpty()) {
|
if(!pchOutputFile.isEmpty()) {
|
||||||
pchFlags.replace("${QMAKE_PCH_OUTPUT}", pchBaseName + pchOutputFile + headerSuffix);
|
pchFlags.replace("${QMAKE_PCH_OUTPUT}",
|
||||||
|
escapeFilePath(pchBaseName + pchOutputFile + headerSuffix));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -253,15 +254,15 @@ UnixMakefileGenerator::init()
|
|||||||
((project->isActiveConfig("build_pass") || project->isEmpty("BUILDS")))) {
|
((project->isActiveConfig("build_pass") || project->isEmpty("BUILDS")))) {
|
||||||
ProString bundle;
|
ProString bundle;
|
||||||
if(project->isActiveConfig("bundle") && !project->isEmpty("QMAKE_BUNDLE_EXTENSION")) {
|
if(project->isActiveConfig("bundle") && !project->isEmpty("QMAKE_BUNDLE_EXTENSION")) {
|
||||||
bundle = unescapeFilePath(project->first("TARGET"));
|
bundle = project->first("TARGET");
|
||||||
if(!project->isEmpty("QMAKE_BUNDLE_NAME"))
|
if(!project->isEmpty("QMAKE_BUNDLE_NAME"))
|
||||||
bundle = unescapeFilePath(project->first("QMAKE_BUNDLE_NAME"));
|
bundle = project->first("QMAKE_BUNDLE_NAME");
|
||||||
if(!bundle.endsWith(project->first("QMAKE_BUNDLE_EXTENSION")))
|
if(!bundle.endsWith(project->first("QMAKE_BUNDLE_EXTENSION")))
|
||||||
bundle += project->first("QMAKE_BUNDLE_EXTENSION");
|
bundle += project->first("QMAKE_BUNDLE_EXTENSION");
|
||||||
} else if(project->first("TEMPLATE") == "app" && project->isActiveConfig("app_bundle")) {
|
} else if(project->first("TEMPLATE") == "app" && project->isActiveConfig("app_bundle")) {
|
||||||
bundle = unescapeFilePath(project->first("TARGET"));
|
bundle = project->first("TARGET");
|
||||||
if(!project->isEmpty("QMAKE_APPLICATION_BUNDLE_NAME"))
|
if(!project->isEmpty("QMAKE_APPLICATION_BUNDLE_NAME"))
|
||||||
bundle = unescapeFilePath(project->first("QMAKE_APPLICATION_BUNDLE_NAME"));
|
bundle = project->first("QMAKE_APPLICATION_BUNDLE_NAME");
|
||||||
if(!bundle.endsWith(".app"))
|
if(!bundle.endsWith(".app"))
|
||||||
bundle += ".app";
|
bundle += ".app";
|
||||||
if(project->isEmpty("QMAKE_BUNDLE_LOCATION"))
|
if(project->isEmpty("QMAKE_BUNDLE_LOCATION"))
|
||||||
@ -271,10 +272,10 @@ UnixMakefileGenerator::init()
|
|||||||
} else if(project->first("TEMPLATE") == "lib" && !project->isActiveConfig("staticlib") &&
|
} else if(project->first("TEMPLATE") == "lib" && !project->isActiveConfig("staticlib") &&
|
||||||
((!project->isActiveConfig("plugin") && project->isActiveConfig("lib_bundle")) ||
|
((!project->isActiveConfig("plugin") && project->isActiveConfig("lib_bundle")) ||
|
||||||
(project->isActiveConfig("plugin") && project->isActiveConfig("plugin_bundle")))) {
|
(project->isActiveConfig("plugin") && project->isActiveConfig("plugin_bundle")))) {
|
||||||
bundle = unescapeFilePath(project->first("TARGET"));
|
bundle = project->first("TARGET");
|
||||||
if(project->isActiveConfig("plugin")) {
|
if(project->isActiveConfig("plugin")) {
|
||||||
if(!project->isEmpty("QMAKE_PLUGIN_BUNDLE_NAME"))
|
if(!project->isEmpty("QMAKE_PLUGIN_BUNDLE_NAME"))
|
||||||
bundle = unescapeFilePath(project->first("QMAKE_PLUGIN_BUNDLE_NAME"));
|
bundle = project->first("QMAKE_PLUGIN_BUNDLE_NAME");
|
||||||
if (project->isEmpty("QMAKE_BUNDLE_EXTENSION"))
|
if (project->isEmpty("QMAKE_BUNDLE_EXTENSION"))
|
||||||
project->values("QMAKE_BUNDLE_EXTENSION").append(".plugin");
|
project->values("QMAKE_BUNDLE_EXTENSION").append(".plugin");
|
||||||
if (!bundle.endsWith(project->first("QMAKE_BUNDLE_EXTENSION")))
|
if (!bundle.endsWith(project->first("QMAKE_BUNDLE_EXTENSION")))
|
||||||
@ -283,7 +284,7 @@ UnixMakefileGenerator::init()
|
|||||||
project->values("QMAKE_BUNDLE_LOCATION").append("Contents/MacOS");
|
project->values("QMAKE_BUNDLE_LOCATION").append("Contents/MacOS");
|
||||||
} else {
|
} else {
|
||||||
if(!project->isEmpty("QMAKE_FRAMEWORK_BUNDLE_NAME"))
|
if(!project->isEmpty("QMAKE_FRAMEWORK_BUNDLE_NAME"))
|
||||||
bundle = unescapeFilePath(project->first("QMAKE_FRAMEWORK_BUNDLE_NAME"));
|
bundle = project->first("QMAKE_FRAMEWORK_BUNDLE_NAME");
|
||||||
if (project->isEmpty("QMAKE_BUNDLE_EXTENSION"))
|
if (project->isEmpty("QMAKE_BUNDLE_EXTENSION"))
|
||||||
project->values("QMAKE_BUNDLE_EXTENSION").append(".framework");
|
project->values("QMAKE_BUNDLE_EXTENSION").append(".framework");
|
||||||
if (!bundle.endsWith(project->first("QMAKE_BUNDLE_EXTENSION")))
|
if (!bundle.endsWith(project->first("QMAKE_BUNDLE_EXTENSION")))
|
||||||
@ -354,7 +355,7 @@ UnixMakefileGenerator::init()
|
|||||||
if(QDir::isRelativePath(rpath))
|
if(QDir::isRelativePath(rpath))
|
||||||
rpath.prepend(Option::output_dir + Option::dir_sep);
|
rpath.prepend(Option::output_dir + Option::dir_sep);
|
||||||
}
|
}
|
||||||
comp_flags += " -rpath " + Option::fixPathToTargetOS(rpath, false);
|
comp_flags += " -rpath " + escapeFilePath(Option::fixPathToTargetOS(rpath, false));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -439,6 +440,12 @@ QStringList
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ProString
|
||||||
|
UnixMakefileGenerator::fixLibFlag(const ProString &lib)
|
||||||
|
{
|
||||||
|
return escapeFilePath(lib);
|
||||||
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
UnixMakefileGenerator::findLibraries()
|
UnixMakefileGenerator::findLibraries()
|
||||||
{
|
{
|
||||||
@ -465,7 +472,7 @@ UnixMakefileGenerator::findLibraries()
|
|||||||
}
|
}
|
||||||
libdirs.insert(libidx++, f);
|
libdirs.insert(libidx++, f);
|
||||||
if (!libArg.isEmpty())
|
if (!libArg.isEmpty())
|
||||||
*it = libArg + lib;
|
*it = libArg + f.real();
|
||||||
} else if(opt.startsWith("-l")) {
|
} else if(opt.startsWith("-l")) {
|
||||||
if (project->isActiveConfig("rvct_linker") || project->isActiveConfig("armcc_linker")) {
|
if (project->isActiveConfig("rvct_linker") || project->isActiveConfig("armcc_linker")) {
|
||||||
(*it) = "lib" + opt.mid(2) + ".so";
|
(*it) = "lib" + opt.mid(2) + ".so";
|
||||||
@ -619,7 +626,7 @@ UnixMakefileGenerator::processPrlFiles()
|
|||||||
ProStringList &prl_libs = project->values("QMAKE_CURRENT_PRL_LIBS");
|
ProStringList &prl_libs = project->values("QMAKE_CURRENT_PRL_LIBS");
|
||||||
if(!prl_libs.isEmpty()) {
|
if(!prl_libs.isEmpty()) {
|
||||||
for(int prl = 0; prl < prl_libs.size(); ++prl)
|
for(int prl = 0; prl < prl_libs.size(); ++prl)
|
||||||
l.insert(lit+prl+1, escapeFilePath(prl_libs.at(prl).toQString()));
|
l.insert(lit+prl+1, prl_libs.at(prl).toQString());
|
||||||
prl_libs.clear();
|
prl_libs.clear();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -739,30 +746,31 @@ UnixMakefileGenerator::defaultInstall(const QString &t)
|
|||||||
}
|
}
|
||||||
for(int i = 0; i < targets.size(); ++i) {
|
for(int i = 0; i < targets.size(); ++i) {
|
||||||
QString src = targets.at(i).toQString(),
|
QString src = targets.at(i).toQString(),
|
||||||
dst = filePrefixRoot(root, targetdir + src.section('/', -1));
|
dst = escapeFilePath(filePrefixRoot(root, targetdir + src.section('/', -1)));
|
||||||
if(!ret.isEmpty())
|
if(!ret.isEmpty())
|
||||||
ret += "\n\t";
|
ret += "\n\t";
|
||||||
ret += "-$(INSTALL_FILE) \"" + src + "\" \"" + dst + "\"";
|
ret += "-$(INSTALL_FILE) " + escapeFilePath(src) + ' ' + dst;
|
||||||
if(!uninst.isEmpty())
|
if(!uninst.isEmpty())
|
||||||
uninst.append("\n\t");
|
uninst.append("\n\t");
|
||||||
uninst.append("-$(DEL_FILE) \"" + dst + "\"");
|
uninst.append("-$(DEL_FILE) " + dst);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (bundle == NoBundle && project->isActiveConfig("compile_libtool")) {
|
if (bundle == NoBundle && project->isActiveConfig("compile_libtool")) {
|
||||||
QString src_targ = target;
|
QString src_targ = escapeFilePath(target);
|
||||||
if(src_targ == "$(TARGET)")
|
if(src_targ == "$(TARGET)")
|
||||||
src_targ = "$(TARGETL)";
|
src_targ = "$(TARGETL)";
|
||||||
QString dst_dir = fileFixify(targetdir, FileFixifyAbsolute);
|
QString dst_dir = fileFixify(targetdir, FileFixifyAbsolute);
|
||||||
if(QDir::isRelativePath(dst_dir))
|
if(QDir::isRelativePath(dst_dir))
|
||||||
dst_dir = Option::fixPathToTargetOS(Option::output_dir + Option::dir_sep + dst_dir);
|
dst_dir = Option::fixPathToTargetOS(Option::output_dir + Option::dir_sep + dst_dir);
|
||||||
ret = "-$(LIBTOOL) --mode=install cp \"" + src_targ + "\" \"" + filePrefixRoot(root, dst_dir) + "\"";
|
ret = "-$(LIBTOOL) --mode=install cp " + src_targ + ' ' + escapeFilePath(filePrefixRoot(root, dst_dir));
|
||||||
uninst.append("-$(LIBTOOL) --mode=uninstall \"" + src_targ + "\"");
|
uninst.append("-$(LIBTOOL) --mode=uninstall " + src_targ);
|
||||||
} else {
|
} else {
|
||||||
QString src_targ = target;
|
QString src_targ = target;
|
||||||
if(!destdir.isEmpty())
|
if(!destdir.isEmpty())
|
||||||
src_targ = Option::fixPathToTargetOS(destdir + target, false);
|
src_targ = Option::fixPathToTargetOS(destdir + target, false);
|
||||||
QString plain_targ = filePrefixRoot(root, fileFixify(targetdir + target, FileFixifyAbsolute));
|
QString plain_targ = filePrefixRoot(root, fileFixify(targetdir + target, FileFixifyAbsolute));
|
||||||
QString dst_targ = plain_targ;
|
QString dst_targ = plain_targ;
|
||||||
|
plain_targ = escapeFilePath(plain_targ);
|
||||||
if (bundle != NoBundle) {
|
if (bundle != NoBundle) {
|
||||||
QString suffix;
|
QString suffix;
|
||||||
if (project->first("TEMPLATE") == "lib")
|
if (project->first("TEMPLATE") == "lib")
|
||||||
@ -773,33 +781,34 @@ UnixMakefileGenerator::defaultInstall(const QString &t)
|
|||||||
if (bundle == SolidBundle) {
|
if (bundle == SolidBundle) {
|
||||||
if (!ret.isEmpty())
|
if (!ret.isEmpty())
|
||||||
ret += "\n\t";
|
ret += "\n\t";
|
||||||
ret += "$(DEL_FILE) -r \"" + plain_targ + "\"\n\t";
|
ret += "$(DEL_FILE) -r " + plain_targ + "\n\t";
|
||||||
} else {
|
} else {
|
||||||
src_targ += suffix;
|
src_targ += suffix;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
src_targ = escapeFilePath(src_targ);
|
||||||
|
dst_targ = escapeFilePath(dst_targ);
|
||||||
if(!ret.isEmpty())
|
if(!ret.isEmpty())
|
||||||
ret += "\n\t";
|
ret += "\n\t";
|
||||||
|
|
||||||
QString copy_cmd("-");
|
QString copy_cmd("-");
|
||||||
if (bundle == SolidBundle) {
|
if (bundle == SolidBundle) {
|
||||||
copy_cmd += "$(INSTALL_DIR) \"" + src_targ + "\" \"" + plain_targ + "\"";
|
copy_cmd += "$(INSTALL_DIR) " + src_targ + ' ' + plain_targ;
|
||||||
} else if (project->first("TEMPLATE") == "lib" && project->isActiveConfig("staticlib")) {
|
} else if (project->first("TEMPLATE") == "lib" && project->isActiveConfig("staticlib")) {
|
||||||
copy_cmd += "$(INSTALL_FILE) \"" + src_targ + "\" \"" + dst_targ + "\"";
|
copy_cmd += "$(INSTALL_FILE) " + src_targ + ' ' + dst_targ;
|
||||||
} else {
|
} else {
|
||||||
if (bundle == SlicedBundle)
|
if (bundle == SlicedBundle)
|
||||||
ret += mkdir_p_asstring("\"`dirname \"" + dst_targ + "\"`\"", false) + "\n\t";
|
ret += mkdir_p_asstring("\"`dirname " + dst_targ + "`\"", false) + "\n\t";
|
||||||
copy_cmd += "$(INSTALL_PROGRAM) \"" + src_targ + "\" \"" + dst_targ + "\"";
|
copy_cmd += "$(INSTALL_PROGRAM) " + src_targ + ' ' + dst_targ;
|
||||||
}
|
}
|
||||||
if(project->first("TEMPLATE") == "lib" && !project->isActiveConfig("staticlib")
|
if(project->first("TEMPLATE") == "lib" && !project->isActiveConfig("staticlib")
|
||||||
&& project->values(ProKey(t + ".CONFIG")).indexOf("fix_rpath") != -1) {
|
&& project->values(ProKey(t + ".CONFIG")).indexOf("fix_rpath") != -1) {
|
||||||
if(!project->isEmpty("QMAKE_FIX_RPATH")) {
|
if(!project->isEmpty("QMAKE_FIX_RPATH")) {
|
||||||
ret += copy_cmd;
|
ret += copy_cmd;
|
||||||
ret += "\n\t-" + var("QMAKE_FIX_RPATH") + " \"" +
|
ret += "\n\t-" + var("QMAKE_FIX_RPATH") + ' ' + dst_targ + ' ' + dst_targ;
|
||||||
dst_targ + "\" \"" + dst_targ + "\"";
|
|
||||||
} else if(!project->isEmpty("QMAKE_LFLAGS_RPATH")) {
|
} else if(!project->isEmpty("QMAKE_LFLAGS_RPATH")) {
|
||||||
ret += "-$(LINK) $(LFLAGS) " + var("QMAKE_LFLAGS_RPATH") + targetdir + " -o \"" +
|
ret += "-$(LINK) $(LFLAGS) " + var("QMAKE_LFLAGS_RPATH") + targetdir + " -o " +
|
||||||
dst_targ + "\" $(OBJECTS) $(LIBS) $(OBJCOMP)";
|
dst_targ + " $(OBJECTS) $(LIBS) $(OBJCOMP)";
|
||||||
} else {
|
} else {
|
||||||
ret += copy_cmd;
|
ret += copy_cmd;
|
||||||
}
|
}
|
||||||
@ -809,7 +818,7 @@ UnixMakefileGenerator::defaultInstall(const QString &t)
|
|||||||
|
|
||||||
if(project->first("TEMPLATE") == "lib" && project->isActiveConfig("staticlib")) {
|
if(project->first("TEMPLATE") == "lib" && project->isActiveConfig("staticlib")) {
|
||||||
if(!project->isEmpty("QMAKE_RANLIB"))
|
if(!project->isEmpty("QMAKE_RANLIB"))
|
||||||
ret += QString("\n\t$(RANLIB) \"") + dst_targ + "\"";
|
ret += QString("\n\t$(RANLIB) ") + dst_targ;
|
||||||
} else if (!project->isActiveConfig("debug_info") && !project->isActiveConfig("nostrip")
|
} else if (!project->isActiveConfig("debug_info") && !project->isActiveConfig("nostrip")
|
||||||
&& !project->isEmpty("QMAKE_STRIP")) {
|
&& !project->isEmpty("QMAKE_STRIP")) {
|
||||||
ret += "\n\t-$(STRIP)";
|
ret += "\n\t-$(STRIP)";
|
||||||
@ -820,27 +829,28 @@ UnixMakefileGenerator::defaultInstall(const QString &t)
|
|||||||
if (!project->isEmpty("QMAKE_STRIPFLAGS_APP"))
|
if (!project->isEmpty("QMAKE_STRIPFLAGS_APP"))
|
||||||
ret += " " + var("QMAKE_STRIPFLAGS_APP");
|
ret += " " + var("QMAKE_STRIPFLAGS_APP");
|
||||||
}
|
}
|
||||||
ret += " \"" + dst_targ + "\"";
|
ret += ' ' + dst_targ;
|
||||||
}
|
}
|
||||||
if(!uninst.isEmpty())
|
if(!uninst.isEmpty())
|
||||||
uninst.append("\n\t");
|
uninst.append("\n\t");
|
||||||
if (bundle == SolidBundle)
|
if (bundle == SolidBundle)
|
||||||
uninst.append("-$(DEL_FILE) -r \"" + plain_targ + "\"");
|
uninst.append("-$(DEL_FILE) -r " + plain_targ);
|
||||||
else
|
else
|
||||||
uninst.append("-$(DEL_FILE) \"" + dst_targ + "\"");
|
uninst.append("-$(DEL_FILE) " + dst_targ);
|
||||||
if (bundle == SlicedBundle) {
|
if (bundle == SlicedBundle) {
|
||||||
int dstlen = project->first("DESTDIR").length();
|
int dstlen = project->first("DESTDIR").length();
|
||||||
foreach (const ProString &src, project->values("QMAKE_BUNDLED_FILES")) {
|
foreach (const ProString &src, project->values("QMAKE_BUNDLED_FILES")) {
|
||||||
QString file = unescapeFilePath(src.toQString()).mid(dstlen);
|
ProString file = src.mid(dstlen);
|
||||||
QString dst = filePrefixRoot(root, fileFixify(targetdir + file, FileFixifyAbsolute));
|
QString dst = escapeFilePath(
|
||||||
|
filePrefixRoot(root, fileFixify(targetdir + file, FileFixifyAbsolute)));
|
||||||
if (!ret.isEmpty())
|
if (!ret.isEmpty())
|
||||||
ret += "\n\t";
|
ret += "\n\t";
|
||||||
ret += mkdir_p_asstring("\"`dirname \"" + dst + "\"`\"", false) + "\n\t";
|
ret += mkdir_p_asstring("\"`dirname " + dst + "`\"", false) + "\n\t";
|
||||||
ret += "-$(DEL_FILE) \"" + dst + "\"\n\t"; // Can't overwrite symlinks to directories
|
ret += "-$(DEL_FILE) " + dst + "\n\t"; // Can't overwrite symlinks to directories
|
||||||
ret += "-$(INSTALL_DIR) " + src + " \"" + dst + "\""; // Use cp -R to copy symlinks
|
ret += "-$(INSTALL_DIR) " + escapeFilePath(src) + " " + dst; // Use cp -R to copy symlinks
|
||||||
if (!uninst.isEmpty())
|
if (!uninst.isEmpty())
|
||||||
uninst.append("\n\t");
|
uninst.append("\n\t");
|
||||||
uninst.append("-$(DEL_FILE) \"" + dst + "\"");
|
uninst.append("-$(DEL_FILE) " + dst);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(!links.isEmpty()) {
|
if(!links.isEmpty()) {
|
||||||
@ -850,11 +860,12 @@ UnixMakefileGenerator::defaultInstall(const QString &t)
|
|||||||
int lslash = link.lastIndexOf(Option::dir_sep);
|
int lslash = link.lastIndexOf(Option::dir_sep);
|
||||||
if(lslash != -1)
|
if(lslash != -1)
|
||||||
link = link.right(link.length() - (lslash + 1));
|
link = link.right(link.length() - (lslash + 1));
|
||||||
QString dst_link = filePrefixRoot(root, fileFixify(targetdir + link, FileFixifyAbsolute));
|
QString dst_link = escapeFilePath(
|
||||||
ret += "\n\t-$(SYMLINK) \"$(TARGET)\" \"" + dst_link + "\"";
|
filePrefixRoot(root, fileFixify(targetdir + link, FileFixifyAbsolute)));
|
||||||
|
ret += "\n\t-$(SYMLINK) $(TARGET) " + dst_link;
|
||||||
if(!uninst.isEmpty())
|
if(!uninst.isEmpty())
|
||||||
uninst.append("\n\t");
|
uninst.append("\n\t");
|
||||||
uninst.append("-$(DEL_FILE) \"" + dst_link + "\"");
|
uninst.append("-$(DEL_FILE) " + dst_link);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -879,7 +890,7 @@ UnixMakefileGenerator::defaultInstall(const QString &t)
|
|||||||
QString dst_meta = filePrefixRoot(root, fileFixify(targetdir + meta, FileFixifyAbsolute));
|
QString dst_meta = filePrefixRoot(root, fileFixify(targetdir + meta, FileFixifyAbsolute));
|
||||||
if(!uninst.isEmpty())
|
if(!uninst.isEmpty())
|
||||||
uninst.append("\n\t");
|
uninst.append("\n\t");
|
||||||
uninst.append("-$(DEL_FILE) \"" + dst_meta + "\"");
|
uninst.append("-$(DEL_FILE) " + escapeFilePath(dst_meta));
|
||||||
const QString dst_meta_dir = fileInfo(dst_meta).path();
|
const QString dst_meta_dir = fileInfo(dst_meta).path();
|
||||||
if(!dst_meta_dir.isEmpty()) {
|
if(!dst_meta_dir.isEmpty()) {
|
||||||
if(!ret.isEmpty())
|
if(!ret.isEmpty())
|
||||||
@ -900,7 +911,7 @@ UnixMakefileGenerator::escapeFilePath(const QString &path) const
|
|||||||
{
|
{
|
||||||
QString ret = path;
|
QString ret = path;
|
||||||
if(!ret.isEmpty()) {
|
if(!ret.isEmpty()) {
|
||||||
ret = unescapeFilePath(ret).replace(QLatin1Char(' '), QLatin1String("\\ "))
|
ret.replace(QLatin1Char(' '), QLatin1String("\\ "))
|
||||||
.replace(QLatin1Char('\t'), QLatin1String("\\\t"));
|
.replace(QLatin1Char('\t'), QLatin1String("\\\t"));
|
||||||
debug_msg(2, "EscapeFilePath: %s -> %s", path.toLatin1().constData(), ret.toLatin1().constData());
|
debug_msg(2, "EscapeFilePath: %s -> %s", path.toLatin1().constData(), ret.toLatin1().constData());
|
||||||
}
|
}
|
||||||
|
@ -53,6 +53,7 @@ protected:
|
|||||||
virtual bool doPrecompiledHeaders() const { return project->isActiveConfig("precompile_header"); }
|
virtual bool doPrecompiledHeaders() const { return project->isActiveConfig("precompile_header"); }
|
||||||
virtual bool doDepends() const { return !Option::mkfile::do_stub_makefile && MakefileGenerator::doDepends(); }
|
virtual bool doDepends() const { return !Option::mkfile::do_stub_makefile && MakefileGenerator::doDepends(); }
|
||||||
virtual QString defaultInstall(const QString &);
|
virtual QString defaultInstall(const QString &);
|
||||||
|
virtual ProString fixLibFlag(const ProString &lib);
|
||||||
virtual void processPrlFiles();
|
virtual void processPrlFiles();
|
||||||
|
|
||||||
virtual bool findLibraries();
|
virtual bool findLibraries();
|
||||||
|
@ -101,7 +101,7 @@ UnixMakefileGenerator::writeDefaultVariables(QTextStream &t)
|
|||||||
distname += project->first("VERSION");
|
distname += project->first("VERSION");
|
||||||
project->values("QMAKE_DISTNAME") = distname;
|
project->values("QMAKE_DISTNAME") = distname;
|
||||||
}
|
}
|
||||||
t << "DISTNAME = " << var("QMAKE_DISTNAME") << endl;
|
t << "DISTNAME = " << fileVar("QMAKE_DISTNAME") << endl;
|
||||||
|
|
||||||
if (project->isEmpty("QMAKE_DISTDIR"))
|
if (project->isEmpty("QMAKE_DISTDIR"))
|
||||||
project->values("QMAKE_DISTDIR") = project->first("QMAKE_DISTNAME");
|
project->values("QMAKE_DISTDIR") = project->first("QMAKE_DISTNAME");
|
||||||
@ -127,7 +127,7 @@ UnixMakefileGenerator::writeSubTargets(QTextStream &t, QList<MakefileGenerator::
|
|||||||
}
|
}
|
||||||
t << " FORCE\n\t"
|
t << " FORCE\n\t"
|
||||||
<< mkdir_p_asstring("$(DISTDIR)", false) << "\n\t"
|
<< mkdir_p_asstring("$(DISTDIR)", false) << "\n\t"
|
||||||
<< "$(COPY_FILE) --parents " << var("DISTFILES") << " $(DISTDIR)" << Option::dir_sep << endl << endl;
|
<< "$(COPY_FILE) --parents " << fileVar("DISTFILES") << " $(DISTDIR)" << Option::dir_sep << endl << endl;
|
||||||
|
|
||||||
const QString abs_source_path = project->first("QMAKE_ABSOLUTE_SOURCE_PATH").toQString();
|
const QString abs_source_path = project->first("QMAKE_ABSOLUTE_SOURCE_PATH").toQString();
|
||||||
for (int target = 0; target < targets.size(); ++target) {
|
for (int target = 0; target < targets.size(); ++target) {
|
||||||
@ -148,8 +148,9 @@ UnixMakefileGenerator::writeSubTargets(QTextStream &t, QList<MakefileGenerator::
|
|||||||
dist_directory.prepend(Option::dir_sep);
|
dist_directory.prepend(Option::dir_sep);
|
||||||
|
|
||||||
QString out_directory_cdin = out_directory.isEmpty() ? "\n\t"
|
QString out_directory_cdin = out_directory.isEmpty() ? "\n\t"
|
||||||
: "\n\tcd " + out_directory + " && ";
|
: "\n\tcd " + escapeFilePath(out_directory) + " && ";
|
||||||
QString makefilein = " -e -f " + subtarget->makefile + " distdir DISTDIR=$(DISTDIR)" + dist_directory;
|
QString makefilein = " -e -f " + escapeFilePath(subtarget->makefile)
|
||||||
|
+ " distdir DISTDIR=$(DISTDIR)" + escapeFilePath(dist_directory);
|
||||||
|
|
||||||
QString out = subtarget->makefile;
|
QString out = subtarget->makefile;
|
||||||
QString in = escapeFilePath(fileFixify(in_directory + subtarget->profile, FileFixifyAbsolute));
|
QString in = escapeFilePath(fileFixify(in_directory + subtarget->profile, FileFixifyAbsolute));
|
||||||
@ -157,7 +158,7 @@ UnixMakefileGenerator::writeSubTargets(QTextStream &t, QList<MakefileGenerator::
|
|||||||
out.remove(0, in_directory.length());
|
out.remove(0, in_directory.length());
|
||||||
|
|
||||||
t << subtarget->target << "-distdir: FORCE";
|
t << subtarget->target << "-distdir: FORCE";
|
||||||
writeSubTargetCall(t, in_directory, in, out_directory, out,
|
writeSubTargetCall(t, in_directory, in, out_directory, escapeFilePath(out),
|
||||||
out_directory_cdin, makefilein);
|
out_directory_cdin, makefilein);
|
||||||
t << endl;
|
t << endl;
|
||||||
}
|
}
|
||||||
@ -166,7 +167,6 @@ UnixMakefileGenerator::writeSubTargets(QTextStream &t, QList<MakefileGenerator::
|
|||||||
void
|
void
|
||||||
UnixMakefileGenerator::writeMakeParts(QTextStream &t)
|
UnixMakefileGenerator::writeMakeParts(QTextStream &t)
|
||||||
{
|
{
|
||||||
QString deps = fileFixify(Option::output.fileName()), target_deps;
|
|
||||||
bool do_incremental = (project->isActiveConfig("incremental") &&
|
bool do_incremental = (project->isActiveConfig("incremental") &&
|
||||||
!project->values("QMAKE_INCREMENTAL").isEmpty() &&
|
!project->values("QMAKE_INCREMENTAL").isEmpty() &&
|
||||||
(!project->values("QMAKE_APP_FLAG").isEmpty() ||
|
(!project->values("QMAKE_APP_FLAG").isEmpty() ||
|
||||||
@ -188,14 +188,15 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
|
|||||||
QString isystem = var("QMAKE_CFLAGS_ISYSTEM");
|
QString isystem = var("QMAKE_CFLAGS_ISYSTEM");
|
||||||
const ProStringList &incs = project->values("INCLUDEPATH");
|
const ProStringList &incs = project->values("INCLUDEPATH");
|
||||||
for(int i = 0; i < incs.size(); ++i) {
|
for(int i = 0; i < incs.size(); ++i) {
|
||||||
ProString inc = escapeFilePath(incs.at(i));
|
const ProString &inc = incs.at(i);
|
||||||
if (inc.isEmpty())
|
if (inc.isEmpty())
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (!isystem.isEmpty() && isSystemInclude(inc.toQString()))
|
if (!isystem.isEmpty() && isSystemInclude(inc.toQString()))
|
||||||
t << ' ' << isystem << ' ' << inc;
|
t << ' ' << isystem << ' ';
|
||||||
else
|
else
|
||||||
t << " -I" << inc;
|
t << " -I";
|
||||||
|
t << escapeFilePath(inc);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(!project->isEmpty("QMAKE_FRAMEWORKPATH_FLAGS"))
|
if(!project->isEmpty("QMAKE_FRAMEWORKPATH_FLAGS"))
|
||||||
@ -207,7 +208,8 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
|
|||||||
if(!project->isActiveConfig("staticlib")) {
|
if(!project->isActiveConfig("staticlib")) {
|
||||||
t << "LINK = " << var("QMAKE_LINK") << endl;
|
t << "LINK = " << var("QMAKE_LINK") << endl;
|
||||||
t << "LFLAGS = " << var("QMAKE_LFLAGS") << endl;
|
t << "LFLAGS = " << var("QMAKE_LFLAGS") << endl;
|
||||||
t << "LIBS = $(SUBLIBS) " << var("QMAKE_LIBS") << " " << var("QMAKE_LIBS_PRIVATE") << endl;
|
t << "LIBS = $(SUBLIBS) " << fixLibFlags("QMAKE_LIBS").join(' ') << ' '
|
||||||
|
<< fixLibFlags("QMAKE_LIBS_PRIVATE").join(' ') << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
t << "AR = " << var("QMAKE_AR") << endl;
|
t << "AR = " << var("QMAKE_AR") << endl;
|
||||||
@ -220,16 +222,17 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
|
|||||||
t << endl;
|
t << endl;
|
||||||
|
|
||||||
t << "####### Output directory\n\n";
|
t << "####### Output directory\n\n";
|
||||||
|
// This is used in commands by some .prf files.
|
||||||
if (! project->values("OBJECTS_DIR").isEmpty())
|
if (! project->values("OBJECTS_DIR").isEmpty())
|
||||||
t << "OBJECTS_DIR = " << var("OBJECTS_DIR") << endl;
|
t << "OBJECTS_DIR = " << fileVar("OBJECTS_DIR") << endl;
|
||||||
else
|
else
|
||||||
t << "OBJECTS_DIR = ./\n";
|
t << "OBJECTS_DIR = ./\n";
|
||||||
t << endl;
|
t << endl;
|
||||||
|
|
||||||
/* files */
|
/* files */
|
||||||
t << "####### Files\n\n";
|
t << "####### Files\n\n";
|
||||||
t << "SOURCES = " << valList(escapeFilePaths(project->values("SOURCES"))) << " "
|
// This is used by the dist target.
|
||||||
<< valList(escapeFilePaths(project->values("GENERATED_SOURCES"))) << endl;
|
t << "SOURCES = " << fileVarList("SOURCES") << ' ' << fileVarList("GENERATED_SOURCES") << endl;
|
||||||
if(do_incremental) {
|
if(do_incremental) {
|
||||||
const ProStringList &objs = project->values("OBJECTS");
|
const ProStringList &objs = project->values("OBJECTS");
|
||||||
const ProStringList &incrs = project->values("QMAKE_INCREMENTAL");
|
const ProStringList &incrs = project->values("QMAKE_INCREMENTAL");
|
||||||
@ -258,37 +261,37 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
|
|||||||
t << "INCREMENTAL_OBJECTS = " << escapeFilePaths(incrs_out).join(" \\\n\t\t") << endl;
|
t << "INCREMENTAL_OBJECTS = " << escapeFilePaths(incrs_out).join(" \\\n\t\t") << endl;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
t << "OBJECTS = " << valList(escapeFilePaths(project->values("OBJECTS"))) << endl;
|
// Used all over the place in both deps and commands.
|
||||||
|
t << "OBJECTS = " << valList(escapeDependencyPaths(project->values("OBJECTS"))) << endl;
|
||||||
}
|
}
|
||||||
if(do_incremental && !src_incremental)
|
if(do_incremental && !src_incremental)
|
||||||
do_incremental = false;
|
do_incremental = false;
|
||||||
t << "DIST = " << valList(fileFixify(project->values("DISTFILES").toQStringList())) << " "
|
t << "DIST = " << valList(fileFixify(project->values("DISTFILES").toQStringList())) << " "
|
||||||
<< valList(escapeFilePaths(project->values("HEADERS"))) << " "
|
<< fileVarList("HEADERS") << ' ' << fileVarList("SOURCES") << endl;
|
||||||
<< valList(escapeFilePaths(project->values("SOURCES"))) << endl;
|
t << "QMAKE_TARGET = " << fileVar("QMAKE_ORIG_TARGET") << endl;
|
||||||
t << "QMAKE_TARGET = " << var("QMAKE_ORIG_TARGET") << endl;
|
|
||||||
// The comment is important for mingw32-make.exe on Windows as otherwise trailing slashes
|
// The comment is important for mingw32-make.exe on Windows as otherwise trailing slashes
|
||||||
// would be interpreted as line continuation. The lack of spacing between the value and the
|
// would be interpreted as line continuation. The lack of spacing between the value and the
|
||||||
// comment is also important as otherwise quoted use of "$(DESTDIR)" would include this
|
// comment is also important as otherwise quoted use of "$(DESTDIR)" would include this
|
||||||
// spacing.
|
// spacing.
|
||||||
t << "DESTDIR = " << var("DESTDIR") << "#avoid trailing-slash linebreak\n";
|
t << "DESTDIR = " << fileVar("DESTDIR") << "#avoid trailing-slash linebreak\n";
|
||||||
if(project->isActiveConfig("compile_libtool"))
|
if(project->isActiveConfig("compile_libtool"))
|
||||||
t << "TARGETL = " << var("TARGET_la") << endl;
|
t << "TARGETL = " << fileVar("TARGET_la") << endl;
|
||||||
t << "TARGET = " << escapeFilePath(var("TARGET")) << endl;
|
t << "TARGET = " << fileVar("TARGET") << endl; // ### mixed use!
|
||||||
if(project->isActiveConfig("plugin")) {
|
if(project->isActiveConfig("plugin")) {
|
||||||
t << "TARGETD = " << escapeFilePath(var("TARGET")) << endl;
|
t << "TARGETD = " << fileVar("TARGET") << endl;
|
||||||
} else if(!project->isActiveConfig("staticlib") && project->values("QMAKE_APP_FLAG").isEmpty()) {
|
} else if(!project->isActiveConfig("staticlib") && project->values("QMAKE_APP_FLAG").isEmpty()) {
|
||||||
t << "TARGETA = " << escapeFilePath(var("TARGETA")) << endl;
|
t << "TARGETA = " << fileVar("TARGETA") << endl; // ### mixed use!
|
||||||
if(!project->isEmpty("QMAKE_BUNDLE")) {
|
if(!project->isEmpty("QMAKE_BUNDLE")) {
|
||||||
t << "TARGETD = " << escapeFilePath(var("TARGET_x.y")) << endl;
|
t << "TARGETD = " << fileVar("TARGET_x.y") << endl;
|
||||||
t << "TARGET0 = " << escapeFilePath(var("TARGET_")) << endl;
|
t << "TARGET0 = " << fileVar("TARGET_") << endl;
|
||||||
} else if (!project->isActiveConfig("unversioned_libname")) {
|
} else if (!project->isActiveConfig("unversioned_libname")) {
|
||||||
t << "TARGET0 = " << escapeFilePath(var("TARGET_")) << endl;
|
t << "TARGET0 = " << fileVar("TARGET_") << endl;
|
||||||
if (project->isEmpty("QMAKE_HPUX_SHLIB")) {
|
if (project->isEmpty("QMAKE_HPUX_SHLIB")) {
|
||||||
t << "TARGETD = " << escapeFilePath(var("TARGET_x.y.z")) << endl;
|
t << "TARGETD = " << fileVar("TARGET_x.y.z") << endl;
|
||||||
t << "TARGET1 = " << escapeFilePath(var("TARGET_x")) << endl;
|
t << "TARGET1 = " << fileVar("TARGET_x") << endl;
|
||||||
t << "TARGET2 = " << escapeFilePath(var("TARGET_x.y")) << endl;
|
t << "TARGET2 = " << fileVar("TARGET_x.y") << endl;
|
||||||
} else {
|
} else {
|
||||||
t << "TARGETD = " << escapeFilePath(var("TARGET_x")) << endl;
|
t << "TARGETD = " << fileVar("TARGET_x") << endl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -300,7 +303,7 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
|
|||||||
const ProStringList &qeui = project->values("QMAKE_EXTRA_INCLUDES");
|
const ProStringList &qeui = project->values("QMAKE_EXTRA_INCLUDES");
|
||||||
ProStringList::ConstIterator it;
|
ProStringList::ConstIterator it;
|
||||||
for(it = qeui.begin(); it != qeui.end(); ++it)
|
for(it = qeui.begin(); it != qeui.end(); ++it)
|
||||||
t << "include " << (*it) << endl;
|
t << "include " << escapeDependencyPath(*it) << endl;
|
||||||
|
|
||||||
/* rules */
|
/* rules */
|
||||||
t << "first: all\n";
|
t << "first: all\n";
|
||||||
@ -321,29 +324,30 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
|
|||||||
ProStringList objects = project->values("OBJECTS");
|
ProStringList objects = project->values("OBJECTS");
|
||||||
for (ProStringList::Iterator it = objects.begin(); it != objects.end(); ++it) {
|
for (ProStringList::Iterator it = objects.begin(); it != objects.end(); ++it) {
|
||||||
QString d_file = (*it).toQString().replace(QRegExp(Option::obj_ext + "$"), ".d");
|
QString d_file = (*it).toQString().replace(QRegExp(Option::obj_ext + "$"), ".d");
|
||||||
t << "-include " << d_file << endl;
|
t << "-include " << escapeDependencyPath(d_file) << endl;
|
||||||
project->values("QMAKE_DISTCLEAN") << d_file;
|
project->values("QMAKE_DISTCLEAN") << d_file;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
QString cmd=var("QMAKE_CFLAGS_DEPS") + " ";
|
QString cmd=var("QMAKE_CFLAGS_DEPS") + " ";
|
||||||
cmd += varGlue("DEFINES","-D"," -D","") + varGlue("PRL_EXPORT_DEFINES"," -D"," -D","");
|
cmd += varGlue("DEFINES","-D"," -D","") + varGlue("PRL_EXPORT_DEFINES"," -D"," -D","");
|
||||||
if(!project->isEmpty("QMAKE_ABSOLUTE_SOURCE_PATH"))
|
if(!project->isEmpty("QMAKE_ABSOLUTE_SOURCE_PATH"))
|
||||||
cmd += " -I" + project->first("QMAKE_ABSOLUTE_SOURCE_PATH") + " ";
|
cmd += " -I" + fileVar("QMAKE_ABSOLUTE_SOURCE_PATH") + ' ';
|
||||||
cmd += " $(INCPATH) " + varGlue("DEPENDPATH", "-I", " -I", "");
|
cmd += " $(INCPATH) " + fileVarGlue("DEPENDPATH", "-I", " -I", "");
|
||||||
ProString odir;
|
ProString odir;
|
||||||
if(!project->values("OBJECTS_DIR").isEmpty())
|
if(!project->values("OBJECTS_DIR").isEmpty())
|
||||||
odir = project->first("OBJECTS_DIR");
|
odir = project->first("OBJECTS_DIR");
|
||||||
|
QString odird = escapeDependencyPath(odir.toQString());
|
||||||
|
|
||||||
QString pwd = escapeFilePath(fileFixify(qmake_getpwd()));
|
QString pwd = escapeFilePath(fileFixify(qmake_getpwd()));
|
||||||
|
|
||||||
t << "###### Dependencies\n\n";
|
t << "###### Dependencies\n\n";
|
||||||
t << odir << ".deps/%.d: " << pwd << "/%.cpp\n\t";
|
t << odird << ".deps/%.d: " << pwd << "/%.cpp\n\t";
|
||||||
if(project->isActiveConfig("echo_depend_creation"))
|
if(project->isActiveConfig("echo_depend_creation"))
|
||||||
t << "@echo Creating depend for $<\n\t";
|
t << "@echo Creating depend for $<\n\t";
|
||||||
t << mkdir_p_asstring("$(@D)", false) << "\n\t"
|
t << mkdir_p_asstring("$(@D)", false) << "\n\t"
|
||||||
<< "@$(CXX) " << cmd << " $< | sed \"s,^\\($(*F).o\\):," << odir << "\\1:,g\" >$@\n\n";
|
<< "@$(CXX) " << cmd << " $< | sed \"s,^\\($(*F).o\\):," << odir << "\\1:,g\" >$@\n\n";
|
||||||
|
|
||||||
t << odir << ".deps/%.d: " << pwd << "/%.c\n\t";
|
t << odird << ".deps/%.d: " << pwd << "/%.c\n\t";
|
||||||
if(project->isActiveConfig("echo_depend_creation"))
|
if(project->isActiveConfig("echo_depend_creation"))
|
||||||
t << "@echo Creating depend for $<\n\t";
|
t << "@echo Creating depend for $<\n\t";
|
||||||
t << mkdir_p_asstring("$(@D)", false) << "\n\t"
|
t << mkdir_p_asstring("$(@D)", false) << "\n\t"
|
||||||
@ -374,11 +378,12 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
|
|||||||
|
|
||||||
if(!d_file.isEmpty()) {
|
if(!d_file.isEmpty()) {
|
||||||
d_file = odir + ".deps/" + fileFixify(d_file, pwd, Option::output_dir) + ".d";
|
d_file = odir + ".deps/" + fileFixify(d_file, pwd, Option::output_dir) + ".d";
|
||||||
|
QString d_file_d = escapeDependencyPath(d_file);
|
||||||
QStringList deps = findDependencies((*it).toQString()).filter(QRegExp(
|
QStringList deps = findDependencies((*it).toQString()).filter(QRegExp(
|
||||||
"((^|/)" + Option::h_moc_mod + "|" + Option::cpp_moc_ext + "$)"));
|
"((^|/)" + Option::h_moc_mod + "|" + Option::cpp_moc_ext + "$)"));
|
||||||
if(!deps.isEmpty())
|
if(!deps.isEmpty())
|
||||||
t << d_file << ": " << deps.join(' ') << endl;
|
t << d_file_d << ": " << escapeDependencyPaths(deps).join(' ') << endl;
|
||||||
t << "-include " << d_file << endl;
|
t << "-include " << d_file_d << endl;
|
||||||
project->values("QMAKE_DISTCLEAN") += d_file;
|
project->values("QMAKE_DISTCLEAN") += d_file;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -395,10 +400,11 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
|
|||||||
t << "SUBLIBS = ";
|
t << "SUBLIBS = ";
|
||||||
const ProStringList &l = project->values("SUBLIBS");
|
const ProStringList &l = project->values("SUBLIBS");
|
||||||
for (ProStringList::ConstIterator it = l.begin(); it != l.end(); ++it)
|
for (ProStringList::ConstIterator it = l.begin(); it != l.end(); ++it)
|
||||||
t << libdir << project->first("QMAKE_PREFIX_STATICLIB") << (*it) << "."
|
t << escapeFilePath(libdir + project->first("QMAKE_PREFIX_STATICLIB") + (*it) + '.'
|
||||||
<< project->first("QMAKE_EXTENSION_STATICLIB") << " ";
|
+ project->first("QMAKE_EXTENSION_STATICLIB")) << ' ';
|
||||||
t << endl << endl;
|
t << endl << endl;
|
||||||
}
|
}
|
||||||
|
QString target_deps;
|
||||||
if ((project->isActiveConfig("depend_prl") || project->isActiveConfig("fast_depend_prl"))
|
if ((project->isActiveConfig("depend_prl") || project->isActiveConfig("fast_depend_prl"))
|
||||||
&& !project->isEmpty("QMAKE_PRL_INTERNAL_FILES")) {
|
&& !project->isEmpty("QMAKE_PRL_INTERNAL_FILES")) {
|
||||||
const ProStringList &l = project->values("QMAKE_PRL_INTERNAL_FILES");
|
const ProStringList &l = project->values("QMAKE_PRL_INTERNAL_FILES");
|
||||||
@ -411,18 +417,20 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
|
|||||||
if(slsh != -1)
|
if(slsh != -1)
|
||||||
dir = (*it).left(slsh + 1);
|
dir = (*it).left(slsh + 1);
|
||||||
QString targ = dir + libinfo.first("QMAKE_PRL_TARGET");
|
QString targ = dir + libinfo.first("QMAKE_PRL_TARGET");
|
||||||
target_deps += " " + targ;
|
QString targ_d = escapeDependencyPath(targ);
|
||||||
t << targ;
|
target_deps += ' ' + targ_d;
|
||||||
|
t << targ_d;
|
||||||
if (project->isActiveConfig("fast_depend_prl"))
|
if (project->isActiveConfig("fast_depend_prl"))
|
||||||
t << ":\n\t@echo \"Creating '";
|
t << ":\n\t@echo \"Creating '";
|
||||||
else
|
else
|
||||||
t << ": FORCE\n\t@echo \"Creating/updating '";
|
t << ": FORCE\n\t@echo \"Creating/updating '";
|
||||||
t << targ << "'\"\n\t"
|
t << targ << "'\"\n\t"
|
||||||
<< "(cd " << libinfo.first("QMAKE_PRL_BUILD_DIR") << ";"
|
<< "(cd " << escapeFilePath(libinfo.first("QMAKE_PRL_BUILD_DIR")) << ';'
|
||||||
<< "$(MAKE))\n";
|
<< "$(MAKE))\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
QString deps = escapeDependencyPath(fileFixify(Option::output.fileName()));
|
||||||
QString allDeps;
|
QString allDeps;
|
||||||
if (!project->values("QMAKE_APP_FLAG").isEmpty() || project->first("TEMPLATE") == "aux") {
|
if (!project->values("QMAKE_APP_FLAG").isEmpty() || project->first("TEMPLATE") == "aux") {
|
||||||
QString destdir = project->first("DESTDIR").toQString();
|
QString destdir = project->first("DESTDIR").toQString();
|
||||||
@ -443,19 +451,23 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
|
|||||||
QString incr_deps, incr_objs;
|
QString incr_deps, incr_objs;
|
||||||
if(project->first("QMAKE_INCREMENTAL_STYLE") == "ld") {
|
if(project->first("QMAKE_INCREMENTAL_STYLE") == "ld") {
|
||||||
QString incr_target_dir = var("OBJECTS_DIR") + incr_target + Option::obj_ext;
|
QString incr_target_dir = var("OBJECTS_DIR") + incr_target + Option::obj_ext;
|
||||||
|
QString incr_target_dir_d = escapeDependencyPath(incr_target_dir);
|
||||||
|
QString incr_target_dir_f = escapeFilePath(incr_target_dir);
|
||||||
//actual target
|
//actual target
|
||||||
t << incr_target_dir << ": $(OBJECTS)\n\t"
|
t << incr_target_dir_d << ": $(OBJECTS)\n\t"
|
||||||
<< "ld -r -o "<< incr_target_dir << " $(OBJECTS)\n";
|
<< "ld -r -o " << incr_target_dir_f << " $(OBJECTS)\n";
|
||||||
//communicated below
|
//communicated below
|
||||||
deps.prepend(incr_target_dir + " ");
|
deps.prepend(incr_target_dir_d + ' ');
|
||||||
incr_deps = "$(INCREMENTAL_OBJECTS)";
|
incr_deps = "$(INCREMENTAL_OBJECTS)";
|
||||||
if(!incr_objs.isEmpty())
|
if(!incr_objs.isEmpty())
|
||||||
incr_objs += " ";
|
incr_objs += " ";
|
||||||
incr_objs += incr_target_dir;
|
incr_objs += incr_target_dir_f;
|
||||||
} else {
|
} else {
|
||||||
//actual target
|
//actual target
|
||||||
QString incr_target_dir = var("DESTDIR") + "lib" + incr_target + "." +
|
QString incr_target_dir = var("DESTDIR") + "lib" + incr_target + "." +
|
||||||
project->first("QMAKE_EXTENSION_SHLIB");
|
project->first("QMAKE_EXTENSION_SHLIB");
|
||||||
|
QString incr_target_dir_d = escapeDependencyPath(incr_target_dir);
|
||||||
|
QString incr_target_dir_f = escapeFilePath(incr_target_dir);
|
||||||
QString incr_lflags = var("QMAKE_LFLAGS_SHLIB") + " ";
|
QString incr_lflags = var("QMAKE_LFLAGS_SHLIB") + " ";
|
||||||
if(project->isActiveConfig("debug"))
|
if(project->isActiveConfig("debug"))
|
||||||
incr_lflags += var("QMAKE_LFLAGS_DEBUG");
|
incr_lflags += var("QMAKE_LFLAGS_DEBUG");
|
||||||
@ -463,31 +475,31 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
|
|||||||
incr_lflags += var("QMAKE_LFLAGS_RELEASE_WITH_DEBUGINFO");
|
incr_lflags += var("QMAKE_LFLAGS_RELEASE_WITH_DEBUGINFO");
|
||||||
else
|
else
|
||||||
incr_lflags += var("QMAKE_LFLAGS_RELEASE");
|
incr_lflags += var("QMAKE_LFLAGS_RELEASE");
|
||||||
t << incr_target_dir << ": $(INCREMENTAL_OBJECTS)\n\t";
|
t << incr_target_dir_d << ": $(INCREMENTAL_OBJECTS)\n\t";
|
||||||
if(!destdir.isEmpty())
|
if(!destdir.isEmpty())
|
||||||
t << "\n\t" << mkdir_p_asstring(destdir) << "\n\t";
|
t << "\n\t" << mkdir_p_asstring(destdir) << "\n\t";
|
||||||
t << "$(LINK) " << incr_lflags << " -o "<< incr_target_dir <<
|
t << "$(LINK) " << incr_lflags << " -o "<< incr_target_dir_f <<
|
||||||
" $(INCREMENTAL_OBJECTS)\n";
|
" $(INCREMENTAL_OBJECTS)\n";
|
||||||
//communicated below
|
//communicated below
|
||||||
if(!destdir.isEmpty()) {
|
if(!destdir.isEmpty()) {
|
||||||
if(!incr_objs.isEmpty())
|
if(!incr_objs.isEmpty())
|
||||||
incr_objs += " ";
|
incr_objs += " ";
|
||||||
incr_objs += "-L" + destdir;
|
incr_objs += "-L" + escapeFilePath(destdir);
|
||||||
} else {
|
} else {
|
||||||
if(!incr_objs.isEmpty())
|
if(!incr_objs.isEmpty())
|
||||||
incr_objs += " ";
|
incr_objs += " ";
|
||||||
incr_objs += "-L" + qmake_getpwd();
|
incr_objs += "-L" + escapeFilePath(qmake_getpwd());
|
||||||
}
|
}
|
||||||
if(!incr_objs.isEmpty())
|
if(!incr_objs.isEmpty())
|
||||||
incr_objs += " ";
|
incr_objs += " ";
|
||||||
incr_objs += " -l" + incr_target;
|
incr_objs += " -l" + escapeFilePath(incr_target);
|
||||||
deps.prepend(incr_target_dir + " ");
|
deps.prepend(incr_target_dir_d + ' ');
|
||||||
incr_deps = "$(OBJECTS)";
|
incr_deps = "$(OBJECTS)";
|
||||||
}
|
}
|
||||||
|
|
||||||
//real target
|
//real target
|
||||||
t << var("TARGET") << ": " << var("PRE_TARGETDEPS") << " " << incr_deps << " " << target_deps
|
t << var("TARGET") << ": " << depVar("PRE_TARGETDEPS") << ' ' << incr_deps << ' ' << target_deps
|
||||||
<< " " << var("POST_TARGETDEPS") << "\n\t";
|
<< ' ' << depVar("POST_TARGETDEPS") << "\n\t";
|
||||||
if(!destdir.isEmpty())
|
if(!destdir.isEmpty())
|
||||||
t << "\n\t" << mkdir_p_asstring(destdir) << "\n\t";
|
t << "\n\t" << mkdir_p_asstring(destdir) << "\n\t";
|
||||||
if(!project->isEmpty("QMAKE_PRE_LINK"))
|
if(!project->isEmpty("QMAKE_PRE_LINK"))
|
||||||
@ -497,8 +509,8 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
|
|||||||
t << "\n\t" << var("QMAKE_POST_LINK");
|
t << "\n\t" << var("QMAKE_POST_LINK");
|
||||||
t << endl << endl;
|
t << endl << endl;
|
||||||
} else {
|
} else {
|
||||||
t << "$(TARGET): " << var("PRE_TARGETDEPS") << " $(OBJECTS) "
|
t << "$(TARGET): " << depVar("PRE_TARGETDEPS") << " $(OBJECTS) "
|
||||||
<< target_deps << " " << var("POST_TARGETDEPS") << "\n\t";
|
<< target_deps << ' ' << depVar("POST_TARGETDEPS") << "\n\t";
|
||||||
if (project->first("TEMPLATE") != "aux") {
|
if (project->first("TEMPLATE") != "aux") {
|
||||||
if (!destdir.isEmpty())
|
if (!destdir.isEmpty())
|
||||||
t << mkdir_p_asstring(destdir) << "\n\t";
|
t << mkdir_p_asstring(destdir) << "\n\t";
|
||||||
@ -512,16 +524,17 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
|
|||||||
}
|
}
|
||||||
allDeps = " $(TARGET)";
|
allDeps = " $(TARGET)";
|
||||||
} else if(!project->isActiveConfig("staticlib")) {
|
} else if(!project->isActiveConfig("staticlib")) {
|
||||||
QString destdir = unescapeFilePath(project->first("DESTDIR").toQString()), incr_deps;
|
QString destdir_r = project->first("DESTDIR").toQString(), incr_deps;
|
||||||
if(!project->isEmpty("QMAKE_BUNDLE")) {
|
if(!project->isEmpty("QMAKE_BUNDLE")) {
|
||||||
QString bundle_loc = project->first("QMAKE_BUNDLE_LOCATION").toQString();
|
QString bundle_loc = project->first("QMAKE_BUNDLE_LOCATION").toQString();
|
||||||
if(!bundle_loc.isEmpty() && !bundle_loc.startsWith("/"))
|
if(!bundle_loc.isEmpty() && !bundle_loc.startsWith("/"))
|
||||||
bundle_loc.prepend("/");
|
bundle_loc.prepend("/");
|
||||||
if(!bundle_loc.endsWith("/"))
|
if(!bundle_loc.endsWith("/"))
|
||||||
bundle_loc += "/";
|
bundle_loc += "/";
|
||||||
destdir += project->first("QMAKE_BUNDLE") + bundle_loc;
|
destdir_r += project->first("QMAKE_BUNDLE") + bundle_loc;
|
||||||
}
|
}
|
||||||
destdir = escapeFilePath(destdir);
|
QString destdir_d = escapeDependencyPath(destdir_r);
|
||||||
|
QString destdir = escapeFilePath(destdir_r);
|
||||||
|
|
||||||
if(do_incremental) {
|
if(do_incremental) {
|
||||||
ProString s_ext = project->first("QMAKE_EXTENSION_SHLIB");
|
ProString s_ext = project->first("QMAKE_EXTENSION_SHLIB");
|
||||||
@ -530,23 +543,26 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
|
|||||||
if(incr_target.indexOf(Option::dir_sep) != -1)
|
if(incr_target.indexOf(Option::dir_sep) != -1)
|
||||||
incr_target = incr_target.right(incr_target.length() -
|
incr_target = incr_target.right(incr_target.length() -
|
||||||
(incr_target.lastIndexOf(Option::dir_sep) + 1));
|
(incr_target.lastIndexOf(Option::dir_sep) + 1));
|
||||||
incr_target = escapeFilePath(incr_target);
|
|
||||||
|
|
||||||
if(project->first("QMAKE_INCREMENTAL_STYLE") == "ld") {
|
if(project->first("QMAKE_INCREMENTAL_STYLE") == "ld") {
|
||||||
QString incr_target_dir = escapeFilePath(var("OBJECTS_DIR") + incr_target + Option::obj_ext);
|
QString incr_target_dir = var("OBJECTS_DIR") + incr_target + Option::obj_ext;
|
||||||
|
QString incr_target_dir_d = escapeDependencyPath(incr_target_dir);
|
||||||
|
QString incr_target_dir_f = escapeFilePath(incr_target_dir);
|
||||||
//actual target
|
//actual target
|
||||||
const QString link_deps = "$(OBJECTS) ";
|
const QString link_deps = "$(OBJECTS) ";
|
||||||
t << incr_target_dir << ": " << link_deps << "\n\t"
|
t << incr_target_dir_d << ": " << link_deps << "\n\t"
|
||||||
<< "ld -r -o " << incr_target_dir << " " << link_deps << endl;
|
<< "ld -r -o " << incr_target_dir_f << ' ' << link_deps << endl;
|
||||||
//communicated below
|
//communicated below
|
||||||
ProStringList &cmd = project->values("QMAKE_LINK_SHLIB_CMD");
|
ProStringList &cmd = project->values("QMAKE_LINK_SHLIB_CMD");
|
||||||
cmd[0] = cmd.at(0).toQString().replace("$(OBJECTS) ", "$(INCREMENTAL_OBJECTS)"); //ick
|
cmd[0] = cmd.at(0).toQString().replace("$(OBJECTS) ", "$(INCREMENTAL_OBJECTS)"); //ick
|
||||||
cmd.append(incr_target_dir);
|
cmd.append(incr_target_dir_f);
|
||||||
deps.prepend(incr_target_dir + " ");
|
deps.prepend(incr_target_dir_d + ' ');
|
||||||
incr_deps = "$(INCREMENTAL_OBJECTS)";
|
incr_deps = "$(INCREMENTAL_OBJECTS)";
|
||||||
} else {
|
} else {
|
||||||
//actual target
|
//actual target
|
||||||
QString incr_target_dir = escapeFilePath(destdir + "lib" + incr_target + "." + s_ext);
|
QString incr_target_dir = destdir_r + "lib" + incr_target + '.' + s_ext;
|
||||||
|
QString incr_target_dir_d = escapeDependencyPath(incr_target_dir);
|
||||||
|
QString incr_target_dir_f = escapeFilePath(incr_target_dir);
|
||||||
QString incr_lflags = var("QMAKE_LFLAGS_SHLIB") + " ";
|
QString incr_lflags = var("QMAKE_LFLAGS_SHLIB") + " ";
|
||||||
if(!project->isEmpty("QMAKE_LFLAGS_INCREMENTAL"))
|
if(!project->isEmpty("QMAKE_LFLAGS_INCREMENTAL"))
|
||||||
incr_lflags += var("QMAKE_LFLAGS_INCREMENTAL") + " ";
|
incr_lflags += var("QMAKE_LFLAGS_INCREMENTAL") + " ";
|
||||||
@ -556,29 +572,29 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
|
|||||||
incr_lflags += var("QMAKE_LFLAGS_RELEASE_WITH_DEBUGINFO");
|
incr_lflags += var("QMAKE_LFLAGS_RELEASE_WITH_DEBUGINFO");
|
||||||
else
|
else
|
||||||
incr_lflags += var("QMAKE_LFLAGS_RELEASE");
|
incr_lflags += var("QMAKE_LFLAGS_RELEASE");
|
||||||
t << incr_target_dir << ": $(INCREMENTAL_OBJECTS)\n\t";
|
t << incr_target_dir_d << ": $(INCREMENTAL_OBJECTS)\n\t";
|
||||||
if(!destdir.isEmpty())
|
if(!destdir.isEmpty())
|
||||||
t << mkdir_p_asstring(destdir, false) << "\n\t";
|
t << mkdir_p_asstring(destdir, false) << "\n\t";
|
||||||
t << "$(LINK) " << incr_lflags << " " << var("QMAKE_LINK_O_FLAG") << incr_target_dir <<
|
t << "$(LINK) " << incr_lflags << ' ' << var("QMAKE_LINK_O_FLAG") << incr_target_dir_f <<
|
||||||
" $(INCREMENTAL_OBJECTS)\n";
|
" $(INCREMENTAL_OBJECTS)\n";
|
||||||
//communicated below
|
//communicated below
|
||||||
ProStringList &cmd = project->values("QMAKE_LINK_SHLIB_CMD");
|
ProStringList &cmd = project->values("QMAKE_LINK_SHLIB_CMD");
|
||||||
if(!destdir.isEmpty())
|
if(!destdir.isEmpty())
|
||||||
cmd.append(" -L" + destdir);
|
cmd.append(" -L" + destdir);
|
||||||
cmd.append(" -l" + incr_target);
|
cmd.append(" -l" + escapeFilePath(incr_target));
|
||||||
deps.prepend(incr_target_dir + " ");
|
deps.prepend(incr_target_dir_d + ' ');
|
||||||
incr_deps = "$(OBJECTS)";
|
incr_deps = "$(OBJECTS)";
|
||||||
}
|
}
|
||||||
|
|
||||||
//real target
|
//real target
|
||||||
t << destdir << "$(TARGET): " << var("PRE_TARGETDEPS") << " "
|
t << destdir_d << "$(TARGET): " << depVar("PRE_TARGETDEPS") << ' '
|
||||||
<< incr_deps << " $(SUBLIBS) " << target_deps << " " << var("POST_TARGETDEPS");
|
<< incr_deps << " $(SUBLIBS) " << target_deps << ' ' << depVar("POST_TARGETDEPS");
|
||||||
} else {
|
} else {
|
||||||
t << destdir << "$(TARGET): " << var("PRE_TARGETDEPS")
|
t << destdir_d << "$(TARGET): " << depVar("PRE_TARGETDEPS")
|
||||||
<< " $(OBJECTS) $(SUBLIBS) $(OBJCOMP) " << target_deps
|
<< " $(OBJECTS) $(SUBLIBS) $(OBJCOMP) " << target_deps
|
||||||
<< " " << var("POST_TARGETDEPS");
|
<< ' ' << depVar("POST_TARGETDEPS");
|
||||||
}
|
}
|
||||||
allDeps = ' ' + destdir + "$(TARGET)";
|
allDeps = ' ' + destdir_d + "$(TARGET)";
|
||||||
if(!destdir.isEmpty())
|
if(!destdir.isEmpty())
|
||||||
t << "\n\t" << mkdir_p_asstring(destdir, false);
|
t << "\n\t" << mkdir_p_asstring(destdir, false);
|
||||||
if(!project->isEmpty("QMAKE_PRE_LINK"))
|
if(!project->isEmpty("QMAKE_PRE_LINK"))
|
||||||
@ -598,8 +614,9 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
|
|||||||
t << "\n\t" << var("QMAKE_POST_LINK");
|
t << "\n\t" << var("QMAKE_POST_LINK");
|
||||||
t << endl << endl;
|
t << endl << endl;
|
||||||
} else if(!project->isEmpty("QMAKE_BUNDLE")) {
|
} else if(!project->isEmpty("QMAKE_BUNDLE")) {
|
||||||
QString currentLink = destdir + "Versions/Current";
|
QString currentLink = destdir_r + "Versions/Current";
|
||||||
bundledFiles << currentLink << destdir + "$(TARGET)";
|
QString currentLink_f = escapeDependencyPath(currentLink);
|
||||||
|
bundledFiles << currentLink << destdir_r + "$(TARGET)";
|
||||||
t << "\n\t"
|
t << "\n\t"
|
||||||
<< "-$(DEL_FILE) $(TARGET) $(TARGET0) $(DESTDIR)$(TARGET0)\n\t"
|
<< "-$(DEL_FILE) $(TARGET) $(TARGET0) $(DESTDIR)$(TARGET0)\n\t"
|
||||||
<< var("QMAKE_LINK_SHLIB_CMD") << "\n\t"
|
<< var("QMAKE_LINK_SHLIB_CMD") << "\n\t"
|
||||||
@ -608,9 +625,9 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
|
|||||||
<< mkdir_p_asstring("\"`dirname $(DESTDIR)$(TARGET0)`\"", false) << "\n\t"
|
<< mkdir_p_asstring("\"`dirname $(DESTDIR)$(TARGET0)`\"", false) << "\n\t"
|
||||||
<< varGlue("QMAKE_LN_SHLIB", "-", " ",
|
<< varGlue("QMAKE_LN_SHLIB", "-", " ",
|
||||||
" Versions/Current/$(TARGET) $(DESTDIR)$(TARGET0)") << "\n\t"
|
" Versions/Current/$(TARGET) $(DESTDIR)$(TARGET0)") << "\n\t"
|
||||||
<< "-$(DEL_FILE) " << currentLink << "\n\t"
|
<< "-$(DEL_FILE) " << currentLink_f << "\n\t"
|
||||||
<< varGlue("QMAKE_LN_SHLIB","-"," ", " " + project->first("QMAKE_FRAMEWORK_VERSION") +
|
<< varGlue("QMAKE_LN_SHLIB","-"," ", " " + project->first("QMAKE_FRAMEWORK_VERSION") +
|
||||||
" " + currentLink) << "\n\t";
|
' ' + currentLink_f) << "\n\t";
|
||||||
if(!project->isEmpty("QMAKE_POST_LINK"))
|
if(!project->isEmpty("QMAKE_POST_LINK"))
|
||||||
t << "\n\t" << var("QMAKE_POST_LINK");
|
t << "\n\t" << var("QMAKE_POST_LINK");
|
||||||
t << endl << endl;
|
t << endl << endl;
|
||||||
@ -667,10 +684,10 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
|
|||||||
|
|
||||||
if (! project->isActiveConfig("plugin")) {
|
if (! project->isActiveConfig("plugin")) {
|
||||||
t << "staticlib: $(TARGETA)\n\n";
|
t << "staticlib: $(TARGETA)\n\n";
|
||||||
t << "$(TARGETA): " << var("PRE_TARGETDEPS") << " $(OBJECTS) $(OBJCOMP)";
|
t << "$(TARGETA): " << depVar("PRE_TARGETDEPS") << " $(OBJECTS) $(OBJCOMP)";
|
||||||
if(do_incremental)
|
if(do_incremental)
|
||||||
t << " $(INCREMENTAL_OBJECTS)";
|
t << " $(INCREMENTAL_OBJECTS)";
|
||||||
t << " " << var("POST_TARGETDEPS") << "\n\t"
|
t << ' ' << depVar("POST_TARGETDEPS") << "\n\t"
|
||||||
<< "-$(DEL_FILE) $(TARGETA) \n\t"
|
<< "-$(DEL_FILE) $(TARGETA) \n\t"
|
||||||
<< var("QMAKE_AR_CMD");
|
<< var("QMAKE_AR_CMD");
|
||||||
if(do_incremental)
|
if(do_incremental)
|
||||||
@ -680,15 +697,17 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
|
|||||||
t << endl << endl;
|
t << endl << endl;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
QString destdir = project->first("DESTDIR").toQString();
|
QString destdir_r = project->first("DESTDIR").toQString();
|
||||||
allDeps = ' ' + destdir + "$(TARGET)"
|
QString destdir_d = escapeDependencyPath(destdir_r);
|
||||||
+ varGlue("QMAKE_AR_SUBLIBS", ' ' + destdir, ' ' + destdir, "");
|
QString destdir = escapeFilePath(destdir_r);
|
||||||
t << "staticlib: " << destdir << "$(TARGET)\n\n";
|
allDeps = ' ' + destdir_d + "$(TARGET)"
|
||||||
|
+ varGlue("QMAKE_AR_SUBLIBS", ' ' + destdir_d, ' ' + destdir_d, "");
|
||||||
|
t << "staticlib: " << destdir_d << "$(TARGET)\n\n";
|
||||||
if(project->isEmpty("QMAKE_AR_SUBLIBS")) {
|
if(project->isEmpty("QMAKE_AR_SUBLIBS")) {
|
||||||
t << destdir << "$(TARGET): " << var("PRE_TARGETDEPS")
|
t << destdir_d << "$(TARGET): " << depVar("PRE_TARGETDEPS")
|
||||||
<< " $(OBJECTS) $(OBJCOMP) " << var("POST_TARGETDEPS") << "\n\t";
|
<< " $(OBJECTS) $(OBJCOMP) " << depVar("POST_TARGETDEPS") << "\n\t";
|
||||||
if(!destdir.isEmpty())
|
if(!destdir.isEmpty())
|
||||||
t << mkdir_p_asstring(destdir) << "\n\t";
|
t << mkdir_p_asstring(destdir, false) << "\n\t";
|
||||||
t << "-$(DEL_FILE) $(TARGET)\n\t"
|
t << "-$(DEL_FILE) $(TARGET)\n\t"
|
||||||
<< var("QMAKE_AR_CMD") << "\n";
|
<< var("QMAKE_AR_CMD") << "\n";
|
||||||
if(!project->isEmpty("QMAKE_POST_LINK"))
|
if(!project->isEmpty("QMAKE_POST_LINK"))
|
||||||
@ -709,26 +728,27 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
|
|||||||
for(int cnt = 0; cnt < max_files && objit != objs.end(); ++objit, cnt++)
|
for(int cnt = 0; cnt < max_files && objit != objs.end(); ++objit, cnt++)
|
||||||
build << (*objit);
|
build << (*objit);
|
||||||
QString ar;
|
QString ar;
|
||||||
|
ProString lib = escapeFilePath(*libit);
|
||||||
if((*libit) == "$(TARGET)") {
|
if((*libit) == "$(TARGET)") {
|
||||||
t << destdir << "$(TARGET): " << var("PRE_TARGETDEPS")
|
t << destdir_d << "$(TARGET): " << depVar("PRE_TARGETDEPS")
|
||||||
<< " " << var("POST_TARGETDEPS") << valList(build) << "\n\t";
|
<< ' ' << depVar("POST_TARGETDEPS") << valList(escapeDependencyPaths(build)) << "\n\t";
|
||||||
ar = project->first("QMAKE_AR_CMD").toQString();
|
ar = project->first("QMAKE_AR_CMD").toQString();
|
||||||
ar.replace("$(OBJECTS)", build.join(' '));
|
ar.replace("$(OBJECTS)", escapeFilePaths(build).join(' '));
|
||||||
} else {
|
} else {
|
||||||
t << (*libit) << ": " << valList(build) << "\n\t";
|
t << escapeDependencyPath(*libit) << ": " << valList(escapeDependencyPaths(build)) << "\n\t";
|
||||||
ar = "$(AR) " + (*libit) + " " + build.join(' ');
|
ar = "$(AR) " + lib + ' ' + escapeFilePaths(build).join(' ');
|
||||||
}
|
}
|
||||||
if(!destdir.isEmpty())
|
if(!destdir.isEmpty())
|
||||||
t << mkdir_p_asstring(destdir) << "\n\t";
|
t << mkdir_p_asstring(destdir, false) << "\n\t";
|
||||||
t << "-$(DEL_FILE) " << (*libit) << "\n\t"
|
t << "-$(DEL_FILE) " << lib << "\n\t"
|
||||||
<< ar << "\n";
|
<< ar << "\n";
|
||||||
if(!project->isEmpty("QMAKE_POST_LINK"))
|
if(!project->isEmpty("QMAKE_POST_LINK"))
|
||||||
t << "\t" << var("QMAKE_POST_LINK") << "\n";
|
t << "\t" << var("QMAKE_POST_LINK") << "\n";
|
||||||
if(!project->isEmpty("QMAKE_RANLIB"))
|
if(!project->isEmpty("QMAKE_RANLIB"))
|
||||||
t << "\t$(RANLIB) " << (*libit) << "\n";
|
t << "\t$(RANLIB) " << lib << "\n";
|
||||||
if(!destdir.isEmpty())
|
if(!destdir.isEmpty())
|
||||||
t << "\t-$(DEL_FILE) " << destdir << (*libit) << "\n"
|
t << "\t-$(DEL_FILE) " << destdir << lib << "\n"
|
||||||
<< "\t-$(MOVE) " << (*libit) << " " << destdir << " \n";
|
<< "\t-$(MOVE) " << lib << ' ' << destdir << " \n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
t << endl << endl;
|
t << endl << endl;
|
||||||
@ -746,7 +766,7 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
|
|||||||
}
|
}
|
||||||
if(!meta_files.isEmpty())
|
if(!meta_files.isEmpty())
|
||||||
t << escapeDependencyPaths(meta_files).join(" ") << ": \n\t"
|
t << escapeDependencyPaths(meta_files).join(" ") << ": \n\t"
|
||||||
<< "@$(QMAKE) -prl " << buildArgs() << " " << project->projectFile() << endl;
|
<< "@$(QMAKE) -prl " << buildArgs() << ' ' << escapeFilePath(project->projectFile()) << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!project->isEmpty("QMAKE_BUNDLE")) {
|
if (!project->isEmpty("QMAKE_BUNDLE")) {
|
||||||
@ -754,31 +774,35 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
|
|||||||
ProStringList &alldeps = project->values("ALL_DEPS");
|
ProStringList &alldeps = project->values("ALL_DEPS");
|
||||||
QString bundle_dir = project->first("DESTDIR") + project->first("QMAKE_BUNDLE") + "/";
|
QString bundle_dir = project->first("DESTDIR") + project->first("QMAKE_BUNDLE") + "/";
|
||||||
if (!project->first("QMAKE_PKGINFO").isEmpty()) {
|
if (!project->first("QMAKE_PKGINFO").isEmpty()) {
|
||||||
ProString pkginfo = escapeFilePath(project->first("QMAKE_PKGINFO"));
|
ProString pkginfo = project->first("QMAKE_PKGINFO");
|
||||||
|
ProString pkginfo_f = escapeFilePath(pkginfo);
|
||||||
|
ProString pkginfo_d = escapeDependencyPath(pkginfo);
|
||||||
bundledFiles << pkginfo;
|
bundledFiles << pkginfo;
|
||||||
alldeps << pkginfo;
|
alldeps << pkginfo;
|
||||||
QString destdir = bundle_dir + "Contents";
|
QString destdir = bundle_dir + "Contents";
|
||||||
t << pkginfo << ": \n\t";
|
t << pkginfo_d << ": \n\t";
|
||||||
if (!destdir.isEmpty())
|
if (!destdir.isEmpty())
|
||||||
t << mkdir_p_asstring(destdir) << "\n\t";
|
t << mkdir_p_asstring(destdir) << "\n\t";
|
||||||
t << "@$(DEL_FILE) " << pkginfo << "\n\t"
|
t << "@$(DEL_FILE) " << pkginfo_f << "\n\t"
|
||||||
<< "@echo \"APPL"
|
<< "@echo \"APPL"
|
||||||
<< (project->isEmpty("QMAKE_PKGINFO_TYPEINFO")
|
<< (project->isEmpty("QMAKE_PKGINFO_TYPEINFO")
|
||||||
? QString::fromLatin1("????") : project->first("QMAKE_PKGINFO_TYPEINFO").left(4))
|
? QString::fromLatin1("????") : project->first("QMAKE_PKGINFO_TYPEINFO").left(4))
|
||||||
<< "\" >" << pkginfo << endl;
|
<< "\" > " << pkginfo_f << endl;
|
||||||
}
|
}
|
||||||
if (!project->first("QMAKE_BUNDLE_RESOURCE_FILE").isEmpty()) {
|
if (!project->first("QMAKE_BUNDLE_RESOURCE_FILE").isEmpty()) {
|
||||||
ProString resources = escapeFilePath(project->first("QMAKE_BUNDLE_RESOURCE_FILE"));
|
ProString resources = project->first("QMAKE_BUNDLE_RESOURCE_FILE");
|
||||||
|
ProString resources_f = escapeFilePath(resources);
|
||||||
|
ProString resources_d = escapeDependencyPath(resources);
|
||||||
bundledFiles << resources;
|
bundledFiles << resources;
|
||||||
alldeps << resources;
|
alldeps << resources;
|
||||||
QString destdir = bundle_dir + "Contents/Resources";
|
QString destdir = bundle_dir + "Contents/Resources";
|
||||||
t << resources << ": \n\t";
|
t << resources_d << ": \n\t";
|
||||||
t << mkdir_p_asstring(destdir) << "\n\t";
|
t << mkdir_p_asstring(destdir) << "\n\t";
|
||||||
t << "@touch " << resources << "\n\t\n";
|
t << "@touch " << resources_f << "\n\t\n";
|
||||||
}
|
}
|
||||||
//copy the plist
|
//copy the plist
|
||||||
while (!project->isActiveConfig("no_plist")) { // 'while' just to be able to 'break'
|
while (!project->isActiveConfig("no_plist")) { // 'while' just to be able to 'break'
|
||||||
QString info_plist = escapeFilePath(fileFixify(project->first("QMAKE_INFO_PLIST").toQString()));
|
QString info_plist = fileFixify(project->first("QMAKE_INFO_PLIST").toQString());
|
||||||
if (info_plist.isEmpty())
|
if (info_plist.isEmpty())
|
||||||
info_plist = specdir() + QDir::separator() + "Info.plist." + project->first("TEMPLATE");
|
info_plist = specdir() + QDir::separator() + "Info.plist." + project->first("TEMPLATE");
|
||||||
if (!exists(Option::fixPathToLocalOS(info_plist))) {
|
if (!exists(Option::fixPathToLocalOS(info_plist))) {
|
||||||
@ -786,15 +810,17 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
|
|||||||
info_plist.toLatin1().constData());
|
info_plist.toLatin1().constData());
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
info_plist = escapeFilePath(info_plist);
|
||||||
bool isApp = (project->first("TEMPLATE") == "app");
|
bool isApp = (project->first("TEMPLATE") == "app");
|
||||||
QString info_plist_out = escapeFilePath(
|
QString info_plist_out =
|
||||||
bundle_dir + (isApp ? "Contents/Info.plist"
|
bundle_dir + (isApp ? "Contents/Info.plist"
|
||||||
: "Versions/" + project->first("QMAKE_FRAMEWORK_VERSION")
|
: "Versions/" + project->first("QMAKE_FRAMEWORK_VERSION")
|
||||||
+ "/Resources/Info.plist"));
|
+ "/Resources/Info.plist");
|
||||||
bundledFiles << info_plist_out;
|
bundledFiles << info_plist_out;
|
||||||
alldeps << info_plist_out;
|
alldeps << info_plist_out;
|
||||||
QString destdir = info_plist_out.section(Option::dir_sep, 0, -2);
|
QString destdir = info_plist_out.section(Option::dir_sep, 0, -2);
|
||||||
t << info_plist_out << ": \n\t";
|
t << escapeDependencyPath(info_plist_out) << ": \n\t";
|
||||||
|
info_plist_out = escapeFilePath(info_plist_out);
|
||||||
if (!destdir.isEmpty())
|
if (!destdir.isEmpty())
|
||||||
t << mkdir_p_asstring(destdir, false) << "\n\t";
|
t << mkdir_p_asstring(destdir, false) << "\n\t";
|
||||||
ProStringList commonSedArgs;
|
ProStringList commonSedArgs;
|
||||||
@ -834,13 +860,14 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
|
|||||||
//copy the icon
|
//copy the icon
|
||||||
if (!project->isEmpty("ICON")) {
|
if (!project->isEmpty("ICON")) {
|
||||||
QString dir = bundle_dir + "Contents/Resources/";
|
QString dir = bundle_dir + "Contents/Resources/";
|
||||||
const QString icon_path = escapeFilePath(dir + icon.section(Option::dir_sep, -1));
|
const QString icon_path = dir + icon.section(Option::dir_sep, -1);
|
||||||
|
QString icon_path_f = escapeFilePath(icon_path);
|
||||||
bundledFiles << icon_path;
|
bundledFiles << icon_path;
|
||||||
alldeps << icon_path;
|
alldeps << icon_path;
|
||||||
t << icon_path << ": " << icon << "\n\t"
|
t << escapeDependencyPath(icon_path) << ": " << escapeDependencyPath(icon) << "\n\t"
|
||||||
<< mkdir_p_asstring(dir) << "\n\t"
|
<< mkdir_p_asstring(dir) << "\n\t"
|
||||||
<< "@$(DEL_FILE) " << icon_path << "\n\t"
|
<< "@$(DEL_FILE) " << icon_path_f << "\n\t"
|
||||||
<< "@$(COPY_FILE) " << escapeFilePath(icon) << " " << icon_path << endl;
|
<< "@$(COPY_FILE) " << escapeFilePath(icon) << ' ' << icon_path_f << endl;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
symlinks[bundle_dir + "Resources"] = "Versions/Current/Resources";
|
symlinks[bundle_dir + "Resources"] = "Versions/Current/Resources";
|
||||||
@ -882,12 +909,13 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
|
|||||||
QString src = fileFixify(fn, FileFixifyAbsolute);
|
QString src = fileFixify(fn, FileFixifyAbsolute);
|
||||||
if (!QFile::exists(src))
|
if (!QFile::exists(src))
|
||||||
src = fn;
|
src = fn;
|
||||||
src = escapeFilePath(src);
|
QString dst = path + Option::dir_sep + fileInfo(fn).fileName();
|
||||||
const QString dst = escapeFilePath(path + Option::dir_sep + fileInfo(fn).fileName());
|
|
||||||
bundledFiles << dst;
|
bundledFiles << dst;
|
||||||
alldeps << dst;
|
alldeps << dst;
|
||||||
t << dst << ": " << src << "\n\t"
|
t << escapeDependencyPath(dst) << ": " << escapeDependencyPath(src) << "\n\t"
|
||||||
<< mkdir_p_asstring(path) << "\n\t";
|
<< mkdir_p_asstring(path) << "\n\t";
|
||||||
|
src = escapeFilePath(src);
|
||||||
|
dst = escapeFilePath(dst);
|
||||||
QFileInfo fi(fileInfo(fn));
|
QFileInfo fi(fileInfo(fn));
|
||||||
if(fi.isDir())
|
if(fi.isDir())
|
||||||
t << "@$(DEL_FILE) -r " << dst << "\n\t"
|
t << "@$(DEL_FILE) -r " << dst << "\n\t"
|
||||||
@ -898,18 +926,19 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
QString bundle_dir_f = escapeFilePath(bundle_dir);
|
||||||
QHash<QString, QString>::ConstIterator symIt = symlinks.constBegin(),
|
QHash<QString, QString>::ConstIterator symIt = symlinks.constBegin(),
|
||||||
symEnd = symlinks.constEnd();
|
symEnd = symlinks.constEnd();
|
||||||
for (; symIt != symEnd; ++symIt) {
|
for (; symIt != symEnd; ++symIt) {
|
||||||
bundledFiles << symIt.key();
|
bundledFiles << symIt.key();
|
||||||
alldeps << symIt.key();
|
alldeps << symIt.key();
|
||||||
t << symIt.key() << ":\n\t"
|
t << escapeDependencyPath(symIt.key()) << ":\n\t"
|
||||||
<< mkdir_p_asstring(bundle_dir) << "\n\t"
|
<< mkdir_p_asstring(bundle_dir) << "\n\t"
|
||||||
<< "@$(SYMLINK) " << symIt.value() << " " << bundle_dir << endl;
|
<< "@$(SYMLINK) " << escapeFilePath(symIt.value()) << ' ' << bundle_dir_f << endl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
t << endl << "all: " << escapeDependencyPath(deps)
|
t << endl << "all: " << deps
|
||||||
<< valGlue(escapeDependencyPaths(project->values("ALL_DEPS")), " \\\n\t\t", " \\\n\t\t", "")
|
<< valGlue(escapeDependencyPaths(project->values("ALL_DEPS")), " \\\n\t\t", " \\\n\t\t", "")
|
||||||
<< allDeps << endl << endl;
|
<< allDeps << endl << endl;
|
||||||
|
|
||||||
@ -930,15 +959,16 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
|
|||||||
const ProStringList &val = project->values((*var_it).toKey());
|
const ProStringList &val = project->values((*var_it).toKey());
|
||||||
if(val.isEmpty())
|
if(val.isEmpty())
|
||||||
continue;
|
continue;
|
||||||
t << "\t$(COPY_FILE) --parents " << val.join(' ') << " $(DISTDIR)" << Option::dir_sep << endl;
|
t << "\t$(COPY_FILE) --parents " << escapeFilePaths(val).join(' ')
|
||||||
|
<< " $(DISTDIR)" << Option::dir_sep << endl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(!project->isEmpty("TRANSLATIONS"))
|
if(!project->isEmpty("TRANSLATIONS"))
|
||||||
t << "\t$(COPY_FILE) --parents " << var("TRANSLATIONS") << " $(DISTDIR)" << Option::dir_sep << endl;
|
t << "\t$(COPY_FILE) --parents " << fileVar("TRANSLATIONS") << " $(DISTDIR)" << Option::dir_sep << endl;
|
||||||
t << endl << endl;
|
t << endl << endl;
|
||||||
|
|
||||||
QString clean_targets = "compiler_clean " + var("CLEAN_DEPS");
|
QString clean_targets = " compiler_clean " + depVar("CLEAN_DEPS");
|
||||||
if(do_incremental) {
|
if(do_incremental) {
|
||||||
t << "incrclean:\n";
|
t << "incrclean:\n";
|
||||||
if(src_incremental)
|
if(src_incremental)
|
||||||
@ -993,26 +1023,27 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
|
|||||||
precomp_files += precomph_out_dir + header_prefix + "objective-c++" + header_suffix;
|
precomp_files += precomph_out_dir + header_prefix + "objective-c++" + header_suffix;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
t << "-$(DEL_FILE) " << precomp_files.join(' ') << "\n\t";
|
t << "-$(DEL_FILE) " << escapeFilePaths(precomp_files).join(' ') << "\n\t";
|
||||||
}
|
}
|
||||||
if(src_incremental)
|
if(src_incremental)
|
||||||
t << "-$(DEL_FILE) $(INCREMENTAL_OBJECTS)\n\t";
|
t << "-$(DEL_FILE) $(INCREMENTAL_OBJECTS)\n\t";
|
||||||
t << varGlue("QMAKE_CLEAN","-$(DEL_FILE) "," ","\n\t")
|
t << fileVarGlue("QMAKE_CLEAN","-$(DEL_FILE) "," ","\n\t")
|
||||||
<< "-$(DEL_FILE) *~ core *.core\n"
|
<< "-$(DEL_FILE) *~ core *.core\n"
|
||||||
<< varGlue("CLEAN_FILES","\t-$(DEL_FILE) "," ","") << endl << endl;
|
<< fileVarGlue("CLEAN_FILES","\t-$(DEL_FILE) "," ","") << endl << endl;
|
||||||
|
|
||||||
ProString destdir = project->first("DESTDIR");
|
ProString destdir = project->first("DESTDIR");
|
||||||
if (!destdir.isEmpty() && !destdir.endsWith(Option::dir_sep))
|
if (!destdir.isEmpty() && !destdir.endsWith(Option::dir_sep))
|
||||||
destdir += Option::dir_sep;
|
destdir += Option::dir_sep;
|
||||||
t << "distclean: clean " << var("DISTCLEAN_DEPS") << '\n';
|
t << "distclean: clean " << depVar("DISTCLEAN_DEPS") << '\n';
|
||||||
if(!project->isEmpty("QMAKE_BUNDLE")) {
|
if(!project->isEmpty("QMAKE_BUNDLE")) {
|
||||||
QString bundlePath = escapeFilePath(destdir + project->first("QMAKE_BUNDLE"));
|
QString bundlePath = escapeFilePath(destdir + project->first("QMAKE_BUNDLE"));
|
||||||
t << "\t-$(DEL_FILE) -r " << bundlePath << endl;
|
t << "\t-$(DEL_FILE) -r " << bundlePath << endl;
|
||||||
} else if(project->isActiveConfig("compile_libtool")) {
|
} else if(project->isActiveConfig("compile_libtool")) {
|
||||||
t << "\t-$(LIBTOOL) --mode=clean $(DEL_FILE) $(TARGET)\n";
|
t << "\t-$(LIBTOOL) --mode=clean $(DEL_FILE) $(TARGET)\n";
|
||||||
} else if (project->isActiveConfig("staticlib")) {
|
} else if (project->isActiveConfig("staticlib")) {
|
||||||
t << "\t-$(DEL_FILE) " << destdir << "$(TARGET) \n";
|
t << "\t-$(DEL_FILE) " << escapeFilePath(destdir) << "$(TARGET) \n";
|
||||||
} else if (project->values("QMAKE_APP_FLAG").isEmpty() && !project->isActiveConfig("plugin")) {
|
} else if (project->values("QMAKE_APP_FLAG").isEmpty() && !project->isActiveConfig("plugin")) {
|
||||||
|
destdir = escapeFilePath(destdir);
|
||||||
t << "\t-$(DEL_FILE) " << destdir << "$(TARGET) \n";
|
t << "\t-$(DEL_FILE) " << destdir << "$(TARGET) \n";
|
||||||
if (!project->isActiveConfig("unversioned_libname")) {
|
if (!project->isActiveConfig("unversioned_libname")) {
|
||||||
t << "\t-$(DEL_FILE) " << destdir << "$(TARGET0) " << destdir << "$(TARGET1) "
|
t << "\t-$(DEL_FILE) " << destdir << "$(TARGET0) " << destdir << "$(TARGET1) "
|
||||||
@ -1023,11 +1054,11 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
|
|||||||
} else {
|
} else {
|
||||||
t << "\t-$(DEL_FILE) $(TARGET) \n";
|
t << "\t-$(DEL_FILE) $(TARGET) \n";
|
||||||
}
|
}
|
||||||
t << varGlue("QMAKE_DISTCLEAN","\t-$(DEL_FILE) "," ","\n");
|
t << fileVarGlue("QMAKE_DISTCLEAN","\t-$(DEL_FILE) "," ","\n");
|
||||||
{
|
{
|
||||||
QString ofile = Option::fixPathToTargetOS(fileFixify(Option::output.fileName()));
|
QString ofile = Option::fixPathToTargetOS(fileFixify(Option::output.fileName()));
|
||||||
if(!ofile.isEmpty())
|
if(!ofile.isEmpty())
|
||||||
t << "\t-$(DEL_FILE) " << ofile << endl;
|
t << "\t-$(DEL_FILE) " << escapeFilePath(ofile) << endl;
|
||||||
}
|
}
|
||||||
t << endl << endl;
|
t << endl << endl;
|
||||||
|
|
||||||
@ -1038,8 +1069,8 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
|
|||||||
libdir = project->first("SUBLIBS_DIR");
|
libdir = project->first("SUBLIBS_DIR");
|
||||||
const ProStringList &l = project->values("SUBLIBS");
|
const ProStringList &l = project->values("SUBLIBS");
|
||||||
for (it = l.begin(); it != l.end(); ++it)
|
for (it = l.begin(); it != l.end(); ++it)
|
||||||
t << libdir << project->first("QMAKE_PREFIX_STATICLIB") << (*it) << "."
|
t << escapeDependencyPath(libdir + project->first("QMAKE_PREFIX_STATICLIB") + (*it) + '.'
|
||||||
<< project->first("QMAKE_EXTENSION_STATICLIB") << ":\n\t"
|
+ project->first("QMAKE_EXTENSION_STATICLIB")) << ":\n\t"
|
||||||
<< var(ProKey("MAKELIB" + *it)) << endl << endl;
|
<< var(ProKey("MAKELIB" + *it)) << endl << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1069,13 +1100,15 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
|
|||||||
if (project->isActiveConfig("icc_pch_style")) {
|
if (project->isActiveConfig("icc_pch_style")) {
|
||||||
// icc style
|
// icc style
|
||||||
QString sourceFile = pchOutput + Option::cpp_ext.first();
|
QString sourceFile = pchOutput + Option::cpp_ext.first();
|
||||||
|
QString sourceFile_f = escapeFilePath(sourceFile);
|
||||||
QString objectFile = createObjectList(ProStringList(sourceFile)).first().toQString();
|
QString objectFile = createObjectList(ProStringList(sourceFile)).first().toQString();
|
||||||
t << pchOutput << ": " << pchInput << " " << findDependencies(pchInput).join(" \\\n\t\t")
|
t << escapeDependencyPath(pchOutput) << ": " << escapeDependencyPath(pchInput) << ' '
|
||||||
<< "\n\techo \"// Automatically generated, do not modify\" > " << sourceFile
|
<< escapeDependencyPaths(findDependencies(pchInput)).join(" \\\n\t\t")
|
||||||
<< "\n\trm -f " << pchOutput;
|
<< "\n\techo \"// Automatically generated, do not modify\" > " << sourceFile_f
|
||||||
|
<< "\n\trm -f " << escapeFilePath(pchOutput);
|
||||||
|
|
||||||
pchFlags.replace("${QMAKE_PCH_TEMP_SOURCE}", sourceFile)
|
pchFlags.replace("${QMAKE_PCH_TEMP_SOURCE}", sourceFile_f)
|
||||||
.replace("${QMAKE_PCH_TEMP_OBJECT}", objectFile);
|
.replace("${QMAKE_PCH_TEMP_OBJECT}", escapeFilePath(objectFile));
|
||||||
} else {
|
} else {
|
||||||
// gcc style (including clang_pch_style)
|
// gcc style (including clang_pch_style)
|
||||||
ProString header_prefix = project->first("QMAKE_PRECOMP_PREFIX");
|
ProString header_prefix = project->first("QMAKE_PRECOMP_PREFIX");
|
||||||
@ -1098,12 +1131,13 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
|
|||||||
continue;
|
continue;
|
||||||
pchOutput += header_prefix + pchOutputFile + header_suffix;
|
pchOutput += header_prefix + pchOutputFile + header_suffix;
|
||||||
|
|
||||||
t << pchOutput << ": " << pchInput << " " << findDependencies(pchInput).join(" \\\n\t\t")
|
t << escapeDependencyPath(pchOutput) << ": " << escapeDependencyPath(pchInput) << ' '
|
||||||
|
<< escapeDependencyPaths(findDependencies(pchInput)).join(" \\\n\t\t")
|
||||||
<< "\n\t" << mkdir_p_asstring(pchOutputDir);
|
<< "\n\t" << mkdir_p_asstring(pchOutputDir);
|
||||||
}
|
}
|
||||||
pchFlags.replace("${QMAKE_PCH_INPUT}", pchInput)
|
pchFlags.replace("${QMAKE_PCH_INPUT}", escapeFilePath(pchInput))
|
||||||
.replace("${QMAKE_PCH_OUTPUT_BASE}", pchBaseName.toQString())
|
.replace("${QMAKE_PCH_OUTPUT_BASE}", escapeFilePath(pchBaseName.toQString()))
|
||||||
.replace("${QMAKE_PCH_OUTPUT}", pchOutput.toQString());
|
.replace("${QMAKE_PCH_OUTPUT}", escapeFilePath(pchOutput.toQString()));
|
||||||
|
|
||||||
QString compiler;
|
QString compiler;
|
||||||
if(comps[i] == "C" || comps[i] == "OBJC" || comps[i] == "OBJCXX")
|
if(comps[i] == "C" || comps[i] == "OBJC" || comps[i] == "OBJCXX")
|
||||||
@ -1166,11 +1200,11 @@ void UnixMakefileGenerator::init2()
|
|||||||
if(!bundle_loc.endsWith("/"))
|
if(!bundle_loc.endsWith("/"))
|
||||||
bundle_loc += "/";
|
bundle_loc += "/";
|
||||||
project->values("TARGET_").append(project->first("QMAKE_BUNDLE") +
|
project->values("TARGET_").append(project->first("QMAKE_BUNDLE") +
|
||||||
bundle_loc + unescapeFilePath(project->first("TARGET")));
|
bundle_loc + project->first("TARGET"));
|
||||||
project->values("TARGET_x.y").append(project->first("QMAKE_BUNDLE") +
|
project->values("TARGET_x.y").append(project->first("QMAKE_BUNDLE") +
|
||||||
"/Versions/" +
|
"/Versions/" +
|
||||||
project->first("QMAKE_FRAMEWORK_VERSION") +
|
project->first("QMAKE_FRAMEWORK_VERSION") +
|
||||||
bundle_loc + unescapeFilePath(project->first("TARGET")));
|
bundle_loc + project->first("TARGET"));
|
||||||
} else if(project->isActiveConfig("plugin")) {
|
} else if(project->isActiveConfig("plugin")) {
|
||||||
QString prefix;
|
QString prefix;
|
||||||
if(!project->isActiveConfig("no_plugin_name_prefix"))
|
if(!project->isActiveConfig("no_plugin_name_prefix"))
|
||||||
@ -1388,22 +1422,23 @@ UnixMakefileGenerator::writeLibtoolFile()
|
|||||||
t << "\n";
|
t << "\n";
|
||||||
|
|
||||||
t << "# The name that we can dlopen(3).\n"
|
t << "# The name that we can dlopen(3).\n"
|
||||||
<< "dlname='" << var(project->isActiveConfig("plugin") ? "TARGET" : "TARGET_x")
|
<< "dlname='" << fileVar(project->isActiveConfig("plugin") ? "TARGET" : "TARGET_x")
|
||||||
<< "'\n\n";
|
<< "'\n\n";
|
||||||
|
|
||||||
t << "# Names of this library.\n";
|
t << "# Names of this library.\n";
|
||||||
t << "library_names='";
|
t << "library_names='";
|
||||||
if(project->isActiveConfig("plugin")) {
|
if(project->isActiveConfig("plugin")) {
|
||||||
t << var("TARGET");
|
t << fileVar("TARGET");
|
||||||
} else {
|
} else {
|
||||||
if (project->isEmpty("QMAKE_HPUX_SHLIB"))
|
if (project->isEmpty("QMAKE_HPUX_SHLIB"))
|
||||||
t << var("TARGET_x.y.z") << " ";
|
t << fileVar("TARGET_x.y.z") << ' ';
|
||||||
t << var("TARGET_x") << " " << var("TARGET_");
|
t << fileVar("TARGET_x") << ' ' << fileVar("TARGET_");
|
||||||
}
|
}
|
||||||
t << "'\n\n";
|
t << "'\n\n";
|
||||||
|
|
||||||
t << "# The name of the static archive.\n"
|
t << "# The name of the static archive.\n"
|
||||||
<< "old_library='" << lname.left(lname.length()-Option::libtool_ext.length()) << ".a'\n\n";
|
<< "old_library='" << escapeFilePath(lname.left(lname.length()-Option::libtool_ext.length()))
|
||||||
|
<< ".a'\n\n";
|
||||||
|
|
||||||
t << "# Libraries that this one depends upon.\n";
|
t << "# Libraries that this one depends upon.\n";
|
||||||
ProStringList libs;
|
ProStringList libs;
|
||||||
@ -1413,7 +1448,7 @@ UnixMakefileGenerator::writeLibtoolFile()
|
|||||||
libs << "QMAKE_LIBS"; //obvious one
|
libs << "QMAKE_LIBS"; //obvious one
|
||||||
t << "dependency_libs='";
|
t << "dependency_libs='";
|
||||||
for (ProStringList::ConstIterator it = libs.begin(); it != libs.end(); ++it)
|
for (ProStringList::ConstIterator it = libs.begin(); it != libs.end(); ++it)
|
||||||
t << project->values((*it).toKey()).join(' ') << " ";
|
t << fixLibFlags((*it).toKey()).join(' ') << ' ';
|
||||||
t << "'\n\n";
|
t << "'\n\n";
|
||||||
|
|
||||||
t << "# Version information for " << lname << "\n";
|
t << "# Version information for " << lname << "\n";
|
||||||
|
@ -46,17 +46,12 @@ QT_BEGIN_NAMESPACE
|
|||||||
|
|
||||||
MingwMakefileGenerator::MingwMakefileGenerator() : Win32MakefileGenerator()
|
MingwMakefileGenerator::MingwMakefileGenerator() : Win32MakefileGenerator()
|
||||||
{
|
{
|
||||||
if (isWindowsShell())
|
|
||||||
quote = "\"";
|
|
||||||
else
|
|
||||||
quote = "'";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QString MingwMakefileGenerator::escapeDependencyPath(const QString &path) const
|
QString MingwMakefileGenerator::escapeDependencyPath(const QString &path) const
|
||||||
{
|
{
|
||||||
QString ret = path;
|
QString ret = path;
|
||||||
ret.remove('\"');
|
ret.replace('\\', "/"); // ### this shouldn't be here
|
||||||
ret.replace('\\', "/");
|
|
||||||
ret.replace(' ', "\\ ");
|
ret.replace(' ', "\\ ");
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
@ -71,6 +66,13 @@ QString MingwMakefileGenerator::getManifestFileForRcFile() const
|
|||||||
return project->first("QMAKE_MANIFEST").toQString();
|
return project->first("QMAKE_MANIFEST").toQString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ProString MingwMakefileGenerator::fixLibFlag(const ProString &lib)
|
||||||
|
{
|
||||||
|
if (lib.startsWith("lib"))
|
||||||
|
return QStringLiteral("-l") + escapeFilePath(lib.mid(3));
|
||||||
|
return escapeFilePath(lib);
|
||||||
|
}
|
||||||
|
|
||||||
bool MingwMakefileGenerator::findLibraries()
|
bool MingwMakefileGenerator::findLibraries()
|
||||||
{
|
{
|
||||||
QList<QMakeLocalFileName> dirs;
|
QList<QMakeLocalFileName> dirs;
|
||||||
@ -99,7 +101,9 @@ bool MingwMakefileGenerator::findLibraries()
|
|||||||
if (!out.isEmpty()) // We assume if it never finds it that its correct
|
if (!out.isEmpty()) // We assume if it never finds it that its correct
|
||||||
(*it) = out;
|
(*it) = out;
|
||||||
} else if ((*it).startsWith("-L")) {
|
} else if ((*it).startsWith("-L")) {
|
||||||
dirs.append(QMakeLocalFileName((*it).mid(2).toQString()));
|
QMakeLocalFileName f((*it).mid(2).toQString());
|
||||||
|
dirs.append(f);
|
||||||
|
*it = "-L" + f.real();
|
||||||
}
|
}
|
||||||
|
|
||||||
++it;
|
++it;
|
||||||
@ -124,7 +128,7 @@ bool MingwMakefileGenerator::writeMakefile(QTextStream &t)
|
|||||||
t << "QMAKE = " << var("QMAKE_QMAKE") << endl;
|
t << "QMAKE = " << var("QMAKE_QMAKE") << endl;
|
||||||
const ProStringList &qut = project->values("QMAKE_EXTRA_TARGETS");
|
const ProStringList &qut = project->values("QMAKE_EXTRA_TARGETS");
|
||||||
for (ProStringList::ConstIterator it = qut.begin(); it != qut.end(); ++it)
|
for (ProStringList::ConstIterator it = qut.begin(); it != qut.end(); ++it)
|
||||||
t << *it << " ";
|
t << escapeDependencyPath(*it) << ' ';
|
||||||
t << "first all clean install distclean uninstall: qmake\n"
|
t << "first all clean install distclean uninstall: qmake\n"
|
||||||
<< "qmake_all:\n";
|
<< "qmake_all:\n";
|
||||||
writeMakeQmake(t);
|
writeMakeQmake(t);
|
||||||
@ -150,6 +154,7 @@ void createLdObjectScriptFile(const QString &fileName, const ProStringList &objL
|
|||||||
t << "INPUT(\n";
|
t << "INPUT(\n";
|
||||||
for (ProStringList::ConstIterator it = objList.constBegin(); it != objList.constEnd(); ++it) {
|
for (ProStringList::ConstIterator it = objList.constBegin(); it != objList.constEnd(); ++it) {
|
||||||
QString path = (*it).toQString();
|
QString path = (*it).toQString();
|
||||||
|
// ### quoting?
|
||||||
if (QDir::isRelativePath(path))
|
if (QDir::isRelativePath(path))
|
||||||
t << "./" << path << endl;
|
t << "./" << path << endl;
|
||||||
else
|
else
|
||||||
@ -167,6 +172,7 @@ void createArObjectScriptFile(const QString &fileName, const QString &target, co
|
|||||||
QFile file(filePath);
|
QFile file(filePath);
|
||||||
if (file.open(QIODevice::WriteOnly | QIODevice::Text)) {
|
if (file.open(QIODevice::WriteOnly | QIODevice::Text)) {
|
||||||
QTextStream t(&file);
|
QTextStream t(&file);
|
||||||
|
// ### quoting?
|
||||||
t << "CREATE " << target << endl;
|
t << "CREATE " << target << endl;
|
||||||
for (ProStringList::ConstIterator it = objList.constBegin(); it != objList.constEnd(); ++it) {
|
for (ProStringList::ConstIterator it = objList.constBegin(); it != objList.constEnd(); ++it) {
|
||||||
t << "ADDMOD " << *it << endl;
|
t << "ADDMOD " << *it << endl;
|
||||||
@ -185,6 +191,7 @@ void createRvctObjectScriptFile(const QString &fileName, const ProStringList &ob
|
|||||||
QTextStream t(&file);
|
QTextStream t(&file);
|
||||||
for (ProStringList::ConstIterator it = objList.constBegin(); it != objList.constEnd(); ++it) {
|
for (ProStringList::ConstIterator it = objList.constBegin(); it != objList.constEnd(); ++it) {
|
||||||
QString path = (*it).toQString();
|
QString path = (*it).toQString();
|
||||||
|
// ### quoting?
|
||||||
if (QDir::isRelativePath(path))
|
if (QDir::isRelativePath(path))
|
||||||
t << "./" << path << endl;
|
t << "./" << path << endl;
|
||||||
else
|
else
|
||||||
@ -205,14 +212,14 @@ void MingwMakefileGenerator::writeMingwParts(QTextStream &t)
|
|||||||
t << escapeDependencyPath(cHeader) << ": " << escapeDependencyPath(header) << " "
|
t << escapeDependencyPath(cHeader) << ": " << escapeDependencyPath(header) << " "
|
||||||
<< escapeDependencyPaths(findDependencies(header)).join(" \\\n\t\t")
|
<< escapeDependencyPaths(findDependencies(header)).join(" \\\n\t\t")
|
||||||
<< "\n\t" << mkdir_p_asstring(preCompHeaderOut)
|
<< "\n\t" << mkdir_p_asstring(preCompHeaderOut)
|
||||||
<< "\n\t$(CC) -x c-header -c $(CFLAGS) $(INCPATH) -o " << cHeader << " " << header
|
<< "\n\t$(CC) -x c-header -c $(CFLAGS) $(INCPATH) -o " << escapeFilePath(cHeader)
|
||||||
<< endl << endl;
|
<< ' ' << escapeFilePath(header) << endl << endl;
|
||||||
QString cppHeader = preCompHeaderOut + Option::dir_sep + "c++";
|
QString cppHeader = preCompHeaderOut + Option::dir_sep + "c++";
|
||||||
t << escapeDependencyPath(cppHeader) << ": " << escapeDependencyPath(header) << " "
|
t << escapeDependencyPath(cppHeader) << ": " << escapeDependencyPath(header) << " "
|
||||||
<< escapeDependencyPaths(findDependencies(header)).join(" \\\n\t\t")
|
<< escapeDependencyPaths(findDependencies(header)).join(" \\\n\t\t")
|
||||||
<< "\n\t" << mkdir_p_asstring(preCompHeaderOut)
|
<< "\n\t" << mkdir_p_asstring(preCompHeaderOut)
|
||||||
<< "\n\t$(CXX) -x c++-header -c $(CXXFLAGS) $(INCPATH) -o " << cppHeader << " " << header
|
<< "\n\t$(CXX) -x c++-header -c $(CXXFLAGS) $(INCPATH) -o " << escapeFilePath(cppHeader)
|
||||||
<< endl << endl;
|
<< ' ' << escapeFilePath(header) << endl << endl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -246,9 +253,7 @@ void MingwMakefileGenerator::init()
|
|||||||
|
|
||||||
processVars();
|
processVars();
|
||||||
|
|
||||||
if (!project->values("RES_FILE").isEmpty()) {
|
project->values("QMAKE_LIBS") += project->values("RES_FILE");
|
||||||
project->values("QMAKE_LIBS") += escapeFilePaths(project->values("RES_FILE"));
|
|
||||||
}
|
|
||||||
|
|
||||||
if (project->isActiveConfig("dll")) {
|
if (project->isActiveConfig("dll")) {
|
||||||
QString destDir = "";
|
QString destDir = "";
|
||||||
@ -256,7 +261,7 @@ void MingwMakefileGenerator::init()
|
|||||||
destDir = Option::fixPathToTargetOS(project->first("DESTDIR") + Option::dir_sep, false, false);
|
destDir = Option::fixPathToTargetOS(project->first("DESTDIR") + Option::dir_sep, false, false);
|
||||||
project->values("MINGW_IMPORT_LIB").prepend(destDir + "lib" + project->first("TARGET")
|
project->values("MINGW_IMPORT_LIB").prepend(destDir + "lib" + project->first("TARGET")
|
||||||
+ project->first("TARGET_VERSION_EXT") + ".a");
|
+ project->first("TARGET_VERSION_EXT") + ".a");
|
||||||
project->values("QMAKE_LFLAGS").append(QString("-Wl,--out-implib,") + project->first("MINGW_IMPORT_LIB"));
|
project->values("QMAKE_LFLAGS").append(QString("-Wl,--out-implib,") + fileVar("MINGW_IMPORT_LIB"));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!project->values("DEF_FILE").isEmpty()) {
|
if (!project->values("DEF_FILE").isEmpty()) {
|
||||||
@ -278,6 +283,7 @@ void MingwMakefileGenerator::init()
|
|||||||
project->values("QMAKE_CLEAN").append(preCompHeaderOut + Option::dir_sep + "c");
|
project->values("QMAKE_CLEAN").append(preCompHeaderOut + Option::dir_sep + "c");
|
||||||
project->values("QMAKE_CLEAN").append(preCompHeaderOut + Option::dir_sep + "c++");
|
project->values("QMAKE_CLEAN").append(preCompHeaderOut + Option::dir_sep + "c++");
|
||||||
|
|
||||||
|
preCompHeader = escapeFilePath(preCompHeader);
|
||||||
project->values("QMAKE_RUN_CC").clear();
|
project->values("QMAKE_RUN_CC").clear();
|
||||||
project->values("QMAKE_RUN_CC").append("$(CC) -c -include " + preCompHeader +
|
project->values("QMAKE_RUN_CC").append("$(CC) -c -include " + preCompHeader +
|
||||||
" $(CFLAGS) $(INCPATH) " + var("QMAKE_CC_O_FLAG") + "$obj $src");
|
" $(CFLAGS) $(INCPATH) " + var("QMAKE_CC_O_FLAG") + "$obj $src");
|
||||||
@ -306,13 +312,12 @@ void MingwMakefileGenerator::writeIncPart(QTextStream &t)
|
|||||||
for (ProStringList::ConstIterator incit = incs.begin(); incit != incs.end(); ++incit) {
|
for (ProStringList::ConstIterator incit = incs.begin(); incit != incs.end(); ++incit) {
|
||||||
QString inc = (*incit).toQString();
|
QString inc = (*incit).toQString();
|
||||||
inc.replace(QRegExp("\\\\$"), "");
|
inc.replace(QRegExp("\\\\$"), "");
|
||||||
inc.replace(QRegExp("\""), "");
|
|
||||||
|
|
||||||
if (!isystem.isEmpty() && isSystemInclude(inc))
|
if (!isystem.isEmpty() && isSystemInclude(inc))
|
||||||
t << isystem << ' ';
|
t << isystem << ' ';
|
||||||
else
|
else
|
||||||
t << "-I";
|
t << "-I";
|
||||||
t << quote << inc << quote << " ";
|
t << escapeFilePath(inc) << ' ';
|
||||||
}
|
}
|
||||||
t << endl;
|
t << endl;
|
||||||
}
|
}
|
||||||
@ -325,8 +330,8 @@ void MingwMakefileGenerator::writeLibsPart(QTextStream &t)
|
|||||||
t << "LINKER = " << var("QMAKE_LINK") << endl;
|
t << "LINKER = " << var("QMAKE_LINK") << endl;
|
||||||
t << "LFLAGS = " << var("QMAKE_LFLAGS") << endl;
|
t << "LFLAGS = " << var("QMAKE_LFLAGS") << endl;
|
||||||
t << "LIBS = "
|
t << "LIBS = "
|
||||||
<< var("QMAKE_LIBS").replace(QRegExp("(\\slib|^lib)")," -l") << ' '
|
<< fixLibFlags("QMAKE_LIBS").join(' ') << ' '
|
||||||
<< var("QMAKE_LIBS_PRIVATE").replace(QRegExp("(\\slib|^lib)")," -l") << endl;
|
<< fixLibFlags("QMAKE_LIBS_PRIVATE").join(' ') << endl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -345,7 +350,7 @@ void MingwMakefileGenerator::writeObjectsPart(QTextStream &t)
|
|||||||
QString ar_cmd = project->values("QMAKE_LIB").join(' ');
|
QString ar_cmd = project->values("QMAKE_LIB").join(' ');
|
||||||
if (ar_cmd.isEmpty())
|
if (ar_cmd.isEmpty())
|
||||||
ar_cmd = "armar --create";
|
ar_cmd = "armar --create";
|
||||||
objectsLinkLine = ar_cmd + " " + var("DEST_TARGET") + " --via " + escapeFilePath(ar_script_file);
|
objectsLinkLine = ar_cmd + ' ' + fileVar("DEST_TARGET") + " --via " + escapeFilePath(ar_script_file);
|
||||||
} else {
|
} else {
|
||||||
// Strip off any options since the ar commands will be read from file.
|
// Strip off any options since the ar commands will be read from file.
|
||||||
QString ar_cmd = var("QMAKE_LIB").section(" ", 0, 0);;
|
QString ar_cmd = var("QMAKE_LIB").section(" ", 0, 0);;
|
||||||
@ -373,8 +378,9 @@ void MingwMakefileGenerator::writeObjectsPart(QTextStream &t)
|
|||||||
void MingwMakefileGenerator::writeBuildRulesPart(QTextStream &t)
|
void MingwMakefileGenerator::writeBuildRulesPart(QTextStream &t)
|
||||||
{
|
{
|
||||||
t << "first: all\n";
|
t << "first: all\n";
|
||||||
t << "all: " << escapeDependencyPath(fileFixify(Option::output.fileName())) << " " << valGlue(escapeDependencyPaths(project->values("ALL_DEPS"))," "," "," ") << " $(DESTDIR_TARGET)\n\n";
|
t << "all: " << escapeDependencyPath(fileFixify(Option::output.fileName()))
|
||||||
t << "$(DESTDIR_TARGET): " << var("PRE_TARGETDEPS") << " $(OBJECTS) " << var("POST_TARGETDEPS");
|
<< ' ' << depVar("ALL_DEPS") << " $(DESTDIR_TARGET)\n\n";
|
||||||
|
t << "$(DESTDIR_TARGET): " << depVar("PRE_TARGETDEPS") << " $(OBJECTS) " << depVar("POST_TARGETDEPS");
|
||||||
if(!project->isEmpty("QMAKE_PRE_LINK"))
|
if(!project->isEmpty("QMAKE_PRE_LINK"))
|
||||||
t << "\n\t" <<var("QMAKE_PRE_LINK");
|
t << "\n\t" <<var("QMAKE_PRE_LINK");
|
||||||
if(project->isActiveConfig("staticlib") && project->first("TEMPLATE") == "lib") {
|
if(project->isActiveConfig("staticlib") && project->first("TEMPLATE") == "lib") {
|
||||||
@ -409,8 +415,8 @@ void MingwMakefileGenerator::writeRcFilePart(QTextStream &t)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!rc_file.isEmpty()) {
|
if (!rc_file.isEmpty()) {
|
||||||
t << escapeDependencyPath(var("RES_FILE")) << ": " << rc_file << "\n\t"
|
t << escapeDependencyPath(var("RES_FILE")) << ": " << escapeDependencyPath(rc_file) << "\n\t"
|
||||||
<< var("QMAKE_RC") << " -i " << rc_file << " -o " << var("RES_FILE")
|
<< var("QMAKE_RC") << " -i " << escapeFilePath(rc_file) << " -o " << fileVar("RES_FILE")
|
||||||
<< incPathStr << " $(DEFINES)\n\n";
|
<< incPathStr << " $(DEFINES)\n\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -45,6 +45,8 @@ public:
|
|||||||
~MingwMakefileGenerator();
|
~MingwMakefileGenerator();
|
||||||
protected:
|
protected:
|
||||||
QString escapeDependencyPath(const QString &path) const;
|
QString escapeDependencyPath(const QString &path) const;
|
||||||
|
ProString escapeDependencyPath(const ProString &path) const { return MakefileGenerator::escapeDependencyPath(path); }
|
||||||
|
virtual ProString fixLibFlag(const ProString &lib);
|
||||||
QString getLibTarget();
|
QString getLibTarget();
|
||||||
virtual QString getManifestFileForRcFile() const;
|
virtual QString getManifestFileForRcFile() const;
|
||||||
bool writeMakefile(QTextStream &);
|
bool writeMakefile(QTextStream &);
|
||||||
@ -64,7 +66,6 @@ private:
|
|||||||
virtual bool findLibraries();
|
virtual bool findLibraries();
|
||||||
|
|
||||||
QString objectsLinkLine;
|
QString objectsLinkLine;
|
||||||
QString quote;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
inline MingwMakefileGenerator::~MingwMakefileGenerator()
|
inline MingwMakefileGenerator::~MingwMakefileGenerator()
|
||||||
|
@ -260,15 +260,14 @@ QString NmakeMakefileGenerator::defaultInstall(const QString &t)
|
|||||||
if (project->isActiveConfig("debug_info")) {
|
if (project->isActiveConfig("debug_info")) {
|
||||||
if (t == "dlltarget" || project->values(ProKey(t + ".CONFIG")).indexOf("no_dll") == -1) {
|
if (t == "dlltarget" || project->values(ProKey(t + ".CONFIG")).indexOf("no_dll") == -1) {
|
||||||
QString pdb_target = getPdbTarget();
|
QString pdb_target = getPdbTarget();
|
||||||
pdb_target.remove('"');
|
|
||||||
QString src_targ = (project->isEmpty("DESTDIR") ? QString("$(DESTDIR)") : project->first("DESTDIR")) + pdb_target;
|
QString src_targ = (project->isEmpty("DESTDIR") ? QString("$(DESTDIR)") : project->first("DESTDIR")) + pdb_target;
|
||||||
QString dst_targ = filePrefixRoot(root, fileFixify(targetdir + pdb_target, FileFixifyAbsolute));
|
QString dst_targ = filePrefixRoot(root, fileFixify(targetdir + pdb_target, FileFixifyAbsolute));
|
||||||
if(!ret.isEmpty())
|
if(!ret.isEmpty())
|
||||||
ret += "\n\t";
|
ret += "\n\t";
|
||||||
ret += QString("-$(INSTALL_FILE)") + " \"" + src_targ + "\" \"" + dst_targ + "\"";
|
ret += QString("-$(INSTALL_FILE) ") + escapeFilePath(src_targ) + ' ' + escapeFilePath(dst_targ);
|
||||||
if(!uninst.isEmpty())
|
if(!uninst.isEmpty())
|
||||||
uninst.append("\n\t");
|
uninst.append("\n\t");
|
||||||
uninst.append("-$(DEL_FILE) \"" + dst_targ + "\"");
|
uninst.append("-$(DEL_FILE) " + escapeFilePath(dst_targ));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -294,9 +293,12 @@ void NmakeMakefileGenerator::writeNmakeParts(QTextStream &t)
|
|||||||
|
|
||||||
// precompiled header
|
// precompiled header
|
||||||
if(usePCH) {
|
if(usePCH) {
|
||||||
QString precompRule = QString("-c -Yc -Fp%1 -Fo%2").arg(precompPch).arg(precompObj);
|
QString precompRule = QString("-c -Yc -Fp%1 -Fo%2")
|
||||||
t << precompObj << ": " << precompH << " " << escapeDependencyPaths(findDependencies(precompH)).join(" \\\n\t\t")
|
.arg(escapeFilePath(precompPch), escapeFilePath(precompObj));
|
||||||
<< "\n\t$(CXX) " + precompRule +" $(CXXFLAGS) $(INCPATH) -TP " << precompH << endl << endl;
|
t << escapeDependencyPath(precompObj) << ": " << escapeDependencyPath(precompH) << ' '
|
||||||
|
<< escapeDependencyPaths(findDependencies(precompH)).join(" \\\n\t\t")
|
||||||
|
<< "\n\t$(CXX) " + precompRule +" $(CXXFLAGS) $(INCPATH) -TP "
|
||||||
|
<< escapeFilePath(precompH) << endl << endl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -307,10 +309,9 @@ QString NmakeMakefileGenerator::var(const ProKey &value) const
|
|||||||
|| value == "QMAKE_RUN_CXX_IMP"
|
|| value == "QMAKE_RUN_CXX_IMP"
|
||||||
|| value == "QMAKE_RUN_CXX")) {
|
|| value == "QMAKE_RUN_CXX")) {
|
||||||
QFileInfo precompHInfo(fileInfo(precompH));
|
QFileInfo precompHInfo(fileInfo(precompH));
|
||||||
|
QString precompH_f = escapeFilePath(precompHInfo.fileName());
|
||||||
QString precompRule = QString("-c -FI%1 -Yu%2 -Fp%3")
|
QString precompRule = QString("-c -FI%1 -Yu%2 -Fp%3")
|
||||||
.arg(precompHInfo.fileName())
|
.arg(precompH_f, precompH_f, escapeFilePath(precompPch));
|
||||||
.arg(precompHInfo.fileName())
|
|
||||||
.arg(precompPch);
|
|
||||||
QString p = MakefileGenerator::var(value);
|
QString p = MakefileGenerator::var(value);
|
||||||
p.replace("-c", precompRule);
|
p.replace("-c", precompRule);
|
||||||
// Cannot use -Gm with -FI & -Yu, as this gives an
|
// Cannot use -Gm with -FI & -Yu, as this gives an
|
||||||
@ -357,9 +358,7 @@ void NmakeMakefileGenerator::init()
|
|||||||
|
|
||||||
processVars();
|
processVars();
|
||||||
|
|
||||||
if (!project->values("RES_FILE").isEmpty()) {
|
project->values("QMAKE_LIBS") += project->values("RES_FILE");
|
||||||
project->values("QMAKE_LIBS") += escapeFilePaths(project->values("RES_FILE"));
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!project->values("DEF_FILE").isEmpty()) {
|
if (!project->values("DEF_FILE").isEmpty()) {
|
||||||
QString defFileName = fileFixify(project->first("DEF_FILE").toQString());
|
QString defFileName = fileFixify(project->first("DEF_FILE").toQString());
|
||||||
@ -502,11 +501,15 @@ void NmakeMakefileGenerator::writeImplicitRulesPart(QTextStream &t)
|
|||||||
if (objDir == ".\\")
|
if (objDir == ".\\")
|
||||||
objDir = "";
|
objDir = "";
|
||||||
for(QStringList::Iterator cppit = Option::cpp_ext.begin(); cppit != Option::cpp_ext.end(); ++cppit)
|
for(QStringList::Iterator cppit = Option::cpp_ext.begin(); cppit != Option::cpp_ext.end(); ++cppit)
|
||||||
t << "{" << sourceDir << "}" << (*cppit) << "{" << objDir << "}" << Option::obj_ext << "::\n\t"
|
t << '{' << escapeDependencyPath(sourceDir) << '}' << (*cppit)
|
||||||
<< var("QMAKE_RUN_CXX_IMP_BATCH").replace(QRegExp("\\$@"), var("OBJECTS_DIR")) << endl << "\t$<\n<<\n\n";
|
<< '{' << escapeDependencyPath(objDir) << '}' << Option::obj_ext << "::\n\t"
|
||||||
|
<< var("QMAKE_RUN_CXX_IMP_BATCH").replace(QRegExp("\\$@"), fileVar("OBJECTS_DIR"))
|
||||||
|
<< "\n\t$<\n<<\n\n";
|
||||||
for(QStringList::Iterator cit = Option::c_ext.begin(); cit != Option::c_ext.end(); ++cit)
|
for(QStringList::Iterator cit = Option::c_ext.begin(); cit != Option::c_ext.end(); ++cit)
|
||||||
t << "{" << sourceDir << "}" << (*cit) << "{" << objDir << "}" << Option::obj_ext << "::\n\t"
|
t << '{' << escapeDependencyPath(sourceDir) << '}' << (*cit)
|
||||||
<< var("QMAKE_RUN_CC_IMP_BATCH").replace(QRegExp("\\$@"), var("OBJECTS_DIR")) << endl << "\t$<\n<<\n\n";
|
<< '{' << escapeDependencyPath(objDir) << '}' << Option::obj_ext << "::\n\t"
|
||||||
|
<< var("QMAKE_RUN_CC_IMP_BATCH").replace(QRegExp("\\$@"), fileVar("OBJECTS_DIR"))
|
||||||
|
<< "\n\t$<\n<<\n\n";
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
for(QStringList::Iterator cppit = Option::cpp_ext.begin(); cppit != Option::cpp_ext.end(); ++cppit)
|
for(QStringList::Iterator cppit = Option::cpp_ext.begin(); cppit != Option::cpp_ext.end(); ++cppit)
|
||||||
@ -522,8 +525,9 @@ void NmakeMakefileGenerator::writeBuildRulesPart(QTextStream &t)
|
|||||||
const ProString templateName = project->first("TEMPLATE");
|
const ProString templateName = project->first("TEMPLATE");
|
||||||
|
|
||||||
t << "first: all\n";
|
t << "first: all\n";
|
||||||
t << "all: " << fileFixify(Option::output.fileName()) << " " << varGlue("ALL_DEPS"," "," "," ") << "$(DESTDIR_TARGET)\n\n";
|
t << "all: " << escapeDependencyPath(fileFixify(Option::output.fileName()))
|
||||||
t << "$(DESTDIR_TARGET): " << var("PRE_TARGETDEPS") << " $(OBJECTS) " << var("POST_TARGETDEPS");
|
<< ' ' << depVar("ALL_DEPS") << " $(DESTDIR_TARGET)\n\n";
|
||||||
|
t << "$(DESTDIR_TARGET): " << depVar("PRE_TARGETDEPS") << " $(OBJECTS) " << depVar("POST_TARGETDEPS");
|
||||||
|
|
||||||
if(!project->isEmpty("QMAKE_PRE_LINK"))
|
if(!project->isEmpty("QMAKE_PRE_LINK"))
|
||||||
t << "\n\t" <<var("QMAKE_PRE_LINK");
|
t << "\n\t" <<var("QMAKE_PRE_LINK");
|
||||||
@ -547,12 +551,12 @@ void NmakeMakefileGenerator::writeBuildRulesPart(QTextStream &t)
|
|||||||
if (linkerSupportsEmbedding) {
|
if (linkerSupportsEmbedding) {
|
||||||
extraLFlags = "/MANIFEST:embed";
|
extraLFlags = "/MANIFEST:embed";
|
||||||
} else {
|
} else {
|
||||||
manifest = escapeFilePath(target + ".embed.manifest");
|
manifest = target + ".embed.manifest";
|
||||||
extraLFlags += "/MANIFEST /MANIFESTFILE:" + manifest;
|
extraLFlags += "/MANIFEST /MANIFESTFILE:" + escapeFilePath(manifest);
|
||||||
project->values("QMAKE_CLEAN") << manifest;
|
project->values("QMAKE_CLEAN") << manifest;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
manifest = escapeFilePath(fileFixify(manifest));
|
manifest = fileFixify(manifest);
|
||||||
}
|
}
|
||||||
|
|
||||||
const QString resourceId = (templateName == "app") ? "1" : "2";
|
const QString resourceId = (templateName == "app") ? "1" : "2";
|
||||||
@ -560,16 +564,19 @@ void NmakeMakefileGenerator::writeBuildRulesPart(QTextStream &t)
|
|||||||
if (incrementalLinking && !linkerSupportsEmbedding) {
|
if (incrementalLinking && !linkerSupportsEmbedding) {
|
||||||
// Link a resource that contains the manifest without modifying the exe/dll after linking.
|
// Link a resource that contains the manifest without modifying the exe/dll after linking.
|
||||||
|
|
||||||
QString manifest_rc = escapeFilePath(target + "_manifest.rc");
|
QString manifest_rc = target + "_manifest.rc";
|
||||||
QString manifest_res = escapeFilePath(target + "_manifest.res");
|
QString manifest_res = target + "_manifest.res";
|
||||||
QString manifest_bak = escapeFilePath(target + "_manifest.bak");
|
|
||||||
project->values("QMAKE_CLEAN") << manifest_rc << manifest_res;
|
project->values("QMAKE_CLEAN") << manifest_rc << manifest_res;
|
||||||
|
manifest_rc = escapeFilePath(manifest_rc);
|
||||||
|
manifest_res = escapeFilePath(manifest_res);
|
||||||
|
|
||||||
t << "\n\techo " << resourceId
|
t << "\n\techo " << resourceId
|
||||||
<< " /* CREATEPROCESS_MANIFEST_RESOURCE_ID */ 24 /* RT_MANIFEST */ "
|
<< " /* CREATEPROCESS_MANIFEST_RESOURCE_ID */ 24 /* RT_MANIFEST */ "
|
||||||
<< cQuoted(unescapeFilePath(manifest)) << ">" << manifest_rc;
|
<< cQuoted(manifest) << '>' << manifest_rc;
|
||||||
|
|
||||||
if (generateManifest) {
|
if (generateManifest) {
|
||||||
|
manifest = escapeFilePath(manifest);
|
||||||
|
QString manifest_bak = escapeFilePath(target + "_manifest.bak");
|
||||||
t << "\n\tif not exist $(DESTDIR_TARGET) if exist " << manifest
|
t << "\n\tif not exist $(DESTDIR_TARGET) if exist " << manifest
|
||||||
<< " del " << manifest;
|
<< " del " << manifest;
|
||||||
t << "\n\tif exist " << manifest << " copy /Y " << manifest << ' ' << manifest_bak;
|
t << "\n\tif exist " << manifest << " copy /Y " << manifest << ' ' << manifest_bak;
|
||||||
@ -591,7 +598,7 @@ void NmakeMakefileGenerator::writeBuildRulesPart(QTextStream &t)
|
|||||||
t << "\n\t";
|
t << "\n\t";
|
||||||
writeLinkCommand(t, extraLFlags);
|
writeLinkCommand(t, extraLFlags);
|
||||||
if (!linkerSupportsEmbedding) {
|
if (!linkerSupportsEmbedding) {
|
||||||
t << "\n\tmt.exe /nologo /manifest " << manifest
|
t << "\n\tmt.exe /nologo /manifest " << escapeFilePath(manifest)
|
||||||
<< " /outputresource:$(DESTDIR_TARGET);" << resourceId;
|
<< " /outputresource:$(DESTDIR_TARGET);" << resourceId;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -604,7 +611,7 @@ void NmakeMakefileGenerator::writeBuildRulesPart(QTextStream &t)
|
|||||||
bool useSignature = !signature.isEmpty() && !project->isActiveConfig("staticlib") &&
|
bool useSignature = !signature.isEmpty() && !project->isActiveConfig("staticlib") &&
|
||||||
!project->isEmpty("CE_SDK") && !project->isEmpty("CE_ARCH");
|
!project->isEmpty("CE_SDK") && !project->isEmpty("CE_ARCH");
|
||||||
if(useSignature) {
|
if(useSignature) {
|
||||||
t << "\n\tsigntool sign /F " << signature << " $(DESTDIR_TARGET)";
|
t << "\n\tsigntool sign /F " << escapeFilePath(signature) << " $(DESTDIR_TARGET)";
|
||||||
}
|
}
|
||||||
if(!project->isEmpty("QMAKE_POST_LINK")) {
|
if(!project->isEmpty("QMAKE_POST_LINK")) {
|
||||||
t << "\n\t" << var("QMAKE_POST_LINK");
|
t << "\n\t" << var("QMAKE_POST_LINK");
|
||||||
|
@ -2363,10 +2363,9 @@ bool VCFilter::addExtraCompiler(const VCFilterFile &info)
|
|||||||
deps = inputs + deps; // input files themselves too..
|
deps = inputs + deps; // input files themselves too..
|
||||||
|
|
||||||
// Replace variables for command w/all input files
|
// Replace variables for command w/all input files
|
||||||
// ### join gives path issues with directories containing spaces!
|
|
||||||
cmd = Project->replaceExtraCompilerVariables(tmp_cmd,
|
cmd = Project->replaceExtraCompilerVariables(tmp_cmd,
|
||||||
inputs.join(' '),
|
inputs,
|
||||||
out,
|
QStringList(out),
|
||||||
MakefileGenerator::TargetShell);
|
MakefileGenerator::TargetShell);
|
||||||
} else {
|
} else {
|
||||||
deps.prepend(inFile); // input file itself too..
|
deps.prepend(inFile); // input file itself too..
|
||||||
@ -2385,9 +2384,6 @@ bool VCFilter::addExtraCompiler(const VCFilterFile &info)
|
|||||||
cmd_name = cmd.left(space);
|
cmd_name = cmd.left(space);
|
||||||
else
|
else
|
||||||
cmd_name = cmd;
|
cmd_name = cmd;
|
||||||
if ((cmd_name[0] == '\'' || cmd_name[0] == '"') &&
|
|
||||||
cmd_name[0] == cmd_name[cmd_name.length()-1])
|
|
||||||
cmd_name = cmd_name.mid(1,cmd_name.length()-2);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Fixify paths
|
// Fixify paths
|
||||||
|
@ -505,7 +505,7 @@ ProStringList VcprojGenerator::collectDependencies(QMakeProject *proj, QHash<QSt
|
|||||||
Option::qmake_mode = old_mode;
|
Option::qmake_mode = old_mode;
|
||||||
|
|
||||||
// We assume project filename is [QMAKE_PROJECT_NAME].vcproj
|
// We assume project filename is [QMAKE_PROJECT_NAME].vcproj
|
||||||
QString vcproj = unescapeFilePath(tmp_vcproj.project->first("QMAKE_PROJECT_NAME") + project->first("VCPROJ_EXTENSION"));
|
QString vcproj = tmp_vcproj.project->first("QMAKE_PROJECT_NAME") + project->first("VCPROJ_EXTENSION");
|
||||||
QString vcprojDir = qmake_getpwd();
|
QString vcprojDir = qmake_getpwd();
|
||||||
|
|
||||||
// If file doesn't exsist, then maybe the users configuration
|
// If file doesn't exsist, then maybe the users configuration
|
||||||
@ -535,7 +535,7 @@ ProStringList VcprojGenerator::collectDependencies(QMakeProject *proj, QHash<QSt
|
|||||||
|
|
||||||
VcsolutionDepend *newDep = new VcsolutionDepend;
|
VcsolutionDepend *newDep = new VcsolutionDepend;
|
||||||
newDep->vcprojFile = vcprojDir + Option::dir_sep + vcproj;
|
newDep->vcprojFile = vcprojDir + Option::dir_sep + vcproj;
|
||||||
newDep->orig_target = unescapeFilePath(tmp_proj.first("QMAKE_ORIG_TARGET")).toQString();
|
newDep->orig_target = tmp_proj.first("QMAKE_ORIG_TARGET").toQString();
|
||||||
newDep->target = tmp_proj.first("MSVCPROJ_TARGET").toQString().section(Option::dir_sep, -1);
|
newDep->target = tmp_proj.first("MSVCPROJ_TARGET").toQString().section(Option::dir_sep, -1);
|
||||||
newDep->targetType = tmp_vcproj.projectTarget;
|
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();
|
newDep->uuid = tmp_proj.isEmpty("QMAKE_UUID") ? getProjectUUID(Option::fixPathToLocalOS(vcprojDir + QDir::separator() + vcproj)).toString().toUpper(): tmp_proj.first("QMAKE_UUID").toQString();
|
||||||
@ -671,6 +671,7 @@ void VcprojGenerator::writeSubDirs(QTextStream &t)
|
|||||||
|
|
||||||
// write out projects
|
// write out projects
|
||||||
for (QList<VcsolutionDepend*>::Iterator it = solution_cleanup.begin(); it != solution_cleanup.end(); ++it) {
|
for (QList<VcsolutionDepend*>::Iterator it = solution_cleanup.begin(); it != solution_cleanup.end(); ++it) {
|
||||||
|
// ### quoting rules?
|
||||||
t << _slnProjectBeg << _slnMSVCvcprojGUID << _slnProjectMid
|
t << _slnProjectBeg << _slnMSVCvcprojGUID << _slnProjectMid
|
||||||
<< "\"" << (*it)->orig_target << "\", \"" << (*it)->vcprojFile
|
<< "\"" << (*it)->orig_target << "\", \"" << (*it)->vcprojFile
|
||||||
<< "\", \"" << (*it)->uuid << "\"";
|
<< "\", \"" << (*it)->uuid << "\"";
|
||||||
@ -799,9 +800,7 @@ void VcprojGenerator::init()
|
|||||||
const ProStringList &incs = project->values("INCLUDEPATH");
|
const ProStringList &incs = project->values("INCLUDEPATH");
|
||||||
for (ProStringList::ConstIterator incit = incs.begin(); incit != incs.end(); ++incit) {
|
for (ProStringList::ConstIterator incit = incs.begin(); incit != incs.end(); ++incit) {
|
||||||
QString inc = (*incit).toQString();
|
QString inc = (*incit).toQString();
|
||||||
if (!inc.startsWith('"') && !inc.endsWith('"'))
|
project->values("MSVCPROJ_INCPATH").append("-I" + escapeFilePath(inc));
|
||||||
inc = QString("\"%1\"").arg(inc); // Quote all paths if not quoted already
|
|
||||||
project->values("MSVCPROJ_INCPATH").append("-I" + inc);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QString dest = Option::fixPathToTargetOS(project->first("TARGET").toQString()) + project->first("TARGET_EXT");
|
QString dest = Option::fixPathToTargetOS(project->first("TARGET").toQString()) + project->first("TARGET_EXT");
|
||||||
@ -815,7 +814,7 @@ void VcprojGenerator::init()
|
|||||||
for (dlldir = dlldirs.begin(); dlldir != dlldirs.end(); ++dlldir) {
|
for (dlldir = dlldirs.begin(); dlldir != dlldirs.end(); ++dlldir) {
|
||||||
if (!copydll.isEmpty())
|
if (!copydll.isEmpty())
|
||||||
copydll += " && ";
|
copydll += " && ";
|
||||||
copydll += "copy \"$(TargetPath)\" \"" + *dlldir + "\"";
|
copydll += "copy \"$(TargetPath)\" " + escapeFilePath(*dlldir);
|
||||||
}
|
}
|
||||||
|
|
||||||
QString deststr("Copy " + dest + " to ");
|
QString deststr("Copy " + dest + " to ");
|
||||||
@ -842,8 +841,7 @@ void VcprojGenerator::init()
|
|||||||
projectTarget = Application;
|
projectTarget = Application;
|
||||||
} else if(project->first("TEMPLATE") == "vclib") {
|
} else if(project->first("TEMPLATE") == "vclib") {
|
||||||
if(project->isActiveConfig("staticlib")) {
|
if(project->isActiveConfig("staticlib")) {
|
||||||
if (!project->values("RES_FILE").isEmpty())
|
project->values("QMAKE_LIBS") += project->values("RES_FILE");
|
||||||
project->values("QMAKE_LIBS") += escapeFilePaths(project->values("RES_FILE"));
|
|
||||||
projectTarget = StaticLib;
|
projectTarget = StaticLib;
|
||||||
} else
|
} else
|
||||||
projectTarget = SharedLib;
|
projectTarget = SharedLib;
|
||||||
@ -856,7 +854,7 @@ void VcprojGenerator::init()
|
|||||||
if (usePCH) {
|
if (usePCH) {
|
||||||
precompHFilename = fileInfo(precompH).fileName();
|
precompHFilename = fileInfo(precompH).fileName();
|
||||||
// Created files
|
// Created files
|
||||||
QString origTarget = unescapeFilePath(project->first("QMAKE_ORIG_TARGET").toQString());
|
QString origTarget = project->first("QMAKE_ORIG_TARGET").toQString();
|
||||||
precompObj = origTarget + Option::obj_ext;
|
precompObj = origTarget + Option::obj_ext;
|
||||||
precompPch = origTarget + ".pch";
|
precompPch = origTarget + ".pch";
|
||||||
// Add PRECOMPILED_HEADER to HEADERS
|
// Add PRECOMPILED_HEADER to HEADERS
|
||||||
@ -947,7 +945,7 @@ void VcprojGenerator::initProject()
|
|||||||
initExtraCompilerOutputs();
|
initExtraCompilerOutputs();
|
||||||
|
|
||||||
// Own elements -----------------------------
|
// Own elements -----------------------------
|
||||||
vcProject.Name = unescapeFilePath(project->first("QMAKE_ORIG_TARGET").toQString());
|
vcProject.Name = project->first("QMAKE_ORIG_TARGET").toQString();
|
||||||
switch (which_dotnet_version(project->first("MSVC_VER").toLatin1())) {
|
switch (which_dotnet_version(project->first("MSVC_VER").toLatin1())) {
|
||||||
case NET2013:
|
case NET2013:
|
||||||
vcProject.Version = "12.00";
|
vcProject.Version = "12.00";
|
||||||
@ -1179,7 +1177,7 @@ void VcprojGenerator::initLinkerTool()
|
|||||||
ProStringList l = ProStringList(libs);
|
ProStringList l = ProStringList(libs);
|
||||||
conf.linker.parseOptions(l);
|
conf.linker.parseOptions(l);
|
||||||
} else {
|
} else {
|
||||||
conf.linker.AdditionalDependencies += libs.toQString();
|
conf.linker.AdditionalDependencies << escapeFilePath(libs.toQString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1239,7 +1237,7 @@ void VcprojGenerator::initPostBuildEventTools()
|
|||||||
!project->isHostBuild() && !project->isEmpty("CE_SDK") && !project->isEmpty("CE_ARCH");
|
!project->isHostBuild() && !project->isEmpty("CE_SDK") && !project->isEmpty("CE_ARCH");
|
||||||
if (useSignature) {
|
if (useSignature) {
|
||||||
conf.postBuild.CommandLine.prepend(
|
conf.postBuild.CommandLine.prepend(
|
||||||
QLatin1String("signtool sign /F ") + signature + QLatin1String(" \"$(TargetPath)\""));
|
QLatin1String("signtool sign /F ") + escapeFilePath(signature) + QLatin1String(" \"$(TargetPath)\""));
|
||||||
conf.postBuild.ExcludedFromBuild = _False;
|
conf.postBuild.ExcludedFromBuild = _False;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1682,7 +1680,7 @@ bool VcprojGenerator::openOutput(QFile &file, const QString &/*build*/) const
|
|||||||
ProString ext = project->first("VCPROJ_EXTENSION");
|
ProString ext = project->first("VCPROJ_EXTENSION");
|
||||||
if(project->first("TEMPLATE") == "vcsubdirs")
|
if(project->first("TEMPLATE") == "vcsubdirs")
|
||||||
ext = project->first("VCSOLUTION_EXTENSION");
|
ext = project->first("VCSOLUTION_EXTENSION");
|
||||||
ProString outputName = unescapeFilePath(project->first("TARGET"));
|
ProString outputName = project->first("TARGET");
|
||||||
if (!project->first("MAKEFILE").isEmpty())
|
if (!project->first("MAKEFILE").isEmpty())
|
||||||
outputName = project->first("MAKEFILE");
|
outputName = project->first("MAKEFILE");
|
||||||
file.setFileName(outdir + outputName + ext);
|
file.setFileName(outdir + outputName + ext);
|
||||||
|
@ -96,6 +96,16 @@ Win32MakefileGenerator::findHighestVersion(const QString &d, const QString &stem
|
|||||||
return biggest;
|
return biggest;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ProString Win32MakefileGenerator::fixLibFlag(const ProString &lib)
|
||||||
|
{
|
||||||
|
if (lib.startsWith('/')) {
|
||||||
|
if (lib.startsWith("/LIBPATH:"))
|
||||||
|
return QStringLiteral("/LIBPATH:") + escapeFilePath(lib.mid(9));
|
||||||
|
return lib;
|
||||||
|
}
|
||||||
|
return escapeFilePath(lib);
|
||||||
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
Win32MakefileGenerator::findLibraries()
|
Win32MakefileGenerator::findLibraries()
|
||||||
{
|
{
|
||||||
@ -104,26 +114,23 @@ Win32MakefileGenerator::findLibraries()
|
|||||||
for (int i = 0; lflags[i]; i++) {
|
for (int i = 0; lflags[i]; i++) {
|
||||||
ProStringList &l = project->values(lflags[i]);
|
ProStringList &l = project->values(lflags[i]);
|
||||||
for (ProStringList::Iterator it = l.begin(); it != l.end();) {
|
for (ProStringList::Iterator it = l.begin(); it != l.end();) {
|
||||||
QChar quote;
|
bool remove = false;
|
||||||
bool modified_opt = false, remove = false;
|
|
||||||
QString opt = (*it).trimmed().toQString();
|
QString opt = (*it).trimmed().toQString();
|
||||||
if((opt[0] == '\'' || opt[0] == '"') && opt[(int)opt.length()-1] == opt[0]) {
|
|
||||||
quote = opt[0];
|
|
||||||
opt = opt.mid(1, opt.length()-2);
|
|
||||||
}
|
|
||||||
if(opt.startsWith("/LIBPATH:")) {
|
if(opt.startsWith("/LIBPATH:")) {
|
||||||
dirs.append(QMakeLocalFileName(opt.mid(9)));
|
QString libpath = opt.mid(9);
|
||||||
|
QMakeLocalFileName l(libpath);
|
||||||
|
if (!dirs.contains(l)) {
|
||||||
|
dirs.append(l);
|
||||||
|
(*it) = "/LIBPATH:" + l.real();
|
||||||
|
} else {
|
||||||
|
remove = true;
|
||||||
|
}
|
||||||
} else if(opt.startsWith("-L") || opt.startsWith("/L")) {
|
} else if(opt.startsWith("-L") || opt.startsWith("/L")) {
|
||||||
QString libpath = Option::fixPathToTargetOS(opt.mid(2), false, false);
|
QString libpath = Option::fixPathToTargetOS(opt.mid(2), false, false);
|
||||||
QMakeLocalFileName l(libpath);
|
QMakeLocalFileName l(libpath);
|
||||||
if(!dirs.contains(l)) {
|
if(!dirs.contains(l)) {
|
||||||
dirs.append(l);
|
dirs.append(l);
|
||||||
modified_opt = true;
|
(*it) = "/LIBPATH:" + l.real();
|
||||||
if (!quote.isNull()) {
|
|
||||||
libpath = quote + libpath + quote;
|
|
||||||
quote = QChar();
|
|
||||||
}
|
|
||||||
(*it) = "/LIBPATH:" + libpath;
|
|
||||||
} else {
|
} else {
|
||||||
remove = true;
|
remove = true;
|
||||||
}
|
}
|
||||||
@ -142,17 +149,12 @@ Win32MakefileGenerator::findLibraries()
|
|||||||
if(QMakeMetaInfo::libExists((*it).local() + Option::dir_sep + lib) ||
|
if(QMakeMetaInfo::libExists((*it).local() + Option::dir_sep + lib) ||
|
||||||
exists((*it).local() + Option::dir_sep + lib + extension)) {
|
exists((*it).local() + Option::dir_sep + lib + extension)) {
|
||||||
out = (*it).real() + Option::dir_sep + lib + extension;
|
out = (*it).real() + Option::dir_sep + lib + extension;
|
||||||
if (out.contains(QLatin1Char(' '))) {
|
|
||||||
out.prepend(QLatin1Char('\"'));
|
|
||||||
out.append(QLatin1Char('\"'));
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(out.isEmpty())
|
if(out.isEmpty())
|
||||||
out = lib + ".lib";
|
out = lib + ".lib";
|
||||||
modified_opt = true;
|
|
||||||
(*it) = out;
|
(*it) = out;
|
||||||
} else if(!exists(Option::fixPathToLocalOS(opt))) {
|
} else if(!exists(Option::fixPathToLocalOS(opt))) {
|
||||||
QList<QMakeLocalFileName> lib_dirs;
|
QList<QMakeLocalFileName> lib_dirs;
|
||||||
@ -182,7 +184,6 @@ Win32MakefileGenerator::findLibraries()
|
|||||||
dir += Option::dir_sep;
|
dir += Option::dir_sep;
|
||||||
lib_tmpl.prepend(dir);
|
lib_tmpl.prepend(dir);
|
||||||
}
|
}
|
||||||
modified_opt = true;
|
|
||||||
(*it) = lib_tmpl;
|
(*it) = lib_tmpl;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -193,8 +194,6 @@ Win32MakefileGenerator::findLibraries()
|
|||||||
if(remove) {
|
if(remove) {
|
||||||
it = l.erase(it);
|
it = l.erase(it);
|
||||||
} else {
|
} else {
|
||||||
if(!quote.isNull() && modified_opt)
|
|
||||||
(*it) = quote + (*it) + quote;
|
|
||||||
++it;
|
++it;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -212,8 +211,6 @@ Win32MakefileGenerator::processPrlFiles()
|
|||||||
ProStringList &l = project->values(lflags[i]);
|
ProStringList &l = project->values(lflags[i]);
|
||||||
for (int lit = 0; lit < l.size(); ++lit) {
|
for (int lit = 0; lit < l.size(); ++lit) {
|
||||||
QString opt = l.at(lit).trimmed().toQString();
|
QString opt = l.at(lit).trimmed().toQString();
|
||||||
if((opt[0] == '\'' || opt[0] == '"') && opt[(int)opt.length()-1] == opt[0])
|
|
||||||
opt = opt.mid(1, opt.length()-2);
|
|
||||||
if (opt.startsWith(libArg)) {
|
if (opt.startsWith(libArg)) {
|
||||||
QMakeLocalFileName l(opt.mid(libArg.length()));
|
QMakeLocalFileName l(opt.mid(libArg.length()));
|
||||||
if (!libdirs.contains(l))
|
if (!libdirs.contains(l))
|
||||||
@ -233,14 +230,8 @@ Win32MakefileGenerator::processPrlFiles()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
ProStringList &prl_libs = project->values("QMAKE_CURRENT_PRL_LIBS");
|
ProStringList &prl_libs = project->values("QMAKE_CURRENT_PRL_LIBS");
|
||||||
for (int prl = 0; prl < prl_libs.size(); ++prl) {
|
for (int prl = 0; prl < prl_libs.size(); ++prl)
|
||||||
ProString arg = prl_libs.at(prl);
|
l.insert(lit + prl + 1, prl_libs.at(prl));
|
||||||
if (arg.startsWith(libArg))
|
|
||||||
arg = arg.left(libArg.length()) + escapeFilePath(arg.mid(libArg.length()).toQString());
|
|
||||||
else if (!arg.startsWith('/'))
|
|
||||||
arg = escapeFilePath(arg.toQString());
|
|
||||||
l.insert(lit + prl + 1, arg);
|
|
||||||
}
|
|
||||||
prl_libs.clear();
|
prl_libs.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -311,14 +302,13 @@ void Win32MakefileGenerator::processVars()
|
|||||||
for (ProStringList::Iterator libDir_it = libDir.begin(); libDir_it != libDir.end(); ++libDir_it) {
|
for (ProStringList::Iterator libDir_it = libDir.begin(); libDir_it != libDir.end(); ++libDir_it) {
|
||||||
QString lib = (*libDir_it).toQString();
|
QString lib = (*libDir_it).toQString();
|
||||||
if (!lib.isEmpty()) {
|
if (!lib.isEmpty()) {
|
||||||
lib.remove('"');
|
|
||||||
if (lib.endsWith('\\'))
|
if (lib.endsWith('\\'))
|
||||||
lib.chop(1);
|
lib.chop(1);
|
||||||
libs << libArg + escapeFilePath(Option::fixPathToTargetOS(lib, false, false));
|
libs << libArg + Option::fixPathToTargetOS(lib, false, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
project->values("QMAKE_LIBS") += libs + escapeFilePaths(project->values("LIBS"));
|
project->values("QMAKE_LIBS") += libs + project->values("LIBS");
|
||||||
project->values("QMAKE_LIBS_PRIVATE") += escapeFilePaths(project->values("LIBS_PRIVATE"));
|
project->values("QMAKE_LIBS_PRIVATE") += project->values("LIBS_PRIVATE");
|
||||||
|
|
||||||
if (project->values("TEMPLATE").contains("app")) {
|
if (project->values("TEMPLATE").contains("app")) {
|
||||||
project->values("QMAKE_CFLAGS") += project->values("QMAKE_CFLAGS_APP");
|
project->values("QMAKE_CFLAGS") += project->values("QMAKE_CFLAGS_APP");
|
||||||
@ -533,7 +523,7 @@ void Win32MakefileGenerator::processRcFileVar()
|
|||||||
|
|
||||||
void Win32MakefileGenerator::writeCleanParts(QTextStream &t)
|
void Win32MakefileGenerator::writeCleanParts(QTextStream &t)
|
||||||
{
|
{
|
||||||
t << "clean: compiler_clean " << var("CLEAN_DEPS");
|
t << "clean: compiler_clean " << depVar("CLEAN_DEPS");
|
||||||
{
|
{
|
||||||
const char *clean_targets[] = { "OBJECTS", "QMAKE_CLEAN", "CLEAN_FILES", 0 };
|
const char *clean_targets[] = { "OBJECTS", "QMAKE_CLEAN", "CLEAN_FILES", 0 };
|
||||||
for(int i = 0; clean_targets[i]; ++i) {
|
for(int i = 0; clean_targets[i]; ++i) {
|
||||||
@ -562,7 +552,7 @@ void Win32MakefileGenerator::writeCleanParts(QTextStream &t)
|
|||||||
}
|
}
|
||||||
t << endl << endl;
|
t << endl << endl;
|
||||||
|
|
||||||
t << "distclean: clean " << var("DISTCLEAN_DEPS");
|
t << "distclean: clean " << depVar("DISTCLEAN_DEPS");
|
||||||
{
|
{
|
||||||
const char *clean_targets[] = { "QMAKE_DISTCLEAN", 0 };
|
const char *clean_targets[] = { "QMAKE_DISTCLEAN", 0 };
|
||||||
for(int i = 0; clean_targets[i]; ++i) {
|
for(int i = 0; clean_targets[i]; ++i) {
|
||||||
@ -593,7 +583,7 @@ void Win32MakefileGenerator::writeCleanParts(QTextStream &t)
|
|||||||
{
|
{
|
||||||
QString ofile = Option::fixPathToTargetOS(fileFixify(Option::output.fileName()));
|
QString ofile = Option::fixPathToTargetOS(fileFixify(Option::output.fileName()));
|
||||||
if(!ofile.isEmpty())
|
if(!ofile.isEmpty())
|
||||||
t << "\t-$(DEL_FILE) " << ofile << endl;
|
t << "\t-$(DEL_FILE) " << escapeFilePath(ofile) << endl;
|
||||||
}
|
}
|
||||||
t << endl;
|
t << endl;
|
||||||
}
|
}
|
||||||
@ -606,9 +596,8 @@ void Win32MakefileGenerator::writeIncPart(QTextStream &t)
|
|||||||
for(int i = 0; i < incs.size(); ++i) {
|
for(int i = 0; i < incs.size(); ++i) {
|
||||||
QString inc = incs.at(i).toQString();
|
QString inc = incs.at(i).toQString();
|
||||||
inc.replace(QRegExp("\\\\$"), "");
|
inc.replace(QRegExp("\\\\$"), "");
|
||||||
inc.replace(QRegExp("\""), "");
|
|
||||||
if(!inc.isEmpty())
|
if(!inc.isEmpty())
|
||||||
t << "-I\"" << inc << "\" ";
|
t << "-I" << escapeFilePath(inc) << ' ';
|
||||||
}
|
}
|
||||||
t << endl;
|
t << endl;
|
||||||
}
|
}
|
||||||
@ -633,8 +622,8 @@ void Win32MakefileGenerator::writeStandardParts(QTextStream &t)
|
|||||||
t << "IDL = " << (project->isEmpty("QMAKE_IDL") ? QString("midl") : var("QMAKE_IDL"))
|
t << "IDL = " << (project->isEmpty("QMAKE_IDL") ? QString("midl") : var("QMAKE_IDL"))
|
||||||
<< endl;
|
<< endl;
|
||||||
t << "ZIP = " << var("QMAKE_ZIP") << endl;
|
t << "ZIP = " << var("QMAKE_ZIP") << endl;
|
||||||
t << "DEF_FILE = " << varList("DEF_FILE") << endl;
|
t << "DEF_FILE = " << fileVar("DEF_FILE") << endl;
|
||||||
t << "RES_FILE = " << varList("RES_FILE") << endl; // Not on mingw, can't see why not though...
|
t << "RES_FILE = " << fileVar("RES_FILE") << endl; // Not on mingw, can't see why not though...
|
||||||
t << "COPY = " << var("QMAKE_COPY") << endl;
|
t << "COPY = " << var("QMAKE_COPY") << endl;
|
||||||
t << "SED = " << var("QMAKE_STREAM_EDITOR") << endl;
|
t << "SED = " << var("QMAKE_STREAM_EDITOR") << endl;
|
||||||
t << "COPY_FILE = " << var("QMAKE_COPY_FILE") << endl;
|
t << "COPY_FILE = " << var("QMAKE_COPY_FILE") << endl;
|
||||||
@ -651,7 +640,7 @@ void Win32MakefileGenerator::writeStandardParts(QTextStream &t)
|
|||||||
|
|
||||||
t << "####### Output directory\n\n";
|
t << "####### Output directory\n\n";
|
||||||
if(!project->values("OBJECTS_DIR").isEmpty())
|
if(!project->values("OBJECTS_DIR").isEmpty())
|
||||||
t << "OBJECTS_DIR = " << var("OBJECTS_DIR").replace(QRegExp("\\\\$"),"") << endl;
|
t << "OBJECTS_DIR = " << escapeFilePath(var("OBJECTS_DIR").remove(QRegExp("\\\\$"))) << endl;
|
||||||
else
|
else
|
||||||
t << "OBJECTS_DIR = . \n";
|
t << "OBJECTS_DIR = . \n";
|
||||||
t << endl;
|
t << endl;
|
||||||
@ -666,7 +655,6 @@ void Win32MakefileGenerator::writeStandardParts(QTextStream &t)
|
|||||||
if (!destDir.isEmpty() && (orgDestDir.endsWith('/') || orgDestDir.endsWith(Option::dir_sep)))
|
if (!destDir.isEmpty() && (orgDestDir.endsWith('/') || orgDestDir.endsWith(Option::dir_sep)))
|
||||||
destDir += Option::dir_sep;
|
destDir += Option::dir_sep;
|
||||||
QString target = QString(project->first("TARGET")+project->first("TARGET_EXT"));
|
QString target = QString(project->first("TARGET")+project->first("TARGET_EXT"));
|
||||||
target.remove("\"");
|
|
||||||
project->values("DEST_TARGET").prepend(destDir + target);
|
project->values("DEST_TARGET").prepend(destDir + target);
|
||||||
|
|
||||||
writeObjectsPart(t);
|
writeObjectsPart(t);
|
||||||
@ -674,15 +662,14 @@ void Win32MakefileGenerator::writeStandardParts(QTextStream &t)
|
|||||||
writeExtraCompilerVariables(t);
|
writeExtraCompilerVariables(t);
|
||||||
writeExtraVariables(t);
|
writeExtraVariables(t);
|
||||||
|
|
||||||
t << "DIST = " << varList("DISTFILES") << " "
|
t << "DIST = " << fileVarList("DISTFILES") << ' '
|
||||||
<< varList("HEADERS") << " "
|
<< fileVarList("HEADERS") << ' ' << fileVarList("SOURCES") << endl;
|
||||||
<< varList("SOURCES") << endl;
|
t << "QMAKE_TARGET = " << fileVar("QMAKE_ORIG_TARGET") << endl;
|
||||||
t << "QMAKE_TARGET = " << var("QMAKE_ORIG_TARGET") << endl;
|
|
||||||
// The comment is important to maintain variable compatibility with Unix
|
// The comment is important to maintain variable compatibility with Unix
|
||||||
// Makefiles, while not interpreting a trailing-slash as a linebreak
|
// Makefiles, while not interpreting a trailing-slash as a linebreak
|
||||||
t << "DESTDIR = " << escapeFilePath(destDir) << " #avoid trailing-slash linebreak\n";
|
t << "DESTDIR = " << escapeFilePath(destDir) << " #avoid trailing-slash linebreak\n";
|
||||||
t << "TARGET = " << escapeFilePath(target) << endl;
|
t << "TARGET = " << escapeFilePath(target) << endl;
|
||||||
t << "DESTDIR_TARGET = " << escapeFilePath(var("DEST_TARGET")) << endl;
|
t << "DESTDIR_TARGET = " << fileVar("DEST_TARGET") << endl;
|
||||||
t << endl;
|
t << endl;
|
||||||
|
|
||||||
t << "####### Implicit rules\n\n";
|
t << "####### Implicit rules\n\n";
|
||||||
@ -694,8 +681,8 @@ void Win32MakefileGenerator::writeStandardParts(QTextStream &t)
|
|||||||
if(project->isActiveConfig("shared") && !project->values("DLLDESTDIR").isEmpty()) {
|
if(project->isActiveConfig("shared") && !project->values("DLLDESTDIR").isEmpty()) {
|
||||||
const ProStringList &dlldirs = project->values("DLLDESTDIR");
|
const ProStringList &dlldirs = project->values("DLLDESTDIR");
|
||||||
for (ProStringList::ConstIterator dlldir = dlldirs.begin(); dlldir != dlldirs.end(); ++dlldir) {
|
for (ProStringList::ConstIterator dlldir = dlldirs.begin(); dlldir != dlldirs.end(); ++dlldir) {
|
||||||
t << "\t-$(COPY_FILE) \"$(DESTDIR_TARGET)\" "
|
t << "\t-$(COPY_FILE) $(DESTDIR_TARGET) "
|
||||||
<< Option::fixPathToTargetOS((*dlldir).toQString(), false) << endl;
|
<< escapeFilePath(Option::fixPathToTargetOS((*dlldir).toQString(), false)) << endl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
t << endl;
|
t << endl;
|
||||||
@ -719,13 +706,13 @@ void Win32MakefileGenerator::writeStandardParts(QTextStream &t)
|
|||||||
}
|
}
|
||||||
t << "dist:\n\t"
|
t << "dist:\n\t"
|
||||||
<< "$(ZIP) " << var("QMAKE_ORIG_TARGET") << ".zip $(SOURCES) $(DIST) "
|
<< "$(ZIP) " << var("QMAKE_ORIG_TARGET") << ".zip $(SOURCES) $(DIST) "
|
||||||
<< dist_files.join(' ') << " " << var("TRANSLATIONS") << " ";
|
<< escapeFilePaths(dist_files).join(' ') << ' ' << fileVar("TRANSLATIONS") << ' ';
|
||||||
if(!project->isEmpty("QMAKE_EXTRA_COMPILERS")) {
|
if(!project->isEmpty("QMAKE_EXTRA_COMPILERS")) {
|
||||||
const ProStringList &quc = project->values("QMAKE_EXTRA_COMPILERS");
|
const ProStringList &quc = project->values("QMAKE_EXTRA_COMPILERS");
|
||||||
for (ProStringList::ConstIterator it = quc.begin(); it != quc.end(); ++it) {
|
for (ProStringList::ConstIterator it = quc.begin(); it != quc.end(); ++it) {
|
||||||
const ProStringList &inputs = project->values(ProKey(*it + ".input"));
|
const ProStringList &inputs = project->values(ProKey(*it + ".input"));
|
||||||
for (ProStringList::ConstIterator input = inputs.begin(); input != inputs.end(); ++input)
|
for (ProStringList::ConstIterator input = inputs.begin(); input != inputs.end(); ++input)
|
||||||
t << (*input) << " ";
|
t << escapeFilePath(*input) << ' ';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
t << endl << endl;
|
t << endl << endl;
|
||||||
@ -744,12 +731,14 @@ void Win32MakefileGenerator::writeLibsPart(QTextStream &t)
|
|||||||
} else {
|
} else {
|
||||||
t << "LINKER = " << var("QMAKE_LINK") << endl;
|
t << "LINKER = " << var("QMAKE_LINK") << endl;
|
||||||
t << "LFLAGS = " << var("QMAKE_LFLAGS") << endl;
|
t << "LFLAGS = " << var("QMAKE_LFLAGS") << endl;
|
||||||
t << "LIBS = " << var("QMAKE_LIBS") << " " << var("QMAKE_LIBS_PRIVATE") << endl;
|
t << "LIBS = " << fixLibFlags("QMAKE_LIBS").join(' ') << ' '
|
||||||
|
<< fixLibFlags("QMAKE_LIBS_PRIVATE").join(' ') << endl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Win32MakefileGenerator::writeObjectsPart(QTextStream &t)
|
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"))) << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -791,9 +780,10 @@ void Win32MakefileGenerator::writeRcFilePart(QTextStream &t)
|
|||||||
incPathStr += escapeFilePath(path);
|
incPathStr += escapeFilePath(path);
|
||||||
}
|
}
|
||||||
|
|
||||||
t << res_file << ": " << rc_file << "\n\t"
|
t << escapeDependencyPath(res_file) << ": " << escapeDependencyPath(rc_file) << "\n\t"
|
||||||
<< var("QMAKE_RC") << (project->isActiveConfig("debug") ? " -D_DEBUG" : "")
|
<< var("QMAKE_RC") << (project->isActiveConfig("debug") ? " -D_DEBUG" : "")
|
||||||
<< " $(DEFINES)" << incPathStr << " -fo " << res_file << " " << rc_file;
|
<< " $(DEFINES)" << incPathStr << " -fo " << escapeFilePath(res_file)
|
||||||
|
<< ' ' << escapeFilePath(rc_file);
|
||||||
t << endl << endl;
|
t << endl << endl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -829,7 +819,7 @@ QString Win32MakefileGenerator::defaultInstall(const QString &t)
|
|||||||
ret += installMetaFile(ProKey("QMAKE_PRL_INSTALL_REPLACE"), project->first("QMAKE_INTERNAL_PRL_FILE").toQString(), dst_prl);
|
ret += installMetaFile(ProKey("QMAKE_PRL_INSTALL_REPLACE"), project->first("QMAKE_INTERNAL_PRL_FILE").toQString(), dst_prl);
|
||||||
if(!uninst.isEmpty())
|
if(!uninst.isEmpty())
|
||||||
uninst.append("\n\t");
|
uninst.append("\n\t");
|
||||||
uninst.append("-$(DEL_FILE) \"" + dst_prl + "\"");
|
uninst.append("-$(DEL_FILE) " + escapeFilePath(dst_prl));
|
||||||
}
|
}
|
||||||
if(project->isActiveConfig("create_pc")) {
|
if(project->isActiveConfig("create_pc")) {
|
||||||
QString dst_pc = pkgConfigFileName(false);
|
QString dst_pc = pkgConfigFileName(false);
|
||||||
@ -846,32 +836,35 @@ QString Win32MakefileGenerator::defaultInstall(const QString &t)
|
|||||||
ret += installMetaFile(ProKey("QMAKE_PKGCONFIG_INSTALL_REPLACE"), pkgConfigFileName(true), dst_pc);
|
ret += installMetaFile(ProKey("QMAKE_PKGCONFIG_INSTALL_REPLACE"), pkgConfigFileName(true), dst_pc);
|
||||||
if(!uninst.isEmpty())
|
if(!uninst.isEmpty())
|
||||||
uninst.append("\n\t");
|
uninst.append("\n\t");
|
||||||
uninst.append("-$(DEL_FILE) \"" + dst_pc + "\"");
|
uninst.append("-$(DEL_FILE) " + escapeFilePath(dst_pc));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(project->isActiveConfig("shared") && !project->isActiveConfig("plugin")) {
|
if(project->isActiveConfig("shared") && !project->isActiveConfig("plugin")) {
|
||||||
QString lib_target = getLibTarget();
|
QString lib_target = getLibTarget();
|
||||||
lib_target.remove('"');
|
QString src_targ = escapeFilePath(
|
||||||
QString src_targ = (project->isEmpty("DESTDIR") ? QString("$(DESTDIR)") : project->first("DESTDIR")) + lib_target;
|
(project->isEmpty("DESTDIR") ? QString("$(DESTDIR)") : project->first("DESTDIR"))
|
||||||
QString dst_targ = filePrefixRoot(root, fileFixify(targetdir + lib_target, FileFixifyAbsolute));
|
+ lib_target);
|
||||||
|
QString dst_targ = escapeFilePath(
|
||||||
|
filePrefixRoot(root, fileFixify(targetdir + lib_target, FileFixifyAbsolute)));
|
||||||
if(!ret.isEmpty())
|
if(!ret.isEmpty())
|
||||||
ret += "\n\t";
|
ret += "\n\t";
|
||||||
ret += QString("-$(INSTALL_FILE)") + " \"" + src_targ + "\" \"" + dst_targ + "\"";
|
ret += QString("-$(INSTALL_FILE) ") + src_targ + ' ' + dst_targ;
|
||||||
if(!uninst.isEmpty())
|
if(!uninst.isEmpty())
|
||||||
uninst.append("\n\t");
|
uninst.append("\n\t");
|
||||||
uninst.append("-$(DEL_FILE) \"" + dst_targ + "\"");
|
uninst.append("-$(DEL_FILE) " + dst_targ);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (t == "dlltarget" || project->values(ProKey(t + ".CONFIG")).indexOf("no_dll") == -1) {
|
if (t == "dlltarget" || project->values(ProKey(t + ".CONFIG")).indexOf("no_dll") == -1) {
|
||||||
QString src_targ = "$(DESTDIR_TARGET)";
|
QString src_targ = "$(DESTDIR_TARGET)";
|
||||||
QString dst_targ = filePrefixRoot(root, fileFixify(targetdir + "$(TARGET)", FileFixifyAbsolute));
|
QString dst_targ = escapeFilePath(
|
||||||
|
filePrefixRoot(root, fileFixify(targetdir + "$(TARGET)", FileFixifyAbsolute)));
|
||||||
if(!ret.isEmpty())
|
if(!ret.isEmpty())
|
||||||
ret += "\n\t";
|
ret += "\n\t";
|
||||||
ret += QString("-$(INSTALL_FILE)") + " \"" + src_targ + "\" \"" + dst_targ + "\"";
|
ret += QString("-$(INSTALL_FILE) ") + src_targ + ' ' + dst_targ;
|
||||||
if(!uninst.isEmpty())
|
if(!uninst.isEmpty())
|
||||||
uninst.append("\n\t");
|
uninst.append("\n\t");
|
||||||
uninst.append("-$(DEL_FILE) \"" + dst_targ + "\"");
|
uninst.append("-$(DEL_FILE) " + dst_targ);
|
||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
@ -880,7 +873,6 @@ QString Win32MakefileGenerator::escapeFilePath(const QString &path) const
|
|||||||
{
|
{
|
||||||
QString ret = path;
|
QString ret = path;
|
||||||
if(!ret.isEmpty()) {
|
if(!ret.isEmpty()) {
|
||||||
ret = unescapeFilePath(ret);
|
|
||||||
if (ret.contains(' ') || ret.contains('\t'))
|
if (ret.contains(' ') || ret.contains('\t'))
|
||||||
ret = "\"" + ret + "\"";
|
ret = "\"" + ret + "\"";
|
||||||
debug_msg(2, "EscapeFilePath: %s -> %s", path.toLatin1().constData(), ret.toLatin1().constData());
|
debug_msg(2, "EscapeFilePath: %s -> %s", path.toLatin1().constData(), ret.toLatin1().constData());
|
||||||
|
@ -60,6 +60,8 @@ protected:
|
|||||||
int findHighestVersion(const QString &dir, const QString &stem, const QString &ext = QLatin1String("lib"));
|
int findHighestVersion(const QString &dir, const QString &stem, const QString &ext = QLatin1String("lib"));
|
||||||
virtual bool findLibraries();
|
virtual bool findLibraries();
|
||||||
|
|
||||||
|
virtual ProString fixLibFlag(const ProString &lib);
|
||||||
|
|
||||||
virtual void processPrlFiles();
|
virtual void processPrlFiles();
|
||||||
void processVars();
|
void processVars();
|
||||||
void fixTargetExt();
|
void fixTargetExt();
|
||||||
|
@ -94,9 +94,6 @@ QMakeMetaInfo::clear()
|
|||||||
QString
|
QString
|
||||||
QMakeMetaInfo::findLib(QString lib)
|
QMakeMetaInfo::findLib(QString lib)
|
||||||
{
|
{
|
||||||
if((lib[0] == '\'' || lib[0] == '"') &&
|
|
||||||
lib[lib.length()-1] == lib[0])
|
|
||||||
lib = lib.mid(1, lib.length()-2);
|
|
||||||
lib = Option::normalizePath(lib);
|
lib = Option::normalizePath(lib);
|
||||||
|
|
||||||
QString ret;
|
QString ret;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user