qmake/generators/symbian/symmake.cpp
changeset 37 758a864f9613
parent 33 3e2da88830cd
equal deleted inserted replaced
36:ef0373b55136 37:758a864f9613
   244         return true;
   244         return true;
   245     }
   245     }
   246 
   246 
   247     writeMkFile(wrapperFileName, false);
   247     writeMkFile(wrapperFileName, false);
   248 
   248 
   249     QString shortProFilename = project->projectFile();
   249     QString absoluteMmpFileName = Option::output_dir + QLatin1Char('/') + mmpFileName;
   250     shortProFilename.replace(0, shortProFilename.lastIndexOf("/") + 1, QString(""));
   250     writeMmpFile(absoluteMmpFileName, symbianLangCodes);
   251     shortProFilename.replace(Option::pro_ext, QString(""));
       
   252 
       
   253     QString mmpFilename = Option::output_dir + QLatin1Char('/') + shortProFilename + QLatin1Char('_')
       
   254                           + uid3 + Option::mmp_ext;
       
   255     writeMmpFile(mmpFilename, symbianLangCodes);
       
   256 
   251 
   257     if (targetType == TypeExe) {
   252     if (targetType == TypeExe) {
   258         if (!project->isActiveConfig("no_icon")) {
   253         if (!project->isActiveConfig("no_icon")) {
   259             writeRegRssFile(userRssRules);
   254             writeRegRssFile(userRssRules);
   260             writeRssFile(numberOfIcons, iconFile);
   255             writeRssFile(numberOfIcons, iconFile);
   287 
   282 
   288     // bld.inf
   283     // bld.inf
   289     project->values("MAKEFILE") += BLD_INF_FILENAME;
   284     project->values("MAKEFILE") += BLD_INF_FILENAME;
   290 
   285 
   291     // .mmp
   286     // .mmp
       
   287     mmpFileName = fixedTarget;
       
   288     if (targetType == TypeExe)
       
   289         mmpFileName.append("_exe");
       
   290     else if (targetType == TypeDll || targetType == TypePlugin)
       
   291         mmpFileName.append("_dll");
       
   292     else if (targetType == TypeLib)
       
   293         mmpFileName.append("_lib");
       
   294     mmpFileName.append(Option::mmp_ext);
       
   295 
   292     initMmpVariables();
   296     initMmpVariables();
   293 
   297 
   294     uid2 = project->first("TARGET.UID2");
   298     uid2 = project->first("TARGET.UID2");
   295 
   299 
   296     uid2 = uid2.trimmed();
   300     uid2 = uid2.trimmed();
   486     t << "// ==============================================================================" << endl;
   490     t << "// ==============================================================================" << endl;
   487     t << "// Generated by qmake (" << qmake_version() << ") (Qt " QT_VERSION_STR ") on: ";
   491     t << "// Generated by qmake (" << qmake_version() << ") (Qt " QT_VERSION_STR ") on: ";
   488     t << QDateTime::currentDateTime().toString(Qt::ISODate) << endl;
   492     t << QDateTime::currentDateTime().toString(Qt::ISODate) << endl;
   489     t << "// This file is generated by qmake and should not be modified by the" << endl;
   493     t << "// This file is generated by qmake and should not be modified by the" << endl;
   490     t << "// user." << endl;
   494     t << "// user." << endl;
   491     t << "//  Name        : " << escapeFilePath(fileFixify(project->projectFile().remove(project->projectFile().length() - 4, 4))) << Option::mmp_ext << endl;
   495     t << "//  Name        : " << mmpFileName << endl;
   492     t << "// ==============================================================================" << endl << endl;
   496     t << "// ==============================================================================" << endl << endl;
   493 }
   497 }
   494 
   498 
   495 void SymbianMakefileGenerator::writeMmpFile(QString &filename, QStringList &symbianLangCodes)
   499 void SymbianMakefileGenerator::writeMmpFile(QString &filename, QStringList &symbianLangCodes)
   496 {
   500 {
   695         regTarget.append("_reg.rss");
   699         regTarget.append("_reg.rss");
   696 
   700 
   697         t << "SOURCEPATH\t\t\t." << endl;
   701         t << "SOURCEPATH\t\t\t." << endl;
   698         t << MMP_START_RESOURCE "\t\t" << regTarget << endl;
   702         t << MMP_START_RESOURCE "\t\t" << regTarget << endl;
   699         if (isForSymbianSbsv2())
   703         if (isForSymbianSbsv2())
   700             t << "DEPENDS " << fixedTarget << ".rsg" << endl;
   704             t << "DEPENDS " << fixedTarget.toLower() << ".rsg" << endl;
   701         t << "TARGETPATH\t\t" REGISTRATION_RESOURCE_DIRECTORY_HW << endl;
   705         t << "TARGETPATH\t\t" REGISTRATION_RESOURCE_DIRECTORY_HW << endl;
   702         t << MMP_END_RESOURCE << endl << endl;
   706         t << MMP_END_RESOURCE << endl << endl;
   703     }
   707     }
   704 }
   708 }
   705 
   709 
   922         }
   926         }
   923     }
   927     }
   924 
   928 
   925     // Add includes of subdirs bld.inf files
   929     // Add includes of subdirs bld.inf files
   926 
   930 
   927     QString mmpfilename = escapeFilePath(fileFixify(project->projectFile()));
       
   928     mmpfilename = mmpfilename.replace(mmpfilename.lastIndexOf("."), 4, Option::mmp_ext);
       
   929     QString currentPath = qmake_getpwd();
   931     QString currentPath = qmake_getpwd();
   930     QDir directory(currentPath);
   932     QDir directory(currentPath);
   931 
   933 
   932     const QStringList &subdirs = project->values("SUBDIRS");
   934     const QStringList &subdirs = project->values("SUBDIRS");
   933     foreach(QString item, subdirs) {
   935     foreach(QString item, subdirs) {
  1005         mmpTag = QLatin1String(BLD_INF_TAG_MMPFILES);
  1007         mmpTag = QLatin1String(BLD_INF_TAG_MMPFILES);
  1006 
  1008 
  1007     t << endl << mmpTag << endl << endl;
  1009     t << endl << mmpTag << endl << endl;
  1008 
  1010 
  1009     writeBldInfMkFilePart(t, addDeploymentExtension);
  1011     writeBldInfMkFilePart(t, addDeploymentExtension);
  1010     if (targetType != TypeSubdirs) {
  1012     if (targetType != TypeSubdirs)
  1011         QString shortProFilename = project->projectFile();
  1013         t << mmpFileName << endl;
  1012         shortProFilename.replace(0, shortProFilename.lastIndexOf("/") + 1, QString(""));
       
  1013         shortProFilename.replace(Option::pro_ext, QString(""));
       
  1014 
       
  1015         QString mmpFilename = shortProFilename + QString("_") + uid3 + Option::mmp_ext;
       
  1016 
       
  1017         t << mmpFilename << endl;
       
  1018     }
       
  1019 
  1014 
  1020     userItems = userBldInfRules.value(mmpTag);
  1015     userItems = userBldInfRules.value(mmpTag);
  1021     foreach(QString item, userItems)
  1016     foreach(QString item, userItems)
  1022         t << item << endl;
  1017         t << item << endl;
  1023     userBldInfRules.remove(mmpTag);
  1018     userBldInfRules.remove(mmpTag);