diff -r 41300fa6a67c -r f7bc934e204c qmake/generators/symbian/symmake_abld.cpp --- a/qmake/generators/symbian/symmake_abld.cpp Tue Feb 02 00:43:10 2010 +0200 +++ b/qmake/generators/symbian/symmake_abld.cpp Wed Mar 31 11:06:36 2010 +0300 @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** @@ -48,6 +48,9 @@ #include #include +// Included from tools/shared +#include + #define DO_NOTHING_TARGET "do_nothing" #define CREATE_TEMPS_TARGET "create_temps" #define EXTENSION_CLEAN "extension_clean" @@ -56,15 +59,11 @@ #define FINALIZE_TARGET "finalize" #define GENERATED_SOURCES_TARGET "generated_sources" #define ALL_SOURCE_DEPS_TARGET "all_source_deps" -//:QTP:QTPROD-92 Deployment of plugins requires WINSCW build before ARM build #define DEPLOYMENT_TARGET "deployment" #define DEPLOYMENT_CLEAN_TARGET "deployment_clean" #define WINSCW_DEPLOYMENT_TARGET "winscw_deployment" #define WINSCW_DEPLOYMENT_CLEAN_TARGET "winscw_deployment_clean" -/* :QTP:QTPROD-155: Don't write .make.cache during the compilation, it causes dependency problems in - * the parallel build clusters - */ -#define STORE_BUILD_TARGET "" +#define STORE_BUILD_TARGET "store_build" SymbianAbldMakefileGenerator::SymbianAbldMakefileGenerator() : SymbianMakefileGenerator() { } SymbianAbldMakefileGenerator::~SymbianAbldMakefileGenerator() { } @@ -116,24 +115,23 @@ QString cleanDepsWinscw; QString finalDepsWinscw; QStringList wrapperTargets; - //:QTP:QTPROD-92 Deployment of plugins requires WINSCW build before ARM build if (deploymentOnly) { buildDeps.append(STORE_BUILD_TARGET); cleanDeps.append(DEPLOYMENT_CLEAN_TARGET); - cleanDepsWinscw.append(WINSCW_DEPLOYMENT_CLEAN_TARGET); + cleanDepsWinscw.append(WINSCW_DEPLOYMENT_CLEAN_TARGET " " DEPLOYMENT_CLEAN_TARGET); finalDeps.append(DEPLOYMENT_TARGET); - finalDepsWinscw.append(WINSCW_DEPLOYMENT_TARGET); + finalDepsWinscw.append(WINSCW_DEPLOYMENT_TARGET " " DEPLOYMENT_TARGET); wrapperTargets << WINSCW_DEPLOYMENT_TARGET - << WINSCW_DEPLOYMENT_CLEAN_TARGET - << DEPLOYMENT_TARGET - << DEPLOYMENT_CLEAN_TARGET + << WINSCW_DEPLOYMENT_CLEAN_TARGET + << DEPLOYMENT_TARGET + << DEPLOYMENT_CLEAN_TARGET << STORE_BUILD_TARGET; } else { buildDeps.append(CREATE_TEMPS_TARGET " " PRE_TARGETDEPS_TARGET " " STORE_BUILD_TARGET); cleanDeps.append(EXTENSION_CLEAN " " DEPLOYMENT_CLEAN_TARGET); - cleanDepsWinscw.append(EXTENSION_CLEAN " " WINSCW_DEPLOYMENT_CLEAN_TARGET); + cleanDepsWinscw.append(EXTENSION_CLEAN " " WINSCW_DEPLOYMENT_CLEAN_TARGET " " DEPLOYMENT_CLEAN_TARGET); finalDeps.append(FINALIZE_TARGET " " DEPLOYMENT_TARGET); - finalDepsWinscw.append(FINALIZE_TARGET " " WINSCW_DEPLOYMENT_TARGET); + finalDepsWinscw.append(FINALIZE_TARGET " " WINSCW_DEPLOYMENT_TARGET " " DEPLOYMENT_TARGET); wrapperTargets << PRE_TARGETDEPS_TARGET << CREATE_TEMPS_TARGET << EXTENSION_CLEAN @@ -155,39 +153,79 @@ t << "endif" << endl << endl; t << "CLEANLIB: " DO_NOTHING_TARGET << endl << endl; - QStringList qmFileNames; - QString translationFilename = project->first("TRANSLATIONS"); - if (!project->values("SYMBIANTRANSLATIONS").isEmpty() && !translationFilename.isEmpty()) { - QStringList symbianTranslations = project->values("SYMBIANTRANSLATIONS"); - QString symbianTrPath = project->first("SYMBIANTRANSLATIONDIR"); - t << "RESOURCE: create_qm" << endl << endl; - t << "create_qm : " << endl; - foreach (const QString &symbianTrans, symbianTranslations) { - QString translationTsFilename(translationFilename); - translationTsFilename.chop(3); - translationTsFilename.insert(0,symbianTrPath); - translationTsFilename.append(QString::fromLatin1("_")); - translationTsFilename.append(symbianTrans); - QString translationQmFilename(translationTsFilename); - translationTsFilename.append(QString::fromLatin1(".ts")); - translationQmFilename.append(QString::fromLatin1(".qm")); - t << "\t$(EPOCROOT)epoc32\\tools\\qt\\lrelease -silent -idbased " << translationTsFilename << " -qm " << translationQmFilename << endl; - // qmFileNames are needed in RELEASABLES: part - qmFileNames.append(translationQmFilename); + QStringList trFileNames; + if (!project->values("SYMBIANTRANSLATIONS").isEmpty()) { + QString translationFilename = project->first("TRANSLATIONS"); + if (!translationFilename.isEmpty()) { + QStringList symbianTranslations = project->values("SYMBIANTRANSLATIONS"); + QString symbianTrPath = project->first("SYMBIANTRANSLATIONDIR"); + QString symbianTrSrcPath = project->first("SYMBIANTRANSLATIONSRCDIR"); + QString symbianWinscwUdebQmPath = project->first("SYMBIANWINSCWUDEBTRANSLATIONDIR"); + QString symbianWinscwUrelQmPath = project->first("SYMBIANWINSCWURELTRANSLATIONDIR"); + t << "RESOURCE: create_qm" << endl << endl; + t << "create_qm : " << endl; + foreach (const QString &symbianTrans, symbianTranslations) { + QString translationTsFilename(translationFilename); + translationTsFilename.chop(3); + translationTsFilename.insert(0,symbianTrPath); + translationTsFilename.append(QString::fromLatin1("_")); + translationTsFilename.append(symbianTrans); + QString translationQmFilename(translationTsFilename); + + translationTsFilename.append(QString::fromLatin1(".ts")); + // output path for armv5 qm files./epoc32/data/z/resource/qt/translations/ + translationQmFilename.append(QString::fromLatin1(".qm")); + + // input path for ts files. /epoc32/include/platform/qt/translations/ + QString translationTsSrcFilename(translationFilename); + translationTsSrcFilename.chop(3); + translationTsSrcFilename.insert(0,symbianTrSrcPath); + translationTsSrcFilename.append(QString::fromLatin1("_")); + translationTsSrcFilename.append(symbianTrans); + translationTsSrcFilename.append(QString::fromLatin1(".ts")); + + // output path for winscw qm files. /epoc32/release/winscw/udeb/z/resource/qt/translations/ + QString translationQmWinscwUdebFilename(translationFilename); + translationQmWinscwUdebFilename.chop(3); + translationQmWinscwUdebFilename.insert(0,symbianWinscwUdebQmPath); + translationQmWinscwUdebFilename.append(QString::fromLatin1("_")); + translationQmWinscwUdebFilename.append(symbianTrans); + translationQmWinscwUdebFilename.append(QString::fromLatin1(".qm")); + + // output path for winscw qm files. /epoc32/release/winscw/urel/z/resource/qt/translations/ + QString translationQmWinscwUrelFilename(translationFilename); + translationQmWinscwUrelFilename.chop(3); + translationQmWinscwUrelFilename.insert(0,symbianWinscwUrelQmPath); + translationQmWinscwUrelFilename.append(QString::fromLatin1("_")); + translationQmWinscwUrelFilename.append(symbianTrans); + translationQmWinscwUrelFilename.append(QString::fromLatin1(".qm")); + + //these get generated to component mk file. + t << "\tlrelease -silent -idbased " << translationTsSrcFilename << " -qm " << translationQmFilename << endl; + t << "\tlrelease -silent -idbased " << translationTsSrcFilename << " -qm " << translationQmWinscwUdebFilename << endl; + t << "\tlrelease -silent -idbased " << translationTsSrcFilename << " -qm " << translationQmWinscwUrelFilename << endl; + + // trFileNames QStringList needed in RELEASABLES part + trFileNames.append(translationQmFilename); + trFileNames.append(translationQmWinscwUdebFilename); + trFileNames.append(translationQmWinscwUrelFilename); + } + t << endl; } - t << endl; + else + t << "RESOURCE: " DO_NOTHING_TARGET << endl << endl; } else { t << "RESOURCE: " DO_NOTHING_TARGET << endl << endl; } t << "FREEZE: " DO_NOTHING_TARGET << endl << endl; t << "SAVESPACE: " DO_NOTHING_TARGET << endl << endl; - if (!project->values("SYMBIANTRANSLATIONS").isEmpty() && !qmFileNames.isEmpty()) { + if (!project->values("SYMBIANTRANSLATIONS").isEmpty()) { t << "RELEASABLES: list_qm" << endl << endl; t << "list_qm : " << endl; - foreach (const QString &qmFilename, qmFileNames) { - t << "\t@echo " << qmFilename << endl; - } + foreach (const QString &trFilename, trFileNames) { + t << "\t@echo " << trFilename << endl; + } t << endl; } else { t << "RELEASABLES: " DO_NOTHING_TARGET << endl << endl; @@ -220,7 +258,7 @@ releasePlatforms.removeAll("winscw"); // No release for emulator QString testClause; - if (project->values("CONFIG").contains("symbian_test", Qt::CaseInsensitive)) + if (project->isActiveConfig(SYMBIAN_TEST_CONFIG)) testClause = QLatin1String(" test"); else testClause = QLatin1String(""); @@ -243,6 +281,8 @@ t << "DEL_FILE = " << var("QMAKE_DEL_FILE") << endl; t << "DEL_DIR = " << var("QMAKE_DEL_DIR") << endl; t << "MOVE = " << var("QMAKE_MOVE") << endl; + t << "CHK_DIR_EXISTS = " << var("QMAKE_CHK_DIR_EXISTS") << endl; + t << "MKDIR = " << var("QMAKE_MKDIR") << endl; t << "XCOPY = xcopy /d /f /h /r /y /i" << endl; t << "ABLD = ABLD.BAT" << endl; t << "DEBUG_PLATFORMS = " << debugPlatforms.join(" ") << endl; @@ -407,16 +447,13 @@ qDeleteAll(subtargets); } - writeDeploymentTargets(t); - //:QTP:QTPROD-92 Deployment of plugins requires WINSCW build before ARM build - writeDeploymentTargets(t, true); + // Deploymend targets for both emulator and rom deployment + writeDeploymentTargets(t, false); + writeDeploymentTargets(t, true); writeSisTargets(t); - /* :QTP:QTPROD-155: Don't write .make.cache during the compilation, it causes dependency problems in - * the parallel build clusters writeStoreBuildTarget(t); - */ generateDistcleanTargets(t); @@ -425,11 +462,29 @@ t << "\t-bldmake clean" << endl; t << endl; - // Create execution target - if (debugPlatforms.contains("winscw") && targetType == TypeExe) { - t << "run:" << endl; - t << "\t-call " << epocRoot() << "epoc32\\release\\winscw\\udeb\\" << fixedTarget << ".exe" << endl << endl; + t << "clean-debug: $(ABLD)" << endl; + foreach(QString item, debugPlatforms) { + t << "\t$(ABLD)" << testClause << " reallyclean " << item << " udeb" << endl; + } + t << endl; + t << "clean-release: $(ABLD)" << endl; + foreach(QString item, releasePlatforms) { + t << "\t$(ABLD)" << testClause << " reallyclean " << item << " urel" << endl; } + t << endl; + + // For more specific builds, targets are in this form: clean-build-platform, e.g. clean-release-armv5 + foreach(QString item, debugPlatforms) { + t << "clean-debug-" << item << ": $(ABLD)" << endl; + t << "\t$(ABLD)" << testClause << " reallyclean " << item << " udeb" << endl; + } + foreach(QString item, releasePlatforms) { + t << "clean-release-" << item << ": $(ABLD)" << endl; + t << "\t$(ABLD)" << testClause << " reallyclean " << item << " urel" << endl; + } + t << endl; + + generateExecutionTargets(t, debugPlatforms); } void SymbianAbldMakefileGenerator::writeBldInfExtensionRulesPart(QTextStream& t, const QString &iconTargetFile) @@ -439,33 +494,36 @@ Q_UNUSED(iconTargetFile); } -//:QTP:QTPROD-92 Deployment of plugins requires WINSCW build before ARM build -bool SymbianAbldMakefileGenerator::writeDeploymentTargets(QTextStream &t, bool isRelease /*= false*/) +bool SymbianAbldMakefileGenerator::writeDeploymentTargets(QTextStream &t, bool isRom) { - if (isRelease) + if (isRom) t << DEPLOYMENT_TARGET ":" << endl; else t << WINSCW_DEPLOYMENT_TARGET ":" << endl; - QString remoteTestPath = epocRoot() + QLatin1String( isRelease?"epoc32\\data\\z\\private\\":"epoc32\\winscw\\c\\private\\") - + privateDirUid; // default 4 OpenC; 4 all Symbian too + QString remoteTestPath = epocRoot() + + QLatin1String(isRom ? "epoc32\\data\\z\\private\\" : "epoc32\\winscw\\c\\private\\") + + privateDirUid; DeploymentList depList; - initProjectDeploySymbian(project, depList, remoteTestPath, false, QLatin1String(isRelease?"armv5":"winscw"), QLatin1String(isRelease?"urel":"udeb"), - generatedDirs, generatedFiles); + initProjectDeploySymbian(project, depList, remoteTestPath, false, + QLatin1String(isRom ? ROM_DEPLOYMENT_PLATFORM : EMULATOR_DEPLOYMENT_PLATFORM), + QString(), generatedDirs, generatedFiles); if (depList.size()) t << "\t-echo Deploying changed files..." << endl; + for (int i = 0; i < depList.size(); ++i) { // Xcopy prompts for selecting file or directory if target doesn't exist, // and doesn't provide switch to force file selection. It does provide dir forcing, though, // so strip the last part of the destination. - t << "\t-$(XCOPY) \"" << depList.at(i).from << "\" \"" << depList.at(i).to.left(depList.at(i).to.lastIndexOf("\\") + 1) << "\"" << endl; + t << "\t-$(XCOPY) \"" << depList.at(i).from << "\" \"" + << depList.at(i).to.left(depList.at(i).to.lastIndexOf("\\") + 1) << "\"" << endl; } t << endl; - if (isRelease) + if (isRom) t << DEPLOYMENT_CLEAN_TARGET ":" << endl; else t << WINSCW_DEPLOYMENT_CLEAN_TARGET ":" << endl;