qmake/generators/symbian/symmake_sbsv2.cpp
changeset 37 758a864f9613
parent 33 3e2da88830cd
equal deleted inserted replaced
36:ef0373b55136 37:758a864f9613
    54 SymbianSbsv2MakefileGenerator::SymbianSbsv2MakefileGenerator() : SymbianMakefileGenerator() { }
    54 SymbianSbsv2MakefileGenerator::SymbianSbsv2MakefileGenerator() : SymbianMakefileGenerator() { }
    55 SymbianSbsv2MakefileGenerator::~SymbianSbsv2MakefileGenerator() { }
    55 SymbianSbsv2MakefileGenerator::~SymbianSbsv2MakefileGenerator() { }
    56 
    56 
    57 #define FLM_DEST_DIR "epoc32/tools/makefile_templates/qt"
    57 #define FLM_DEST_DIR "epoc32/tools/makefile_templates/qt"
    58 #define FLM_SOURCE_DIR "/mkspecs/symbian-sbsv2/flm/qt"
    58 #define FLM_SOURCE_DIR "/mkspecs/symbian-sbsv2/flm/qt"
       
    59 #define UNDETECTED_GCCE_VERSION "0"
       
    60 #define PLATFORM_GCCE "gcce"
       
    61 #define PLATFORM_WINSCW "winscw"
       
    62 #define PLATFORM_ARMV5 "armv5"
       
    63 #define BUILD_DEBUG "udeb"
       
    64 #define BUILD_RELEASE "urel"
    59 
    65 
    60 // Copies Qt FLMs to correct location under epocroot.
    66 // Copies Qt FLMs to correct location under epocroot.
    61 // This is not done by configure as it is possible to change epocroot after configure.
    67 // This is not done by configure as it is possible to change epocroot after configure.
    62 void SymbianSbsv2MakefileGenerator::exportFlm()
    68 void SymbianSbsv2MakefileGenerator::exportFlm()
    63 {
    69 {
    92         }
    98         }
    93         flmExportDone = true;
    99         flmExportDone = true;
    94     }
   100     }
    95 }
   101 }
    96 
   102 
       
   103 QString SymbianSbsv2MakefileGenerator::gcceVersion()
       
   104 {
       
   105     static QString gcceVersionStr;
       
   106 
       
   107     if (gcceVersionStr.isEmpty()) {
       
   108         // First check if QT_GCCE_VERSION has been set, and use that if it is
       
   109         QByteArray qtGcceVersion = qgetenv("QT_GCCE_VERSION");
       
   110         if (!qtGcceVersion.isEmpty()) {
       
   111             // Check that QT_GCCE_VERSION is in proper format
       
   112             QString check(qtGcceVersion);
       
   113             check.replace(QRegExp("^\\d+\\.\\d+\\.\\d+$"),QString());
       
   114             if (check.isEmpty()) {
       
   115                 gcceVersionStr = PLATFORM_GCCE + QString(qtGcceVersion).replace(".","_");
       
   116                 return gcceVersionStr;
       
   117             } else {
       
   118                 fprintf(stderr, "Warning: Environment variable QT_GCCE_VERSION ('%s') is in incorrect "
       
   119                         "format, expected format is: '1.2.3'. Attempting to autodetect GCCE version.",
       
   120                         qtGcceVersion.constData());
       
   121             }
       
   122         }
       
   123         // Sbsv2 has separate env variable defined for each gcce version, so try to determine
       
   124         // which user is likely to want to use by checking version 4.0.0 to 9.9.9 and taking
       
   125         // the highest found version that actually points to a valid path.
       
   126         // This is kind of a kludge, but since qmake doesn't bootstrap QProcess, there
       
   127         // is no Qt API available to get all environment variables.
       
   128         for (int i = 9; i >= 4; i--) {
       
   129             for (int j = 9; j >= 0; j--) {
       
   130                 for (int k = 9; k >= 0; k--) {
       
   131                     QByteArray gcceVar = qgetenv(qPrintable(QString("SBS_GCCE%1%2%3BIN").arg(i).arg(j).arg(k)));
       
   132                     if (!gcceVar.isEmpty() && fileInfo(QString::fromLocal8Bit(gcceVar.constData())).exists()) {
       
   133                         gcceVersionStr = QString(PLATFORM_GCCE "%1_%2_%3").arg(i).arg(j).arg(k);
       
   134                         return gcceVersionStr;
       
   135                    }
       
   136                 }
       
   137             }
       
   138         }
       
   139     }
       
   140 
       
   141     // Indicate undetected version to avoid rechecking multiple times
       
   142     if (gcceVersionStr.isEmpty())
       
   143         gcceVersionStr = UNDETECTED_GCCE_VERSION;
       
   144 
       
   145     return gcceVersionStr;
       
   146 }
       
   147 
       
   148 QString SymbianSbsv2MakefileGenerator::configClause(QString &platform,
       
   149                                                     QString &build,
       
   150                                                     QString &winscwClauseTemplate,
       
   151                                                     QString &gcceClauseTemplate,
       
   152                                                     QString &genericClauseTemplate)
       
   153 {
       
   154     QString retval;
       
   155     if (QString::compare(platform, PLATFORM_WINSCW) == 0)
       
   156         retval = winscwClauseTemplate.arg(build);
       
   157     else if (QString::compare(platform, PLATFORM_GCCE) == 0)
       
   158         retval = gcceClauseTemplate.arg(build);
       
   159     else
       
   160         retval = genericClauseTemplate.arg(platform).arg(build);
       
   161     return retval;
       
   162 }
       
   163 
    97 void SymbianSbsv2MakefileGenerator::writeSbsDeploymentList(const DeploymentList& depList, QTextStream& t)
   164 void SymbianSbsv2MakefileGenerator::writeSbsDeploymentList(const DeploymentList& depList, QTextStream& t)
    98 {
   165 {
    99     for (int i = 0; i < depList.size(); ++i) {
   166     for (int i = 0; i < depList.size(); ++i) {
   100         t << "START EXTENSION qt/qmake_emulator_deployment" << endl;
   167         t << "START EXTENSION qt/qmake_emulator_deployment" << endl;
   101         QString fromItem = depList.at(i).from;
   168         QString fromItem = depList.at(i).from;
   121     Q_UNUSED(deploymentOnly);
   188     Q_UNUSED(deploymentOnly);
   122 }
   189 }
   123 
   190 
   124 void SymbianSbsv2MakefileGenerator::writeWrapperMakefile(QFile& wrapperFile, bool isPrimaryMakefile)
   191 void SymbianSbsv2MakefileGenerator::writeWrapperMakefile(QFile& wrapperFile, bool isPrimaryMakefile)
   125 {
   192 {
       
   193     static QString debugBuild(BUILD_DEBUG);
       
   194     static QString releaseBuild(BUILD_RELEASE);
       
   195 
   126     QStringList allPlatforms;
   196     QStringList allPlatforms;
   127     foreach(QString platform, project->values("SYMBIAN_PLATFORMS")) {
   197     foreach(QString platform, project->values("SYMBIAN_PLATFORMS")) {
   128         allPlatforms << platform.toLower();
   198         allPlatforms << platform.toLower();
   129     }
   199     }
   130 
       
   131     QStringList debugPlatforms = allPlatforms;
       
   132     QStringList releasePlatforms = allPlatforms;
       
   133     releasePlatforms.removeAll("winscw"); // No release for emulator
       
   134 
   200 
   135     QString testClause;
   201     QString testClause;
   136     if (project->isActiveConfig(SYMBIAN_TEST_CONFIG))
   202     if (project->isActiveConfig(SYMBIAN_TEST_CONFIG))
   137         testClause = QLatin1String(".test");
   203         testClause = QLatin1String(".test");
   138     else
   204     else
   139         testClause = QLatin1String("");
   205         testClause = QLatin1String("");
       
   206 
       
   207     QString genericClause = " -c %1_%2" + testClause;
       
   208     QString winscwClause = " -c winscw_%1.mwccinc" + testClause;
       
   209     QString gcceClause;
       
   210     bool stripArmv5 = false;
       
   211 
       
   212     if (allPlatforms.contains(PLATFORM_GCCE)) {
       
   213         if (QString::compare(gcceVersion(), UNDETECTED_GCCE_VERSION) == 0) {
       
   214             allPlatforms.removeAll(PLATFORM_GCCE);
       
   215         } else {
       
   216             gcceClause = " -c arm.v5.%1." + gcceVersion() + testClause;
       
   217             // Since gcce building is enabled, do not add armv5 for any sbs command
       
   218             // that also contains gcce, because those will build same targets.
       
   219             stripArmv5 = true;
       
   220         }
       
   221     }
       
   222 
       
   223     QStringList allClauses;
       
   224     QStringList debugClauses;
       
   225     QStringList releaseClauses;
       
   226 
       
   227     QStringList debugPlatforms = allPlatforms;
       
   228     QStringList releasePlatforms = allPlatforms;
       
   229     releasePlatforms.removeAll(PLATFORM_WINSCW); // No release for emulator
       
   230 
       
   231     foreach(QString item, debugPlatforms) {
       
   232         if (item != PLATFORM_ARMV5 || !stripArmv5)
       
   233             debugClauses << configClause(item, debugBuild, winscwClause, gcceClause, genericClause);
       
   234     }
       
   235     foreach(QString item, releasePlatforms) {
       
   236         if (item != PLATFORM_ARMV5 || !stripArmv5)
       
   237             releaseClauses << configClause(item, releaseBuild, winscwClause, gcceClause, genericClause);
       
   238     }
       
   239     allClauses << debugClauses << releaseClauses;
   140 
   240 
   141     QTextStream t(&wrapperFile);
   241     QTextStream t(&wrapperFile);
   142 
   242 
   143     t << "# ==============================================================================" << endl;
   243     t << "# ==============================================================================" << endl;
   144     t << "# Generated by qmake (" << qmake_version() << ") (Qt " << QT_VERSION_STR << ") on: ";
   244     t << "# Generated by qmake (" << qmake_version() << ") (Qt " << QT_VERSION_STR << ") on: ";
   175             t << " -I\"" << values.at(i) << "\" ";
   275             t << " -I\"" << values.at(i) << "\" ";
   176         }
   276         }
   177     }
   277     }
   178     t << endl;
   278     t << endl;
   179     t << "first: default" << endl;
   279     t << "first: default" << endl;
   180     if (debugPlatforms.contains("winscw"))
   280     if (debugPlatforms.contains(PLATFORM_WINSCW))
   181         t << "default: debug-winscw";
   281         t << "default: debug-winscw";
   182     else if (debugPlatforms.contains("armv5"))
   282     else if (debugPlatforms.contains(PLATFORM_ARMV5))
   183         t << "default: debug-armv5";
   283         t << "default: debug-armv5";
   184     else if (debugPlatforms.size())
   284     else if (debugPlatforms.size())
   185         t << "default: debug-" << debugPlatforms.first();
   285         t << "default: debug-" << debugPlatforms.first();
   186     else
   286     else
   187         t << "default: all";
   287         t << "default: all";
   190     if (!isPrimaryMakefile) {
   290     if (!isPrimaryMakefile) {
   191         t << "all:" << endl;
   291         t << "all:" << endl;
   192     } else {
   292     } else {
   193         t << "all: debug release" << endl;
   293         t << "all: debug release" << endl;
   194         t << endl;
   294         t << endl;
       
   295 
       
   296         QString qmakeCmd = "\t$(QMAKE) \"" + project->projectFile() + "\" " + buildArgs();
       
   297 
   195         t << "qmake:" << endl;
   298         t << "qmake:" << endl;
   196         t << "\t$(QMAKE) -spec symbian-sbsv2 -o \"" << fileInfo(Option::output.fileName()).fileName()
   299         t << qmakeCmd << endl;
   197           << "\" \"" << project->projectFile() << "\"" << endl;
   300         t << endl;
   198         t << endl;
   301 
   199         t << BLD_INF_FILENAME ":" << endl;
   302         t << BLD_INF_FILENAME ": " << project->projectFile() << endl;
   200         t << "\t$(QMAKE)" << endl;
   303         t << qmakeCmd << endl;
   201         t << endl;
   304         t << endl;
   202 
   305 
   203         QString winscw("winscw");
   306         QString currentClause;
       
   307 
   204         t << "debug: " << BLD_INF_FILENAME << endl;
   308         t << "debug: " << BLD_INF_FILENAME << endl;
   205         t << "\t$(SBS)";
   309         t << "\t$(SBS)";
   206         foreach(QString item, debugPlatforms) {
   310         foreach(QString item, debugClauses) {
   207             if(QString::compare(item, winscw) == 0)
   311             t << item;
   208                 t << " -c " << item << "_udeb.mwccinc" << testClause;
       
   209             else
       
   210                 t << " -c " << item << "_udeb" << testClause;
       
   211         }
   312         }
   212         t << endl;
   313         t << endl;
   213         t << "release: " << BLD_INF_FILENAME << endl;
   314         t << "release: " << BLD_INF_FILENAME << endl;
   214         t << "\t$(SBS)";
   315         t << "\t$(SBS)";
   215         foreach(QString item, releasePlatforms) {
   316         foreach(QString item, releaseClauses) {
   216             if(QString::compare(item, winscw) == 0)
   317             t << item;
   217                 t << " -c " << item << "_urel.mwccinc" << testClause;
       
   218             else
       
   219                 t << " -c " << item << "_urel" << testClause;
       
   220         }
   318         }
   221         t << endl;
   319         t << endl;
   222 
   320 
   223         // For more specific builds, targets are in this form: build-platform, e.g. release-armv5
   321         // For more specific builds, targets are in this form: build-platform, e.g. release-armv5
   224         foreach(QString item, debugPlatforms) {
   322         foreach(QString item, debugPlatforms) {
   225             t << "debug-" << item << ": " << BLD_INF_FILENAME << endl;
   323             t << "debug-" << item << ": " << BLD_INF_FILENAME << endl;
   226             if(QString::compare(item, winscw) == 0)
   324             t << "\t$(SBS)";
   227                 t << "\t$(SBS) -c " << item << "_udeb.mwccinc" << testClause << endl;
   325             t << configClause(item, debugBuild, winscwClause, gcceClause, genericClause);
   228             else
   326             t << endl;
   229                 t << "\t$(SBS) -c " << item << "_udeb" << testClause << endl;
       
   230         }
   327         }
   231 
   328 
   232         foreach(QString item, releasePlatforms) {
   329         foreach(QString item, releasePlatforms) {
   233             t << "release-" << item << ": " << BLD_INF_FILENAME << endl;
   330             t << "release-" << item << ": " << BLD_INF_FILENAME << endl;
   234             if(QString::compare(item, winscw) == 0)
   331             t << "\t$(SBS)";
   235                 t << "\t$(SBS) -c " << item << "_urel.mwccinc" << testClause << endl;
   332             t << configClause(item, releaseBuild, winscwClause, gcceClause, genericClause);
   236             else
   333             t << endl;
   237                 t << "\t$(SBS) -c " << item << "_urel" << testClause << endl;
       
   238         }
   334         }
   239 
   335 
   240         t << endl;
   336         t << endl;
   241         t << "export: " << BLD_INF_FILENAME << endl;
   337         t << "export: " << BLD_INF_FILENAME << endl;
   242         t << "\t$(SBS) export" << endl;
   338         t << "\t$(SBS) export";
   243         t << endl;
   339         foreach(QString clause, allClauses) {
       
   340             t << clause;
       
   341         }
       
   342         t << endl << endl;
   244 
   343 
   245         t << "cleanexport: " << BLD_INF_FILENAME << endl;
   344         t << "cleanexport: " << BLD_INF_FILENAME << endl;
   246         t << "\t$(SBS) cleanexport" << endl;
   345         t << "\t$(SBS) cleanexport";
   247         t << endl;
   346         foreach(QString clause, allClauses) {
   248 
   347             t << clause;
       
   348         }
       
   349         t << endl << endl;
   249     }
   350     }
   250 
   351 
   251     // Add all extra targets including extra compiler targest also to wrapper makefile,
   352     // Add all extra targets including extra compiler targest also to wrapper makefile,
   252     // even though many of them may have already been added to bld.inf as FLMs.
   353     // even though many of them may have already been added to bld.inf as FLMs.
   253     // This is to enable use of targets like 'mocables', which call targets generated by extra compilers.
   354     // This is to enable use of targets like 'mocables', which call targets generated by extra compilers.
   261     }
   362     }
   262 
   363 
   263     generateDistcleanTargets(t);
   364     generateDistcleanTargets(t);
   264 
   365 
   265     t << "clean: " << BLD_INF_FILENAME << endl;
   366     t << "clean: " << BLD_INF_FILENAME << endl;
   266     t << "\t-$(SBS) reallyclean" << endl;
   367     t << "\t-$(SBS) reallyclean";
   267     t << endl;
   368     foreach(QString clause, allClauses) {
       
   369         t << clause;
       
   370     }
       
   371     t << endl << endl;
   268 
   372 
   269     t << "clean-debug: " << BLD_INF_FILENAME << endl;
   373     t << "clean-debug: " << BLD_INF_FILENAME << endl;
   270     t << "\t$(SBS) reallyclean";
   374     t << "\t$(SBS) reallyclean";
   271     foreach(QString item, debugPlatforms) {
   375     foreach(QString clause, debugClauses) {
   272         t << " -c " << item << "_udeb" << testClause;
   376         t << clause;
   273     }
   377     }
   274     t << endl;
   378     t << endl << endl;
   275     t << "clean-release: " << BLD_INF_FILENAME << endl;
   379     t << "clean-release: " << BLD_INF_FILENAME << endl;
   276     t << "\t$(SBS) reallyclean";
   380     t << "\t$(SBS) reallyclean";
   277     foreach(QString item, releasePlatforms) {
   381     foreach(QString clause, releaseClauses) {
   278         t << " -c " << item << "_urel" << testClause;
   382         t << clause;
   279     }
   383     }
   280     t << endl;
   384     t << endl << endl;
   281 
   385 
   282     // For more specific builds, targets are in this form: clean-build-platform, e.g. clean-release-armv5
   386     // For more specific builds, targets are in this form: clean-build-platform, e.g. clean-release-armv5
   283     foreach(QString item, debugPlatforms) {
   387     foreach(QString item, debugPlatforms) {
   284         t << "clean-debug-" << item << ": " << BLD_INF_FILENAME << endl;
   388         t << "clean-debug-" << item << ": " << BLD_INF_FILENAME << endl;
   285         t << "\t$(SBS) reallyclean -c " << item << "_udeb" << testClause << endl;
   389         t << "\t$(SBS) reallyclean";
       
   390         t << configClause(item, debugBuild, winscwClause, gcceClause, genericClause);
       
   391         t << endl;
   286     }
   392     }
   287     foreach(QString item, releasePlatforms) {
   393     foreach(QString item, releasePlatforms) {
   288         t << "clean-release-" << item << ": " << BLD_INF_FILENAME << endl;
   394         t << "clean-release-" << item << ": " << BLD_INF_FILENAME << endl;
   289         t << "\t$(SBS) reallyclean -c " << item << "_urel" << testClause << endl;
   395         t << "\t$(SBS) reallyclean";
       
   396         t << configClause(item, releaseBuild, winscwClause, gcceClause, genericClause);
       
   397         t << endl;
   290     }
   398     }
   291     t << endl;
   399     t << endl;
   292 }
   400 }
   293 
   401 
   294 void SymbianSbsv2MakefileGenerator::writeBldInfExtensionRulesPart(QTextStream& t, const QString &iconTargetFile)
   402 void SymbianSbsv2MakefileGenerator::writeBldInfExtensionRulesPart(QTextStream& t, const QString &iconTargetFile)
   308         for (int i = 0; i < values.size(); ++i) {
   416         for (int i = 0; i < values.size(); ++i) {
   309             incPath << QLatin1String(" -I\"") + values.at(i) + "\"";
   417             incPath << QLatin1String(" -I\"") + values.at(i) + "\"";
   310         }
   418         }
   311     }
   419     }
   312 
   420 
       
   421     QMap<QString, QString> commandsToReplace;
       
   422     commandsToReplace.insert(project->values("QMAKE_COPY").join(" "),
       
   423                              project->values("QMAKE_SBSV2_COPY").join(" "));
       
   424     commandsToReplace.insert(project->values("QMAKE_COPY_DIR").join(" "),
       
   425                              project->values("QMAKE_SBSV2_COPY_DIR").join(" "));
       
   426     commandsToReplace.insert(project->values("QMAKE_MOVE").join(" "),
       
   427                              project->values("QMAKE_SBSV2_MOVE").join(" "));
       
   428     commandsToReplace.insert(project->values("QMAKE_DEL_FILE").join(" "),
       
   429                              project->values("QMAKE_SBSV2_DEL_FILE").join(" "));
       
   430     commandsToReplace.insert(project->values("QMAKE_MKDIR").join(" "),
       
   431                              project->values("QMAKE_SBSV2_MKDIR").join(" "));
       
   432     commandsToReplace.insert(project->values("QMAKE_DEL_DIR").join(" "),
       
   433                              project->values("QMAKE_SBSV2_DEL_DIR").join(" "));
       
   434     commandsToReplace.insert(project->values("QMAKE_DEL_TREE").join(" "),
       
   435                              project->values("QMAKE_SBSV2_DEL_TREE").join(" "));
       
   436 
       
   437     // If commandItem starts with any $$QMAKE_* commands, do a replace for SBS equivalent
       
   438     // Command replacement is done only for the start of the command or right after
       
   439     // concatenation operators (&& and ||), as otherwise unwanted replacements might occur.
       
   440     static QString cmdFind("(^|&&\\s*|\\|\\|\\s*)%1");
       
   441     static QString cmdReplace("\\1%1");
       
   442 
   313     // Write extra compilers and targets to initialize QMAKE_ET_* variables
   443     // Write extra compilers and targets to initialize QMAKE_ET_* variables
   314     // Cache results to avoid duplicate calls when creating wrapper makefile
   444     // Cache results to avoid duplicate calls when creating wrapper makefile
   315     QTextStream extraCompilerStream(&extraCompilersCache);
   445     QTextStream extraCompilerStream(&extraCompilersCache);
   316     QTextStream extraTargetStream(&extraTargetsCache);
   446     QTextStream extraTargetStream(&extraTargetsCache);
   317     writeExtraCompilerTargets(extraCompilerStream);
   447     writeExtraCompilerTargets(extraCompilerStream);
   319 
   449 
   320     // Figure out everything the target depends on as we don't want to run extra targets that
   450     // Figure out everything the target depends on as we don't want to run extra targets that
   321     // are not necessary.
   451     // are not necessary.
   322     QStringList allPreDeps;
   452     QStringList allPreDeps;
   323     foreach(QString item, project->values("PRE_TARGETDEPS")) {
   453     foreach(QString item, project->values("PRE_TARGETDEPS")) {
   324         // Predeps get mangled in windows, so fix them to more sbsv2 friendly format
   454         allPreDeps.append(fileInfo(item).absoluteFilePath());
   325 #if defined(Q_OS_WIN)
       
   326         if (item.mid(1, 1) == ":")
       
   327             item = item.mid(0, 1).toUpper().append(item.mid(1)); // Fix drive to uppercase
       
   328 #endif
       
   329         item.replace("\\", "/");
       
   330         allPreDeps << escapeDependencyPath(item);
       
   331     }
   455     }
   332 
   456 
   333     foreach (QString item, project->values("GENERATED_SOURCES")) {
   457     foreach (QString item, project->values("GENERATED_SOURCES")) {
   334         allPreDeps.append(fileInfo(item).absoluteFilePath());
   458         allPreDeps.append(fileInfo(item).absoluteFilePath());
   335     }
   459     }
   355             QString absoluteTarget = fileInfo(targetItem).absoluteFilePath();
   479             QString absoluteTarget = fileInfo(targetItem).absoluteFilePath();
   356             if (allPreDeps.contains(absoluteTarget)) {
   480             if (allPreDeps.contains(absoluteTarget)) {
   357                 QStringList deps = project->values(QLatin1String("QMAKE_INTERNAL_ET_PARSED_DEPS.") + item + targetItem);
   481                 QStringList deps = project->values(QLatin1String("QMAKE_INTERNAL_ET_PARSED_DEPS.") + item + targetItem);
   358                 QString commandItem =  project->values(QLatin1String("QMAKE_INTERNAL_ET_PARSED_CMD.") + item + targetItem).join(" ");
   482                 QString commandItem =  project->values(QLatin1String("QMAKE_INTERNAL_ET_PARSED_CMD.") + item + targetItem).join(" ");
   359 
   483 
   360 
       
   361                 // Make sure all deps paths are absolute
   484                 // Make sure all deps paths are absolute
   362                 QString absoluteDeps;
   485                 QString absoluteDeps;
   363                 foreach (QString depItem, deps) {
   486                 foreach (QString depItem, deps) {
   364                     if (!depItem.isEmpty()) {
   487                     if (!depItem.isEmpty()) {
   365                         absoluteDeps.append(fileInfo(depItem).absoluteFilePath());
   488                         absoluteDeps.append(fileInfo(depItem).absoluteFilePath());
   369 
   492 
   370                 t << "START EXTENSION qt/qmake_extra_pre_targetdep.export" << endl;
   493                 t << "START EXTENSION qt/qmake_extra_pre_targetdep.export" << endl;
   371                 t << "OPTION PREDEP_TARGET " << absoluteTarget << endl;
   494                 t << "OPTION PREDEP_TARGET " << absoluteTarget << endl;
   372                 t << "OPTION DEPS " << absoluteDeps << endl;
   495                 t << "OPTION DEPS " << absoluteDeps << endl;
   373 
   496 
       
   497                 // Iterate command replacements in reverse alphabetical order of keys so
       
   498                 // that keys which are starts of other longer keys are iterated after longer keys.
       
   499                 QMapIterator<QString, QString> cmdIter(commandsToReplace);
       
   500                 cmdIter.toBack();
       
   501                 while (cmdIter.hasPrevious()) {
       
   502                     cmdIter.previous();
       
   503                     if (commandItem.contains(cmdIter.key())) {
       
   504                         commandItem.replace(QRegExp(cmdFind.arg(cmdIter.key())),
       
   505                                             cmdReplace.arg(cmdIter.value()));
       
   506                     }
       
   507                 }
       
   508 
   374                 if (commandItem.indexOf("$(INCPATH)") != -1)
   509                 if (commandItem.indexOf("$(INCPATH)") != -1)
   375                     commandItem.replace("$(INCPATH)", incPath.join(" "));
   510                     commandItem.replace("$(INCPATH)", incPath.join(" "));
   376                 if (commandItem.indexOf("$(DEFINES)") != -1)
   511                 if (commandItem.indexOf("$(DEFINES)") != -1)
   377                     commandItem.replace("$(DEFINES)", defines.join(" "));
   512                     commandItem.replace("$(DEFINES)", defines.join(" "));
   378 
   513 
   386     }
   521     }
   387 
   522 
   388     t << endl;
   523     t << endl;
   389     
   524     
   390     //loc change starts
   525     //loc change starts
   391     QString translationFilename = project->first("TRANSLATIONS");
   526     //QString translationFilename = project->first("TRANSLATIONS");
   392     if (!project->values("SYMBIANTRANSLATIONS").isEmpty() && !translationFilename.isEmpty()) {
   527     if (!project->values("SYMBIANTRANSLATIONS").isEmpty() && !project->first("TRANSLATIONS").isEmpty()) {
       
   528         QStringList translationFilenames = project->values("TRANSLATIONS");
       
   529         foreach (const QString &translationFilename, translationFilenames) {
   393         QStringList symbianTranslations = project->values("SYMBIANTRANSLATIONS");
   530         QStringList symbianTranslations = project->values("SYMBIANTRANSLATIONS");
   394         QString symbianTrPath = project->first("SYMBIANTRANSLATIONDIR");
   531         QString symbianTrPath = project->first("SYMBIANTRANSLATIONDIR");
   395         QString symbianTrSrcPath = project->first("SYMBIANTRANSLATIONSRCDIR");    	
   532         QString symbianTrSrcPath = project->first("SYMBIANTRANSLATIONSRCDIR");    	
   396         QString symbianWinscwUdebQmPath = project->first("SYMBIANWINSCWUDEBTRANSLATIONDIR");  
   533         QString symbianWinscwUdebQmPath = project->first("SYMBIANWINSCWUDEBTRANSLATIONDIR");  
   397         QString symbianWinscwUrelQmPath = project->first("SYMBIANWINSCWURELTRANSLATIONDIR");  
   534         QString symbianWinscwUrelQmPath = project->first("SYMBIANWINSCWURELTRANSLATIONDIR");  
   449             t << "OPTION QMFILE " << translationQmWinscwUrelFilename << endl;
   586             t << "OPTION QMFILE " << translationQmWinscwUrelFilename << endl;
   450             t << "END" << endl;
   587             t << "END" << endl;
   451             t << endl;
   588             t << endl;
   452         }
   589         }
   453     }
   590     }
       
   591   }
   454     //QTP: loc change end
   592     //QTP: loc change end
   455     
   593     
   456     // Write deployment rules
   594     // Write deployment rules
   457     QString remoteTestPath = epocRoot() + QLatin1String("epoc32/winscw/c/private/") + privateDirUid;
   595     QString remoteTestPath = epocRoot() + QLatin1String("epoc32/winscw/c/private/") + privateDirUid;
   458     DeploymentList depList;
   596     DeploymentList depList;