Changeset 769 for trunk/qmake/generators
- Timestamp:
- Aug 2, 2010, 9:27:30 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 1 deleted
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:mergeinfo changed
/branches/vendor/nokia/qt/4.6.3 (added) merged: 768 /branches/vendor/nokia/qt/current merged: 767 /branches/vendor/nokia/qt/4.6.2 removed
- Property svn:mergeinfo changed
-
trunk/qmake/generators/makefile.cpp
r651 r769 1267 1267 do_default = false; 1268 1268 for(QStringList::Iterator wild_it = tmp.begin(); wild_it != tmp.end(); ++wild_it) { 1269 QString wild = Option::fixPathTo LocalOS((*wild_it), false, false);1269 QString wild = Option::fixPathToTargetOS((*wild_it), false, false); 1270 1270 QString dirstr = qmake_getpwd(), filestr = wild; 1271 1271 int slsh = filestr.lastIndexOf(Option::dir_sep); … … 1307 1307 QString local_dirstr = Option::fixPathToLocalOS(dirstr, true); 1308 1308 QStringList files = QDir(local_dirstr).entryList(QStringList(filestr)); 1309 if(project->values((*it) + ".CONFIG").indexOf("no_check_exist") != -1 && files.isEmpty()) { 1309 const QStringList &installConfigValues = project->values((*it) + ".CONFIG"); 1310 if (installConfigValues.contains("no_check_exist") && files.isEmpty()) { 1310 1311 if(!target.isEmpty()) 1311 1312 target += "\t"; 1312 1313 QString dst_file = filePrefixRoot(root, dst); 1313 1314 QFileInfo fi(fileInfo(wild)); 1314 QString cmd = inst_prefix + QString(fi.isExecutable() ? "$(INSTALL_PROGRAM)" : "$(INSTALL_FILE)") + " " + 1315 wild + " " + dst_file + "\n"; 1315 QString cmd; 1316 if (installConfigValues.contains("directory")) { 1317 cmd = QLatin1String(inst_prefix + "$(INSTALL_DIR)"); 1318 if (!dst_file.endsWith(Option::dir_sep)) 1319 dst_file += Option::dir_sep; 1320 dst_file += fi.fileName(); 1321 } else if (installConfigValues.contains("executable")) { 1322 cmd = QLatin1String(inst_prefix + "$(INSTALL_PROGRAM)"); 1323 } else if (installConfigValues.contains("data")) { 1324 cmd = QLatin1String(inst_prefix + "$(INSTALL_FILE)"); 1325 } else { 1326 cmd = inst_prefix + QString(fi.isExecutable() ? "$(INSTALL_PROGRAM)" : "$(INSTALL_FILE)"); 1327 } 1328 cmd += " " + wild + " " + dst_file + "\n"; 1316 1329 target += cmd; 1317 1330 if(!uninst.isEmpty()) … … 1878 1891 } 1879 1892 } 1880 if(!cleans.isEmpty()) 1893 if(!cleans.isEmpty()) { 1881 1894 t << valGlue(cleans, "\n\t" + del_statement, del_suffix + "\n\t" + del_statement, del_suffix); 1895 } 1882 1896 if(!wrote_clean_cmds) { 1883 1897 for(QStringList::ConstIterator input = tmp_inputs.begin(); input != tmp_inputs.end(); ++input) { … … 2592 2606 if(!ofile.isEmpty()) 2593 2607 t << "\t-$(DEL_FILE) " << ofile << del_suffix << endl; 2608 t << varGlue("QMAKE_DISTCLEAN","\t-$(DEL_FILE) "," ","\n"); 2594 2609 } else if(project->isActiveConfig("no_empty_targets")) { 2595 2610 t << "\t" << "@cd ." << endl; -
trunk/qmake/generators/makefiledeps.cpp
r651 r769 398 398 for(int have_read = 0; 399 399 (have_read = QT_READ(fd, buffer + buffer_len, fst.st_size - buffer_len)); 400 buffer_len += have_read) ;400 buffer_len += have_read) ; 401 401 QT_CLOSE(fd); 402 402 } … … 419 419 if(buffer_len >= x + 12 && !strncmp(buffer + x, "includehint", 11) && 420 420 (*(buffer + x + 11) == ' ' || *(buffer + x + 11) == '>')) { 421 for(x += 11; *(buffer + x) != '>'; ++x) ;421 for(x += 11; *(buffer + x) != '>'; ++x) ; 422 422 int inc_len = 0; 423 for(x += 1 ; *(buffer + x + inc_len) != '<'; ++inc_len) ;423 for(x += 1 ; *(buffer + x + inc_len) != '<'; ++inc_len) ; 424 424 *(buffer + x + inc_len) = '\0'; 425 425 inc = buffer + x; 426 426 } else if(buffer_len >= x + 13 && !strncmp(buffer + x, "customwidget", 12) && 427 427 (*(buffer + x + 12) == ' ' || *(buffer + x + 12) == '>')) { 428 for(x += 13; *(buffer + x) != '>'; ++x) ; //skip up to >428 for(x += 13; *(buffer + x) != '>'; ++x) ; //skip up to > 429 429 while(x < buffer_len) { 430 for(x++; *(buffer + x) != '<'; ++x) ; //skip up to <430 for(x++; *(buffer + x) != '<'; ++x) ; //skip up to < 431 431 x++; 432 432 if(buffer_len >= x + 7 && !strncmp(buffer+x, "header", 6) && 433 433 (*(buffer + x + 6) == ' ' || *(buffer + x + 6) == '>')) { 434 for(x += 7; *(buffer + x) != '>'; ++x) ; //skip up to >434 for(x += 7; *(buffer + x) != '>'; ++x) ; //skip up to > 435 435 int inc_len = 0; 436 for(x += 1 ; *(buffer + x + inc_len) != '<'; ++inc_len) ;436 for(x += 1 ; *(buffer + x + inc_len) != '<'; ++inc_len) ; 437 437 *(buffer + x + inc_len) = '\0'; 438 438 inc = buffer + x; … … 449 449 if(buffer_len >= x + 9 && *(buffer + x) == 'i' && 450 450 !strncmp(buffer + x, "impldecl", 8)) { 451 for(x += 8; *(buffer + x) != '='; ++x) ;451 for(x += 8; *(buffer + x) != '='; ++x) ; 452 452 if(*(buffer + x) != '=') 453 453 continue; 454 for(++x; *(buffer+x) == '\t' || *(buffer+x) == ' '; ++x) ;454 for(++x; *(buffer+x) == '\t' || *(buffer+x) == ' '; ++x) ; 455 455 char quote = 0; 456 456 if(*(buffer+x) == '\'' || *(buffer+x) == '"') { … … 476 476 } 477 477 int inc_len = 0; 478 for(x += 1 ; *(buffer + x + inc_len) != '<'; ++inc_len) ;478 for(x += 1 ; *(buffer + x + inc_len) != '<'; ++inc_len) ; 479 479 *(buffer + x + inc_len) = '\0'; 480 480 inc = buffer + x; … … 482 482 } 483 483 //read past new line now.. 484 for(; x < buffer_len && !qmake_endOfLine(*(buffer + x)); ++x) ;484 for(; x < buffer_len && !qmake_endOfLine(*(buffer + x)); ++x) ; 485 485 ++line_count; 486 486 } else if(file->type == QMakeSourceFileInfo::TYPE_QRC) { … … 495 495 if(buffer_len >= x) { 496 496 if(*(buffer+x) == '/') { //c++ style comment 497 for(; x < buffer_len && !qmake_endOfLine(*(buffer + x)); ++x) ;497 for(; x < buffer_len && !qmake_endOfLine(*(buffer + x)); ++x) ; 498 498 beginning = 1; 499 499 } else if(*(buffer+x) == '*') { //c style comment … … 559 559 for(x+=keyword_len; //skip spaces after keyword 560 560 x < buffer_len && (*(buffer+x) == ' ' || *(buffer+x) == '\t'); 561 x++) ;561 x++) ; 562 562 break; 563 563 } else if(qmake_endOfLine(*(buffer+x+keyword_len))) { … … 580 580 581 581 int inc_len; 582 for(inc_len = 0; *(buffer + x + inc_len) != term && !qmake_endOfLine(*(buffer + x + inc_len)); ++inc_len) ;582 for(inc_len = 0; *(buffer + x + inc_len) != term && !qmake_endOfLine(*(buffer + x + inc_len)); ++inc_len) ; 583 583 *(buffer + x + inc_len) = '\0'; 584 584 inc = buffer + x; … … 595 595 int msg_len; 596 596 for(msg_len = 0; (term && *(buffer + x + msg_len) != term) && 597 !qmake_endOfLine(*(buffer + x + msg_len)); ++msg_len) ;597 !qmake_endOfLine(*(buffer + x + msg_len)); ++msg_len) ; 598 598 *(buffer + x + msg_len) = '\0'; 599 599 debug_msg(0, "%s:%d %s -- %s", file->file.local().toLatin1().constData(), line_count, keyword, buffer+x); … … 707 707 for(int have_read = buffer_len = 0; 708 708 (have_read = QT_READ(fd, buffer + buffer_len, fst.st_size - buffer_len)); 709 buffer_len += have_read) ;709 buffer_len += have_read) ; 710 710 QT_CLOSE(fd); 711 711 } … … 721 721 if(buffer_len >= x) { 722 722 if(*(buffer + x) == '/') { //c++ style comment 723 for(;x < buffer_len && !qmake_endOfLine(*(buffer + x)); ++x) ;723 for(;x < buffer_len && !qmake_endOfLine(*(buffer + x)); ++x) ; 724 724 } else if(*(buffer + x) == '*') { //c style comment 725 725 for(++x; x < buffer_len; ++x) { -
trunk/qmake/generators/symbian/initprojectdeploy_symbian.cpp
r651 r769 47 47 #include <qdebug.h> 48 48 49 #define SYSBIN_DIR "\\sys\\bin" 49 // Included from tools/shared 50 #include <symbian/epocroot.h> 51 52 #define SYSBIN_DIR "/sys/bin" 50 53 51 54 #define SUFFIX_DLL "dll" … … 53 56 #define SUFFIX_QTPLUGIN "qtplugin" 54 57 55 static void fixEpocRootStr(QString& path) 56 { 57 path.replace("\\", "/"); 58 59 if (path.size() > 1 && path[1] == QChar(':')) { 60 path = path.mid(2); 61 } 62 63 if (!path.size() || path[path.size()-1] != QChar('/')) { 64 path += QChar('/'); 65 } 66 } 67 68 #define SYMBIAN_SDKS_KEY "HKEY_LOCAL_MACHINE\\Software\\Symbian\\EPOC SDKs" 69 70 static QString epocRootStr; 71 72 QString epocRoot() 73 { 74 if (!epocRootStr.isEmpty()) { 75 return epocRootStr; 76 } 77 78 // First, check the env variable 79 epocRootStr = qgetenv("EPOCROOT"); 80 81 if (epocRootStr.isEmpty()) { 82 // No EPOCROOT set, check the default device 83 // First check EPOCDEVICE env variable 84 QString defaultDevice = qgetenv("EPOCDEVICE"); 85 86 // Check the windows registry via QSettings for devices.xml path 87 QSettings settings(SYMBIAN_SDKS_KEY, QSettings::NativeFormat); 88 QString devicesXmlPath = settings.value("CommonPath").toString(); 89 90 if (!devicesXmlPath.isEmpty()) { 91 // Parse xml for correct device 92 devicesXmlPath += "/devices.xml"; 93 QFile devicesFile(devicesXmlPath); 94 if (devicesFile.open(QIODevice::ReadOnly)) { 95 QXmlStreamReader xml(&devicesFile); 96 while (!xml.atEnd()) { 97 xml.readNext(); 98 if (xml.isStartElement() && xml.name() == "devices") { 99 if (xml.attributes().value("version") == "1.0") { 100 // Look for correct device 101 while (!(xml.isEndElement() && xml.name() == "devices") && !xml.atEnd()) { 102 xml.readNext(); 103 if (xml.isStartElement() && xml.name() == "device") { 104 if ((defaultDevice.isEmpty() && xml.attributes().value("default") == "yes") || 105 (!defaultDevice.isEmpty() && (xml.attributes().value("id").toString() + QString(":") + xml.attributes().value("name").toString()) == defaultDevice)) { 106 // Found the correct device 107 while (!(xml.isEndElement() && xml.name() == "device") && !xml.atEnd()) { 108 xml.readNext(); 109 if (xml.isStartElement() && xml.name() == "epocroot") { 110 epocRootStr = xml.readElementText(); 111 fixEpocRootStr(epocRootStr); 112 return epocRootStr; 113 } 114 } 115 xml.raiseError("No epocroot element found"); 116 } 117 } 118 } 119 } else { 120 xml.raiseError("Invalid 'devices' element version"); 121 } 122 } 123 } 124 if (xml.hasError()) { 125 fprintf(stderr, "ERROR: \"%s\" when parsing devices.xml\n", qPrintable(xml.errorString())); 126 } 127 } else { 128 fprintf(stderr, "Could not open devices.xml (%s)\n", qPrintable(devicesXmlPath)); 129 } 130 } else { 131 fprintf(stderr, "Could not retrieve " SYMBIAN_SDKS_KEY " setting\n"); 132 } 133 134 fprintf(stderr, "Failed to determine epoc root.\n"); 135 if (!defaultDevice.isEmpty()) 136 fprintf(stderr, "The device indicated by EPOCDEVICE environment variable (%s) could not be found.\n", qPrintable(defaultDevice)); 137 fprintf(stderr, "Either set EPOCROOT or EPOCDEVICE environment variable to a valid value, or provide a default Symbian device.\n"); 138 139 // No valid device found; set epocroot to "/" 140 epocRootStr = QLatin1String("/"); 141 } 142 143 fixEpocRootStr(epocRootStr); 144 return epocRootStr; 145 } 146 58 static QString fixPathToEpocOS(const QString &src) 59 { 60 QString ret = Option::fixPathToTargetOS(src); 61 return ret.replace('/', '\\'); 62 } 147 63 148 64 static bool isPlugin(const QFileInfo& info, const QString& devicePath) … … 176 92 QStringList& generatedFiles) 177 93 { 178 QDir().mkpath(QLatin1String(PLUGIN_STUB_DIR "\\"));94 QDir().mkpath(QLatin1String(PLUGIN_STUB_DIR)); 179 95 if (!generatedDirs.contains(PLUGIN_STUB_DIR)) 180 96 generatedDirs << PLUGIN_STUB_DIR; 181 97 // Plugin stubs must have different name from the actual plugins, because 182 98 // the toolchain for creating ROM images cannot handle non-binary .dll files properly. 183 QFile stubFile(QLatin1String(PLUGIN_STUB_DIR " \\") + info.completeBaseName() + "." SUFFIX_QTPLUGIN);99 QFile stubFile(QLatin1String(PLUGIN_STUB_DIR "/") + info.completeBaseName() + "." SUFFIX_QTPLUGIN); 184 100 if (stubFile.open(QIODevice::WriteOnly)) { 185 101 if (!generatedFiles.contains(stubFile.fileName())) … … 195 111 QFileInfo stubInfo(stubFile); 196 112 deploymentList.append(CopyItem(Option::fixPathToLocalOS(stubInfo.absoluteFilePath()), 197 Option::fixPathToLocalOS(devicePath + "\\" + stubInfo.fileName())));113 fixPathToEpocOS(devicePath + "/" + stubInfo.fileName()))); 198 114 } 199 115 … … 208 124 } 209 125 210 unsigned longhash = 5381;126 quint32 hash = 5381; 211 127 int c; 212 128 … … 259 175 foreach(QString item, project->values("DEPLOYMENT")) { 260 176 QString devicePath = project->first(item + ".path"); 177 QString devicePathWithoutDrive = devicePath; 178 179 bool devicePathHasDriveLetter = false; 180 if (devicePath.size() > 1) { 181 devicePathHasDriveLetter = devicePath.at(1) == QLatin1Char(':'); 182 } 183 184 // Sometimes devicePath can contain disk but APP_RESOURCE_DIR does not, 185 // so remove the drive letter for comparison purposes. 186 if (devicePathHasDriveLetter) 187 { 188 devicePathWithoutDrive.remove(0,2); 189 } 261 190 if (!deployBinaries 262 && !devicePath .isEmpty()263 && (0 == devicePath .compare(project->values("APP_RESOURCE_DIR").join(""), Qt::CaseInsensitive)264 || 0 == devicePath .compare(project->values("REG_RESOURCE_IMPORT_DIR").join(""), Qt::CaseInsensitive))) {191 && !devicePathWithoutDrive.isEmpty() 192 && (0 == devicePathWithoutDrive.compare(project->values("APP_RESOURCE_DIR").join(""), Qt::CaseInsensitive) 193 || 0 == devicePathWithoutDrive.compare(project->values("REG_RESOURCE_IMPORT_DIR").join(""), Qt::CaseInsensitive))) { 265 194 // Do not deploy resources in emulator builds, as that seems to cause conflicts 266 195 // If there is ever a real need to deploy pre-built resources for emulator, … … 269 198 } 270 199 271 bool devicePathHasDriveLetter = false;272 if (devicePath.size() > 1) {273 devicePathHasDriveLetter = devicePath.at(1) == QLatin1Char(':');274 }275 276 200 if (devicePath.isEmpty() || devicePath == QLatin1String(".")) { 277 201 devicePath = targetPath; … … 281 205 || devicePath.at(0) == QLatin1Char('\\') 282 206 || devicePathHasDriveLetter)) { 283 // create output path284 devicePath = Option::fixPathToLocalOS(QDir::cleanPath(targetPath + QLatin1Char(' \\') + devicePath));207 // Create output path 208 devicePath = Option::fixPathToLocalOS(QDir::cleanPath(targetPath + QLatin1Char('/') + devicePath)); 285 209 } else { 286 if ( 0 == platform.compare(QLatin1String("winscw"), Qt::CaseInsensitive)) {210 if (!platform.compare(QLatin1String(EMULATOR_DEPLOYMENT_PLATFORM))) { 287 211 if (devicePathHasDriveLetter) { 288 devicePath = epocRoot() + "epoc32 \\winscw\\" + devicePath.remove(1, 1);212 devicePath = epocRoot() + "epoc32/winscw/" + devicePath.remove(1, 1); 289 213 } else { 290 devicePath = epocRoot() + "epoc32 \\winscw\\c" + devicePath;214 devicePath = epocRoot() + "epoc32/winscw/c" + devicePath; 291 215 } 292 216 } else { 293 // Drive letter needed if targetpath contains one and it is not already in 294 if (targetPathHasDriveLetter && !devicePathHasDriveLetter) { 295 devicePath = deploymentDrive + devicePath; 217 if (!devicePathHasDriveLetter) { 218 if (!platform.compare(QLatin1String(ROM_DEPLOYMENT_PLATFORM))) { 219 //For plugin deployment under ARM no needed drive letter 220 devicePath = epocRoot() + "epoc32/data/z" + devicePath; 221 } else if (targetPathHasDriveLetter) { 222 // Drive letter needed if targetpath contains one and it is not already in 223 devicePath = deploymentDrive + devicePath; 224 } 225 } else { 226 //it is necessary to delete drive letter for ARM deployment 227 if (!platform.compare(QLatin1String(ROM_DEPLOYMENT_PLATFORM))) { 228 devicePath.remove(0,2); 229 devicePath = epocRoot() + "epoc32/data/z" + devicePath; 230 } 296 231 } 297 232 } 298 233 } 299 234 300 devicePath.replace(QLatin1String(" /"), QLatin1String("\\"));235 devicePath.replace(QLatin1String("\\"), QLatin1String("/")); 301 236 302 237 if (!deployBinaries && … … 322 257 } else { 323 258 if (info.exists() || source.indexOf('*') != -1) { 324 nameFilter = source.split( '\\').last();259 nameFilter = source.split(QDir::separator()).last(); 325 260 searchPath = info.absolutePath(); 326 261 } else { … … 330 265 if (deployBinaries) { 331 266 // Executables and libraries are deployed to \sys\bin 332 QFileInfo releasePath(epocRoot() + "epoc32\\release\\" + platform + "\\" + build + "\\");267 QFileInfo targetPath(epocRoot() + "epoc32/release/" + platform + "/" + build + "/"); 333 268 if(devicePathHasDriveLetter) { 334 deploymentList.append(CopyItem(Option::fixPathToLocalOS(releasePath.absolutePath() + "\\" + info.fileName(), false, true), 335 Option::fixPathToLocalOS(devicePath.left(2) + QLatin1String(SYSBIN_DIR "\\") + info.fileName()))); 269 deploymentList.append(CopyItem( 270 Option::fixPathToLocalOS(targetPath.absolutePath() + "/" + info.fileName(), 271 false, true), 272 fixPathToEpocOS(devicePath.left(2) + QLatin1String(SYSBIN_DIR "/") 273 + info.fileName()))); 336 274 } else { 337 deploymentList.append(CopyItem(Option::fixPathToLocalOS(releasePath.absolutePath() + "\\" + info.fileName(), false, true), 338 Option::fixPathToLocalOS(deploymentDrive + QLatin1String(SYSBIN_DIR "\\") + info.fileName()))); 275 deploymentList.append(CopyItem( 276 Option::fixPathToLocalOS(targetPath.absolutePath() + "/" + info.fileName(), 277 false, true), 278 fixPathToEpocOS(deploymentDrive + QLatin1String(SYSBIN_DIR "/") 279 + info.fileName()))); 339 280 } 340 281 } … … 347 288 // when generating .pkg files. 348 289 deploymentList.append(CopyItem(Option::fixPathToLocalOS(info.absoluteFilePath()), 349 Option::fixPathToLocalOS(devicePath + "\\" + info.fileName())));290 fixPathToEpocOS(devicePath + "/" + info.fileName()))); 350 291 continue; 351 292 } … … 369 310 // as they have SYSBIN_DIR target path. 370 311 if (deployBinaries) { 371 deploymentList.append(CopyItem(Option::fixPathToLocalOS(absoluteItemPath + "\\" + iterator.fileName()), 372 Option::fixPathToLocalOS(deploymentDrive + QLatin1String(SYSBIN_DIR "\\") + iterator.fileName()))); 312 if (devicePathHasDriveLetter) { 313 deploymentList.append(CopyItem( 314 Option::fixPathToLocalOS(absoluteItemPath + "/" + iterator.fileName()), 315 fixPathToEpocOS(devicePath.left(2) + QLatin1String(SYSBIN_DIR "/") 316 + iterator.fileName()))); 317 } else { 318 deploymentList.append(CopyItem( 319 Option::fixPathToLocalOS(absoluteItemPath + "/" + iterator.fileName()), 320 fixPathToEpocOS(deploymentDrive + QLatin1String(SYSBIN_DIR "/") 321 + iterator.fileName()))); 322 } 373 323 } 374 createPluginStub(info, devicePath + "\\" + absoluteItemPath.right(diffSize), deploymentList, generatedDirs, generatedFiles); 324 createPluginStub(info, devicePath + "/" + absoluteItemPath.right(diffSize), 325 deploymentList, generatedDirs, generatedFiles); 375 326 continue; 376 327 } else { 377 deploymentList.append(CopyItem(Option::fixPathToLocalOS(absoluteItemPath + "\\" + iterator.fileName()), 378 Option::fixPathToLocalOS(devicePath + "\\" + absoluteItemPath.right(diffSize) + "\\" + iterator.fileName()))); 328 deploymentList.append(CopyItem( 329 Option::fixPathToLocalOS(absoluteItemPath + "/" + iterator.fileName()), 330 fixPathToEpocOS(devicePath + "/" + absoluteItemPath.right(diffSize) 331 + "/" + iterator.fileName()))); 379 332 } 380 333 } -
trunk/qmake/generators/symbian/initprojectdeploy_symbian.h
r651 r769 51 51 #include <stdlib.h> 52 52 53 #include "epocroot.h"54 55 53 #define PLUGIN_STUB_DIR "qmakepluginstubs" 54 #define ROM_DEPLOYMENT_PLATFORM "rom" 55 #define EMULATOR_DEPLOYMENT_PLATFORM "emulator" 56 56 57 57 struct CopyItem -
trunk/qmake/generators/symbian/symmake.cpp
r651 r769 50 50 #include <qdebug.h> 51 51 52 // Included from tools/shared 53 #include <symbian/epocroot.h> 54 52 55 #define RESOURCE_DIRECTORY_MMP "/resource/apps" 53 56 #define RESOURCE_DIRECTORY_RESOURCE "\\\\resource\\\\apps\\\\" … … 55 58 #define PLUGIN_COMMON_DEF_FILE_FOR_MMP "./plugin_common.def" 56 59 #define PLUGIN_COMMON_DEF_FILE_ACTUAL "plugin_commonU.def" 57 #define BLD_INF_FILENAME_LEN (sizeof(BLD_INF_FILENAME) - 1)58 60 59 61 #define BLD_INF_RULES_BASE "BLD_INF_RULES." … … 62 64 #define BLD_INF_TAG_TESTMMPFILES "prj_testmmpfiles" 63 65 #define BLD_INF_TAG_EXTENSIONS "prj_extensions" 64 #define BLD_INF_TAG_ EXPORTS "prj_exports"66 #define BLD_INF_TAG_TESTEXTENSIONS "prj_testextensions" 65 67 66 68 #define RSS_RULES "RSS_RULES" … … 68 70 #define RSS_TAG_NBROFICONS "number_of_icons" 69 71 #define RSS_TAG_ICONFILE "icon_file" 72 #define RSS_TAG_HEADER "header" 73 #define RSS_TAG_SERVICE_LIST "service_list" 74 #define RSS_TAG_FILE_OWNERSHIP_LIST "file_ownership_list" 75 #define RSS_TAG_DATATYPE_LIST "datatype_list" 76 #define RSS_TAG_FOOTER "footer" 77 #define RSS_TAG_DEFAULT "default_rules" // Same as just giving rules without tag 70 78 71 79 #define MMP_TARGET "TARGET" 72 80 #define MMP_TARGETTYPE "TARGETTYPE" 73 81 #define MMP_SECUREID "SECUREID" 74 #define MMP_OPTION_CW "OPTION CW" 75 #define MMP_OPTION_ARMCC "OPTION ARMCC" 76 #define MMP_OPTION_GCCE "OPTION GCCE" 77 #define MMP_LINKEROPTION_CW "LINKEROPTION CW" 78 #define MMP_LINKEROPTION_ARMCC "LINKEROPTION ARMCC" 79 #define MMP_LINKEROPTION_GCCE "LINKEROPTION GCCE" 82 #define MMP_OPTION "OPTION" 83 #define MMP_LINKEROPTION "LINKEROPTION" 80 84 #define MMP_CAPABILITY "CAPABILITY" 81 85 #define MMP_EPOCALLOWDLLDATA "EPOCALLOWDLLDATA" … … 88 92 #define MMP_END_RESOURCE "END" 89 93 94 #define VAR_CXXFLAGS "QMAKE_CXXFLAGS" 95 #define VAR_CFLAGS "QMAKE_CFLAGS" 96 #define VAR_LFLAGS "QMAKE_LFLAGS" 97 90 98 #define SIS_TARGET "sis" 91 99 #define INSTALLER_SIS_TARGET "installer_sis" 100 #define ROM_STUB_SIS_TARGET "stub_sis" 92 101 #define OK_SIS_TARGET "ok_sis" 93 102 #define OK_INSTALLER_SIS_TARGET "ok_installer_sis" 103 #define OK_ROM_STUB_SIS_TARGET "ok_stub_sis" 94 104 #define FAIL_SIS_NOPKG_TARGET "fail_sis_nopkg" 95 105 #define FAIL_SIS_NOCACHE_TARGET "fail_sis_nocache" … … 106 116 static QString epocRootStr; 107 117 if (epocRootStr.isEmpty()) { 108 QFileInfo efi(epocRoot());109 epocRootStr = efi.canonicalFilePath();110 if ( epocRootStr.isEmpty()) {118 epocRootStr = epocRoot(); 119 QFileInfo efi(epocRootStr); 120 if (!efi.exists() || epocRootStr.isEmpty()) { 111 121 fprintf(stderr, "Unable to resolve epocRoot '%s' to real dir on current drive, defaulting to '/' for mmp paths\n", qPrintable(epocRoot())); 112 122 epocRootStr = "/"; 123 } else { 124 epocRootStr = efi.absoluteFilePath(); 113 125 } 114 126 if (!epocRootStr.endsWith("/")) … … 134 146 } 135 147 136 QString SymbianMakefileGenerator::canonizePath(const QString& origPath) 137 { 138 // Since current path gets appended almost always anyway, use it as default 139 // for nonexisting paths. 140 static QString defaultPath; 141 if (defaultPath.isEmpty()) { 142 QFileInfo fi("."); 143 defaultPath = fi.canonicalFilePath(); 144 } 145 148 QString SymbianMakefileGenerator::absolutizePath(const QString& origPath) 149 { 146 150 // Prepend epocroot to any paths beginning with "/epoc32/" 147 151 QString resultPath = QDir::fromNativeSeparators(origPath); … … 150 154 151 155 QFileInfo fi(fileInfo(resultPath)); 152 if (fi.isDir()) { 153 resultPath = fi.canonicalFilePath(); 156 157 // Since origPath can be something given in HEADERS, we need to check if we are dealing 158 // with a file or a directory. In case the origPath doesn't yet exist, isFile() returns 159 // false and we default to assuming it is a dir. 160 if (fi.isFile()) { 161 resultPath = fi.absolutePath(); 154 162 } else { 155 resultPath = fi. canonicalPath();163 resultPath = fi.absoluteFilePath(); 156 164 } 157 165 158 166 resultPath = QDir::cleanPath(resultPath); 159 160 if (resultPath.isEmpty())161 resultPath = defaultPath;162 167 163 168 return resultPath; … … 202 207 QString numberOfIcons; 203 208 QString iconFile; 204 Q StringListuserRssRules;209 QMap<QString, QStringList> userRssRules; 205 210 readRssRules(numberOfIcons, iconFile, userRssRules); 206 211 … … 235 240 QString outputFileName = fileInfo(Option::output.fileName()).fileName(); 236 241 if (outputFileName != BLD_INF_FILENAME) { 237 wrapperFileName.append(".").append((outputFileName.size() > BLD_INF_FILENAME_LEN && outputFileName.left(BLD_INF_FILENAME_LEN) == BLD_INF_FILENAME) ? outputFileName.mid(8) : outputFileName); 242 wrapperFileName.append(".").append(outputFileName.startsWith(BLD_INF_FILENAME) 243 ? outputFileName.mid(sizeof(BLD_INF_FILENAME)) 244 : outputFileName); 238 245 isPrimaryMakefile = false; 239 246 } … … 269 276 270 277 if (targetType == TypeExe) { 271 if (!project-> values("CONFIG").contains("no_icon", Qt::CaseInsensitive)) {278 if (!project->isActiveConfig("no_icon")) { 272 279 writeRegRssFile(userRssRules); 273 280 writeRssFile(numberOfIcons, iconFile); … … 316 323 317 324 // Construct QStringList from pkg_prerules since we need search it before printed to file 325 // Note: Though there can't be more than one language or header line, use stringlists 326 // in case user wants comments to go with the rules. 318 327 QStringList rawPkgPreRules; 328 QStringList languageRules; 329 QStringList headerRules; 319 330 foreach(QString deploymentItem, project->values("DEPLOYMENT")) { 320 331 foreach(QString pkgrulesItem, project->values(deploymentItem + ".pkg_prerules")) { … … 323 334 // This is convenience for defining single line mmp statements 324 335 if (pkgrulesValue.isEmpty()) { 325 rawPkgPreRules << pkgrulesItem; 336 if (pkgrulesItem.startsWith("&")) 337 languageRules << pkgrulesItem; 338 else if (pkgrulesItem.startsWith("#")) 339 headerRules << pkgrulesItem; 340 else 341 rawPkgPreRules << pkgrulesItem; 326 342 } else { 327 foreach(QString pkgrule, pkgrulesValue) { 328 rawPkgPreRules << pkgrule; 343 if (containsStartWithItem('&', pkgrulesValue)) { 344 foreach(QString pkgrule, pkgrulesValue) { 345 languageRules << pkgrule; 346 } 347 } else if (containsStartWithItem('#', pkgrulesValue)) { 348 foreach(QString pkgrule, pkgrulesValue) { 349 headerRules << pkgrule; 350 } 351 } else { 352 foreach(QString pkgrule, pkgrulesValue) { 353 rawPkgPreRules << pkgrule; 354 } 329 355 } 330 356 } … … 334 360 // Apply some defaults if specific data does not exist in PKG pre-rules 335 361 336 if ( !containsStartWithItem('&', rawPkgPreRules)) {362 if (languageRules.isEmpty()) { 337 363 // language, (*** hardcoded to english atm, should be parsed from TRANSLATIONS) 338 QString languageCode = "; Language\n&EN\n\n"; 339 t << languageCode; 340 tw << languageCode; 341 } else { 364 languageRules << "; Language\n&EN\n\n"; 365 } else if (headerRules.isEmpty()) { 342 366 // In case user defines langs, he must take care also about SIS header 343 if (!containsStartWithItem('#', rawPkgPreRules)) 344 fprintf(stderr, "Warning: If language is defined with DEPLOYMENT pkg_prerules, also the SIS header must be defined\n"); 345 } 367 fprintf(stderr, "Warning: If language is defined with DEPLOYMENT pkg_prerules, also the SIS header must be defined\n"); 368 } 369 370 t << languageRules.join("\n") << endl; 371 tw << languageRules.join("\n") << endl; 346 372 347 373 // name of application, UID and version … … 358 384 } 359 385 360 if ( !containsStartWithItem('#', rawPkgPreRules)) {386 if (headerRules.isEmpty()) 361 387 t << sisHeader.arg(visualTarget).arg(uid3).arg(applicationVersion); 362 } 388 else 389 t << headerRules.join("\n") << endl; 363 390 364 391 // Localized vendor name … … 425 452 426 453 // deploy rsc & reg_rsc file 427 if (!project-> values("CONFIG").contains("no_icon", Qt::CaseInsensitive)) {454 if (!project->isActiveConfig("no_icon")) { 428 455 t << QString("\"%1epoc32/data/z/resource/apps/%2\" - \"%3\\%4\"") 429 456 .arg(epocRoot()) … … 450 477 QString remoteTestPath; 451 478 remoteTestPath = QString("!:\\private\\%1").arg(privateDirUid); 479 QString zDir = epocRoot() + QLatin1String("epoc32/data/z"); 452 480 453 481 initProjectDeploySymbian(project, depList, remoteTestPath, true, "$(PLATFORM)", "$(TARGET)", generatedDirs, generatedFiles); … … 455 483 t << "; DEPLOYMENT" << endl; 456 484 for (int i = 0; i < depList.size(); ++i) { 457 t << QString("\"%1\" - \"%2\"") 458 .arg(QString(depList.at(i).from).replace('\\','/')) 459 .arg(depList.at(i).to) << endl; 485 QString from = depList.at(i).from; 486 QString to = depList.at(i).to; 487 488 // Deploy anything not already deployed from under epoc32 instead from under 489 // \epoc32\data\z\ to enable using pkg file without rebuilding 490 // the project, which can be useful for some binary only distributions. 491 if (!from.contains(QLatin1String("epoc32"), Qt::CaseInsensitive)) { 492 from = to; 493 if (from.size() > 1 && from.at(1) == QLatin1Char(':')) 494 from = from.mid(2); 495 from.prepend(zDir); 496 } else { 497 if (from.size() > 1 && from.at(1) == QLatin1Char(':')) 498 from = from.mid(2); 499 } 500 501 t << QString("\"%1\" - \"%2\"").arg(from.replace('\\','/')).arg(to) << endl; 460 502 } 461 503 t << endl; … … 542 584 void SymbianMakefileGenerator::writeCustomDefFile() 543 585 { 544 if (targetType == TypePlugin && !project-> values("CONFIG").contains("stdbinary", Qt::CaseInsensitive)) {586 if (targetType == TypePlugin && !project->isActiveConfig("stdbinary")) { 545 587 // Create custom def file for plugin 546 588 QFile ft(QLatin1String(PLUGIN_COMMON_DEF_FILE_ACTUAL)); … … 607 649 else if ((project->values("TEMPLATE")).contains("lib")) { 608 650 // Check CONFIG to see if we are to build staticlib or dll 609 if (project-> values("CONFIG").contains("staticlib") || project->values("CONFIG").contains("static"))651 if (project->isActiveConfig("staticlib") || project->isActiveConfig("static")) 610 652 targetType = TypeLib; 611 else if (project-> values("CONFIG").contains("plugin"))653 else if (project->isActiveConfig("plugin")) 612 654 targetType = TypePlugin; 613 655 else … … 619 661 if (0 != project->values("TARGET.UID2").size()) { 620 662 uid2 = project->first("TARGET.UID2"); 621 } else if (project-> values("CONFIG").contains("stdbinary", Qt::CaseInsensitive)) {663 } else if (project->isActiveConfig("stdbinary")) { 622 664 uid2 = "0x20004C45"; 623 665 } else { … … 690 732 691 733 QDir current = QDir::current(); 692 QString canonizedCurrent = canonizePath(".");734 QString absolutizedCurrent = absolutizePath("."); 693 735 694 736 for (int j = 0; j < srcpaths.size(); ++j) { … … 698 740 if (fi.filePath().length() > fi.fileName().length()) { 699 741 appendIfnotExist(srcincpaths, fi.path()); 700 sources[ canonizePath(fi.path())] += fi.fileName();742 sources[absolutizePath(fi.path())] += fi.fileName(); 701 743 } else { 702 sources[ canonizedCurrent] += fi.fileName();703 appendIfnotExist(srcincpaths, canonizedCurrent);744 sources[absolutizedCurrent] += fi.fileName(); 745 appendIfnotExist(srcincpaths, absolutizedCurrent); 704 746 } 705 747 } … … 715 757 716 758 for (int j = 0; j < incpaths.size(); ++j) { 717 QString includepath = canonizePath(incpaths.at(j));759 QString includepath = absolutizePath(incpaths.at(j)); 718 760 appendIfnotExist(sysincspaths, includepath); 719 761 appendAbldTempDirs(sysincspaths, includepath); … … 757 799 bool inResourceBlock = false; 758 800 759 overridableMmpKeywords << QLatin1String(MMP_TARGETTYPE) ;801 overridableMmpKeywords << QLatin1String(MMP_TARGETTYPE) << QLatin1String(MMP_EPOCHEAPSIZE); 760 802 restrictableMmpKeywords << QLatin1String(MMP_TARGET) << QLatin1String(MMP_SECUREID) 761 << QLatin1String(MMP_OPTION_CW) << QLatin1String(MMP_OPTION_ARMCC) 762 << QLatin1String(MMP_OPTION_GCCE) << QLatin1String(MMP_LINKEROPTION_CW) 763 << QLatin1String(MMP_LINKEROPTION_ARMCC) << QLatin1String(MMP_LINKEROPTION_GCCE) 803 << QLatin1String(MMP_OPTION) << QLatin1String(MMP_LINKEROPTION) 764 804 << QLatin1String(MMP_CAPABILITY) << QLatin1String(MMP_EPOCALLOWDLLDATA) 765 << QLatin1String(MMP_EPOCHEAPSIZE) << QLatin1String(MMP_EPOCSTACKSIZE) 766 << QLatin1String(MMP_UID) << QLatin1String(MMP_VENDORID) 767 << QLatin1String(MMP_VERSION); 805 << QLatin1String(MMP_EPOCSTACKSIZE) << QLatin1String(MMP_UID) 806 << QLatin1String(MMP_VENDORID) << QLatin1String(MMP_VERSION); 768 807 769 808 foreach (QString item, project->values("MMP_RULES")) { … … 886 925 t << endl; 887 926 888 if (!project-> values("CONFIG").contains("static") && !project->values("CONFIG").contains("staticlib")) {927 if (!project->isActiveConfig("static") && !project->isActiveConfig("staticlib")) { 889 928 writeMmpFileLibraryPart(t); 890 929 } … … 935 974 { 936 975 bool skipTargetType = overriddenMmpKeywords.contains(MMP_TARGETTYPE); 976 bool skipEpocHeapSize = overriddenMmpKeywords.contains(MMP_EPOCHEAPSIZE); 937 977 938 978 if (targetType == TypeExe) { 939 979 t << MMP_TARGET "\t\t" << fixedTarget << ".exe" << endl; 940 980 if (!skipTargetType) { 941 if (project-> values("CONFIG").contains("stdbinary", Qt::CaseInsensitive))981 if (project->isActiveConfig("stdbinary")) 942 982 t << MMP_TARGETTYPE "\t\tSTDEXE" << endl; 943 983 else … … 947 987 t << MMP_TARGET "\t\t" << fixedTarget << ".dll" << endl; 948 988 if (!skipTargetType) { 949 if (project-> values("CONFIG").contains("stdbinary", Qt::CaseInsensitive))989 if (project->isActiveConfig("stdbinary")) 950 990 t << MMP_TARGETTYPE "\t\tSTDDLL" << endl; 951 991 else … … 955 995 t << MMP_TARGET "\t\t" << fixedTarget << ".lib" << endl; 956 996 if (!skipTargetType) { 957 if (project-> values("CONFIG").contains("stdbinary", Qt::CaseInsensitive))997 if (project->isActiveConfig("stdbinary")) 958 998 t << MMP_TARGETTYPE "\t\tSTDLIB" << endl; 959 999 else … … 986 1026 if (0 != project->first("TARGET.EPOCSTACKSIZE").size()) 987 1027 t << MMP_EPOCSTACKSIZE "\t\t" << project->first("TARGET.EPOCSTACKSIZE") << endl; 988 if ( 0 != project->values("TARGET.EPOCHEAPSIZE").size())1028 if (!skipEpocHeapSize && 0 != project->values("TARGET.EPOCHEAPSIZE").size()) 989 1029 t << MMP_EPOCHEAPSIZE "\t\t" << project->values("TARGET.EPOCHEAPSIZE").join(" ") << endl; 990 1030 if (0 != project->values("TARGET.EPOCALLOWDLLDATA").size()) 991 1031 t << MMP_EPOCALLOWDLLDATA << endl; 992 1032 993 if (targetType == TypePlugin && !project-> values("CONFIG").contains("stdbinary", Qt::CaseInsensitive)) {1033 if (targetType == TypePlugin && !project->isActiveConfig("stdbinary")) { 994 1034 // Use custom def file for Qt plugins 995 1035 t << "DEFFILE " PLUGIN_COMMON_DEF_FILE_FOR_MMP << endl; … … 1007 1047 { 1008 1048 if ((targetType == TypeExe) && 1009 !project-> values("CONFIG").contains("no_icon", Qt::CaseInsensitive)) {1049 !project->isActiveConfig("no_icon")) { 1010 1050 1011 1051 QString locTarget = fixedTarget; … … 1111 1151 } 1112 1152 1153 void SymbianMakefileGenerator::writeMmpFileConditionalOptions(QTextStream& t, 1154 const QString &optionType, 1155 const QString &optionTag, 1156 const QString &variableBase) 1157 { 1158 foreach(QString compilerVersion, project->values("VERSION_FLAGS." + optionTag)) { 1159 QStringList currentValues = project->values(variableBase + "." + compilerVersion); 1160 if (currentValues.size()) { 1161 t << "#if defined(" << compilerVersion << ")" << endl; 1162 t << optionType << " " << optionTag << " " << currentValues.join(" ") << endl; 1163 t << "#endif" << endl; 1164 } 1165 } 1166 } 1167 1168 void SymbianMakefileGenerator::writeMmpFileSimpleOption(QTextStream& t, 1169 const QString &optionType, 1170 const QString &optionTag, 1171 const QString &options) 1172 { 1173 QString trimmedOptions = options.trimmed(); 1174 if (!trimmedOptions.isEmpty()) 1175 t << optionType << " " << optionTag << " " << trimmedOptions << endl; 1176 } 1177 1178 void SymbianMakefileGenerator::appendMmpFileOptions(QString &options, const QStringList &list) 1179 { 1180 if (list.size()) { 1181 options.append(list.join(" ")); 1182 options.append(" "); 1183 } 1184 } 1185 1113 1186 void SymbianMakefileGenerator::writeMmpFileCompilerOptionPart(QTextStream& t) 1114 1187 { 1115 QString cw, armcc, gcce; 1116 QString cwlink, armlink, gccelink; 1117 1118 if (0 != project->values("QMAKE_CXXFLAGS.CW").size()) { 1119 cw.append(project->values("QMAKE_CXXFLAGS.CW").join(" ")); 1120 cw.append(" "); 1121 } 1122 1123 if (0 != project->values("QMAKE_CXXFLAGS.ARMCC").size()) { 1124 armcc.append(project->values("QMAKE_CXXFLAGS.ARMCC").join(" ")); 1125 armcc.append(" "); 1126 } 1127 1128 if (0 != project->values("QMAKE_CXXFLAGS.GCCE").size()) { 1129 gcce.append(project->values("QMAKE_CXXFLAGS.GCCE").join(" ")); 1130 gcce.append(" "); 1131 } 1132 1133 if (0 != project->values("QMAKE_CFLAGS.CW").size()) { 1134 cw.append(project->values("QMAKE_CFLAGS.CW").join(" ")); 1135 cw.append(" "); 1136 } 1137 1138 if (0 != project->values("QMAKE_CFLAGS.ARMCC").size()) { 1139 armcc.append(project->values("QMAKE_CFLAGS.ARMCC").join(" ")); 1140 armcc.append(" "); 1141 } 1142 1143 if (0 != project->values("QMAKE_CFLAGS.GCCE").size()) { 1144 gcce.append(project->values("QMAKE_CXXFLAGS.GCCE").join(" ")); 1145 gcce.append(" "); 1146 } 1147 1148 if (0 != project->values("QMAKE_CXXFLAGS").size()) { 1149 cw.append(project->values("QMAKE_CXXFLAGS").join(" ")); 1150 cw.append(" "); 1151 armcc.append(project->values("QMAKE_CXXFLAGS").join(" ")); 1152 armcc.append(" "); 1153 gcce.append(project->values("QMAKE_CXXFLAGS").join(" ")); 1154 gcce.append(" "); 1155 } 1156 1157 if (0 != project->values("QMAKE_CFLAGS").size()) { 1158 cw.append(project->values("QMAKE_CFLAGS").join(" ")); 1159 cw.append(" "); 1160 armcc.append(project->values("QMAKE_CFLAGS").join(" ")); 1161 armcc.append(" "); 1162 gcce.append(project->values("QMAKE_CFLAGS").join(" ")); 1163 gcce.append(" "); 1164 } 1165 1166 if (0 != project->values("QMAKE_LFLAGS.CW").size()) { 1167 cwlink.append(project->values("QMAKE_LFLAGS.CW").join(" ")); 1168 cwlink.append(" "); 1169 } 1170 1171 if (0 != project->values("QMAKE_LFLAGS.ARMCC").size()) { 1172 armlink.append(project->values("QMAKE_LFLAGS.ARMCC").join(" ")); 1173 armlink.append(" "); 1174 } 1175 1176 if (0 != project->values("QMAKE_LFLAGS.GCCE").size()) { 1177 gccelink.append(project->values("QMAKE_LFLAGS.GCCE").join(" ")); 1178 gccelink.append(" "); 1179 } 1180 1181 if (0 != project->values("QMAKE_LFLAGS").size()) { 1182 cwlink.append(project->values("QMAKE_LFLAGS").join(" ")); 1183 cwlink.append(" "); 1184 armlink.append(project->values("QMAKE_LFLAGS").join(" ")); 1185 armlink.append(" "); 1186 gccelink.append(project->values("QMAKE_LFLAGS").join(" ")); 1187 gccelink.append(" "); 1188 } 1189 1190 if (!cw.isEmpty() && cw[cw.size()-1] == ' ') 1191 cw.chop(1); 1192 if (!armcc.isEmpty() && armcc[armcc.size()-1] == ' ') 1193 armcc.chop(1); 1194 if (!gcce.isEmpty() && gcce[gcce.size()-1] == ' ') 1195 gcce.chop(1); 1196 if (!cwlink.isEmpty() && cwlink[cwlink.size()-1] == ' ') 1197 cwlink.chop(1); 1198 if (!armlink.isEmpty() && armlink[armlink.size()-1] == ' ') 1199 armlink.chop(1); 1200 if (!gccelink.isEmpty() && gccelink[gccelink.size()-1] == ' ') 1201 gccelink.chop(1); 1202 1203 if (!cw.isEmpty()) 1204 t << MMP_OPTION_CW " " << cw << endl; 1205 if (!armcc.isEmpty()) 1206 t << MMP_OPTION_ARMCC " " << armcc << endl; 1207 if (!gcce.isEmpty()) 1208 t << MMP_OPTION_GCCE " " << gcce << endl; 1209 1210 if (!cwlink.isEmpty()) 1211 t << MMP_LINKEROPTION_CW " " << cwlink << endl; 1212 if (!armlink.isEmpty()) 1213 t << MMP_LINKEROPTION_ARMCC " " << armlink << endl; 1214 if (!gccelink.isEmpty()) 1215 t << MMP_LINKEROPTION_GCCE " " << gccelink << endl; 1188 QStringList keywords = project->values("MMP_OPTION_KEYWORDS"); 1189 QStringList commonCxxFlags = project->values(VAR_CXXFLAGS); 1190 QStringList commonCFlags = project->values(VAR_CFLAGS); 1191 QStringList commonLFlags = project->values(VAR_LFLAGS); 1192 1193 foreach(QString item, keywords) { 1194 QString compilerOption; 1195 QString linkerOption; 1196 1197 appendMmpFileOptions(compilerOption, project->values(VAR_CXXFLAGS "." + item)); 1198 appendMmpFileOptions(compilerOption, project->values(VAR_CFLAGS "." + item)); 1199 appendMmpFileOptions(compilerOption, commonCxxFlags); 1200 appendMmpFileOptions(compilerOption, commonCFlags); 1201 1202 appendMmpFileOptions(linkerOption, project->values(VAR_LFLAGS "." + item)); 1203 appendMmpFileOptions(linkerOption, commonLFlags); 1204 1205 writeMmpFileSimpleOption(t, MMP_OPTION, item, compilerOption); 1206 writeMmpFileSimpleOption(t, MMP_LINKEROPTION, item, linkerOption); 1207 1208 writeMmpFileConditionalOptions(t, MMP_OPTION, item, VAR_CXXFLAGS); 1209 writeMmpFileConditionalOptions(t, MMP_LINKEROPTION, item, VAR_LFLAGS); 1210 } 1216 1211 1217 1212 t << endl; … … 1317 1312 } 1318 1313 1314 QString condition; 1315 if (!project->isEmpty(item + ".condition")) 1316 condition = project->first(item + ".condition"); 1317 1319 1318 QFileInfo subdir(fileInfo(fixedItem)); 1320 1319 QString relativePath = directory.relativeFilePath(fixedItem); … … 1345 1344 removeSpecialCharacters(bldinfDefine); 1346 1345 1346 if (!condition.isEmpty()) 1347 t << "#if defined(" << condition << ")" << endl; 1348 1347 1349 t << "#ifndef " << bldinfDefine << endl; 1348 t << "\t#include \"" << QDir::toNativeSeparators(bldinfFilename) << "\"" << endl; 1349 t << "#endif // " << bldinfDefine << endl; 1350 t << "\t#include \"" << bldinfFilename << "\"" << endl; 1351 t << "#endif" << endl; 1352 1353 if (!condition.isEmpty()) 1354 t << "#endif" << endl; 1355 1350 1356 } 1351 1357 … … 1365 1371 1366 1372 QString mmpTag; 1367 if (project-> values("CONFIG").contains("symbian_test", Qt::CaseInsensitive))1373 if (project->isActiveConfig(SYMBIAN_TEST_CONFIG)) 1368 1374 mmpTag = QLatin1String(BLD_INF_TAG_TESTMMPFILES); 1369 1375 else … … 1388 1394 userBldInfRules.remove(mmpTag); 1389 1395 1390 t << endl << BLD_INF_TAG_EXTENSIONS << endl << endl; 1396 QString extensionTag; 1397 if (project->isActiveConfig(SYMBIAN_TEST_CONFIG)) 1398 extensionTag = QLatin1String(BLD_INF_TAG_TESTEXTENSIONS); 1399 else 1400 extensionTag = QLatin1String(BLD_INF_TAG_EXTENSIONS); 1401 1402 t << endl << extensionTag << endl << endl; 1391 1403 1392 1404 // Generate extension rules … … 1394 1406 writeBldInfExtensionRulesPart(t, iconFile); 1395 1407 1396 userItems = userBldInfRules.value( BLD_INF_TAG_EXTENSIONS);1408 userItems = userBldInfRules.value(extensionTag); 1397 1409 foreach(QString item, userItems) 1398 1410 t << item << endl; 1399 userBldInfRules.remove(BLD_INF_TAG_EXTENSIONS); 1400 1401 t << endl << BLD_INF_TAG_EXPORTS << endl << endl; 1402 1403 // Generate export rules 1404 1405 // Export any deployed plugin stubs under /epoc32/data/z to support ROM builds 1406 for (int i = 0; i < depList.size(); ++i) { 1407 int index = depList.at(i).from.indexOf(PLUGIN_STUB_DIR); 1408 if (index != -1) { 1409 t << QString("%1 /epoc32/data/z%2") 1410 .arg(QString(depList.at(i).from).mid(index).replace('\\','/')) 1411 .arg(QString(depList.at(i).to).mid(2).replace('\\','/')) << endl; 1412 } 1413 } 1414 1415 userItems = userBldInfRules.value(BLD_INF_TAG_EXPORTS); 1416 foreach(QString item, userItems) 1417 t << item << endl; 1418 userBldInfRules.remove(BLD_INF_TAG_EXPORTS); 1411 userBldInfRules.remove(extensionTag); 1419 1412 1420 1413 // Add rest of the user defined content … … 1428 1421 } 1429 1422 1430 void SymbianMakefileGenerator::writeRegRssFile(Q StringList&userItems)1423 void SymbianMakefileGenerator::writeRegRssFile(QMap<QString, QStringList> &userItems) 1431 1424 { 1432 1425 QString filename(fixedTarget); … … 1445 1438 t << "#include <" << fixedTarget << ".rsg>" << endl; 1446 1439 t << "#include <appinfo.rh>" << endl; 1440 foreach(QString item, userItems[RSS_TAG_HEADER]) 1441 t << item << endl; 1447 1442 t << endl; 1448 1443 t << "UID2 KUidAppRegistrationResourceFile" << endl; … … 1452 1447 t << "\tapp_file=\"" << fixedTarget << "\";" << endl; 1453 1448 t << "\tlocalisable_resource_file=\"" RESOURCE_DIRECTORY_RESOURCE << fixedTarget << "\";" << endl; 1449 1450 writeRegRssList(t, userItems[RSS_TAG_SERVICE_LIST], 1451 QLatin1String(RSS_TAG_SERVICE_LIST), 1452 QLatin1String("SERVICE_INFO")); 1453 writeRegRssList(t, userItems[RSS_TAG_FILE_OWNERSHIP_LIST], 1454 QLatin1String(RSS_TAG_FILE_OWNERSHIP_LIST), 1455 QLatin1String("FILE_OWNERSHIP_INFO")); 1456 writeRegRssList(t, userItems[RSS_TAG_DATATYPE_LIST], 1457 QLatin1String(RSS_TAG_DATATYPE_LIST), 1458 QLatin1String("DATATYPE")); 1454 1459 t << endl; 1455 1460 1456 foreach(QString item, userItems )1457 t << "\t" << item << endl;1461 foreach(QString item, userItems[RSS_TAG_DEFAULT]) 1462 t << "\t" << item.replace("\n","\n\t") << endl; 1458 1463 t << "\t}" << endl; 1464 1465 foreach(QString item, userItems[RSS_TAG_FOOTER]) 1466 t << item << endl; 1459 1467 } else { 1460 1468 PRINT_FILE_CREATE_ERROR(filename) 1469 } 1470 } 1471 1472 void SymbianMakefileGenerator::writeRegRssList(QTextStream &t, 1473 QStringList &userList, 1474 const QString &listTag, 1475 const QString &listItem) 1476 { 1477 int itemCount = userList.count(); 1478 if (itemCount) { 1479 t << "\t" << listTag << " ="<< endl; 1480 t << "\t\t{" << endl; 1481 foreach(QString item, userList) { 1482 t << "\t\t" << listItem << endl; 1483 t << "\t\t\t{" << endl; 1484 t << "\t\t\t" << item.replace("\n","\n\t\t\t") << endl; 1485 t << "\t\t\t}"; 1486 if (--itemCount) 1487 t << ","; 1488 t << endl; 1489 } 1490 t << "\t\t}; "<< endl; 1461 1491 } 1462 1492 } … … 1540 1570 } 1541 1571 1542 void SymbianMakefileGenerator::readRssRules(QString &numberOfIcons, QString &iconFile, QStringList &userRssRules) 1572 void SymbianMakefileGenerator::readRssRules(QString &numberOfIcons, 1573 QString &iconFile, QMap<QString, 1574 QStringList> &userRssRules) 1543 1575 { 1544 1576 for (QMap<QString, QStringList>::iterator it = project->variables().begin(); it != project->variables().end(); ++it) { … … 1552 1584 QStringList values = it.value(); 1553 1585 foreach(QString item, values) { 1554 // If there is no stringlist defined for a rule, use rule name directly1586 // If there is no stringlist defined for a rule, use rule value directly 1555 1587 // This is convenience for defining single line statements 1556 1588 if (project->values(item).isEmpty()) { 1557 1589 newValues << item; 1558 1590 } else { 1591 QStringList itemList; 1559 1592 foreach(QString itemRow, project->values(item)) { 1560 newValues<< itemRow;1593 itemList << itemRow; 1561 1594 } 1595 newValues << itemList.join("\n"); 1562 1596 } 1563 1597 } … … 1580 1614 continue; 1581 1615 } 1616 } else if (newKey == RSS_TAG_HEADER 1617 || newKey == RSS_TAG_SERVICE_LIST 1618 || newKey == RSS_TAG_FILE_OWNERSHIP_LIST 1619 || newKey == RSS_TAG_DATATYPE_LIST 1620 || newKey == RSS_TAG_FOOTER 1621 || newKey == RSS_TAG_DEFAULT) { 1622 userRssRules[newKey] = newValues; 1623 continue; 1582 1624 } else { 1583 1625 fprintf(stderr, "Warning: Unsupported key:'%s%s'\n", … … 1588 1630 } 1589 1631 1632 QStringList newValues; 1590 1633 foreach(QString item, project->values(RSS_RULES)) { 1591 // If there is no stringlist defined for a rule, use rule name directly1592 // This is convenience for defining single line mmpstatements1634 // If there is no stringlist defined for a rule, use rule value directly 1635 // This is convenience for defining single line statements 1593 1636 if (project->values(item).isEmpty()) { 1594 userRssRules << item;1637 newValues << item; 1595 1638 } else { 1596 userRssRules << project->values(item); 1597 } 1598 } 1639 newValues << project->values(item); 1640 } 1641 } 1642 userRssRules[RSS_TAG_DEFAULT] << newValues; 1599 1643 1600 1644 // Validate that either both RSS_TAG_NBROFICONS and RSS_TAG_ICONFILE keys exist … … 1612 1656 bool ok; 1613 1657 numberOfIcons = numberOfIcons.simplified(); 1614 int tmp =numberOfIcons.toInt(&ok);1658 numberOfIcons.toInt(&ok); 1615 1659 if (!ok) { 1616 1660 numberOfIcons.clear(); … … 1883 1927 1884 1928 t << SIS_TARGET ":" << endl; 1885 QString siscommand = QString ("\t$(if $(wildcard %1_template.%2),$(if $(wildcard %3)," \1929 QString siscommand = QString::fromLatin1("\t$(if $(wildcard %1_template.%2),$(if $(wildcard %3)," \ 1886 1930 "$(MAKE) -s -f $(MAKEFILE) %4," \ 1887 1931 "$(if $(QT_SIS_TARGET),$(MAKE) -s -f $(MAKEFILE) %4," \ … … 1899 1943 t << OK_SIS_TARGET ":" << endl; 1900 1944 1901 QString pkgcommand = QString ("\tcreatepackage.bat $(QT_SIS_OPTIONS) %1_template.%2 $(QT_SIS_TARGET) " \1945 QString pkgcommand = QString::fromLatin1("\tcreatepackage.bat $(QT_SIS_OPTIONS) %1_template.%2 $(QT_SIS_TARGET) " \ 1902 1946 "$(QT_SIS_CERTIFICATE) $(QT_SIS_KEY) $(QT_SIS_PASSPHRASE)") 1903 1947 .arg(fixedTarget) … … 1912 1956 t << "\t$(MAKE) -s -f $(MAKEFILE) " SIS_TARGET << endl << endl; 1913 1957 1958 t << ROM_STUB_SIS_TARGET ":" << endl; 1959 QString stubsiscommand = QString::fromLatin1("\t$(if $(wildcard %1_template.%2),$(if $(wildcard %3)," \ 1960 "$(MAKE) -s -f $(MAKEFILE) %4," \ 1961 "$(if $(QT_SIS_TARGET),$(MAKE) -s -f $(MAKEFILE) %4," \ 1962 "$(MAKE) -s -f $(MAKEFILE) %5))," \ 1963 "$(MAKE) -s -f $(MAKEFILE) %6)") 1964 .arg(fixedTarget) 1965 .arg("pkg") 1966 .arg(MAKE_CACHE_NAME) 1967 .arg(OK_ROM_STUB_SIS_TARGET) 1968 .arg(FAIL_SIS_NOCACHE_TARGET) 1969 .arg(FAIL_SIS_NOPKG_TARGET); 1970 t << stubsiscommand << endl; 1971 t << endl; 1972 1973 t << OK_ROM_STUB_SIS_TARGET ":" << endl; 1974 1975 QString stubpkgcommand = QString::fromLatin1("\tcreatepackage.bat -s $(QT_SIS_OPTIONS) %1_template.%2 $(QT_SIS_TARGET) " \ 1976 "$(QT_SIS_CERTIFICATE) $(QT_SIS_KEY) $(QT_SIS_PASSPHRASE)") 1977 .arg(fixedTarget) 1978 .arg("pkg"); 1979 t << stubpkgcommand << endl; 1980 t << endl; 1981 1914 1982 t << INSTALLER_SIS_TARGET ": " << sisName << endl; 1915 siscommand = QString ("\t$(if $(wildcard %1_installer.%2)," \1983 siscommand = QString::fromLatin1("\t$(if $(wildcard %1_installer.%2)," \ 1916 1984 "$(MAKE) -s -f $(MAKEFILE) %3," \ 1917 1985 "$(MAKE) -s -f $(MAKEFILE) %4)") … … 1925 1993 t << OK_INSTALLER_SIS_TARGET ": " << endl; 1926 1994 1927 pkgcommand = QString ("\tcreatepackage.bat $(QT_SIS_OPTIONS) %1_installer.%2 - " \1995 pkgcommand = QString::fromLatin1("\tcreatepackage.bat $(QT_SIS_OPTIONS) %1_installer.%2 - " \ 1928 1996 "$(QT_SIS_CERTIFICATE) $(QT_SIS_KEY) $(QT_SIS_PASSPHRASE)") 1929 1997 .arg(fixedTarget) … … 2005 2073 } 2006 2074 t << "runonphone: sis" << endl; 2007 t << "\trunonphone $(QT_RUN_ON_PHONE_OPTIONS) --sis " << fixedTarget << " _$(QT_SIS_TARGET).sis " << fixedTarget << ".exe " << "$(QT_RUN_OPTIONS)" << endl;2075 t << "\trunonphone $(QT_RUN_ON_PHONE_OPTIONS) --sis " << fixedTarget << ".sis " << fixedTarget << ".exe " << "$(QT_RUN_OPTIONS)" << endl; 2008 2076 t << endl; 2009 2077 } -
trunk/qmake/generators/symbian/symmake.h
r651 r769 50 50 #define BLD_INF_FILENAME "bld.inf" 51 51 #define MAKEFILE_DEPENDENCY_SEPARATOR " \\\n\t" 52 53 52 #define QT_EXTRA_INCLUDE_DIR "tmp" 54 53 #define MAKE_CACHE_NAME ".make.cache" 54 #define SYMBIAN_TEST_CONFIG "symbian_test" 55 55 56 56 class SymbianMakefileGenerator : public MakefileGenerator … … 85 85 void removeSpecialCharacters(QString& str); 86 86 QString fixPathForMmp(const QString& origPath, const QDir& parentDir); 87 QString canonizePath(const QString& origPath);87 QString absolutizePath(const QString& origPath); 88 88 89 89 virtual bool writeMakefile(QTextStream &t); … … 108 108 109 109 void writeHeader(QTextStream &t); 110 void writeBldInfContent(QTextStream& t, bool addDeploymentExtension, const QString &iconFile, DeploymentList &depList); 110 void writeBldInfContent(QTextStream& t, 111 bool addDeploymentExtension, 112 const QString &iconFile, 113 DeploymentList &depList); 111 114 112 115 static bool removeDuplicatedStrings(QStringList& stringList); … … 122 125 void writeMmpFileLibraryPart(QTextStream& t); 123 126 void writeMmpFileCapabilityPart(QTextStream& t); 127 void writeMmpFileConditionalOptions(QTextStream& t, 128 const QString &optionType, 129 const QString &optionTag, 130 const QString &variableBase); 131 void writeMmpFileSimpleOption(QTextStream& t, 132 const QString &optionType, 133 const QString &optionTag, 134 const QString &options); 135 void appendMmpFileOptions(QString &options, const QStringList &list); 124 136 void writeMmpFileCompilerOptionPart(QTextStream& t); 125 137 void writeMmpFileBinaryVersionPart(QTextStream& t); … … 128 140 void writeCustomDefFile(); 129 141 130 void writeRegRssFile(QStringList &useritems); 142 void writeRegRssFile(QMap<QString, QStringList> &useritems); 143 void writeRegRssList(QTextStream &t, QStringList &userList, 144 const QString &listTag, 145 const QString &listItem); 131 146 void writeRssFile(QString &numberOfIcons, QString &iconfile); 132 147 void writeLocFile(QStringList &symbianLangCodes); 133 void readRssRules(QString &numberOfIcons, QString &iconFile, QStringList &userRssRules); 148 void readRssRules(QString &numberOfIcons, 149 QString &iconFile, 150 QMap<QString, QStringList> &userRssRules); 134 151 135 152 QStringList symbianLangCodesFromTsFiles(); -
trunk/qmake/generators/symbian/symmake_abld.cpp
r651 r769 48 48 #include <qdatetime.h> 49 49 #include <qdebug.h> 50 51 // Included from tools/shared 52 #include <symbian/epocroot.h> 50 53 51 54 #define DO_NOTHING_TARGET "do_nothing" … … 57 60 #define GENERATED_SOURCES_TARGET "generated_sources" 58 61 #define ALL_SOURCE_DEPS_TARGET "all_source_deps" 62 #define DEPLOYMENT_TARGET "deployment" 63 #define DEPLOYMENT_CLEAN_TARGET "deployment_clean" 59 64 #define WINSCW_DEPLOYMENT_TARGET "winscw_deployment" 60 65 #define WINSCW_DEPLOYMENT_CLEAN_TARGET "winscw_deployment_clean" … … 110 115 if (deploymentOnly) { 111 116 buildDeps.append(STORE_BUILD_TARGET); 112 cleanDeps.append(D O_NOTHING_TARGET);113 cleanDepsWinscw.append(WINSCW_DEPLOYMENT_CLEAN_TARGET );114 finalDeps.append(D O_NOTHING_TARGET);115 finalDepsWinscw.append(WINSCW_DEPLOYMENT_TARGET );117 cleanDeps.append(DEPLOYMENT_CLEAN_TARGET); 118 cleanDepsWinscw.append(WINSCW_DEPLOYMENT_CLEAN_TARGET " " DEPLOYMENT_CLEAN_TARGET); 119 finalDeps.append(DEPLOYMENT_TARGET); 120 finalDepsWinscw.append(WINSCW_DEPLOYMENT_TARGET " " DEPLOYMENT_TARGET); 116 121 wrapperTargets << WINSCW_DEPLOYMENT_TARGET 117 122 << WINSCW_DEPLOYMENT_CLEAN_TARGET 123 << DEPLOYMENT_TARGET 124 << DEPLOYMENT_CLEAN_TARGET 118 125 << STORE_BUILD_TARGET; 119 126 } else { 120 127 buildDeps.append(CREATE_TEMPS_TARGET " " PRE_TARGETDEPS_TARGET " " STORE_BUILD_TARGET); 121 cleanDeps.append(EXTENSION_CLEAN );122 cleanDepsWinscw.append(EXTENSION_CLEAN " " WINSCW_DEPLOYMENT_CLEAN_TARGET );123 finalDeps.append(FINALIZE_TARGET );124 finalDepsWinscw.append(FINALIZE_TARGET " " WINSCW_DEPLOYMENT_TARGET );128 cleanDeps.append(EXTENSION_CLEAN " " DEPLOYMENT_CLEAN_TARGET); 129 cleanDepsWinscw.append(EXTENSION_CLEAN " " WINSCW_DEPLOYMENT_CLEAN_TARGET " " DEPLOYMENT_CLEAN_TARGET); 130 finalDeps.append(FINALIZE_TARGET " " DEPLOYMENT_TARGET); 131 finalDepsWinscw.append(FINALIZE_TARGET " " WINSCW_DEPLOYMENT_TARGET " " DEPLOYMENT_TARGET); 125 132 wrapperTargets << PRE_TARGETDEPS_TARGET 126 133 << CREATE_TEMPS_TARGET … … 129 136 << WINSCW_DEPLOYMENT_CLEAN_TARGET 130 137 << WINSCW_DEPLOYMENT_TARGET 138 << DEPLOYMENT_CLEAN_TARGET 139 << DEPLOYMENT_TARGET 131 140 << STORE_BUILD_TARGET; 132 141 } … … 173 182 174 183 QString testClause; 175 if (project-> values("CONFIG").contains("symbian_test", Qt::CaseInsensitive))184 if (project->isActiveConfig(SYMBIAN_TEST_CONFIG)) 176 185 testClause = QLatin1String(" test"); 177 186 else … … 196 205 t << "DEL_DIR = " << var("QMAKE_DEL_DIR") << endl; 197 206 t << "MOVE = " << var("QMAKE_MOVE") << endl; 207 t << "CHK_DIR_EXISTS = " << var("QMAKE_CHK_DIR_EXISTS") << endl; 208 t << "MKDIR = " << var("QMAKE_MKDIR") << endl; 198 209 t << "XCOPY = xcopy /d /f /h /r /y /i" << endl; 199 210 t << "ABLD = ABLD.BAT" << endl; … … 360 371 } 361 372 362 writeDeploymentTargets(t); 373 // Deploymend targets for both emulator and rom deployment 374 writeDeploymentTargets(t, false); 375 writeDeploymentTargets(t, true); 363 376 364 377 writeSisTargets(t); … … 405 418 } 406 419 407 bool SymbianAbldMakefileGenerator::writeDeploymentTargets(QTextStream &t) 408 { 409 t << WINSCW_DEPLOYMENT_TARGET ":" << endl; 410 411 QString remoteTestPath = epocRoot() + QLatin1String("epoc32\\winscw\\c\\private\\") + privateDirUid; // default 4 OpenC; 4 all Symbian too 420 bool SymbianAbldMakefileGenerator::writeDeploymentTargets(QTextStream &t, bool isRom) 421 { 422 if (isRom) 423 t << DEPLOYMENT_TARGET ":" << endl; 424 else 425 t << WINSCW_DEPLOYMENT_TARGET ":" << endl; 426 427 QString remoteTestPath = epocRoot() 428 + QLatin1String(isRom ? "epoc32\\data\\z\\private\\" : "epoc32\\winscw\\c\\private\\") 429 + privateDirUid; 412 430 DeploymentList depList; 413 initProjectDeploySymbian(project, depList, remoteTestPath, false, QLatin1String("winscw"), QLatin1String("udeb"), generatedDirs, generatedFiles); 431 432 initProjectDeploySymbian(project, depList, remoteTestPath, false, 433 QLatin1String(isRom ? ROM_DEPLOYMENT_PLATFORM : EMULATOR_DEPLOYMENT_PLATFORM), 434 QString(), generatedDirs, generatedFiles); 414 435 415 436 if (depList.size()) … … 420 441 // and doesn't provide switch to force file selection. It does provide dir forcing, though, 421 442 // so strip the last part of the destination. 422 t << "\t-$(XCOPY) \"" << depList.at(i).from << "\" \"" << depList.at(i).to.left(depList.at(i).to.lastIndexOf("\\") + 1) << "\"" << endl; 423 } 424 425 t << endl; 426 427 t << WINSCW_DEPLOYMENT_CLEAN_TARGET ":" << endl; 443 t << "\t-$(XCOPY) \"" << depList.at(i).from << "\" \"" 444 << depList.at(i).to.left(depList.at(i).to.lastIndexOf("\\") + 1) << "\"" << endl; 445 } 446 447 t << endl; 448 449 if (isRom) 450 t << DEPLOYMENT_CLEAN_TARGET ":" << endl; 451 else 452 t << WINSCW_DEPLOYMENT_CLEAN_TARGET ":" << endl; 453 428 454 QStringList cleanList; 429 455 for (int i = 0; i < depList.size(); ++i) { -
trunk/qmake/generators/symbian/symmake_abld.h
r651 r769 59 59 60 60 void writeStoreBuildTarget(QTextStream &t); 61 bool writeDeploymentTargets(QTextStream &t );61 bool writeDeploymentTargets(QTextStream &t, bool isRom); 62 62 63 63 public: -
trunk/qmake/generators/symbian/symmake_sbsv2.cpp
r651 r769 49 49 #include <qdebug.h> 50 50 51 // Included from tools/shared 52 #include <symbian/epocroot.h> 53 51 54 SymbianSbsv2MakefileGenerator::SymbianSbsv2MakefileGenerator() : SymbianMakefileGenerator() { } 52 55 SymbianSbsv2MakefileGenerator::~SymbianSbsv2MakefileGenerator() { } … … 73 76 foreach(QFileInfo item, sourceInfos) { 74 77 QFileInfo destInfo = QFileInfo(destDir.absolutePath() + "/" + item.fileName()); 75 if (!destInfo.exists() || destInfo.lastModified() <item.lastModified()) {78 if (!destInfo.exists() || destInfo.lastModified() != item.lastModified()) { 76 79 if (destInfo.exists()) 77 80 QFile::remove(destInfo.absoluteFilePath()); … … 88 91 } 89 92 90 void SymbianSbsv2MakefileGenerator::writeMkFile(const QString& wrapperFileName, bool deploymentOnly) 91 { 92 // Can't use extension makefile with sbsv2 93 Q_UNUSED(wrapperFileName); 94 Q_UNUSED(deploymentOnly); 95 } 96 97 void SymbianSbsv2MakefileGenerator::writeWrapperMakefile(QFile& wrapperFile, bool isPrimaryMakefile) 98 { 99 QStringList allPlatforms; 100 foreach(QString platform, project->values("SYMBIAN_PLATFORMS")) { 101 allPlatforms << platform.toLower(); 102 } 103 104 QStringList debugPlatforms = allPlatforms; 105 QStringList releasePlatforms = allPlatforms; 106 releasePlatforms.removeAll("winscw"); // No release for emulator 107 108 QString testClause; 109 if (project->values("CONFIG").contains("symbian_test", Qt::CaseInsensitive)) 110 testClause = QLatin1String(".test"); 111 else 112 testClause = QLatin1String(""); 113 114 QTextStream t(&wrapperFile); 115 116 t << "# ==============================================================================" << endl; 117 t << "# Generated by qmake (" << qmake_version() << ") (Qt " << QT_VERSION_STR << ") on: "; 118 t << QDateTime::currentDateTime().toString() << endl; 119 t << "# This file is generated by qmake and should not be modified by the" << endl; 120 t << "# user." << endl; 121 t << "# Name : " << wrapperFile.fileName() << endl; 122 t << "# Description : Wrapper Makefile for calling Symbian build tools" << endl; 123 t << "#" << endl; 124 t << "# ==============================================================================" << "\n" << endl; 125 t << endl; 126 t << "MAKEFILE = " << wrapperFile.fileName() << endl; 127 t << "QMAKE = " << Option::fixPathToTargetOS(var("QMAKE_QMAKE")) << endl; 128 t << "DEL_FILE = " << var("QMAKE_DEL_FILE") << endl; 129 t << "DEL_DIR = " << var("QMAKE_DEL_DIR") << endl; 130 t << "MOVE = " << var("QMAKE_MOVE") << endl; 131 t << "DEBUG_PLATFORMS = " << debugPlatforms.join(" ") << endl; 132 t << "RELEASE_PLATFORMS = " << releasePlatforms.join(" ") << endl; 133 t << "MAKE = make" << endl; 134 t << "SBS = sbs" << endl; 135 t << endl; 136 t << "DEFINES" << '\t' << " = " 137 << varGlue("PRL_EXPORT_DEFINES","-D"," -D"," ") 138 << varGlue("QMAKE_COMPILER_DEFINES", "-D", "-D", " ") 139 << varGlue("DEFINES","-D"," -D","") << endl; 140 141 t << "INCPATH" << '\t' << " = "; 142 143 for (QMap<QString, QStringList>::iterator it = systeminclude.begin(); it != systeminclude.end(); ++it) { 144 QStringList values = it.value(); 145 for (int i = 0; i < values.size(); ++i) { 146 t << " -I\"" << values.at(i) << "\" "; 147 } 148 } 149 t << endl; 150 t << "first: default" << endl; 151 if (debugPlatforms.contains("winscw")) 152 t << "default: debug-winscw"; 153 else if (debugPlatforms.contains("armv5")) 154 t << "default: debug-armv5"; 155 else if (debugPlatforms.size()) 156 t << "default: debug-" << debugPlatforms.first(); 157 else 158 t << "default: all"; 159 160 t << endl; 161 if (!isPrimaryMakefile) { 162 t << "all:" << endl; 163 } else { 164 t << "all: debug release" << endl; 165 t << endl; 166 t << "qmake:" << endl; 167 t << "\t$(QMAKE) -spec symbian-sbsv2 -o \"" << fileInfo(Option::output.fileName()).fileName() 168 << "\" \"" << project->projectFile() << "\"" << endl; 169 t << endl; 170 t << BLD_INF_FILENAME ":" << endl; 171 t << "\t$(QMAKE)" << endl; 172 t << endl; 173 174 QString winscw("winscw"); 175 t << "debug: " << BLD_INF_FILENAME << endl; 176 t << "\t$(SBS)"; 177 foreach(QString item, debugPlatforms) { 178 if(QString::compare(item, winscw) == 0) 179 t << " -c " << item << "_udeb.mwccinc" << testClause; 180 else 181 t << " -c " << item << "_udeb" << testClause; 182 } 183 t << endl; 184 t << "release: " << BLD_INF_FILENAME << endl; 185 t << "\t$(SBS)"; 186 foreach(QString item, releasePlatforms) { 187 if(QString::compare(item, winscw) == 0) 188 t << " -c " << item << "_urel.mwccinc" << testClause; 189 else 190 t << " -c " << item << "_urel" << testClause; 191 } 192 t << endl; 193 194 // For more specific builds, targets are in this form: build-platform, e.g. release-armv5 195 foreach(QString item, debugPlatforms) { 196 t << "debug-" << item << ": " << BLD_INF_FILENAME << endl; 197 if(QString::compare(item, winscw) == 0) 198 t << "\t$(SBS) -c " << item << "_udeb.mwccinc" << testClause << endl; 199 else 200 t << "\t$(SBS) -c " << item << "_udeb" << testClause << endl; 201 } 202 203 foreach(QString item, releasePlatforms) { 204 t << "release-" << item << ": " << BLD_INF_FILENAME << endl; 205 if(QString::compare(item, winscw) == 0) 206 t << "\t$(SBS) -c " << item << "_urel.mwccinc" << testClause << endl; 207 else 208 t << "\t$(SBS) -c " << item << "_urel" << testClause << endl; 209 } 210 211 t << endl; 212 t << "export: " << BLD_INF_FILENAME << endl; 213 t << "\t$(SBS) export" << endl; 214 t << endl; 215 216 t << "cleanexport: " << BLD_INF_FILENAME << endl; 217 t << "\t$(SBS) cleanexport" << endl; 218 t << endl; 219 220 } 221 222 // Add all extra targets including extra compiler targest also to wrapper makefile, 223 // even though many of them may have already been added to bld.inf as FLMs. 224 // This is to enable use of targets like 'mocables', which call targets generated by extra compilers. 225 if (targetType != TypeSubdirs) { 226 t << extraTargetsCache; 227 t << extraCompilersCache; 228 } else { 229 QList<MakefileGenerator::SubTarget*> subtargets = findSubDirsSubTargets(); 230 writeSubTargets(t, subtargets, SubTargetSkipDefaultVariables|SubTargetSkipDefaultTargets); 231 qDeleteAll(subtargets); 232 } 233 234 writeSisTargets(t); 235 236 generateDistcleanTargets(t); 237 238 t << "clean: " << BLD_INF_FILENAME << endl; 239 t << "\t-$(SBS) reallyclean" << endl; 240 t << endl; 241 242 t << "clean-debug: " << BLD_INF_FILENAME << endl; 243 t << "\t$(SBS) reallyclean"; 244 foreach(QString item, debugPlatforms) { 245 t << " -c " << item << "_udeb" << testClause; 246 } 247 t << endl; 248 t << "clean-release: " << BLD_INF_FILENAME << endl; 249 t << "\t$(SBS) reallyclean"; 250 foreach(QString item, releasePlatforms) { 251 t << " -c " << item << "_urel" << testClause; 252 } 253 t << endl; 254 255 // For more specific builds, targets are in this form: clean-build-platform, e.g. clean-release-armv5 256 foreach(QString item, debugPlatforms) { 257 t << "clean-debug-" << item << ": " << BLD_INF_FILENAME << endl; 258 t << "\t$(SBS) reallyclean -c " << item << "_udeb" << testClause << endl; 259 } 260 foreach(QString item, releasePlatforms) { 261 t << "clean-release-" << item << ": " << BLD_INF_FILENAME << endl; 262 t << "\t$(SBS) reallyclean -c " << item << "_urel" << testClause << endl; 263 } 264 t << endl; 265 266 generateExecutionTargets(t, debugPlatforms); 267 } 268 269 void SymbianSbsv2MakefileGenerator::writeBldInfExtensionRulesPart(QTextStream& t, const QString &iconTargetFile) 270 { 271 // Makes sure we have needed FLMs in place. 272 exportFlm(); 273 274 // Parse extra compilers data 275 QStringList defines; 276 QStringList incPath; 277 278 defines << varGlue("PRL_EXPORT_DEFINES","-D"," -D"," ") 279 << varGlue("QMAKE_COMPILER_DEFINES", "-D", "-D", " ") 280 << varGlue("DEFINES","-D"," -D",""); 281 for (QMap<QString, QStringList>::iterator it = systeminclude.begin(); it != systeminclude.end(); ++it) { 282 QStringList values = it.value(); 283 for (int i = 0; i < values.size(); ++i) { 284 incPath << QLatin1String(" -I\"") + values.at(i) + "\""; 285 } 286 } 287 288 // Write extra compilers and targets to initialize QMAKE_ET_* variables 289 // Cache results to avoid duplicate calls when creating wrapper makefile 290 QTextStream extraCompilerStream(&extraCompilersCache); 291 QTextStream extraTargetStream(&extraTargetsCache); 292 writeExtraCompilerTargets(extraCompilerStream); 293 writeExtraTargets(extraTargetStream); 294 295 // Figure out everything the target depends on as we don't want to run extra targets that 296 // are not necessary. 297 QStringList allPreDeps; 298 foreach(QString item, project->values("PRE_TARGETDEPS")) { 299 // Predeps get mangled in windows, so fix them to more sbsv2 friendly format 300 #if defined(Q_OS_WIN) 301 if (item.mid(1, 1) == ":") 302 item = item.mid(0, 1).toUpper().append(item.mid(1)); // Fix drive to uppercase 303 #endif 304 item.replace("\\", "/"); 305 allPreDeps << escapeDependencyPath(item); 306 } 307 308 foreach (QString item, project->values("GENERATED_SOURCES")) { 309 allPreDeps.append(fileInfo(item).absoluteFilePath()); 310 } 311 312 for (QMap<QString, QStringList>::iterator it = sources.begin(); it != sources.end(); ++it) { 313 QString currentSourcePath = it.key(); 314 QStringList values = it.value(); 315 for (int i = 0; i < values.size(); ++i) { 316 QString sourceFile = currentSourcePath + "/" + values.at(i); 317 QStringList deps = findDependencies(QDir::toNativeSeparators(sourceFile)); 318 foreach(QString depItem, deps) { 319 appendIfnotExist(allPreDeps, fileInfo(depItem).absoluteFilePath()); 320 } 321 } 322 } 323 324 // Write FLM rules for all extra targets and compilers that we depend on to build the target. 325 QStringList extraTargets; 326 extraTargets << project->values("QMAKE_EXTRA_TARGETS") << project->values("QMAKE_EXTRA_COMPILERS"); 327 foreach(QString item, extraTargets) { 328 foreach(QString targetItem, project->values(QLatin1String("QMAKE_INTERNAL_ET_PARSED_TARGETS.") + item)) { 329 // Make sure targetpath is absolute 330 QString absoluteTarget = fileInfo(targetItem).absoluteFilePath(); 331 if (allPreDeps.contains(absoluteTarget)) { 332 QStringList deps = project->values(QLatin1String("QMAKE_INTERNAL_ET_PARSED_DEPS.") + item + targetItem); 333 QString commandItem = project->values(QLatin1String("QMAKE_INTERNAL_ET_PARSED_CMD.") + item + targetItem).join(" "); 334 335 336 // Make sure all deps paths are absolute 337 QString absoluteDeps; 338 foreach (QString depItem, deps) { 339 if (!depItem.isEmpty()) { 340 absoluteDeps.append(fileInfo(depItem).absoluteFilePath()); 341 absoluteDeps.append(" "); 342 } 343 } 344 345 t << "START EXTENSION qt/qmake_extra_pre_targetdep" << endl; 346 t << "OPTION PREDEP_TARGET " << absoluteTarget << endl; 347 t << "OPTION DEPS " << absoluteDeps << endl; 348 349 if (commandItem.indexOf("$(INCPATH)") != -1) 350 commandItem.replace("$(INCPATH)", incPath.join(" ")); 351 if (commandItem.indexOf("$(DEFINES)") != -1) 352 commandItem.replace("$(DEFINES)", defines.join(" ")); 353 354 // Sbsv2 strips all backslashes (even doubles ones) from option parameters, so just replace them with slashes 355 // Problem: If some command actually needs backslashes for something else than dir separator, we are out of luck... 356 commandItem.replace("\\", "/"); 357 t << "OPTION COMMAND " << commandItem << endl; 358 t << "END" << endl; 359 } 360 } 361 } 362 363 t << endl; 364 365 // Write winscw deployment rules 366 QString remoteTestPath = epocRoot() + QLatin1String("epoc32/winscw/c/private/") + privateDirUid; 367 DeploymentList depList; 368 initProjectDeploySymbian(project, depList, remoteTestPath, false, QLatin1String("winscw"), QLatin1String("udeb"), generatedDirs, generatedFiles); 369 370 t << "#if defined(WINSCW)" << endl; 93 void SymbianSbsv2MakefileGenerator::writeSbsDeploymentList(const DeploymentList& depList, QTextStream& t) 94 { 371 95 for (int i = 0; i < depList.size(); ++i) { 372 96 t << "START EXTENSION qt/qmake_emulator_deployment" << endl; … … 382 106 t << "END" << endl; 383 107 } 108 } 109 110 void SymbianSbsv2MakefileGenerator::writeMkFile(const QString& wrapperFileName, bool deploymentOnly) 111 { 112 // Can't use extension makefile with sbsv2 113 Q_UNUSED(wrapperFileName); 114 Q_UNUSED(deploymentOnly); 115 } 116 117 void SymbianSbsv2MakefileGenerator::writeWrapperMakefile(QFile& wrapperFile, bool isPrimaryMakefile) 118 { 119 QStringList allPlatforms; 120 foreach(QString platform, project->values("SYMBIAN_PLATFORMS")) { 121 allPlatforms << platform.toLower(); 122 } 123 124 QStringList debugPlatforms = allPlatforms; 125 QStringList releasePlatforms = allPlatforms; 126 releasePlatforms.removeAll("winscw"); // No release for emulator 127 128 QString testClause; 129 if (project->isActiveConfig(SYMBIAN_TEST_CONFIG)) 130 testClause = QLatin1String(".test"); 131 else 132 testClause = QLatin1String(""); 133 134 QTextStream t(&wrapperFile); 135 136 t << "# ==============================================================================" << endl; 137 t << "# Generated by qmake (" << qmake_version() << ") (Qt " << QT_VERSION_STR << ") on: "; 138 t << QDateTime::currentDateTime().toString() << endl; 139 t << "# This file is generated by qmake and should not be modified by the" << endl; 140 t << "# user." << endl; 141 t << "# Name : " << wrapperFile.fileName() << endl; 142 t << "# Description : Wrapper Makefile for calling Symbian build tools" << endl; 143 t << "#" << endl; 144 t << "# ==============================================================================" << "\n" << endl; 145 t << endl; 146 t << "MAKEFILE = " << wrapperFile.fileName() << endl; 147 t << "QMAKE = " << Option::fixPathToTargetOS(var("QMAKE_QMAKE")) << endl; 148 t << "DEL_FILE = " << var("QMAKE_DEL_FILE") << endl; 149 t << "DEL_DIR = " << var("QMAKE_DEL_DIR") << endl; 150 t << "CHK_DIR_EXISTS = " << var("QMAKE_CHK_DIR_EXISTS") << endl; 151 t << "MKDIR = " << var("QMAKE_MKDIR") << endl; 152 t << "MOVE = " << var("QMAKE_MOVE") << endl; 153 t << "DEBUG_PLATFORMS = " << debugPlatforms.join(" ") << endl; 154 t << "RELEASE_PLATFORMS = " << releasePlatforms.join(" ") << endl; 155 t << "MAKE = make" << endl; 156 t << "SBS = sbs" << endl; 157 t << endl; 158 t << "DEFINES" << '\t' << " = " 159 << varGlue("PRL_EXPORT_DEFINES","-D"," -D"," ") 160 << varGlue("QMAKE_COMPILER_DEFINES", "-D", "-D", " ") 161 << varGlue("DEFINES","-D"," -D","") << endl; 162 163 t << "INCPATH" << '\t' << " = "; 164 165 for (QMap<QString, QStringList>::iterator it = systeminclude.begin(); it != systeminclude.end(); ++it) { 166 QStringList values = it.value(); 167 for (int i = 0; i < values.size(); ++i) { 168 t << " -I\"" << values.at(i) << "\" "; 169 } 170 } 171 t << endl; 172 t << "first: default" << endl; 173 if (debugPlatforms.contains("winscw")) 174 t << "default: debug-winscw"; 175 else if (debugPlatforms.contains("armv5")) 176 t << "default: debug-armv5"; 177 else if (debugPlatforms.size()) 178 t << "default: debug-" << debugPlatforms.first(); 179 else 180 t << "default: all"; 181 182 t << endl; 183 if (!isPrimaryMakefile) { 184 t << "all:" << endl; 185 } else { 186 t << "all: debug release" << endl; 187 t << endl; 188 t << "qmake:" << endl; 189 t << "\t$(QMAKE) -spec symbian-sbsv2 -o \"" << fileInfo(Option::output.fileName()).fileName() 190 << "\" \"" << project->projectFile() << "\"" << endl; 191 t << endl; 192 t << BLD_INF_FILENAME ":" << endl; 193 t << "\t$(QMAKE)" << endl; 194 t << endl; 195 196 QString winscw("winscw"); 197 t << "debug: " << BLD_INF_FILENAME << endl; 198 t << "\t$(SBS)"; 199 foreach(QString item, debugPlatforms) { 200 if(QString::compare(item, winscw) == 0) 201 t << " -c " << item << "_udeb.mwccinc" << testClause; 202 else 203 t << " -c " << item << "_udeb" << testClause; 204 } 205 t << endl; 206 t << "release: " << BLD_INF_FILENAME << endl; 207 t << "\t$(SBS)"; 208 foreach(QString item, releasePlatforms) { 209 if(QString::compare(item, winscw) == 0) 210 t << " -c " << item << "_urel.mwccinc" << testClause; 211 else 212 t << " -c " << item << "_urel" << testClause; 213 } 214 t << endl; 215 216 // For more specific builds, targets are in this form: build-platform, e.g. release-armv5 217 foreach(QString item, debugPlatforms) { 218 t << "debug-" << item << ": " << BLD_INF_FILENAME << endl; 219 if(QString::compare(item, winscw) == 0) 220 t << "\t$(SBS) -c " << item << "_udeb.mwccinc" << testClause << endl; 221 else 222 t << "\t$(SBS) -c " << item << "_udeb" << testClause << endl; 223 } 224 225 foreach(QString item, releasePlatforms) { 226 t << "release-" << item << ": " << BLD_INF_FILENAME << endl; 227 if(QString::compare(item, winscw) == 0) 228 t << "\t$(SBS) -c " << item << "_urel.mwccinc" << testClause << endl; 229 else 230 t << "\t$(SBS) -c " << item << "_urel" << testClause << endl; 231 } 232 233 t << endl; 234 t << "export: " << BLD_INF_FILENAME << endl; 235 t << "\t$(SBS) export" << endl; 236 t << endl; 237 238 t << "cleanexport: " << BLD_INF_FILENAME << endl; 239 t << "\t$(SBS) cleanexport" << endl; 240 t << endl; 241 242 } 243 244 // Add all extra targets including extra compiler targest also to wrapper makefile, 245 // even though many of them may have already been added to bld.inf as FLMs. 246 // This is to enable use of targets like 'mocables', which call targets generated by extra compilers. 247 if (targetType != TypeSubdirs) { 248 t << extraTargetsCache; 249 t << extraCompilersCache; 250 } else { 251 QList<MakefileGenerator::SubTarget*> subtargets = findSubDirsSubTargets(); 252 writeSubTargets(t, subtargets, SubTargetSkipDefaultVariables|SubTargetSkipDefaultTargets); 253 qDeleteAll(subtargets); 254 } 255 256 writeSisTargets(t); 257 258 generateDistcleanTargets(t); 259 260 t << "clean: " << BLD_INF_FILENAME << endl; 261 t << "\t-$(SBS) reallyclean" << endl; 262 t << endl; 263 264 t << "clean-debug: " << BLD_INF_FILENAME << endl; 265 t << "\t$(SBS) reallyclean"; 266 foreach(QString item, debugPlatforms) { 267 t << " -c " << item << "_udeb" << testClause; 268 } 269 t << endl; 270 t << "clean-release: " << BLD_INF_FILENAME << endl; 271 t << "\t$(SBS) reallyclean"; 272 foreach(QString item, releasePlatforms) { 273 t << " -c " << item << "_urel" << testClause; 274 } 275 t << endl; 276 277 // For more specific builds, targets are in this form: clean-build-platform, e.g. clean-release-armv5 278 foreach(QString item, debugPlatforms) { 279 t << "clean-debug-" << item << ": " << BLD_INF_FILENAME << endl; 280 t << "\t$(SBS) reallyclean -c " << item << "_udeb" << testClause << endl; 281 } 282 foreach(QString item, releasePlatforms) { 283 t << "clean-release-" << item << ": " << BLD_INF_FILENAME << endl; 284 t << "\t$(SBS) reallyclean -c " << item << "_urel" << testClause << endl; 285 } 286 t << endl; 287 288 generateExecutionTargets(t, debugPlatforms); 289 } 290 291 void SymbianSbsv2MakefileGenerator::writeBldInfExtensionRulesPart(QTextStream& t, const QString &iconTargetFile) 292 { 293 // Makes sure we have needed FLMs in place. 294 exportFlm(); 295 296 // Parse extra compilers data 297 QStringList defines; 298 QStringList incPath; 299 300 defines << varGlue("PRL_EXPORT_DEFINES","-D"," -D"," ") 301 << varGlue("QMAKE_COMPILER_DEFINES", "-D", "-D", " ") 302 << varGlue("DEFINES","-D"," -D",""); 303 for (QMap<QString, QStringList>::iterator it = systeminclude.begin(); it != systeminclude.end(); ++it) { 304 QStringList values = it.value(); 305 for (int i = 0; i < values.size(); ++i) { 306 incPath << QLatin1String(" -I\"") + values.at(i) + "\""; 307 } 308 } 309 310 // Write extra compilers and targets to initialize QMAKE_ET_* variables 311 // Cache results to avoid duplicate calls when creating wrapper makefile 312 QTextStream extraCompilerStream(&extraCompilersCache); 313 QTextStream extraTargetStream(&extraTargetsCache); 314 writeExtraCompilerTargets(extraCompilerStream); 315 writeExtraTargets(extraTargetStream); 316 317 // Figure out everything the target depends on as we don't want to run extra targets that 318 // are not necessary. 319 QStringList allPreDeps; 320 foreach(QString item, project->values("PRE_TARGETDEPS")) { 321 // Predeps get mangled in windows, so fix them to more sbsv2 friendly format 322 #if defined(Q_OS_WIN) 323 if (item.mid(1, 1) == ":") 324 item = item.mid(0, 1).toUpper().append(item.mid(1)); // Fix drive to uppercase 325 #endif 326 item.replace("\\", "/"); 327 allPreDeps << escapeDependencyPath(item); 328 } 329 330 foreach (QString item, project->values("GENERATED_SOURCES")) { 331 allPreDeps.append(fileInfo(item).absoluteFilePath()); 332 } 333 334 for (QMap<QString, QStringList>::iterator it = sources.begin(); it != sources.end(); ++it) { 335 QString currentSourcePath = it.key(); 336 QStringList values = it.value(); 337 for (int i = 0; i < values.size(); ++i) { 338 QString sourceFile = currentSourcePath + "/" + values.at(i); 339 QStringList deps = findDependencies(QDir::toNativeSeparators(sourceFile)); 340 foreach(QString depItem, deps) { 341 appendIfnotExist(allPreDeps, fileInfo(depItem).absoluteFilePath()); 342 } 343 } 344 } 345 346 // Write FLM rules for all extra targets and compilers that we depend on to build the target. 347 QStringList extraTargets; 348 extraTargets << project->values("QMAKE_EXTRA_TARGETS") << project->values("QMAKE_EXTRA_COMPILERS"); 349 foreach(QString item, extraTargets) { 350 foreach(QString targetItem, project->values(QLatin1String("QMAKE_INTERNAL_ET_PARSED_TARGETS.") + item)) { 351 // Make sure targetpath is absolute 352 QString absoluteTarget = fileInfo(targetItem).absoluteFilePath(); 353 if (allPreDeps.contains(absoluteTarget)) { 354 QStringList deps = project->values(QLatin1String("QMAKE_INTERNAL_ET_PARSED_DEPS.") + item + targetItem); 355 QString commandItem = project->values(QLatin1String("QMAKE_INTERNAL_ET_PARSED_CMD.") + item + targetItem).join(" "); 356 357 358 // Make sure all deps paths are absolute 359 QString absoluteDeps; 360 foreach (QString depItem, deps) { 361 if (!depItem.isEmpty()) { 362 absoluteDeps.append(fileInfo(depItem).absoluteFilePath()); 363 absoluteDeps.append(" "); 364 } 365 } 366 367 t << "START EXTENSION qt/qmake_extra_pre_targetdep.export" << endl; 368 t << "OPTION PREDEP_TARGET " << absoluteTarget << endl; 369 t << "OPTION DEPS " << absoluteDeps << endl; 370 371 if (commandItem.indexOf("$(INCPATH)") != -1) 372 commandItem.replace("$(INCPATH)", incPath.join(" ")); 373 if (commandItem.indexOf("$(DEFINES)") != -1) 374 commandItem.replace("$(DEFINES)", defines.join(" ")); 375 376 // Sbsv2 strips all backslashes (even doubles ones) from option parameters, so just replace them with slashes 377 // Problem: If some command actually needs backslashes for something else than dir separator, we are out of luck... 378 commandItem.replace("\\", "/"); 379 t << "OPTION COMMAND " << commandItem << endl; 380 t << "END" << endl; 381 } 382 } 383 } 384 385 t << endl; 386 387 // Write deployment rules 388 QString remoteTestPath = epocRoot() + QLatin1String("epoc32/winscw/c/private/") + privateDirUid; 389 DeploymentList depList; 390 391 //write emulator deployment 392 t << "#if defined(WINSCW)" << endl; 393 initProjectDeploySymbian(project, depList, remoteTestPath, false, 394 QLatin1String(EMULATOR_DEPLOYMENT_PLATFORM), QString(), generatedDirs, generatedFiles); 395 writeSbsDeploymentList(depList, t); 384 396 t << "#endif" << endl; 385 397 398 //write ROM deployment 399 remoteTestPath = epocRoot() + QLatin1String("epoc32/data/z/private/") + privateDirUid; 400 depList.clear(); 401 initProjectDeploySymbian(project, depList, remoteTestPath, false, 402 QLatin1String(ROM_DEPLOYMENT_PLATFORM), QString(), generatedDirs, generatedFiles); 403 writeSbsDeploymentList(depList, t); 386 404 t << endl; 387 405 -
trunk/qmake/generators/symbian/symmake_sbsv2.h
r651 r769 65 65 private: 66 66 void exportFlm(); 67 void writeSbsDeploymentList(const DeploymentList& depList, QTextStream& t); 67 68 68 69 QString extraTargetsCache; -
trunk/qmake/generators/win32/msvc_vcproj.cpp
r651 r769 68 68 #ifdef Q_OS_WIN32 69 69 #include <qt_windows.h> 70 #include <windows/registry.h> 70 71 71 72 QT_BEGIN_NAMESPACE … … 94 95 }; 95 96 96 static QString keyPath(const QString &rKey)97 {98 int idx = rKey.lastIndexOf(QLatin1Char('\\'));99 if (idx == -1)100 return QString();101 return rKey.left(idx + 1);102 }103 104 static QString keyName(const QString &rKey)105 {106 int idx = rKey.lastIndexOf(QLatin1Char('\\'));107 if (idx == -1)108 return rKey;109 110 QString res(rKey.mid(idx + 1));111 if (res == "Default" || res == ".")112 res = "";113 return res;114 }115 116 static QString readRegistryKey(HKEY parentHandle, const QString &rSubkey)117 {118 119 QString rSubkeyName = keyName(rSubkey);120 QString rSubkeyPath = keyPath(rSubkey);121 122 HKEY handle = 0;123 LONG res = RegOpenKeyEx(parentHandle, (wchar_t*)rSubkeyPath.utf16(), 0, KEY_READ, &handle);124 125 if (res != ERROR_SUCCESS)126 return QString();127 128 // get the size and type of the value129 DWORD dataType;130 DWORD dataSize;131 res = RegQueryValueEx(handle, (wchar_t*)rSubkeyName.utf16(), 0, &dataType, 0, &dataSize);132 if (res != ERROR_SUCCESS) {133 RegCloseKey(handle);134 return QString();135 }136 137 // get the value138 QByteArray data(dataSize, 0);139 res = RegQueryValueEx(handle, (wchar_t*)rSubkeyName.utf16(), 0, 0,140 reinterpret_cast<unsigned char*>(data.data()), &dataSize);141 if (res != ERROR_SUCCESS) {142 RegCloseKey(handle);143 return QString();144 }145 146 QString result;147 switch (dataType) {148 case REG_EXPAND_SZ:149 case REG_SZ: {150 result = QString::fromWCharArray(((const wchar_t *)data.constData()));151 break;152 }153 154 case REG_MULTI_SZ: {155 QStringList l;156 int i = 0;157 for (;;) {158 QString s = QString::fromWCharArray((const wchar_t *)data.constData() + i);159 i += s.length() + 1;160 161 if (s.isEmpty())162 break;163 l.append(s);164 }165 result = l.join(", ");166 break;167 }168 169 case REG_NONE:170 case REG_BINARY: {171 result = QString::fromWCharArray((const wchar_t *)data.constData(), data.size() / 2);172 break;173 }174 175 case REG_DWORD_BIG_ENDIAN:176 case REG_DWORD: {177 Q_ASSERT(data.size() == sizeof(int));178 int i;179 memcpy((char*)&i, data.constData(), sizeof(int));180 result = QString::number(i);181 break;182 }183 184 default:185 qWarning("QSettings: unknown data %d type in windows registry", dataType);186 break;187 }188 189 RegCloseKey(handle);190 return result;191 }192 97 QT_END_NAMESPACE 193 98 #endif -
trunk/qmake/generators/win32/winmakefile.cpp
r682 r769 151 151 exists((*it).local() + Option::dir_sep + lib + extension)) { 152 152 out = (*it).real() + Option::dir_sep + lib + extension; 153 if (out.contains(QLatin1Char(' '))) { 154 out.prepend(QLatin1Char('\"')); 155 out.append(QLatin1Char('\"')); 156 } 153 157 break; 154 158 }
Note:
See TracChangeset
for help on using the changeset viewer.