qmake/generators/symbian/symmake_abld.cpp
changeset 3 41300fa6a67c
parent 0 1918ee327afb
child 4 3b1da2848fc7
child 7 f7bc934e204c
child 18 2f34d5167611
equal deleted inserted replaced
2:56cd8111b7f7 3:41300fa6a67c
    95         t << "#  Version     : " << endl;
    95         t << "#  Version     : " << endl;
    96         t << "#" << endl;
    96         t << "#" << endl;
    97         t << "# ==============================================================================" << "\n" << endl;
    97         t << "# ==============================================================================" << "\n" << endl;
    98 
    98 
    99         t << endl << endl;
    99         t << endl << endl;
   100         
   100 
   101         t << "MAKE = make" << endl;
   101         t << "MAKE = make" << endl;
   102         t << endl;
   102         t << endl;
   103         
   103 
   104         t << "VISUAL_CFG = RELEASE" << endl;
   104         t << "VISUAL_CFG = RELEASE" << endl;
   105         t << "ifeq \"$(CFG)\" \"UDEB\"" << endl;        
   105         t << "ifeq \"$(CFG)\" \"UDEB\"" << endl;
   106         t << "VISUAL_CFG = DEBUG" << endl;        
   106         t << "VISUAL_CFG = DEBUG" << endl;
   107         t << "endif" << endl;           
   107         t << "endif" << endl;
   108         t << endl;        
   108         t << endl;
   109 
   109 
   110         t << DO_NOTHING_TARGET " :" << endl;
   110         t << DO_NOTHING_TARGET " :" << endl;
   111         t << "\t" << "@rem " DO_NOTHING_TARGET << endl << endl;
   111         t << "\t" << "@rem " DO_NOTHING_TARGET << endl << endl;
   112 
   112 
   113         QString buildDeps;
   113         QString buildDeps;
   152         t << "CLEAN: " << cleanDepsWinscw << endl;
   152         t << "CLEAN: " << cleanDepsWinscw << endl;
   153         t << "else" << endl;
   153         t << "else" << endl;
   154         t << "CLEAN: " << cleanDeps << endl;
   154         t << "CLEAN: " << cleanDeps << endl;
   155         t << "endif" << endl << endl;
   155         t << "endif" << endl << endl;
   156         t << "CLEANLIB: " DO_NOTHING_TARGET << endl << endl;
   156         t << "CLEANLIB: " DO_NOTHING_TARGET << endl << endl;
   157         t << "RESOURCE: " DO_NOTHING_TARGET << endl << endl;
   157 
       
   158         QStringList qmFileNames;
       
   159         QString translationFilename = project->first("TRANSLATIONS");
       
   160         if (!project->values("SYMBIANTRANSLATIONS").isEmpty() && !translationFilename.isEmpty()) {
       
   161             QStringList symbianTranslations = project->values("SYMBIANTRANSLATIONS");
       
   162             QString symbianTrPath = project->first("SYMBIANTRANSLATIONDIR");
       
   163             t << "RESOURCE: create_qm" << endl << endl;
       
   164             t << "create_qm : " << endl;
       
   165             foreach (const QString &symbianTrans, symbianTranslations) {
       
   166                 QString translationTsFilename(translationFilename);
       
   167                 translationTsFilename.chop(3);
       
   168                 translationTsFilename.insert(0,symbianTrPath);
       
   169                 translationTsFilename.append(QString::fromLatin1("_"));
       
   170                 translationTsFilename.append(symbianTrans);
       
   171                 QString translationQmFilename(translationTsFilename);
       
   172                 translationTsFilename.append(QString::fromLatin1(".ts"));
       
   173                 translationQmFilename.append(QString::fromLatin1(".qm"));
       
   174                 t << "\t$(EPOCROOT)epoc32\\tools\\qt\\lrelease -silent -idbased " << translationTsFilename << " -qm " << translationQmFilename << endl;
       
   175                 // qmFileNames are needed in RELEASABLES: part
       
   176                 qmFileNames.append(translationQmFilename);
       
   177             }
       
   178             t << endl;
       
   179         } else {
       
   180             t << "RESOURCE: " DO_NOTHING_TARGET << endl << endl;
       
   181         }
   158         t << "FREEZE: " DO_NOTHING_TARGET << endl << endl;
   182         t << "FREEZE: " DO_NOTHING_TARGET << endl << endl;
   159         t << "SAVESPACE: " DO_NOTHING_TARGET << endl << endl;
   183         t << "SAVESPACE: " DO_NOTHING_TARGET << endl << endl;
   160         t << "RELEASABLES: " DO_NOTHING_TARGET << endl << endl;
   184 
       
   185         if (!project->values("SYMBIANTRANSLATIONS").isEmpty() && !qmFileNames.isEmpty()) {
       
   186             t << "RELEASABLES: list_qm" << endl << endl;
       
   187             t << "list_qm : " << endl;
       
   188             foreach (const QString &qmFilename, qmFileNames) {
       
   189                 t << "\t@echo " << qmFilename << endl;
       
   190             }
       
   191             t << endl;
       
   192         } else {
       
   193             t << "RELEASABLES: " DO_NOTHING_TARGET << endl << endl;
       
   194         }
   161         t << "ifeq \"$(PLATFORM)\" \"WINSCW\"" << endl;
   195         t << "ifeq \"$(PLATFORM)\" \"WINSCW\"" << endl;
   162         t << "FINAL: " << finalDepsWinscw << endl;
   196         t << "FINAL: " << finalDepsWinscw << endl;
   163         t << "else" << endl;
   197         t << "else" << endl;
   164         t << "FINAL: " << finalDeps << endl;
   198         t << "FINAL: " << finalDeps << endl;
   165         t << "endif" << endl << endl;
   199         t << "endif" << endl << endl;
   166 
   200 
   167         QString makefile(Option::fixPathToTargetOS(fileInfo(wrapperFileName).canonicalFilePath()));
   201         QString makefile(Option::fixPathToTargetOS(fileInfo(wrapperFileName).canonicalFilePath()));
   168         foreach(QString target, wrapperTargets) {
   202         foreach(QString target, wrapperTargets) {
   169             t << target << " : " << makefile << endl;
   203             t << target << " : " << makefile << endl;
   170             t << "\t-$(MAKE) -f \"" << makefile << "\" " << target << " QT_SIS_TARGET=$(VISUAL_CFG)-$(PLATFORM)" << endl << endl;                    
   204             t << "\t-$(MAKE) -f \"" << makefile << "\" " << target << " QT_SIS_TARGET=$(VISUAL_CFG)-$(PLATFORM)" << endl << endl;
   171         }     
   205         }
   172         
   206 
   173         t << endl;
   207         t << endl;
   174     } // if(ft.open(QIODevice::WriteOnly))
   208     } // if(ft.open(QIODevice::WriteOnly))
   175 }
   209 }
   176 
   210 
   177 void SymbianAbldMakefileGenerator::writeWrapperMakefile(QFile& wrapperFile, bool isPrimaryMakefile)
   211 void SymbianAbldMakefileGenerator::writeWrapperMakefile(QFile& wrapperFile, bool isPrimaryMakefile)
   392     t << endl;
   426     t << endl;
   393 
   427 
   394     // Create execution target
   428     // Create execution target
   395     if (debugPlatforms.contains("winscw") && targetType == TypeExe) {
   429     if (debugPlatforms.contains("winscw") && targetType == TypeExe) {
   396         t << "run:" << endl;
   430         t << "run:" << endl;
   397         t << "\t-call " << epocRoot() << "epoc32\\release\\winscw\\udeb\\" << removePathSeparators(escapeFilePath(fileFixify(project->first("TARGET"))).append(".exe")) << endl << endl;
   431         t << "\t-call " << epocRoot() << "epoc32\\release\\winscw\\udeb\\" << fixedTarget << ".exe" << endl << endl;
   398     }
   432     }
   399 }
   433 }
   400 
   434 
   401 void SymbianAbldMakefileGenerator::writeBldInfExtensionRulesPart(QTextStream& t)
   435 void SymbianAbldMakefileGenerator::writeBldInfExtensionRulesPart(QTextStream& t, const QString &iconTargetFile)
   402 {
   436 {
   403     // We don't use extensions for anything in abld
   437     // We don't use extensions for anything in abld
   404     Q_UNUSED(t);
   438     Q_UNUSED(t);
       
   439     Q_UNUSED(iconTargetFile);
   405 }
   440 }
   406 
   441 
   407 //:QTP:QTPROD-92 Deployment of plugins requires WINSCW build before ARM build
   442 //:QTP:QTPROD-92 Deployment of plugins requires WINSCW build before ARM build
   408 bool SymbianAbldMakefileGenerator::writeDeploymentTargets(QTextStream &t, bool isRelease /*= false*/)
   443 bool SymbianAbldMakefileGenerator::writeDeploymentTargets(QTextStream &t, bool isRelease /*= false*/)
   409 {
   444 {
   477         removeSpecialCharacters(gnuMakefileName);
   512         removeSpecialCharacters(gnuMakefileName);
   478         gnuMakefileName.append(".mk");
   513         gnuMakefileName.append(".mk");
   479         t << "gnumakefile " << gnuMakefileName << endl;
   514         t << "gnumakefile " << gnuMakefileName << endl;
   480     }
   515     }
   481 }
   516 }
       
   517 
       
   518 void SymbianAbldMakefileGenerator::appendAbldTempDirs(QStringList& sysincspaths, QString includepath)
       
   519 {
       
   520     // As a workaround for Symbian toolchain insistence to treat include
       
   521     // statements as relative to source file rather than the file they appear in,
       
   522     // we generate extra temporary include directories to make
       
   523     // relative include paths used in various headers to work properly.
       
   524     // Note that this is not a fix-all solution; it's just a stop-gap measure
       
   525     // to make Qt itself build until toolchain can support relative includes in
       
   526     // a way that Qt expects.
       
   527     QString epocPath("epoc32");
       
   528     if (!includepath.contains(epocPath)) // No temp dirs for epoc includes
       
   529         appendIfnotExist(sysincspaths, includepath + QString("/" QT_EXTRA_INCLUDE_DIR));
       
   530 }