summaryrefslogtreecommitdiffstats
path: root/qmake/generators
diff options
context:
space:
mode:
Diffstat (limited to 'qmake/generators')
-rw-r--r--qmake/generators/makefile.cpp4
-rw-r--r--qmake/generators/makefiledeps.cpp34
-rw-r--r--qmake/generators/symbian/symmake.cpp33
-rw-r--r--qmake/generators/symbian/symmake_abld.cpp2
-rw-r--r--qmake/generators/symbian/symmake_sbsv2.cpp2
-rw-r--r--qmake/generators/win32/winmakefile.cpp3
6 files changed, 41 insertions, 37 deletions
diff --git a/qmake/generators/makefile.cpp b/qmake/generators/makefile.cpp
index 7424d1d..69e1d8a 100644
--- a/qmake/generators/makefile.cpp
+++ b/qmake/generators/makefile.cpp
@@ -1824,11 +1824,12 @@ MakefileGenerator::writeExtraCompilerTargets(QTextStream &t)
cleans.append(files);
}
}
- if(!cleans.isEmpty())
+ if(!cleans.isEmpty()) {
if (isForSymbian())
t << valGlue(cleans, "\n\t" + del_statement, " 2> NUL\n\t" + del_statement, " 2> NUL");
else
t << valGlue(cleans, "\n\t" + del_statement, "\n\t" + del_statement, "");
+ }
if(!wrote_clean_cmds) {
for(QStringList::ConstIterator input = tmp_inputs.begin(); input != tmp_inputs.end(); ++input) {
t << "\n\t" << replaceExtraCompilerVariables(tmp_clean_cmds, (*input),
@@ -2535,6 +2536,7 @@ MakefileGenerator::writeSubTargets(QTextStream &t, QList<MakefileGenerator::SubT
QString ofile = Option::fixPathToTargetOS(fileFixify(Option::output.fileName()));
if(!ofile.isEmpty())
t << "\t-$(DEL_FILE) " << ofile << endl;
+ t << varGlue("QMAKE_DISTCLEAN","\t-$(DEL_FILE) "," ","\n");
} else if(project->isActiveConfig("no_empty_targets")) {
t << "\t" << "@cd ." << endl;
}
diff --git a/qmake/generators/makefiledeps.cpp b/qmake/generators/makefiledeps.cpp
index 40304a6..21e1273 100644
--- a/qmake/generators/makefiledeps.cpp
+++ b/qmake/generators/makefiledeps.cpp
@@ -397,7 +397,7 @@ bool QMakeSourceFileInfo::findDeps(SourceFile *file)
buffer = getBuffer(fst.st_size);
for(int have_read = 0;
(have_read = QT_READ(fd, buffer + buffer_len, fst.st_size - buffer_len));
- buffer_len += have_read);
+ buffer_len += have_read) ;
QT_CLOSE(fd);
}
if(!buffer)
@@ -418,22 +418,22 @@ bool QMakeSourceFileInfo::findDeps(SourceFile *file)
++x;
if(buffer_len >= x + 12 && !strncmp(buffer + x, "includehint", 11) &&
(*(buffer + x + 11) == ' ' || *(buffer + x + 11) == '>')) {
- for(x += 11; *(buffer + x) != '>'; ++x);
+ for(x += 11; *(buffer + x) != '>'; ++x) ;
int inc_len = 0;
- for(x += 1 ; *(buffer + x + inc_len) != '<'; ++inc_len);
+ for(x += 1 ; *(buffer + x + inc_len) != '<'; ++inc_len) ;
*(buffer + x + inc_len) = '\0';
inc = buffer + x;
} else if(buffer_len >= x + 13 && !strncmp(buffer + x, "customwidget", 12) &&
(*(buffer + x + 12) == ' ' || *(buffer + x + 12) == '>')) {
- for(x += 13; *(buffer + x) != '>'; ++x); //skip up to >
+ for(x += 13; *(buffer + x) != '>'; ++x) ; //skip up to >
while(x < buffer_len) {
- for(x++; *(buffer + x) != '<'; ++x); //skip up to <
+ for(x++; *(buffer + x) != '<'; ++x) ; //skip up to <
x++;
if(buffer_len >= x + 7 && !strncmp(buffer+x, "header", 6) &&
(*(buffer + x + 6) == ' ' || *(buffer + x + 6) == '>')) {
- for(x += 7; *(buffer + x) != '>'; ++x); //skip up to >
+ for(x += 7; *(buffer + x) != '>'; ++x) ; //skip up to >
int inc_len = 0;
- for(x += 1 ; *(buffer + x + inc_len) != '<'; ++inc_len);
+ for(x += 1 ; *(buffer + x + inc_len) != '<'; ++inc_len) ;
*(buffer + x + inc_len) = '\0';
inc = buffer + x;
break;
@@ -448,10 +448,10 @@ bool QMakeSourceFileInfo::findDeps(SourceFile *file)
for(x += 8; *(buffer + x) != '>'; ++x) {
if(buffer_len >= x + 9 && *(buffer + x) == 'i' &&
!strncmp(buffer + x, "impldecl", 8)) {
- for(x += 8; *(buffer + x) != '='; ++x);
+ for(x += 8; *(buffer + x) != '='; ++x) ;
if(*(buffer + x) != '=')
continue;
- for(++x; *(buffer+x) == '\t' || *(buffer+x) == ' '; ++x);
+ for(++x; *(buffer+x) == '\t' || *(buffer+x) == ' '; ++x) ;
char quote = 0;
if(*(buffer+x) == '\'' || *(buffer+x) == '"') {
quote = *(buffer + x);
@@ -475,13 +475,13 @@ bool QMakeSourceFileInfo::findDeps(SourceFile *file)
}
}
int inc_len = 0;
- for(x += 1 ; *(buffer + x + inc_len) != '<'; ++inc_len);
+ for(x += 1 ; *(buffer + x + inc_len) != '<'; ++inc_len) ;
*(buffer + x + inc_len) = '\0';
inc = buffer + x;
}
}
//read past new line now..
- for(; x < buffer_len && !qmake_endOfLine(*(buffer + x)); ++x);
+ for(; x < buffer_len && !qmake_endOfLine(*(buffer + x)); ++x) ;
++line_count;
} else if(file->type == QMakeSourceFileInfo::TYPE_QRC) {
} else if(file->type == QMakeSourceFileInfo::TYPE_C) {
@@ -494,7 +494,7 @@ bool QMakeSourceFileInfo::findDeps(SourceFile *file)
++x;
if(buffer_len >= x) {
if(*(buffer+x) == '/') { //c++ style comment
- for(; x < buffer_len && !qmake_endOfLine(*(buffer + x)); ++x);
+ for(; x < buffer_len && !qmake_endOfLine(*(buffer + x)); ++x) ;
beginning = 1;
} else if(*(buffer+x) == '*') { //c style comment
for(++x; x < buffer_len; ++x) {
@@ -558,7 +558,7 @@ bool QMakeSourceFileInfo::findDeps(SourceFile *file)
*(buffer+x+keyword_len) != '_') {
for(x+=keyword_len; //skip spaces after keyword
x < buffer_len && (*(buffer+x) == ' ' || *(buffer+x) == '\t');
- x++);
+ x++) ;
break;
} else if(qmake_endOfLine(*(buffer+x+keyword_len))) {
x += keyword_len-1;
@@ -579,7 +579,7 @@ bool QMakeSourceFileInfo::findDeps(SourceFile *file)
x++;
int inc_len;
- for(inc_len = 0; *(buffer + x + inc_len) != term && !qmake_endOfLine(*(buffer + x + inc_len)); ++inc_len);
+ for(inc_len = 0; *(buffer + x + inc_len) != term && !qmake_endOfLine(*(buffer + x + inc_len)); ++inc_len) ;
*(buffer + x + inc_len) = '\0';
inc = buffer + x;
x += inc_len;
@@ -594,7 +594,7 @@ bool QMakeSourceFileInfo::findDeps(SourceFile *file)
int msg_len;
for(msg_len = 0; (term && *(buffer + x + msg_len) != term) &&
- !qmake_endOfLine(*(buffer + x + msg_len)); ++msg_len);
+ !qmake_endOfLine(*(buffer + x + msg_len)); ++msg_len) ;
*(buffer + x + msg_len) = '\0';
debug_msg(0, "%s:%d %s -- %s", file->file.local().toLatin1().constData(), line_count, keyword, buffer+x);
x += msg_len;
@@ -706,7 +706,7 @@ bool QMakeSourceFileInfo::findMocs(SourceFile *file)
buffer = getBuffer(fst.st_size);
for(int have_read = buffer_len = 0;
(have_read = QT_READ(fd, buffer + buffer_len, fst.st_size - buffer_len));
- buffer_len += have_read);
+ buffer_len += have_read) ;
QT_CLOSE(fd);
}
@@ -720,7 +720,7 @@ bool QMakeSourceFileInfo::findMocs(SourceFile *file)
++x;
if(buffer_len >= x) {
if(*(buffer + x) == '/') { //c++ style comment
- for(;x < buffer_len && !qmake_endOfLine(*(buffer + x)); ++x);
+ for(;x < buffer_len && !qmake_endOfLine(*(buffer + x)); ++x) ;
} else if(*(buffer + x) == '*') { //c style comment
for(++x; x < buffer_len; ++x) {
if(*(buffer + x) == 't' || *(buffer + x) == 'q') { //ignore
diff --git a/qmake/generators/symbian/symmake.cpp b/qmake/generators/symbian/symmake.cpp
index a23ec60..8f712d8 100644
--- a/qmake/generators/symbian/symmake.cpp
+++ b/qmake/generators/symbian/symmake.cpp
@@ -54,7 +54,6 @@
#define REGISTRATION_RESOURCE_DIRECTORY_HW "/private/10003a3f/import/apps"
#define PLUGIN_COMMON_DEF_FILE_FOR_MMP "./plugin_common.def"
#define PLUGIN_COMMON_DEF_FILE_ACTUAL "plugin_commonU.def"
-#define BLD_INF_FILENAME_LEN (sizeof(BLD_INF_FILENAME) - 1)
#define BLD_INF_RULES_BASE "BLD_INF_RULES."
#define BLD_INF_TAG_PLATFORMS "prj_platforms"
@@ -232,7 +231,9 @@ bool SymbianMakefileGenerator::writeMakefile(QTextStream &t)
QString wrapperFileName("Makefile");
QString outputFileName = fileInfo(Option::output.fileName()).fileName();
if (outputFileName != BLD_INF_FILENAME) {
- wrapperFileName.append(".").append((outputFileName.size() > BLD_INF_FILENAME_LEN && outputFileName.left(BLD_INF_FILENAME_LEN) == BLD_INF_FILENAME) ? outputFileName.mid(8) : outputFileName);
+ wrapperFileName.append(".").append(outputFileName.startsWith(BLD_INF_FILENAME)
+ ? outputFileName.mid(sizeof(BLD_INF_FILENAME))
+ : outputFileName);
isPrimaryMakefile = false;
}
@@ -266,7 +267,7 @@ bool SymbianMakefileGenerator::writeMakefile(QTextStream &t)
writeMmpFile(mmpFilename, symbianLangCodes);
if (targetType == TypeExe) {
- if (!project->values("CONFIG").contains("no_icon", Qt::CaseInsensitive)) {
+ if (!project->isActiveConfig("no_icon")) {
writeRegRssFile(userRssRules);
writeRssFile(numberOfIcons, iconFile);
writeLocFile(symbianLangCodes);
@@ -391,7 +392,7 @@ void SymbianMakefileGenerator::generatePkgFile(const QString &iconFile, Deployme
.arg(exeFile) << endl;
// deploy rsc & reg_rsc file
- if (!project->values("CONFIG").contains("no_icon", Qt::CaseInsensitive)) {
+ if (!project->isActiveConfig("no_icon")) {
t << QString("\"%1epoc32/data/z/resource/apps/%2\" - \"%3\\%4\"")
.arg(epocRoot())
.arg(fixedTarget + ".rsc")
@@ -484,7 +485,7 @@ bool SymbianMakefileGenerator::containsStartWithItem(const QChar &c, const QStri
void SymbianMakefileGenerator::writeCustomDefFile()
{
- if (targetType == TypePlugin && !project->values("CONFIG").contains("stdbinary", Qt::CaseInsensitive)) {
+ if (targetType == TypePlugin && !project->isActiveConfig("stdbinary")) {
// Create custom def file for plugin
QFile ft(QLatin1String(PLUGIN_COMMON_DEF_FILE_ACTUAL));
@@ -549,9 +550,9 @@ void SymbianMakefileGenerator::init()
targetType = TypeExe;
else if ((project->values("TEMPLATE")).contains("lib")) {
// Check CONFIG to see if we are to build staticlib or dll
- if (project->values("CONFIG").contains("staticlib") || project->values("CONFIG").contains("static"))
+ if (project->isActiveConfig("staticlib") || project->isActiveConfig("static"))
targetType = TypeLib;
- else if (project->values("CONFIG").contains("plugin"))
+ else if (project->isActiveConfig("plugin"))
targetType = TypePlugin;
else
targetType = TypeDll;
@@ -561,7 +562,7 @@ void SymbianMakefileGenerator::init()
if (0 != project->values("TARGET.UID2").size()) {
uid2 = project->first("TARGET.UID2");
- } else if (project->values("CONFIG").contains("stdbinary", Qt::CaseInsensitive)) {
+ } else if (project->isActiveConfig("stdbinary")) {
uid2 = "0x20004C45";
} else {
if (targetType == TypeExe) {
@@ -828,7 +829,7 @@ void SymbianMakefileGenerator::writeMmpFile(QString &filename, QStringList &symb
}
t << endl;
- if (!project->values("CONFIG").contains("static") && !project->values("CONFIG").contains("staticlib")) {
+ if (!project->isActiveConfig("static") && !project->isActiveConfig("staticlib")) {
writeMmpFileLibraryPart(t);
}
@@ -881,7 +882,7 @@ void SymbianMakefileGenerator::writeMmpFileTargetPart(QTextStream& t)
if (targetType == TypeExe) {
t << MMP_TARGET "\t\t" << fixedTarget << ".exe" << endl;
if (!skipTargetType) {
- if (project->values("CONFIG").contains("stdbinary", Qt::CaseInsensitive))
+ if (project->isActiveConfig("stdbinary"))
t << MMP_TARGETTYPE "\t\tSTDEXE" << endl;
else
t << MMP_TARGETTYPE "\t\tEXE" << endl;
@@ -889,7 +890,7 @@ void SymbianMakefileGenerator::writeMmpFileTargetPart(QTextStream& t)
} else if (targetType == TypeDll || targetType == TypePlugin) {
t << MMP_TARGET "\t\t" << fixedTarget << ".dll" << endl;
if (!skipTargetType) {
- if (project->values("CONFIG").contains("stdbinary", Qt::CaseInsensitive))
+ if (project->isActiveConfig("stdbinary"))
t << MMP_TARGETTYPE "\t\tSTDDLL" << endl;
else
t << MMP_TARGETTYPE "\t\tDLL" << endl;
@@ -897,7 +898,7 @@ void SymbianMakefileGenerator::writeMmpFileTargetPart(QTextStream& t)
} else if (targetType == TypeLib) {
t << MMP_TARGET "\t\t" << fixedTarget << ".lib" << endl;
if (!skipTargetType) {
- if (project->values("CONFIG").contains("stdbinary", Qt::CaseInsensitive))
+ if (project->isActiveConfig("stdbinary"))
t << MMP_TARGETTYPE "\t\tSTDLIB" << endl;
else
t << MMP_TARGETTYPE "\t\tLIB" << endl;
@@ -933,7 +934,7 @@ void SymbianMakefileGenerator::writeMmpFileTargetPart(QTextStream& t)
if (0 != project->values("TARGET.EPOCALLOWDLLDATA").size())
t << MMP_EPOCALLOWDLLDATA << endl;
- if (targetType == TypePlugin && !project->values("CONFIG").contains("stdbinary", Qt::CaseInsensitive)) {
+ if (targetType == TypePlugin && !project->isActiveConfig("stdbinary")) {
// Use custom def file for Qt plugins
t << "DEFFILE " PLUGIN_COMMON_DEF_FILE_FOR_MMP << endl;
}
@@ -949,7 +950,7 @@ void SymbianMakefileGenerator::writeMmpFileTargetPart(QTextStream& t)
void SymbianMakefileGenerator::writeMmpFileResourcePart(QTextStream& t, QStringList &symbianLangCodes)
{
if ((targetType == TypeExe) &&
- !project->values("CONFIG").contains("no_icon", Qt::CaseInsensitive)) {
+ !project->isActiveConfig("no_icon")) {
QString locTarget = fixedTarget;
locTarget.append(".rss");
@@ -1307,7 +1308,7 @@ void SymbianMakefileGenerator::writeBldInfContent(QTextStream &t, bool addDeploy
// Add project mmps and old style extension makefiles
QString mmpTag;
- if (project->values("CONFIG").contains("symbian_test", Qt::CaseInsensitive))
+ if (project->isActiveConfig("symbian_test"))
mmpTag = QLatin1String(BLD_INF_TAG_TESTMMPFILES);
else
mmpTag = QLatin1String(BLD_INF_TAG_MMPFILES);
@@ -1554,7 +1555,7 @@ void SymbianMakefileGenerator::readRssRules(QString &numberOfIcons, QString &ico
if (!numberOfIcons.isEmpty()) {
bool ok;
numberOfIcons = numberOfIcons.simplified();
- int tmp = numberOfIcons.toInt(&ok);
+ numberOfIcons.toInt(&ok);
if (!ok) {
numberOfIcons.clear();
iconFile.clear();
diff --git a/qmake/generators/symbian/symmake_abld.cpp b/qmake/generators/symbian/symmake_abld.cpp
index d1e63cb..033bcbe 100644
--- a/qmake/generators/symbian/symmake_abld.cpp
+++ b/qmake/generators/symbian/symmake_abld.cpp
@@ -172,7 +172,7 @@ void SymbianAbldMakefileGenerator::writeWrapperMakefile(QFile& wrapperFile, bool
releasePlatforms.removeAll("winscw"); // No release for emulator
QString testClause;
- if (project->values("CONFIG").contains("symbian_test", Qt::CaseInsensitive))
+ if (project->isActiveConfig("symbian_test"))
testClause = QLatin1String(" test");
else
testClause = QLatin1String("");
diff --git a/qmake/generators/symbian/symmake_sbsv2.cpp b/qmake/generators/symbian/symmake_sbsv2.cpp
index 5adf30d..e081b19 100644
--- a/qmake/generators/symbian/symmake_sbsv2.cpp
+++ b/qmake/generators/symbian/symmake_sbsv2.cpp
@@ -106,7 +106,7 @@ void SymbianSbsv2MakefileGenerator::writeWrapperMakefile(QFile& wrapperFile, boo
releasePlatforms.removeAll("winscw"); // No release for emulator
QString testClause;
- if (project->values("CONFIG").contains("symbian_test", Qt::CaseInsensitive))
+ if (project->isActiveConfig("symbian_test"))
testClause = QLatin1String(".test");
else
testClause = QLatin1String("");
diff --git a/qmake/generators/win32/winmakefile.cpp b/qmake/generators/win32/winmakefile.cpp
index efdf8ac..9d3b4c6 100644
--- a/qmake/generators/win32/winmakefile.cpp
+++ b/qmake/generators/win32/winmakefile.cpp
@@ -467,11 +467,12 @@ void Win32MakefileGenerator::processRcFileVar()
resFile.replace(".rc", Option::res_ext);
project->values("RES_FILE").prepend(fileInfo(resFile).fileName());
- if (!project->values("OBJECTS_DIR").isEmpty())
+ if (!project->values("OBJECTS_DIR").isEmpty()) {
if(project->isActiveConfig("staticlib"))
project->values("RES_FILE").first().prepend(fileInfo(project->values("DESTDIR").first()).absoluteFilePath() + Option::dir_sep);
else
project->values("RES_FILE").first().prepend(project->values("OBJECTS_DIR").first() + Option::dir_sep);
+ }
project->values("RES_FILE").first() = Option::fixPathToTargetOS(project->values("RES_FILE").first(), false, false);
project->values("POST_TARGETDEPS") += project->values("RES_FILE");
project->values("CLEAN_FILES") += project->values("RES_FILE");