author | Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> |
Fri, 12 Mar 2010 15:46:37 +0200 | |
branch | RCL_3 |
changeset 5 | d3bac044e0f0 |
parent 4 | 3b1da2848fc7 |
child 8 | 3f74d0d4af4c |
permissions | -rw-r--r-- |
0 | 1 |
/**************************************************************************** |
2 |
** |
|
4
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
3 |
** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). |
0 | 4 |
** All rights reserved. |
5 |
** Contact: Nokia Corporation (qt-info@nokia.com) |
|
6 |
** |
|
7 |
** This file is part of the qmake application of the Qt Toolkit. |
|
8 |
** |
|
9 |
** $QT_BEGIN_LICENSE:LGPL$ |
|
10 |
** No Commercial Usage |
|
11 |
** This file contains pre-release code and may not be distributed. |
|
12 |
** You may use this file in accordance with the terms and conditions |
|
13 |
** contained in the Technology Preview License Agreement accompanying |
|
14 |
** this package. |
|
15 |
** |
|
16 |
** GNU Lesser General Public License Usage |
|
17 |
** Alternatively, this file may be used under the terms of the GNU Lesser |
|
18 |
** General Public License version 2.1 as published by the Free Software |
|
19 |
** Foundation and appearing in the file LICENSE.LGPL included in the |
|
20 |
** packaging of this file. Please review the following information to |
|
21 |
** ensure the GNU Lesser General Public License version 2.1 requirements |
|
22 |
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. |
|
23 |
** |
|
24 |
** In addition, as a special exception, Nokia gives you certain additional |
|
25 |
** rights. These rights are described in the Nokia Qt LGPL Exception |
|
26 |
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. |
|
27 |
** |
|
28 |
** If you have questions regarding the use of this file, please contact |
|
29 |
** Nokia at qt-info@nokia.com. |
|
30 |
** |
|
31 |
** |
|
32 |
** |
|
33 |
** |
|
34 |
** |
|
35 |
** |
|
36 |
** |
|
37 |
** |
|
38 |
** $QT_END_LICENSE$ |
|
39 |
** |
|
40 |
****************************************************************************/ |
|
41 |
||
42 |
#include "symmake.h" |
|
43 |
||
44 |
#include <qstring.h> |
|
45 |
#include <qhash.h> |
|
46 |
#include <qstringlist.h> |
|
47 |
#include <qdir.h> |
|
48 |
#include <qdatetime.h> |
|
49 |
#include <stdlib.h> |
|
50 |
#include <qdebug.h> |
|
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
51 |
#include <qxmlstream.h> |
4
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
52 |
#include <QSettings> |
0 | 53 |
|
54 |
#define RESOURCE_DIRECTORY_MMP "/resource/apps" |
|
55 |
#define RESOURCE_DIRECTORY_RESOURCE "\\\\resource\\\\apps\\\\" |
|
56 |
#define REGISTRATION_RESOURCE_DIRECTORY_HW "/private/10003a3f/import/apps" |
|
57 |
#define PLUGIN_COMMON_DEF_FILE_FOR_MMP "./plugin_common.def" |
|
58 |
#define PLUGIN_COMMON_DEF_FILE_ACTUAL "plugin_commonU.def" |
|
59 |
||
60 |
#define BLD_INF_RULES_BASE "BLD_INF_RULES." |
|
61 |
#define BLD_INF_TAG_PLATFORMS "prj_platforms" |
|
62 |
#define BLD_INF_TAG_MMPFILES "prj_mmpfiles" |
|
63 |
#define BLD_INF_TAG_TESTMMPFILES "prj_testmmpfiles" |
|
64 |
#define BLD_INF_TAG_EXTENSIONS "prj_extensions" |
|
4
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
65 |
#define BLD_INF_TAG_EXPORTS "prj_exports" |
0 | 66 |
|
67 |
#define RSS_RULES "RSS_RULES" |
|
68 |
#define RSS_RULES_BASE "RSS_RULES." |
|
69 |
#define RSS_TAG_NBROFICONS "number_of_icons" |
|
70 |
#define RSS_TAG_ICONFILE "icon_file" |
|
71 |
||
72 |
#define MMP_TARGET "TARGET" |
|
73 |
#define MMP_TARGETTYPE "TARGETTYPE" |
|
74 |
#define MMP_SECUREID "SECUREID" |
|
75 |
#define MMP_OPTION_CW "OPTION CW" |
|
76 |
#define MMP_OPTION_ARMCC "OPTION ARMCC" |
|
77 |
#define MMP_OPTION_GCCE "OPTION GCCE" |
|
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
78 |
#define MMP_LINKEROPTION_CW "LINKEROPTION CW" |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
79 |
#define MMP_LINKEROPTION_ARMCC "LINKEROPTION ARMCC" |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
80 |
#define MMP_LINKEROPTION_GCCE "LINKEROPTION GCCE" |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
81 |
#define MMP_CAPABILITY "CAPABILITY" |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
82 |
#define MMP_EPOCALLOWDLLDATA "EPOCALLOWDLLDATA" |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
83 |
#define MMP_EPOCHEAPSIZE "EPOCHEAPSIZE" |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
84 |
#define MMP_EPOCSTACKSIZE "EPOCSTACKSIZE" |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
85 |
#define MMP_UID "UID" |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
86 |
#define MMP_VENDORID "VENDORID" |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
87 |
#define MMP_VERSION "VERSION" |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
88 |
#define MMP_START_RESOURCE "START RESOURCE" |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
89 |
#define MMP_END_RESOURCE "END" |
0 | 90 |
|
91 |
#define SIS_TARGET "sis" |
|
92 |
#define OK_SIS_TARGET "ok_sis" |
|
93 |
#define FAIL_SIS_NOPKG_TARGET "fail_sis_nopkg" |
|
94 |
#define FAIL_SIS_NOCACHE_TARGET "fail_sis_nocache" |
|
95 |
||
96 |
#define PRINT_FILE_CREATE_ERROR(filename) fprintf(stderr, "Error: Could not create '%s'\n", qPrintable(filename)); |
|
97 |
||
5
d3bac044e0f0
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
98 |
#define MANUFACTURER_NOTE_FILE "manufacturer_note.txt" |
d3bac044e0f0
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
99 |
#define DEFAULT_MANUFACTURER_NOTE \ |
d3bac044e0f0
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
100 |
"The package is not supported for devices from this manufacturer. Please try the selfsigned " \ |
d3bac044e0f0
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
101 |
"version of the package instead." |
d3bac044e0f0
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
102 |
|
0 | 103 |
QString SymbianMakefileGenerator::fixPathForMmp(const QString& origPath, const QDir& parentDir) |
104 |
{ |
|
105 |
static QString epocRootStr; |
|
106 |
if (epocRootStr.isEmpty()) { |
|
107 |
QFileInfo efi(epocRoot()); |
|
108 |
epocRootStr = efi.canonicalFilePath(); |
|
109 |
if (epocRootStr.isEmpty()) { |
|
110 |
fprintf(stderr, "Unable to resolve epocRoot '%s' to real dir on current drive, defaulting to '/' for mmp paths\n", qPrintable(epocRoot())); |
|
111 |
epocRootStr = "/"; |
|
112 |
} |
|
113 |
if (!epocRootStr.endsWith("/")) |
|
114 |
epocRootStr += "/"; |
|
115 |
||
116 |
epocRootStr += "epoc32/"; |
|
117 |
} |
|
118 |
||
119 |
QString resultPath = origPath; |
|
120 |
||
121 |
// Make it relative, unless it starts with "%epocroot%/epoc32/" |
|
122 |
if (resultPath.startsWith(epocRootStr, Qt::CaseInsensitive)) { |
|
123 |
resultPath.replace(epocRootStr, "/epoc32/", Qt::CaseInsensitive); |
|
124 |
} else { |
|
125 |
resultPath = parentDir.relativeFilePath(resultPath); |
|
126 |
} |
|
127 |
resultPath = QDir::cleanPath(resultPath); |
|
128 |
||
129 |
if (resultPath.isEmpty()) |
|
130 |
resultPath = "."; |
|
131 |
||
132 |
return resultPath; |
|
133 |
} |
|
134 |
||
135 |
QString SymbianMakefileGenerator::canonizePath(const QString& origPath) |
|
136 |
{ |
|
137 |
// Since current path gets appended almost always anyway, use it as default |
|
138 |
// for nonexisting paths. |
|
139 |
static QString defaultPath; |
|
140 |
if (defaultPath.isEmpty()) { |
|
141 |
QFileInfo fi("."); |
|
142 |
defaultPath = fi.canonicalFilePath(); |
|
143 |
} |
|
144 |
||
145 |
// Prepend epocroot to any paths beginning with "/epoc32/" |
|
146 |
QString resultPath = QDir::fromNativeSeparators(origPath); |
|
147 |
QString tempPath(resultPath); |
|
148 |
bool isEpoc = false; |
|
149 |
if (resultPath.startsWith("/epoc32/", Qt::CaseInsensitive)) { |
|
150 |
isEpoc = true; |
|
151 |
resultPath = QDir::fromNativeSeparators(epocRoot()) + resultPath.mid(1); |
|
152 |
} |
|
153 |
||
154 |
QFileInfo fi(fileInfo(resultPath)); |
|
155 |
if(fi.isDir()) { |
|
156 |
if (isEpoc) |
|
157 |
resultPath = fi.absoluteFilePath();//canonicalFilePath(); |
|
158 |
else |
|
159 |
resultPath = fi.canonicalFilePath(); |
|
160 |
} else { |
|
161 |
if (isEpoc) |
|
162 |
resultPath = fi.absolutePath();//canonicalPath(); |
|
163 |
else |
|
164 |
resultPath = fi.canonicalPath(); |
|
165 |
} |
|
166 |
//some fix for the not existed EPOC32\include folder |
|
167 |
if (isEpoc) { |
|
168 |
int index = resultPath.lastIndexOf("/epoc32/"); |
|
169 |
QString tmpRes = resultPath.mid(index); |
|
170 |
if (tmpRes != tempPath) { |
|
171 |
//we have the problems for not existed include directory |
|
172 |
//change the path |
|
173 |
resultPath.replace(tmpRes, tempPath); |
|
174 |
} |
|
175 |
} |
|
176 |
||
177 |
resultPath = QDir::cleanPath(resultPath); |
|
178 |
||
179 |
if (resultPath.isEmpty()) |
|
180 |
resultPath = defaultPath; |
|
181 |
||
182 |
return resultPath; |
|
183 |
} |
|
184 |
||
185 |
SymbianMakefileGenerator::SymbianMakefileGenerator() : MakefileGenerator() { } |
|
186 |
SymbianMakefileGenerator::~SymbianMakefileGenerator() { } |
|
187 |
||
188 |
void SymbianMakefileGenerator::writeHeader(QTextStream &t) |
|
189 |
{ |
|
190 |
t << "// ============================================================================" << endl; |
|
191 |
t << "// * Makefile for building: " << escapeFilePath(var("TARGET")) << endl; |
|
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
192 |
t << "// * Generated by qmake (" << qmake_version() << ") (Qt " QT_VERSION_STR ") on: "; |
0 | 193 |
t << QDateTime::currentDateTime().toString(Qt::ISODate) << endl; |
194 |
t << "// * This file is generated by qmake and should not be modified by the" << endl; |
|
195 |
t << "// * user." << endl; |
|
196 |
t << "// * Project: " << fileFixify(project->projectFile()) << endl; |
|
197 |
t << "// * Template: " << var("TEMPLATE") << endl; |
|
198 |
t << "// ============================================================================" << endl; |
|
199 |
t << endl; |
|
200 |
||
201 |
// Defining define for bld.inf |
|
202 |
||
203 |
QString shortProFilename = project->projectFile(); |
|
204 |
shortProFilename.replace(0, shortProFilename.lastIndexOf("/") + 1, QString("")); |
|
205 |
shortProFilename.replace(Option::pro_ext, QString("")); |
|
206 |
||
207 |
QString bldinfDefine = shortProFilename; |
|
208 |
bldinfDefine.append("_"); |
|
209 |
bldinfDefine.append(generate_uid(project->projectFile())); |
|
210 |
||
211 |
bldinfDefine.prepend("BLD_INF_"); |
|
212 |
removeSpecialCharacters(bldinfDefine); |
|
213 |
||
214 |
t << "#define " << bldinfDefine.toUpper() << endl << endl; |
|
215 |
} |
|
216 |
||
217 |
bool SymbianMakefileGenerator::writeMakefile(QTextStream &t) |
|
218 |
{ |
|
219 |
writeHeader(t); |
|
220 |
||
221 |
QString numberOfIcons; |
|
222 |
QString iconFile; |
|
223 |
QStringList userRssRules; |
|
224 |
readRssRules(numberOfIcons, iconFile, userRssRules); |
|
225 |
||
226 |
// Get the application translations and convert to symbian OS lang code, i.e. decical number |
|
227 |
QStringList symbianLangCodes = symbianLangCodesFromTsFiles(); |
|
228 |
||
229 |
// Generate pkg files if there are any actual files to deploy |
|
230 |
bool generatePkg = false; |
|
4
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
231 |
DeploymentList depList; |
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
232 |
|
0 | 233 |
if (targetType == TypeExe) { |
234 |
generatePkg = true; |
|
235 |
} else { |
|
236 |
foreach(QString item, project->values("DEPLOYMENT")) { |
|
237 |
if (!project->values(item + ".sources").isEmpty()) { |
|
238 |
generatePkg = true; |
|
239 |
break; |
|
240 |
} |
|
241 |
} |
|
242 |
} |
|
243 |
||
244 |
if (generatePkg) { |
|
4
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
245 |
generatePkgFile(iconFile, depList); |
0 | 246 |
} |
247 |
||
4
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
248 |
writeBldInfContent(t, generatePkg, iconFile, depList); |
0 | 249 |
|
250 |
// Generate empty wrapper makefile here, because wrapper makefile must exist before writeMkFile, |
|
251 |
// but all required data is not yet available. |
|
252 |
bool isPrimaryMakefile = true; |
|
253 |
QString wrapperFileName("Makefile"); |
|
254 |
QString outputFileName = fileInfo(Option::output.fileName()).fileName(); |
|
255 |
if (outputFileName != BLD_INF_FILENAME) { |
|
5
d3bac044e0f0
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
256 |
wrapperFileName.append(".").append(outputFileName.startsWith(BLD_INF_FILENAME) |
d3bac044e0f0
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
257 |
? outputFileName.mid(sizeof(BLD_INF_FILENAME)) |
d3bac044e0f0
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
258 |
: outputFileName); |
0 | 259 |
isPrimaryMakefile = false; |
260 |
} |
|
261 |
||
262 |
QFile wrapperMakefile(wrapperFileName); |
|
263 |
if (wrapperMakefile.open(QIODevice::WriteOnly)) { |
|
264 |
generatedFiles << wrapperFileName; |
|
265 |
if (Option::mkfile::listgen) { |
|
266 |
generatePrint(fileInfo(wrapperMakefile.fileName()).absoluteFilePath()); |
|
267 |
} |
|
268 |
||
269 |
} else { |
|
270 |
PRINT_FILE_CREATE_ERROR(wrapperFileName); |
|
271 |
return false; |
|
272 |
} |
|
273 |
||
274 |
if (targetType == TypeSubdirs) { |
|
275 |
// If we have something to deploy, generate extension makefile for just that, since |
|
276 |
// normal extension makefile is not getting generated and we need emulator deployment to be done. |
|
277 |
if (generatePkg) |
|
278 |
writeMkFile(wrapperFileName, true); |
|
279 |
writeWrapperMakefile(wrapperMakefile, isPrimaryMakefile); |
|
280 |
return true; |
|
281 |
} |
|
282 |
||
283 |
writeMkFile(wrapperFileName, false); |
|
284 |
||
285 |
QString shortProFilename = project->projectFile(); |
|
286 |
shortProFilename.replace(0, shortProFilename.lastIndexOf("/") + 1, QString("")); |
|
287 |
shortProFilename.replace(Option::pro_ext, QString("")); |
|
288 |
||
289 |
QString mmpFilename = shortProFilename; |
|
290 |
mmpFilename.append("_"); |
|
291 |
mmpFilename.append(uid3); |
|
292 |
mmpFilename.append(Option::mmp_ext); |
|
293 |
writeMmpFile(mmpFilename, symbianLangCodes); |
|
294 |
||
295 |
if (targetType == TypeExe) { |
|
5
d3bac044e0f0
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
296 |
if (!project->isActiveConfig("no_icon")) { |
0 | 297 |
writeRegRssFile(userRssRules); |
298 |
writeRssFile(numberOfIcons, iconFile); |
|
299 |
writeLocFile(symbianLangCodes); |
|
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
300 |
if (!project->values("SYMBIANTRANSLATIONS").isEmpty()) |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
301 |
writeSymbianLocFile(symbianLangCodes); |
0 | 302 |
} |
303 |
} |
|
304 |
||
305 |
writeCustomDefFile(); |
|
306 |
writeWrapperMakefile(wrapperMakefile, isPrimaryMakefile); |
|
307 |
||
308 |
return true; |
|
309 |
} |
|
310 |
||
4
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
311 |
void SymbianMakefileGenerator::generatePkgFile(const QString &iconFile, DeploymentList &depList) |
0 | 312 |
{ |
313 |
QString pkgFilename = QString("%1_template.%2") |
|
314 |
.arg(fixedTarget) |
|
315 |
.arg("pkg"); |
|
316 |
QFile pkgFile(pkgFilename); |
|
317 |
if (!pkgFile.open(QIODevice::WriteOnly | QIODevice::Text)) { |
|
318 |
PRINT_FILE_CREATE_ERROR(pkgFilename); |
|
319 |
return; |
|
320 |
} |
|
321 |
if (Option::mkfile::listgen) { |
|
322 |
generatePrint(fileInfo(pkgFile.fileName()).absoluteFilePath()); |
|
323 |
} |
|
324 |
generatedFiles << pkgFile.fileName(); |
|
325 |
||
326 |
// Header info |
|
327 |
QTextStream t(&pkgFile); |
|
328 |
t << QString("; %1 generated by qmake at %2").arg(pkgFilename).arg(QDateTime::currentDateTime().toString(Qt::ISODate)) << endl; |
|
329 |
t << "; This file is generated by qmake and should not be modified by the user" << endl; |
|
330 |
t << ";" << endl << endl; |
|
331 |
||
332 |
// Construct QStringList from pkg_prerules since we need search it before printed to file |
|
333 |
QStringList rawPkgPreRules; |
|
334 |
foreach(QString deploymentItem, project->values("DEPLOYMENT")) { |
|
335 |
foreach(QString pkgrulesItem, project->values(deploymentItem + ".pkg_prerules")) { |
|
336 |
QStringList pkgrulesValue = project->values(pkgrulesItem); |
|
337 |
// If there is no stringlist defined for a rule, use rule name directly |
|
338 |
// This is convenience for defining single line mmp statements |
|
339 |
if (pkgrulesValue.isEmpty()) { |
|
340 |
rawPkgPreRules << pkgrulesItem; |
|
341 |
} else { |
|
342 |
foreach(QString pkgrule, pkgrulesValue) { |
|
343 |
rawPkgPreRules << pkgrule; |
|
344 |
} |
|
345 |
} |
|
346 |
} |
|
347 |
} |
|
348 |
||
349 |
// Apply some defaults if specific data does not exist in PKG pre-rules |
|
350 |
||
351 |
if (!containsStartWithItem('&', rawPkgPreRules)) { |
|
352 |
// language, (*** hardcoded to english atm, should be parsed from TRANSLATIONS) |
|
353 |
t << "; Language" << endl; |
|
354 |
t << "&EN" << endl << endl; |
|
355 |
} else { |
|
356 |
// In case user defines langs, he must take care also about SIS header |
|
357 |
if (!containsStartWithItem('#', rawPkgPreRules)) |
|
358 |
fprintf(stderr, "Warning: If language is defined with DEPLOYMENT pkg_prerules, also the SIS header must be defined\n"); |
|
359 |
} |
|
360 |
||
361 |
// name of application, UID and version |
|
362 |
QString applicationVersion = project->first("VERSION").isEmpty() ? "1,0,0" : project->first("VERSION").replace('.', ','); |
|
363 |
||
364 |
if (!containsStartWithItem('#', rawPkgPreRules)) { |
|
365 |
QString visualTarget = escapeFilePath(fileFixify(project->first("TARGET"))); |
|
366 |
visualTarget = removePathSeparators(visualTarget); |
|
367 |
||
368 |
t << "; SIS header: name, uid, version" << endl; |
|
369 |
t << QString("#{\"%1\"},(%2),%3").arg(visualTarget).arg(uid3).arg(applicationVersion) << endl << endl; |
|
370 |
} |
|
371 |
||
372 |
// Localized vendor name |
|
373 |
if (!containsStartWithItem('%', rawPkgPreRules)) { |
|
374 |
t << "; Localised Vendor name" << endl; |
|
375 |
t << "%{\"Vendor\"}" << endl << endl; |
|
376 |
} |
|
377 |
||
378 |
// Unique vendor name |
|
379 |
if (!containsStartWithItem(':', rawPkgPreRules)) { |
|
380 |
t << "; Unique Vendor name" << endl; |
|
381 |
t << ":\"Vendor\"" << endl << endl; |
|
382 |
} |
|
383 |
||
384 |
// PKG pre-rules - these are added before actual file installations i.e. SIS package body |
|
385 |
if (rawPkgPreRules.size()) { |
|
386 |
t << "; Manual PKG pre-rules from PRO files" << endl; |
|
387 |
foreach(QString item, rawPkgPreRules) { |
|
388 |
t << item << endl; |
|
389 |
} |
|
390 |
t << endl; |
|
391 |
} |
|
392 |
||
5
d3bac044e0f0
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
393 |
// Begin Manufacturer block |
d3bac044e0f0
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
394 |
if (!project->values("DEPLOYMENT.manufacturers").isEmpty()) { |
d3bac044e0f0
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
395 |
QString manufacturerStr("IF "); |
d3bac044e0f0
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
396 |
foreach(QString manufacturer, project->values("DEPLOYMENT.manufacturers")) { |
d3bac044e0f0
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
397 |
manufacturerStr.append(QString("(MANUFACTURER)=(%1) OR \n ").arg(manufacturer)); |
d3bac044e0f0
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
398 |
} |
d3bac044e0f0
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
399 |
// Remove the final OR |
d3bac044e0f0
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
400 |
manufacturerStr.chop(8); |
d3bac044e0f0
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
401 |
t << manufacturerStr << endl; |
d3bac044e0f0
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
402 |
} |
d3bac044e0f0
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
403 |
|
0 | 404 |
// Install paths on the phone *** should be dynamic at some point |
405 |
QString installPathBin = "!:\\sys\\bin"; |
|
406 |
QString installPathResource = "!:\\resource\\apps"; |
|
407 |
QString installPathRegResource = "!:\\private\\10003a3f\\import\\apps"; |
|
408 |
||
409 |
// Find location of builds |
|
410 |
QString epocReleasePath = QString("%1epoc32/release/$(PLATFORM)/$(TARGET)") |
|
411 |
.arg(epocRoot()); |
|
412 |
||
413 |
||
414 |
if (targetType == TypeExe) { |
|
415 |
// deploy .exe file |
|
416 |
t << "; Executable and default resource files" << endl; |
|
417 |
QString exeFile = fixedTarget + ".exe"; |
|
418 |
t << QString("\"%1/%2\" - \"%3\\%4\"") |
|
419 |
.arg(epocReleasePath) |
|
420 |
.arg(exeFile) |
|
421 |
.arg(installPathBin) |
|
422 |
.arg(exeFile) << endl; |
|
423 |
||
424 |
// deploy rsc & reg_rsc file |
|
5
d3bac044e0f0
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
425 |
if (!project->isActiveConfig("no_icon")) { |
0 | 426 |
t << QString("\"%1epoc32/data/z/resource/apps/%2\" - \"%3\\%4\"") |
427 |
.arg(epocRoot()) |
|
428 |
.arg(fixedTarget + ".rsc") |
|
429 |
.arg(installPathResource) |
|
430 |
.arg(fixedTarget + ".rsc") << endl; |
|
431 |
||
432 |
t << QString("\"%1epoc32/data/z/private/10003a3f/import/apps/%2\" - \"%3\\%4\"") |
|
433 |
.arg(epocRoot()) |
|
434 |
.arg(fixedTarget + "_reg.rsc") |
|
435 |
.arg(installPathRegResource) |
|
436 |
.arg(fixedTarget + "_reg.rsc") << endl; |
|
437 |
||
438 |
if (!iconFile.isEmpty()) { |
|
439 |
t << QString("\"%1epoc32/data/z%2\" - \"!:%3\"") |
|
440 |
.arg(epocRoot()) |
|
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
441 |
.arg(iconFile) |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
442 |
.arg(QDir::toNativeSeparators(iconFile)) << endl << endl; |
0 | 443 |
} |
444 |
} |
|
445 |
} |
|
446 |
||
447 |
// deploy any additional DEPLOYMENT files |
|
448 |
QString remoteTestPath; |
|
449 |
remoteTestPath = QString("!:\\private\\%1").arg(privateDirUid); |
|
450 |
||
451 |
initProjectDeploySymbian(project, depList, remoteTestPath, true, "$(PLATFORM)", "$(TARGET)", generatedDirs, generatedFiles); |
|
452 |
if (depList.size()) |
|
453 |
t << "; DEPLOYMENT" << endl; |
|
454 |
for (int i = 0; i < depList.size(); ++i) { |
|
455 |
t << QString("\"%1\" - \"%2\"") |
|
456 |
.arg(QString(depList.at(i).from).replace('\\','/')) |
|
457 |
.arg(depList.at(i).to) << endl; |
|
458 |
} |
|
459 |
t << endl; |
|
460 |
||
461 |
// PKG post-rules - these are added after actual file installations i.e. SIS package body |
|
462 |
t << "; Manual PKG post-rules from PRO files" << endl; |
|
463 |
foreach(QString deploymentItem, project->values("DEPLOYMENT")) { |
|
464 |
foreach(QString pkgrulesItem, project->values(deploymentItem + ".pkg_postrules")) { |
|
465 |
QStringList pkgrulesValue = project->values(pkgrulesItem); |
|
466 |
// If there is no stringlist defined for a rule, use rule name directly |
|
467 |
// This is convenience for defining single line statements |
|
468 |
if (pkgrulesValue.isEmpty()) { |
|
469 |
t << pkgrulesItem << endl; |
|
470 |
} else { |
|
471 |
foreach(QString pkgrule, pkgrulesValue) { |
|
472 |
t << pkgrule << endl; |
|
473 |
} |
|
474 |
} |
|
475 |
t << endl; |
|
476 |
} |
|
477 |
} |
|
5
d3bac044e0f0
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
478 |
|
d3bac044e0f0
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
479 |
// Close Manufacturer block |
d3bac044e0f0
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
480 |
if (!project->values("DEPLOYMENT.manufacturers").isEmpty()) { |
d3bac044e0f0
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
481 |
QString manufacturerFailNoteFile; |
d3bac044e0f0
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
482 |
if (project->values("DEPLOYMENT.manufacturers.fail_note").isEmpty()) { |
d3bac044e0f0
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
483 |
manufacturerFailNoteFile = QString("%1_" MANUFACTURER_NOTE_FILE).arg(uid3); |
d3bac044e0f0
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
484 |
QFile ft(manufacturerFailNoteFile); |
d3bac044e0f0
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
485 |
if (ft.open(QIODevice::WriteOnly)) { |
d3bac044e0f0
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
486 |
generatedFiles << ft.fileName(); |
d3bac044e0f0
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
487 |
QTextStream t2(&ft); |
d3bac044e0f0
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
488 |
|
d3bac044e0f0
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
489 |
t2 << QString(DEFAULT_MANUFACTURER_NOTE) << endl; |
d3bac044e0f0
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
490 |
} else { |
d3bac044e0f0
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
491 |
PRINT_FILE_CREATE_ERROR(manufacturerFailNoteFile) |
d3bac044e0f0
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
492 |
} |
d3bac044e0f0
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
493 |
} else { |
d3bac044e0f0
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
494 |
manufacturerFailNoteFile = project->values("DEPLOYMENT.manufacturers.fail_note").join(""); |
d3bac044e0f0
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
495 |
} |
d3bac044e0f0
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
496 |
|
d3bac044e0f0
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
497 |
t << "ELSEIF NOT(0) ; MANUFACTURER" << endl |
d3bac044e0f0
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
498 |
<< "\"" << fileInfo(manufacturerFailNoteFile).absoluteFilePath() << "\"" |
d3bac044e0f0
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
499 |
<< " - \"\", FILETEXT, TEXTEXIT" << endl |
d3bac044e0f0
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
500 |
<< "ENDIF ; MANUFACTURER" << endl; |
d3bac044e0f0
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
501 |
} |
0 | 502 |
} |
503 |
||
504 |
bool SymbianMakefileGenerator::containsStartWithItem(const QChar &c, const QStringList& src) |
|
505 |
{ |
|
506 |
bool result = false; |
|
507 |
foreach(QString str, src) { |
|
508 |
if (str.startsWith(c)) { |
|
509 |
result = true; |
|
510 |
break; |
|
511 |
} |
|
512 |
} |
|
513 |
return result; |
|
514 |
} |
|
515 |
||
516 |
void SymbianMakefileGenerator::writeCustomDefFile() |
|
517 |
{ |
|
5
d3bac044e0f0
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
518 |
if (targetType == TypePlugin && !project->isActiveConfig("stdbinary")) { |
0 | 519 |
// Create custom def file for plugin |
520 |
QFile ft(QLatin1String(PLUGIN_COMMON_DEF_FILE_ACTUAL)); |
|
521 |
||
522 |
if (ft.open(QIODevice::WriteOnly)) { |
|
523 |
if (Option::mkfile::listgen) { |
|
524 |
generatePrint(fileInfo(ft.fileName()).absoluteFilePath()); |
|
525 |
} |
|
526 |
generatedFiles << ft.fileName(); |
|
527 |
QTextStream t(&ft); |
|
528 |
||
529 |
t << "; ==============================================================================" << endl; |
|
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
530 |
t << "; Generated by qmake (" << qmake_version() << ") (Qt " QT_VERSION_STR ") on: "; |
0 | 531 |
t << QDateTime::currentDateTime().toString(Qt::ISODate) << endl; |
532 |
t << "; This file is generated by qmake and should not be modified by the" << endl; |
|
533 |
t << "; user." << endl; |
|
534 |
t << "; Name : " PLUGIN_COMMON_DEF_FILE_ACTUAL << endl; |
|
535 |
t << "; Part of : " << project->values("TARGET").join(" ") << endl; |
|
536 |
t << "; Description : Fixes common plugin symbols to known ordinals" << endl; |
|
537 |
t << "; Version : " << endl; |
|
538 |
t << ";" << endl; |
|
539 |
t << "; ==============================================================================" << "\n" << endl; |
|
540 |
||
541 |
t << endl; |
|
542 |
||
543 |
t << "EXPORTS" << endl; |
|
544 |
t << "\tqt_plugin_query_verification_data @ 1 NONAME" << endl; |
|
545 |
t << "\tqt_plugin_instance @ 2 NONAME" << endl; |
|
546 |
t << endl; |
|
547 |
} else { |
|
548 |
PRINT_FILE_CREATE_ERROR(QString(PLUGIN_COMMON_DEF_FILE_ACTUAL)) |
|
549 |
} |
|
550 |
} |
|
551 |
} |
|
552 |
||
553 |
void SymbianMakefileGenerator::init() |
|
554 |
{ |
|
555 |
MakefileGenerator::init(); |
|
556 |
fixedTarget = escapeFilePath(fileFixify(project->first("TARGET"))); |
|
557 |
fixedTarget = removePathSeparators(fixedTarget); |
|
558 |
removeSpecialCharacters(fixedTarget); |
|
5
d3bac044e0f0
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
559 |
|
d3bac044e0f0
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
560 |
translationFileName = escapeFilePath(fileFixify(project->first("TRANSLATIONS"))); |
d3bac044e0f0
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
561 |
if (!translationFileName.isEmpty()){ |
d3bac044e0f0
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
562 |
translationFileName.chop(3); |
d3bac044e0f0
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
563 |
translationFileName = removePathSeparators(translationFileName); |
d3bac044e0f0
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
564 |
removeSpecialCharacters(translationFileName); |
d3bac044e0f0
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
565 |
} |
d3bac044e0f0
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
566 |
else |
d3bac044e0f0
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
567 |
translationFileName = fixedTarget; |
0 | 568 |
|
569 |
if (0 != project->values("QMAKE_PLATFORM").size()) |
|
570 |
platform = varGlue("QMAKE_PLATFORM", "", " ", ""); |
|
571 |
||
572 |
if (0 == project->values("QMAKESPEC").size()) |
|
573 |
project->values("QMAKESPEC").append(qgetenv("QMAKESPEC")); |
|
574 |
||
575 |
project->values("QMAKE_LIBS") += escapeFilePaths(project->values("LIBS")); |
|
576 |
project->values("QMAKE_LIBS_PRIVATE") += escapeFilePaths(project->values("LIBS_PRIVATE")); |
|
577 |
||
578 |
// bld.inf |
|
579 |
project->values("MAKEFILE") += BLD_INF_FILENAME; |
|
580 |
||
581 |
// .mmp |
|
582 |
initMmpVariables(); |
|
583 |
||
584 |
// Check TARGET.UID3 presence |
|
585 |
if (0 != project->values("TARGET.UID3").size()) { |
|
586 |
uid3 = project->first("TARGET.UID3"); |
|
587 |
} else { |
|
588 |
uid3 = generateUID3(); |
|
589 |
} |
|
590 |
||
591 |
if ((project->values("TEMPLATE")).contains("app")) |
|
592 |
targetType = TypeExe; |
|
593 |
else if ((project->values("TEMPLATE")).contains("lib")) { |
|
594 |
// Check CONFIG to see if we are to build staticlib or dll |
|
5
d3bac044e0f0
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
595 |
if (project->isActiveConfig("staticlib") || project->isActiveConfig("static")) |
0 | 596 |
targetType = TypeLib; |
5
d3bac044e0f0
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
597 |
else if (project->isActiveConfig("plugin")) |
0 | 598 |
targetType = TypePlugin; |
599 |
else |
|
600 |
targetType = TypeDll; |
|
601 |
} else { |
|
602 |
targetType = TypeSubdirs; |
|
603 |
} |
|
604 |
||
605 |
if (0 != project->values("TARGET.UID2").size()) { |
|
606 |
uid2 = project->first("TARGET.UID2"); |
|
5
d3bac044e0f0
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
607 |
} else if (project->isActiveConfig("stdbinary")) { |
0 | 608 |
uid2 = "0x20004C45"; |
609 |
} else { |
|
610 |
if (targetType == TypeExe) { |
|
611 |
if (project->values("QT").contains("gui", Qt::CaseInsensitive)) { |
|
612 |
// exe and gui -> uid2 needed |
|
613 |
uid2 = "0x100039CE"; |
|
614 |
} else { |
|
615 |
// exe but not gui: uid2 is ignored anyway -> set it to 0 |
|
616 |
uid2 = "0"; |
|
617 |
} |
|
618 |
} else if (targetType == TypeDll || targetType == TypeLib || targetType == TypePlugin) { |
|
619 |
uid2 = "0x1000008d"; |
|
620 |
} |
|
621 |
} |
|
622 |
||
623 |
uid2 = uid2.trimmed(); |
|
624 |
uid3 = uid3.trimmed(); |
|
625 |
||
626 |
// UID is valid as either hex or decimal, so just convert it to number and back to hex |
|
627 |
// to get proper string for private dir |
|
628 |
bool conversionOk = false; |
|
629 |
uint uidNum = uid3.toUInt(&conversionOk, 0); |
|
630 |
||
631 |
if (!conversionOk) { |
|
632 |
fprintf(stderr, "Error: Invalid UID \"%s\".\n", uid3.toUtf8().constData()); |
|
633 |
} else { |
|
634 |
privateDirUid.setNum(uidNum, 16); |
|
635 |
while (privateDirUid.length() < 8) |
|
636 |
privateDirUid.insert(0, QLatin1Char('0')); |
|
637 |
} |
|
638 |
} |
|
639 |
||
640 |
QString SymbianMakefileGenerator::getTargetExtension() |
|
641 |
{ |
|
642 |
QString ret; |
|
643 |
if (targetType == TypeExe) { |
|
644 |
ret.append("exe"); |
|
645 |
} else if (targetType == TypeLib) { |
|
646 |
ret.append("lib"); |
|
647 |
} else if (targetType == TypeDll || targetType == TypePlugin) { |
|
648 |
ret.append("dll"); |
|
649 |
} else if (targetType == TypeSubdirs) { |
|
650 |
// Not actually usable, so return empty |
|
651 |
} else { |
|
652 |
// If nothing else set, default to exe |
|
653 |
ret.append("exe"); |
|
654 |
} |
|
655 |
||
656 |
return ret; |
|
657 |
} |
|
658 |
||
659 |
QString SymbianMakefileGenerator::generateUID3() |
|
660 |
{ |
|
661 |
QString target = project->first("TARGET"); |
|
662 |
QString currPath = qmake_getpwd(); |
|
663 |
target.prepend("/").prepend(currPath); |
|
664 |
return generate_test_uid(target); |
|
665 |
} |
|
666 |
||
667 |
void SymbianMakefileGenerator::initMmpVariables() |
|
668 |
{ |
|
669 |
QStringList sysincspaths; |
|
670 |
QStringList srcincpaths; |
|
671 |
QStringList srcpaths; |
|
672 |
||
673 |
srcpaths << project->values("SOURCES") << project->values("GENERATED_SOURCES"); |
|
674 |
srcpaths << project->values("UNUSED_SOURCES") << project->values("UI_SOURCES_DIR"); |
|
675 |
srcpaths << project->values("UI_DIR"); |
|
676 |
||
677 |
QDir current = QDir::current(); |
|
678 |
QString canonizedCurrent = canonizePath("."); |
|
679 |
||
680 |
for (int j = 0; j < srcpaths.size(); ++j) { |
|
681 |
QFileInfo fi(fileInfo(srcpaths.at(j))); |
|
682 |
// Sometimes sources have other than *.c* files (e.g. *.moc); prune them. |
|
683 |
if (fi.suffix().startsWith("c")) { |
|
684 |
if (fi.filePath().length() > fi.fileName().length()) { |
|
685 |
appendIfnotExist(srcincpaths, fi.path()); |
|
686 |
sources[canonizePath(fi.path())] += fi.fileName(); |
|
687 |
} else { |
|
688 |
sources[canonizedCurrent] += fi.fileName(); |
|
689 |
appendIfnotExist(srcincpaths, canonizedCurrent); |
|
690 |
} |
|
691 |
} |
|
692 |
} |
|
693 |
||
694 |
QStringList incpaths; |
|
695 |
incpaths << project->values("INCLUDEPATH"); |
|
696 |
incpaths << QLibraryInfo::location(QLibraryInfo::HeadersPath); |
|
697 |
incpaths << project->values("HEADERS"); |
|
698 |
incpaths << srcincpaths; |
|
699 |
incpaths << project->values("UI_HEADERS_DIR"); |
|
700 |
incpaths << project->values("UI_DIR"); |
|
701 |
||
702 |
for (int j = 0; j < incpaths.size(); ++j) { |
|
703 |
QString includepath = canonizePath(incpaths.at(j)); |
|
704 |
appendIfnotExist(sysincspaths, includepath); |
|
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
705 |
appendAbldTempDirs(sysincspaths, includepath); |
0 | 706 |
} |
707 |
||
708 |
// Remove duplicate include path entries |
|
709 |
QStringList temporary; |
|
710 |
for (int i = 0; i < sysincspaths.size(); ++i) { |
|
711 |
QString origPath = sysincspaths.at(i); |
|
712 |
QFileInfo origPathInfo(fileInfo(origPath)); |
|
713 |
bool bFound = false; |
|
714 |
||
715 |
for (int j = 0; j < temporary.size(); ++j) { |
|
716 |
QString tmpPath = temporary.at(j); |
|
717 |
QFileInfo tmpPathInfo(fileInfo(tmpPath)); |
|
718 |
||
719 |
if (origPathInfo.absoluteFilePath() == tmpPathInfo.absoluteFilePath()) { |
|
720 |
bFound = true; |
|
721 |
if (!tmpPathInfo.isRelative() && origPathInfo.isRelative()) { |
|
722 |
// We keep the relative notation |
|
723 |
temporary.removeOne(tmpPath); |
|
724 |
temporary << origPath; |
|
725 |
} |
|
726 |
} |
|
727 |
} |
|
728 |
||
729 |
if (!bFound) |
|
730 |
temporary << origPath; |
|
731 |
||
732 |
} |
|
733 |
||
734 |
sysincspaths.clear(); |
|
735 |
sysincspaths << temporary; |
|
736 |
||
737 |
systeminclude.insert("SYSTEMINCLUDE", sysincspaths); |
|
738 |
||
739 |
// Check MMP_RULES for singleton keywords that are overridden |
|
740 |
QStringList overridableMmpKeywords; |
|
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
741 |
QStringList restrictableMmpKeywords; |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
742 |
QStringList restrictedMmpKeywords; |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
743 |
bool inResourceBlock = false; |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
744 |
|
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
745 |
overridableMmpKeywords << QLatin1String(MMP_TARGETTYPE); |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
746 |
restrictableMmpKeywords << QLatin1String(MMP_TARGET) << QLatin1String(MMP_SECUREID) |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
747 |
<< QLatin1String(MMP_OPTION_CW) << QLatin1String(MMP_OPTION_ARMCC) |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
748 |
<< QLatin1String(MMP_OPTION_GCCE) << QLatin1String(MMP_LINKEROPTION_CW) |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
749 |
<< QLatin1String(MMP_LINKEROPTION_ARMCC) << QLatin1String(MMP_LINKEROPTION_GCCE) |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
750 |
<< QLatin1String(MMP_CAPABILITY) << QLatin1String(MMP_EPOCALLOWDLLDATA) |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
751 |
<< QLatin1String(MMP_EPOCHEAPSIZE) << QLatin1String(MMP_EPOCSTACKSIZE) |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
752 |
<< QLatin1String(MMP_UID) << QLatin1String(MMP_VENDORID) |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
753 |
<< QLatin1String(MMP_VERSION); |
0 | 754 |
|
755 |
foreach (QString item, project->values("MMP_RULES")) { |
|
756 |
if (project->values(item).isEmpty()) { |
|
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
757 |
handleMmpRulesOverrides(item, inResourceBlock, restrictedMmpKeywords, |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
758 |
restrictableMmpKeywords, overridableMmpKeywords); |
0 | 759 |
} else { |
760 |
foreach (QString itemRow, project->values(item)) { |
|
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
761 |
handleMmpRulesOverrides(itemRow, inResourceBlock, restrictedMmpKeywords, |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
762 |
restrictableMmpKeywords, overridableMmpKeywords); |
0 | 763 |
} |
764 |
} |
|
765 |
} |
|
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
766 |
|
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
767 |
if (restrictedMmpKeywords.size()) { |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
768 |
fprintf(stderr, "Warning: Restricted statements detected in MMP_RULES:\n" |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
769 |
" (%s)\n" |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
770 |
" Use corresponding qmake variable(s) instead.\n", |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
771 |
qPrintable(restrictedMmpKeywords.join(", "))); |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
772 |
} |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
773 |
} |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
774 |
|
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
775 |
void SymbianMakefileGenerator::handleMmpRulesOverrides(QString &checkString, |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
776 |
bool &inResourceBlock, |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
777 |
QStringList &restrictedMmpKeywords, |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
778 |
const QStringList &restrictableMmpKeywords, |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
779 |
const QStringList &overridableMmpKeywords) |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
780 |
{ |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
781 |
QString simplifiedString = checkString.simplified(); |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
782 |
|
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
783 |
if (!inResourceBlock && simplifiedString.startsWith(MMP_START_RESOURCE, Qt::CaseInsensitive)) |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
784 |
inResourceBlock = true; |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
785 |
else if (inResourceBlock && simplifiedString.startsWith(MMP_END_RESOURCE, Qt::CaseInsensitive)) |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
786 |
inResourceBlock = false; |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
787 |
|
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
788 |
// Allow restricted and overridable items in RESOURCE blocks as those do not actually |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
789 |
// override anything. |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
790 |
if (!inResourceBlock) { |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
791 |
appendKeywordIfMatchFound(overriddenMmpKeywords, overridableMmpKeywords, simplifiedString); |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
792 |
appendKeywordIfMatchFound(restrictedMmpKeywords, restrictableMmpKeywords, simplifiedString); |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
793 |
} |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
794 |
} |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
795 |
|
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
796 |
void SymbianMakefileGenerator::appendKeywordIfMatchFound(QStringList &list, |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
797 |
const QStringList &keywordList, |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
798 |
QString &checkString) |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
799 |
{ |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
800 |
// Check if checkString starts with any supplied keyword and |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
801 |
// add the found keyword to list if it does. |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
802 |
foreach (QString item, keywordList) { |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
803 |
if (checkString.startsWith(QString(item).append(" "), Qt::CaseInsensitive) |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
804 |
|| checkString.compare(item, Qt::CaseInsensitive) == 0) { |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
805 |
appendIfnotExist(list, item); |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
806 |
} |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
807 |
} |
0 | 808 |
} |
809 |
||
810 |
||
811 |
bool SymbianMakefileGenerator::removeDuplicatedStrings(QStringList &stringList) |
|
812 |
{ |
|
813 |
QStringList tmpStringList; |
|
814 |
||
815 |
for (int i = 0; i < stringList.size(); ++i) { |
|
816 |
QString string = stringList.at(i); |
|
817 |
if (tmpStringList.contains(string)) |
|
818 |
continue; |
|
819 |
else |
|
820 |
tmpStringList.append(string); |
|
821 |
} |
|
822 |
||
823 |
stringList.clear(); |
|
824 |
stringList = tmpStringList; |
|
825 |
return true; |
|
826 |
} |
|
827 |
||
828 |
void SymbianMakefileGenerator::writeMmpFileHeader(QTextStream &t) |
|
829 |
{ |
|
830 |
t << "// ==============================================================================" << endl; |
|
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
831 |
t << "// Generated by qmake (" << qmake_version() << ") (Qt " QT_VERSION_STR ") on: "; |
0 | 832 |
t << QDateTime::currentDateTime().toString(Qt::ISODate) << endl; |
833 |
t << "// This file is generated by qmake and should not be modified by the" << endl; |
|
834 |
t << "// user." << endl; |
|
835 |
t << "// Name : " << escapeFilePath(fileFixify(project->projectFile().remove(project->projectFile().length() - 4, 4))) << Option::mmp_ext << endl; |
|
836 |
t << "// ==============================================================================" << endl << endl; |
|
837 |
} |
|
838 |
||
839 |
void SymbianMakefileGenerator::writeMmpFile(QString &filename, QStringList &symbianLangCodes) |
|
840 |
{ |
|
841 |
QFile ft(filename); |
|
842 |
if (ft.open(QIODevice::WriteOnly)) { |
|
843 |
if (Option::mkfile::listgen) { |
|
844 |
generatePrint(fileInfo(ft.fileName()).absoluteFilePath()); |
|
845 |
} |
|
846 |
||
847 |
generatedFiles << ft.fileName(); |
|
848 |
||
849 |
QTextStream t(&ft); |
|
850 |
||
851 |
writeMmpFileHeader(t); |
|
852 |
||
853 |
writeMmpFileTargetPart(t); |
|
854 |
||
855 |
writeMmpFileResourcePart(t, symbianLangCodes); |
|
856 |
||
857 |
writeMmpFileMacrosPart(t); |
|
858 |
||
859 |
writeMmpFileIncludePart(t); |
|
860 |
||
861 |
QDir current = QDir::current(); |
|
862 |
||
863 |
for (QMap<QString, QStringList>::iterator it = sources.begin(); it != sources.end(); ++it) { |
|
864 |
QStringList values = it.value(); |
|
865 |
QString currentSourcePath = it.key(); |
|
866 |
||
867 |
if (values.size()) |
|
868 |
t << "SOURCEPATH \t" << fixPathForMmp(currentSourcePath, current) << endl; |
|
869 |
||
870 |
for (int i = 0; i < values.size(); ++i) { |
|
871 |
QString sourceFileName = values.at(i); |
|
872 |
t << "SOURCE\t\t" << sourceFileName << endl; |
|
873 |
} |
|
874 |
t << endl; |
|
875 |
} |
|
876 |
t << endl; |
|
877 |
||
5
d3bac044e0f0
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
878 |
if (!project->isActiveConfig("static") && !project->isActiveConfig("staticlib")) { |
0 | 879 |
writeMmpFileLibraryPart(t); |
880 |
} |
|
881 |
||
882 |
writeMmpFileCapabilityPart(t); |
|
883 |
||
884 |
writeMmpFileCompilerOptionPart(t); |
|
885 |
||
886 |
writeMmpFileBinaryVersionPart(t); |
|
887 |
||
888 |
writeMmpFileRulesPart(t); |
|
889 |
} else { |
|
890 |
PRINT_FILE_CREATE_ERROR(filename) |
|
891 |
} |
|
892 |
} |
|
893 |
||
894 |
void SymbianMakefileGenerator::writeMmpFileMacrosPart(QTextStream& t) |
|
895 |
{ |
|
896 |
t << endl; |
|
897 |
||
898 |
QStringList &defines = project->values("DEFINES"); |
|
899 |
if (defines.size()) |
|
900 |
t << "// Qt Macros" << endl; |
|
901 |
for (int i = 0; i < defines.size(); ++i) { |
|
902 |
QString def = defines.at(i); |
|
903 |
addMacro(t, def); |
|
904 |
} |
|
905 |
||
906 |
// These are required in order that all methods will be correctly exported e.g from qtestlib |
|
907 |
QStringList &exp_defines = project->values("PRL_EXPORT_DEFINES"); |
|
908 |
if (exp_defines.size()) |
|
909 |
t << endl << "// Qt Export Defines" << endl; |
|
910 |
for (int i = 0; i < exp_defines.size(); ++i) { |
|
911 |
QString def = exp_defines.at(i); |
|
912 |
addMacro(t, def); |
|
913 |
} |
|
914 |
||
915 |
t << endl; |
|
916 |
} |
|
917 |
||
918 |
void SymbianMakefileGenerator::addMacro(QTextStream& t, const QString& value) |
|
919 |
{ |
|
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
920 |
t << "MACRO\t\t" << value << endl; |
0 | 921 |
} |
922 |
||
923 |
||
924 |
void SymbianMakefileGenerator::writeMmpFileTargetPart(QTextStream& t) |
|
925 |
{ |
|
926 |
bool skipTargetType = overriddenMmpKeywords.contains(MMP_TARGETTYPE); |
|
927 |
||
928 |
if (targetType == TypeExe) { |
|
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
929 |
t << MMP_TARGET "\t\t" << fixedTarget << ".exe" << endl; |
0 | 930 |
if (!skipTargetType) { |
5
d3bac044e0f0
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
931 |
if (project->isActiveConfig("stdbinary")) |
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
932 |
t << MMP_TARGETTYPE "\t\tSTDEXE" << endl; |
0 | 933 |
else |
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
934 |
t << MMP_TARGETTYPE "\t\tEXE" << endl; |
0 | 935 |
} |
936 |
} else if (targetType == TypeDll || targetType == TypePlugin) { |
|
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
937 |
t << MMP_TARGET "\t\t" << fixedTarget << ".dll" << endl; |
0 | 938 |
if (!skipTargetType) { |
5
d3bac044e0f0
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
939 |
if (project->isActiveConfig("stdbinary")) |
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
940 |
t << MMP_TARGETTYPE "\t\tSTDDLL" << endl; |
0 | 941 |
else |
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
942 |
t << MMP_TARGETTYPE "\t\tDLL" << endl; |
0 | 943 |
} |
944 |
} else if (targetType == TypeLib) { |
|
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
945 |
t << MMP_TARGET "\t\t" << fixedTarget << ".lib" << endl; |
0 | 946 |
if (!skipTargetType) { |
5
d3bac044e0f0
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
947 |
if (project->isActiveConfig("stdbinary")) |
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
948 |
t << MMP_TARGETTYPE "\t\tSTDLIB" << endl; |
0 | 949 |
else |
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
950 |
t << MMP_TARGETTYPE "\t\tLIB" << endl; |
0 | 951 |
} |
952 |
} else { |
|
953 |
fprintf(stderr, "Error: Unexpected targettype (%d) in SymbianMakefileGenerator::writeMmpFileTargetPart\n", targetType); |
|
954 |
} |
|
955 |
||
956 |
t << endl; |
|
957 |
||
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
958 |
t << MMP_UID "\t\t" << uid2 << " " << uid3 << endl; |
0 | 959 |
|
960 |
if (0 != project->values("TARGET.SID").size()) { |
|
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
961 |
t << MMP_SECUREID "\t\t" << project->values("TARGET.SID").join(" ") << endl; |
0 | 962 |
} else { |
963 |
if (0 == uid3.size()) |
|
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
964 |
t << MMP_SECUREID "\t\t0" << endl; |
0 | 965 |
else |
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
966 |
t << MMP_SECUREID "\t\t" << uid3 << endl; |
0 | 967 |
} |
968 |
||
969 |
// default value used from mkspecs is 0 |
|
970 |
if (0 != project->values("TARGET.VID").size()) { |
|
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
971 |
t << MMP_VENDORID "\t\t" << project->values("TARGET.VID").join(" ") << endl; |
0 | 972 |
} |
973 |
||
974 |
t << endl; |
|
975 |
||
976 |
if (0 != project->first("TARGET.EPOCSTACKSIZE").size()) |
|
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
977 |
t << MMP_EPOCSTACKSIZE "\t\t" << project->first("TARGET.EPOCSTACKSIZE") << endl; |
0 | 978 |
if (0 != project->values("TARGET.EPOCHEAPSIZE").size()) |
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
979 |
t << MMP_EPOCHEAPSIZE "\t\t" << project->values("TARGET.EPOCHEAPSIZE").join(" ") << endl; |
0 | 980 |
if (0 != project->values("TARGET.EPOCALLOWDLLDATA").size()) |
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
981 |
t << MMP_EPOCALLOWDLLDATA << endl; |
0 | 982 |
|
5
d3bac044e0f0
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
983 |
if (targetType == TypePlugin && !project->isActiveConfig("stdbinary")) { |
0 | 984 |
// Use custom def file for Qt plugins |
985 |
t << "DEFFILE " PLUGIN_COMMON_DEF_FILE_FOR_MMP << endl; |
|
986 |
} |
|
987 |
||
988 |
t << endl; |
|
989 |
} |
|
990 |
||
991 |
||
992 |
/* |
|
993 |
Application registration resource files should be installed to the |
|
994 |
\private\10003a3f\import\apps directory. |
|
995 |
*/ |
|
996 |
void SymbianMakefileGenerator::writeMmpFileResourcePart(QTextStream& t, QStringList &symbianLangCodes) |
|
997 |
{ |
|
998 |
if ((targetType == TypeExe) && |
|
5
d3bac044e0f0
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
999 |
!project->isActiveConfig("no_icon")) { |
0 | 1000 |
|
1001 |
QString locTarget = fixedTarget; |
|
1002 |
locTarget.append(".rss"); |
|
1003 |
||
1004 |
t << "SOURCEPATH\t\t\t. " << endl; |
|
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1005 |
|
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1006 |
if (!project->values("SYMBIANTRANSLATIONS").isEmpty()) { |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1007 |
t << MMP_START_RESOURCE "\t\t" << locTarget << endl; |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1008 |
t << "LANGUAGE_IDS" << endl; |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1009 |
t << "HEADER" << endl; |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1010 |
t << "TARGETPATH\t\t\t" RESOURCE_DIRECTORY_MMP << endl; |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1011 |
t << MMP_END_RESOURCE << endl << endl; |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1012 |
} else { |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1013 |
t << "LANG SC "; // no endl |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1014 |
foreach(QString lang, symbianLangCodes) { |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1015 |
t << lang << " "; // no endl |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1016 |
} |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1017 |
t << endl; |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1018 |
t << MMP_START_RESOURCE "\t\t" << locTarget << endl; |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1019 |
t << "HEADER" << endl; |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1020 |
t << "TARGETPATH\t\t\t" RESOURCE_DIRECTORY_MMP << endl; |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1021 |
t << MMP_END_RESOURCE << endl << endl; |
0 | 1022 |
} |
1023 |
||
1024 |
QString regTarget = fixedTarget; |
|
1025 |
regTarget.append("_reg.rss"); |
|
1026 |
||
1027 |
t << "SOURCEPATH\t\t\t." << endl; |
|
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1028 |
t << MMP_START_RESOURCE "\t\t" << regTarget << endl; |
0 | 1029 |
if (isForSymbianSbsv2()) |
1030 |
t << "DEPENDS " << fixedTarget << ".rsg" << endl; |
|
1031 |
t << "TARGETPATH\t\t" REGISTRATION_RESOURCE_DIRECTORY_HW << endl; |
|
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1032 |
t << MMP_END_RESOURCE << endl << endl; |
0 | 1033 |
} |
1034 |
} |
|
1035 |
||
1036 |
void SymbianMakefileGenerator::writeMmpFileSystemIncludePart(QTextStream& t) |
|
1037 |
{ |
|
1038 |
QDir current = QDir::current(); |
|
1039 |
||
1040 |
for (QMap<QString, QStringList>::iterator it = systeminclude.begin(); it != systeminclude.end(); ++it) { |
|
1041 |
QStringList values = it.value(); |
|
1042 |
for (int i = 0; i < values.size(); ++i) { |
|
1043 |
QString handledPath = values.at(i); |
|
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1044 |
t << "SYSTEMINCLUDE\t\t" << fixPathForMmp(handledPath, current) << endl; |
0 | 1045 |
} |
1046 |
} |
|
1047 |
||
1048 |
t << endl; |
|
1049 |
} |
|
1050 |
||
1051 |
void SymbianMakefileGenerator::writeMmpFileIncludePart(QTextStream& t) |
|
1052 |
{ |
|
1053 |
writeMmpFileSystemIncludePart(t); |
|
1054 |
} |
|
1055 |
||
1056 |
void SymbianMakefileGenerator::writeMmpFileLibraryPart(QTextStream& t) |
|
1057 |
{ |
|
1058 |
QStringList &libs = project->values("LIBS"); |
|
1059 |
libs << project->values("QMAKE_LIBS") << project->values("QMAKE_LIBS_PRIVATE"); |
|
1060 |
||
1061 |
removeDuplicatedStrings(libs); |
|
1062 |
||
1063 |
for (int i = 0; i < libs.size(); ++i) { |
|
1064 |
QString lib = libs.at(i); |
|
1065 |
// The -L flag is uninteresting, since all symbian libraries exist in the same directory. |
|
1066 |
if (lib.startsWith("-l")) { |
|
1067 |
lib.remove(0, 2); |
|
1068 |
QString mmpStatement; |
|
1069 |
if (lib.endsWith(".dll")) { |
|
1070 |
lib.chop(4); |
|
1071 |
mmpStatement = "LIBRARY\t\t"; |
|
1072 |
} else if (lib.endsWith(".lib")) { |
|
1073 |
lib.chop(4); |
|
1074 |
mmpStatement = "STATICLIBRARY\t"; |
|
1075 |
} else { |
|
1076 |
// Hacky way to find out what kind of library it is. Check the |
|
1077 |
// ARMV5 build directory for library type. We default to shared |
|
1078 |
// library, since that is more common. |
|
1079 |
QString udebStaticLibLocation(epocRoot()); |
|
1080 |
QString urelStaticLibLocation(udebStaticLibLocation); |
|
1081 |
udebStaticLibLocation += QString("epoc32/release/armv5/udeb/%1.lib").arg(lib); |
|
1082 |
urelStaticLibLocation += QString("epoc32/release/armv5/urel/%1.lib").arg(lib); |
|
1083 |
if (QFile::exists(udebStaticLibLocation) || QFile::exists(urelStaticLibLocation)) { |
|
1084 |
mmpStatement = "STATICLIBRARY\t"; |
|
1085 |
} else { |
|
1086 |
mmpStatement = "LIBRARY\t\t"; |
|
1087 |
} |
|
1088 |
} |
|
1089 |
t << mmpStatement << lib << ".lib" << endl; |
|
1090 |
} |
|
1091 |
} |
|
1092 |
||
1093 |
t << endl; |
|
1094 |
} |
|
1095 |
||
1096 |
void SymbianMakefileGenerator::writeMmpFileCapabilityPart(QTextStream& t) |
|
1097 |
{ |
|
1098 |
if (0 != project->first("TARGET.CAPABILITY").size()) { |
|
1099 |
QStringList &capabilities = project->values("TARGET.CAPABILITY"); |
|
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1100 |
t << MMP_CAPABILITY "\t\t"; |
0 | 1101 |
|
1102 |
for (int i = 0; i < capabilities.size(); ++i) { |
|
1103 |
QString cap = capabilities.at(i); |
|
1104 |
t << cap << " "; |
|
1105 |
} |
|
1106 |
} else { |
|
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1107 |
t << MMP_CAPABILITY "\t\tNone"; |
0 | 1108 |
} |
1109 |
t << endl << endl; |
|
1110 |
} |
|
1111 |
||
1112 |
void SymbianMakefileGenerator::writeMmpFileCompilerOptionPart(QTextStream& t) |
|
1113 |
{ |
|
1114 |
QString cw, armcc, gcce; |
|
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1115 |
QString cwlink, armlink, gccelink; |
0 | 1116 |
|
1117 |
if (0 != project->values("QMAKE_CXXFLAGS.CW").size()) { |
|
1118 |
cw.append(project->values("QMAKE_CXXFLAGS.CW").join(" ")); |
|
1119 |
cw.append(" "); |
|
1120 |
} |
|
1121 |
||
1122 |
if (0 != project->values("QMAKE_CXXFLAGS.ARMCC").size()) { |
|
1123 |
armcc.append(project->values("QMAKE_CXXFLAGS.ARMCC").join(" ")); |
|
1124 |
armcc.append(" "); |
|
1125 |
} |
|
1126 |
||
1127 |
if (0 != project->values("QMAKE_CXXFLAGS.GCCE").size()) { |
|
1128 |
gcce.append(project->values("QMAKE_CXXFLAGS.GCCE").join(" ")); |
|
1129 |
gcce.append(" "); |
|
1130 |
} |
|
1131 |
||
1132 |
if (0 != project->values("QMAKE_CFLAGS.CW").size()) { |
|
1133 |
cw.append(project->values("QMAKE_CFLAGS.CW").join(" ")); |
|
1134 |
cw.append(" "); |
|
1135 |
} |
|
1136 |
||
1137 |
if (0 != project->values("QMAKE_CFLAGS.ARMCC").size()) { |
|
1138 |
armcc.append(project->values("QMAKE_CFLAGS.ARMCC").join(" ")); |
|
1139 |
armcc.append(" "); |
|
1140 |
} |
|
1141 |
||
1142 |
if (0 != project->values("QMAKE_CFLAGS.GCCE").size()) { |
|
1143 |
gcce.append(project->values("QMAKE_CXXFLAGS.GCCE").join(" ")); |
|
1144 |
gcce.append(" "); |
|
1145 |
} |
|
1146 |
||
1147 |
if (0 != project->values("QMAKE_CXXFLAGS").size()) { |
|
1148 |
cw.append(project->values("QMAKE_CXXFLAGS").join(" ")); |
|
1149 |
cw.append(" "); |
|
1150 |
armcc.append(project->values("QMAKE_CXXFLAGS").join(" ")); |
|
1151 |
armcc.append(" "); |
|
1152 |
gcce.append(project->values("QMAKE_CXXFLAGS").join(" ")); |
|
1153 |
gcce.append(" "); |
|
1154 |
} |
|
1155 |
||
1156 |
if (0 != project->values("QMAKE_CFLAGS").size()) { |
|
1157 |
cw.append(project->values("QMAKE_CFLAGS").join(" ")); |
|
1158 |
cw.append(" "); |
|
1159 |
armcc.append(project->values("QMAKE_CFLAGS").join(" ")); |
|
1160 |
armcc.append(" "); |
|
1161 |
gcce.append(project->values("QMAKE_CFLAGS").join(" ")); |
|
1162 |
gcce.append(" "); |
|
1163 |
} |
|
1164 |
||
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1165 |
if (0 != project->values("QMAKE_LFLAGS.CW").size()) { |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1166 |
cwlink.append(project->values("QMAKE_LFLAGS.CW").join(" ")); |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1167 |
cwlink.append(" "); |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1168 |
} |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1169 |
|
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1170 |
if (0 != project->values("QMAKE_LFLAGS.ARMCC").size()) { |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1171 |
armlink.append(project->values("QMAKE_LFLAGS.ARMCC").join(" ")); |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1172 |
armlink.append(" "); |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1173 |
} |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1174 |
|
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1175 |
if (0 != project->values("QMAKE_LFLAGS.GCCE").size()) { |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1176 |
gccelink.append(project->values("QMAKE_LFLAGS.GCCE").join(" ")); |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1177 |
gccelink.append(" "); |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1178 |
} |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1179 |
|
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1180 |
if (0 != project->values("QMAKE_LFLAGS").size()) { |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1181 |
cwlink.append(project->values("QMAKE_LFLAGS").join(" ")); |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1182 |
cwlink.append(" "); |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1183 |
armlink.append(project->values("QMAKE_LFLAGS").join(" ")); |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1184 |
armlink.append(" "); |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1185 |
gccelink.append(project->values("QMAKE_LFLAGS").join(" ")); |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1186 |
gccelink.append(" "); |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1187 |
} |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1188 |
|
0 | 1189 |
if (!cw.isEmpty() && cw[cw.size()-1] == ' ') |
1190 |
cw.chop(1); |
|
1191 |
if (!armcc.isEmpty() && armcc[armcc.size()-1] == ' ') |
|
1192 |
armcc.chop(1); |
|
1193 |
if (!gcce.isEmpty() && gcce[gcce.size()-1] == ' ') |
|
1194 |
gcce.chop(1); |
|
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1195 |
if (!cwlink.isEmpty() && cwlink[cwlink.size()-1] == ' ') |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1196 |
cwlink.chop(1); |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1197 |
if (!armlink.isEmpty() && armlink[armlink.size()-1] == ' ') |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1198 |
armlink.chop(1); |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1199 |
if (!gccelink.isEmpty() && gccelink[gccelink.size()-1] == ' ') |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1200 |
gccelink.chop(1); |
0 | 1201 |
|
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1202 |
if (!cw.isEmpty()) |
0 | 1203 |
t << MMP_OPTION_CW " " << cw << endl; |
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1204 |
if (!armcc.isEmpty()) |
0 | 1205 |
t << MMP_OPTION_ARMCC " " << armcc << endl; |
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1206 |
if (!gcce.isEmpty()) |
0 | 1207 |
t << MMP_OPTION_GCCE " " << gcce << endl; |
1208 |
||
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1209 |
if (!cwlink.isEmpty()) |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1210 |
t << MMP_LINKEROPTION_CW " " << cwlink << endl; |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1211 |
if (!armlink.isEmpty()) |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1212 |
t << MMP_LINKEROPTION_ARMCC " " << armlink << endl; |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1213 |
if (!gccelink.isEmpty()) |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1214 |
t << MMP_LINKEROPTION_GCCE " " << gccelink << endl; |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1215 |
|
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1216 |
t << endl; |
0 | 1217 |
} |
1218 |
||
1219 |
void SymbianMakefileGenerator::writeMmpFileBinaryVersionPart(QTextStream& t) |
|
1220 |
{ |
|
1221 |
QString applicationVersion = project->first("VERSION"); |
|
1222 |
QStringList verNumList = applicationVersion.split('.'); |
|
1223 |
uint major = 0; |
|
1224 |
uint minor = 0; |
|
1225 |
uint patch = 0; |
|
1226 |
bool success = false; |
|
1227 |
||
1228 |
if (verNumList.size() > 0) { |
|
1229 |
major = verNumList[0].toUInt(&success); |
|
1230 |
if (success && verNumList.size() > 1) { |
|
1231 |
minor = verNumList[1].toUInt(&success); |
|
1232 |
if (success && verNumList.size() > 2) { |
|
1233 |
patch = verNumList[2].toUInt(&success); |
|
1234 |
} |
|
1235 |
} |
|
1236 |
} |
|
1237 |
||
1238 |
QString mmpVersion; |
|
1239 |
if (success && major <= 0xFFFF && minor <= 0xFF && patch <= 0xFF) { |
|
1240 |
// Symbian binary version only has major and minor components, so compress |
|
1241 |
// Qt's minor and patch values into the minor component. Since Symbian's minor |
|
1242 |
// component is a 16 bit value, only allow 8 bits for each to avoid overflow. |
|
1243 |
mmpVersion.append(QString::number(major)) |
|
1244 |
.append('.') |
|
1245 |
.append(QString::number((minor << 8) + patch)); |
|
1246 |
} else { |
|
1247 |
if (!applicationVersion.isEmpty()) |
|
1248 |
fprintf(stderr, "Invalid VERSION string: %s\n", qPrintable(applicationVersion)); |
|
1249 |
mmpVersion = "10.0"; // Default binary version for symbian is 10.0 |
|
1250 |
} |
|
1251 |
||
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1252 |
t << MMP_VERSION " " << mmpVersion << endl; |
0 | 1253 |
} |
1254 |
||
1255 |
void SymbianMakefileGenerator::writeMmpFileRulesPart(QTextStream& t) |
|
1256 |
{ |
|
1257 |
foreach(QString item, project->values("MMP_RULES")) { |
|
1258 |
t << endl; |
|
1259 |
// If there is no stringlist defined for a rule, use rule name directly |
|
1260 |
// This is convenience for defining single line mmp statements |
|
1261 |
if (project->values(item).isEmpty()) { |
|
1262 |
t << item << endl; |
|
1263 |
} else { |
|
1264 |
foreach(QString itemRow, project->values(item)) { |
|
1265 |
t << itemRow << endl; |
|
1266 |
} |
|
1267 |
} |
|
1268 |
} |
|
1269 |
} |
|
1270 |
||
4
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
1271 |
void SymbianMakefileGenerator::writeBldInfContent(QTextStream &t, bool addDeploymentExtension, const QString &iconFile, DeploymentList &depList) |
0 | 1272 |
{ |
1273 |
// Read user defined bld inf rules |
|
1274 |
||
1275 |
QMap<QString, QStringList> userBldInfRules; |
|
1276 |
for (QMap<QString, QStringList>::iterator it = project->variables().begin(); it != project->variables().end(); ++it) { |
|
1277 |
if (it.key().startsWith(BLD_INF_RULES_BASE)) { |
|
1278 |
QString newKey = it.key().mid(sizeof(BLD_INF_RULES_BASE) - 1); |
|
1279 |
if (newKey.isEmpty()) { |
|
1280 |
fprintf(stderr, "Warning: Empty BLD_INF_RULES key encountered\n"); |
|
1281 |
continue; |
|
1282 |
} |
|
1283 |
QStringList newValues; |
|
1284 |
QStringList values = it.value(); |
|
1285 |
foreach(QString item, values) { |
|
1286 |
// If there is no stringlist defined for a rule, use rule name directly |
|
1287 |
// This is convenience for defining single line statements |
|
1288 |
if (project->values(item).isEmpty()) { |
|
1289 |
newValues << item; |
|
1290 |
} else { |
|
1291 |
foreach(QString itemRow, project->values(item)) { |
|
1292 |
newValues << itemRow; |
|
1293 |
} |
|
1294 |
} |
|
1295 |
} |
|
1296 |
userBldInfRules.insert(newKey, newValues); |
|
1297 |
} |
|
1298 |
} |
|
1299 |
||
1300 |
// Add includes of subdirs bld.inf files |
|
1301 |
||
1302 |
QString mmpfilename = escapeFilePath(fileFixify(project->projectFile())); |
|
1303 |
mmpfilename = mmpfilename.replace(mmpfilename.lastIndexOf("."), 4, Option::mmp_ext); |
|
1304 |
QString currentPath = qmake_getpwd(); |
|
1305 |
QDir directory(currentPath); |
|
1306 |
||
1307 |
const QStringList &subdirs = project->values("SUBDIRS"); |
|
1308 |
foreach(QString item, subdirs) { |
|
1309 |
QString fixedItem; |
|
1310 |
if (!project->isEmpty(item + ".file")) { |
|
1311 |
fixedItem = project->first(item + ".file"); |
|
1312 |
} else if (!project->isEmpty(item + ".subdir")) { |
|
1313 |
fixedItem = project->first(item + ".subdir"); |
|
1314 |
} else { |
|
1315 |
fixedItem = item; |
|
1316 |
} |
|
1317 |
||
1318 |
QFileInfo subdir(fileInfo(fixedItem)); |
|
1319 |
QString relativePath = directory.relativeFilePath(fixedItem); |
|
1320 |
QString subdirFileName = subdir.completeBaseName(); |
|
1321 |
QString fullProName = subdir.absoluteFilePath();; |
|
1322 |
QString bldinfFilename; |
|
1323 |
||
1324 |
if (subdir.isDir()) { |
|
1325 |
// Subdir is a regular project |
|
1326 |
bldinfFilename = relativePath + QString("/") + QString(BLD_INF_FILENAME); |
|
1327 |
fullProName += QString("/") + subdirFileName + Option::pro_ext; |
|
1328 |
} else { |
|
1329 |
// Subdir is actually a .pro file |
|
1330 |
if (relativePath.contains("/")) { |
|
1331 |
// .pro not in same directory as parent .pro |
|
1332 |
relativePath.remove(relativePath.lastIndexOf("/") + 1, relativePath.length()); |
|
1333 |
bldinfFilename = relativePath; |
|
1334 |
} else { |
|
1335 |
// .pro and parent .pro in same directory |
|
1336 |
bldinfFilename = QString("./"); |
|
1337 |
} |
|
1338 |
bldinfFilename += QString(BLD_INF_FILENAME ".") + subdirFileName; |
|
1339 |
} |
|
1340 |
||
1341 |
QString uid = generate_uid(fullProName); |
|
1342 |
QString bldinfDefine = QString("BLD_INF_") + subdirFileName + QString("_") + uid; |
|
1343 |
bldinfDefine = bldinfDefine.toUpper(); |
|
1344 |
removeSpecialCharacters(bldinfDefine); |
|
1345 |
||
1346 |
t << "#ifndef " << bldinfDefine << endl; |
|
1347 |
t << "\t#include \"" << QDir::toNativeSeparators(bldinfFilename) << "\"" << endl; |
|
1348 |
t << "#endif // " << bldinfDefine << endl; |
|
1349 |
} |
|
1350 |
||
1351 |
// Add supported project platforms |
|
1352 |
||
1353 |
t << endl << BLD_INF_TAG_PLATFORMS << endl << endl; |
|
1354 |
if (0 != project->values("SYMBIAN_PLATFORMS").size()) |
|
1355 |
t << project->values("SYMBIAN_PLATFORMS").join(" ") << endl; |
|
1356 |
||
1357 |
QStringList userItems = userBldInfRules.value(BLD_INF_TAG_PLATFORMS); |
|
1358 |
foreach(QString item, userItems) |
|
1359 |
t << item << endl; |
|
1360 |
userBldInfRules.remove(BLD_INF_TAG_PLATFORMS); |
|
1361 |
t << endl; |
|
1362 |
||
1363 |
// Add project mmps and old style extension makefiles |
|
1364 |
||
1365 |
QString mmpTag; |
|
5
d3bac044e0f0
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
1366 |
if (project->isActiveConfig("symbian_test")) |
0 | 1367 |
mmpTag = QLatin1String(BLD_INF_TAG_TESTMMPFILES); |
1368 |
else |
|
1369 |
mmpTag = QLatin1String(BLD_INF_TAG_MMPFILES); |
|
1370 |
||
1371 |
t << endl << mmpTag << endl << endl; |
|
1372 |
||
1373 |
writeBldInfMkFilePart(t, addDeploymentExtension); |
|
1374 |
if (targetType != TypeSubdirs) { |
|
1375 |
QString shortProFilename = project->projectFile(); |
|
1376 |
shortProFilename.replace(0, shortProFilename.lastIndexOf("/") + 1, QString("")); |
|
1377 |
shortProFilename.replace(Option::pro_ext, QString("")); |
|
1378 |
||
1379 |
QString mmpFilename = shortProFilename + QString("_") + uid3 + Option::mmp_ext; |
|
1380 |
||
1381 |
t << mmpFilename << endl; |
|
1382 |
} |
|
1383 |
||
1384 |
userItems = userBldInfRules.value(mmpTag); |
|
1385 |
foreach(QString item, userItems) |
|
1386 |
t << item << endl; |
|
1387 |
userBldInfRules.remove(mmpTag); |
|
1388 |
||
1389 |
t << endl << BLD_INF_TAG_EXTENSIONS << endl << endl; |
|
1390 |
||
1391 |
// Generate extension rules |
|
1392 |
||
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1393 |
writeBldInfExtensionRulesPart(t, iconFile); |
0 | 1394 |
|
1395 |
userItems = userBldInfRules.value(BLD_INF_TAG_EXTENSIONS); |
|
1396 |
foreach(QString item, userItems) |
|
1397 |
t << item << endl; |
|
1398 |
userBldInfRules.remove(BLD_INF_TAG_EXTENSIONS); |
|
1399 |
||
1400 |
// Add rest of the user defined content |
|
1401 |
||
1402 |
for (QMap<QString, QStringList>::iterator it = userBldInfRules.begin(); it != userBldInfRules.end(); ++it) { |
|
1403 |
t << endl << endl << it.key() << endl << endl; |
|
1404 |
userItems = it.value(); |
|
1405 |
foreach(QString item, userItems) |
|
1406 |
t << item << endl; |
|
1407 |
} |
|
1408 |
if (project->values("CONFIG").contains("headerexport", Qt::CaseInsensitive)) { |
|
1409 |
writeExportPart(t); |
|
1410 |
} |
|
1411 |
} |
|
1412 |
||
1413 |
void SymbianMakefileGenerator::writeExportPart(QTextStream &t) |
|
1414 |
{ |
|
1415 |
QDir currentDir = QDir::current(); |
|
1416 |
t << "prj_exports" << endl; |
|
1417 |
||
1418 |
foreach(QString install, project->values("INSTALLS")) { |
|
1419 |
QString installDir = project->first(install + ".path"); |
|
1420 |
||
1421 |
// Export macros are the recommended way, but might not be used |
|
1422 |
// in all cases (such as Qt headers). We handle it either way, |
|
1423 |
// macros or not. |
|
1424 |
bool useLayerMacro = false; |
|
1425 |
if (installDir.startsWith("MW_LAYER_") || |
|
1426 |
installDir.startsWith("APP_LAYER_") || |
|
1427 |
installDir.startsWith("APP_LAYER_")) { |
|
1428 |
useLayerMacro = true; |
|
1429 |
} else { |
|
1430 |
#ifdef Q_OS_WIN |
|
1431 |
// If we are running on Windows, and the export target starts |
|
1432 |
// with a drive letter, we need to remove it, the build tools |
|
1433 |
// cannot handle drives in export paths |
|
1434 |
||
1435 |
if (installDir.length() > 2 && installDir[1] == ':') { |
|
1436 |
installDir.remove(0, 2); |
|
1437 |
} |
|
1438 |
#endif |
|
1439 |
installDir.replace("\\", "/"); |
|
1440 |
if (!installDir.endsWith("/")) { |
|
1441 |
installDir.append("/"); |
|
1442 |
} |
|
1443 |
} |
|
1444 |
||
1445 |
foreach(QString target, project->values(install + ".files")) { |
|
1446 |
// Handle glob targets (only in the current directory) |
|
1447 |
if (target.contains("*") || target.contains("?")) { |
|
1448 |
QDir globber = QDir::current(); |
|
1449 |
globber.setNameFilters(QStringList(target)); |
|
1450 |
foreach(QString globbedTarget, globber.entryList()) { |
|
1451 |
if (useLayerMacro) { |
|
1452 |
QFileInfo globbedInfo(globbedTarget); |
|
1453 |
t << globbedTarget << " " << installDir << |
|
1454 |
"(" << globbedInfo.fileName() << ")" << endl; |
|
1455 |
} else { |
|
1456 |
t << globbedTarget << " " << installDir << |
|
1457 |
globbedTarget << endl; |
|
1458 |
} |
|
1459 |
} |
|
1460 |
} else { |
|
1461 |
target = currentDir.relativeFilePath(target); |
|
1462 |
QFileInfo targetInfo(target); |
|
1463 |
||
1464 |
// Not possible to export whole directories, extension makefile needed for this |
|
1465 |
// Note that this check requires the file to be exported to exist in the qmake phase! |
|
1466 |
if (targetInfo.isFile()) { |
|
1467 |
if (useLayerMacro) { |
|
1468 |
t << target << " " << installDir << |
|
1469 |
"(" << targetInfo.fileName() << ")" << endl; |
|
1470 |
} else { |
|
1471 |
t << target << " " << installDir << |
|
1472 |
targetInfo.fileName() << endl; |
|
1473 |
} |
|
1474 |
} |
|
1475 |
} |
|
1476 |
} |
|
1477 |
} |
|
1478 |
t << endl; |
|
1479 |
} |
|
1480 |
||
1481 |
void SymbianMakefileGenerator::writeRegRssFile(QStringList &userItems) |
|
1482 |
{ |
|
1483 |
QString filename(fixedTarget); |
|
1484 |
filename.append("_reg.rss"); |
|
1485 |
QFile ft(filename); |
|
1486 |
if (ft.open(QIODevice::WriteOnly)) { |
|
1487 |
if (Option::mkfile::listgen) { |
|
1488 |
generatePrint(fileInfo(ft.fileName()).absoluteFilePath()); |
|
1489 |
} |
|
1490 |
generatedFiles << ft.fileName(); |
|
1491 |
QTextStream t(&ft); |
|
1492 |
t << "// ============================================================================" << endl; |
|
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1493 |
t << "// * Generated by qmake (" << qmake_version() << ") (Qt " QT_VERSION_STR ") on: "; |
0 | 1494 |
t << QDateTime::currentDateTime().toString(Qt::ISODate) << endl; |
1495 |
t << "// * This file is generated by qmake and should not be modified by the" << endl; |
|
1496 |
t << "// * user." << endl; |
|
1497 |
t << "// ============================================================================" << endl; |
|
1498 |
t << endl; |
|
1499 |
t << "#include <" << fixedTarget << ".rsg>" << endl; |
|
1500 |
t << "#include <appinfo.rh>" << endl; |
|
1501 |
t << endl; |
|
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1502 |
t << "UID2 KUidAppRegistrationResourceFile" << endl; |
0 | 1503 |
t << "UID3 " << uid3 << endl << endl; |
1504 |
t << "RESOURCE APP_REGISTRATION_INFO" << endl; |
|
1505 |
t << "\t{" << endl; |
|
1506 |
t << "\tapp_file=\"" << fixedTarget << "\";" << endl; |
|
1507 |
t << "\tlocalisable_resource_file=\"" RESOURCE_DIRECTORY_RESOURCE << fixedTarget << "\";" << endl; |
|
1508 |
t << endl; |
|
1509 |
||
1510 |
foreach(QString item, userItems) |
|
1511 |
t << "\t" << item << endl; |
|
1512 |
t << "\t}" << endl; |
|
1513 |
} else { |
|
1514 |
PRINT_FILE_CREATE_ERROR(filename) |
|
1515 |
} |
|
1516 |
} |
|
1517 |
||
1518 |
void SymbianMakefileGenerator::writeRssFile(QString &numberOfIcons, QString &iconFile) |
|
1519 |
{ |
|
1520 |
QString filename(fixedTarget); |
|
1521 |
filename.append(".rss"); |
|
1522 |
QFile ft(filename); |
|
1523 |
if (ft.open(QIODevice::WriteOnly)) { |
|
1524 |
if (Option::mkfile::listgen) { |
|
1525 |
generatePrint(fileInfo(ft.fileName()).absoluteFilePath()); |
|
1526 |
} |
|
1527 |
generatedFiles << ft.fileName(); |
|
1528 |
QTextStream t(&ft); |
|
1529 |
t << "// ============================================================================" << endl; |
|
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1530 |
t << "// * Generated by qmake (" << qmake_version() << ") (Qt " QT_VERSION_STR ") on: "; |
0 | 1531 |
t << QDateTime::currentDateTime().toString(Qt::ISODate) << endl; |
1532 |
t << "// * This file is generated by qmake and should not be modified by the" << endl; |
|
1533 |
t << "// * user." << endl; |
|
1534 |
t << "// ============================================================================" << endl; |
|
1535 |
t << endl; |
|
1536 |
t << "#include <appinfo.rh>" << endl; |
|
5
d3bac044e0f0
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
1537 |
t << "#include <" << translationFileName << ".loc>" << endl; |
0 | 1538 |
t << endl; |
1539 |
t << "RESOURCE LOCALISABLE_APP_INFO r_localisable_app_info" << endl; |
|
1540 |
t << "\t{" << endl; |
|
1541 |
t << "\tshort_caption = STRING_r_short_caption;" << endl; |
|
1542 |
t << "\tcaption_and_icon =" << endl; |
|
1543 |
t << "\tCAPTION_AND_ICON_INFO" << endl; |
|
1544 |
t << "\t\t{" << endl; |
|
1545 |
t << "\t\tcaption = STRING_r_caption;" << endl; |
|
1546 |
||
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1547 |
QString rssIconFile = iconFile; |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1548 |
rssIconFile = rssIconFile.replace("/", "\\\\"); |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1549 |
|
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1550 |
if (numberOfIcons.isEmpty() || rssIconFile.isEmpty()) { |
0 | 1551 |
// There can be maximum one item in this tag, validated when parsed |
1552 |
t << "\t\tnumber_of_icons = 0;" << endl; |
|
1553 |
t << "\t\ticon_file = \"\";" << endl; |
|
1554 |
} else { |
|
1555 |
// There can be maximum one item in this tag, validated when parsed |
|
1556 |
t << "\t\tnumber_of_icons = " << numberOfIcons << ";" << endl; |
|
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1557 |
t << "\t\ticon_file = \"" << rssIconFile << "\";" << endl; |
0 | 1558 |
} |
1559 |
t << "\t\t};" << endl; |
|
1560 |
t << "\t}" << endl; |
|
1561 |
t << endl; |
|
1562 |
} else { |
|
1563 |
PRINT_FILE_CREATE_ERROR(filename); |
|
1564 |
} |
|
1565 |
} |
|
1566 |
||
1567 |
void SymbianMakefileGenerator::writeLocFile(QStringList &symbianLangCodes) |
|
1568 |
{ |
|
5
d3bac044e0f0
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
1569 |
QString filename(translationFileName); |
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1570 |
if (project->values("SYMBIANTRANSLATIONS").isEmpty()) { |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1571 |
filename.append(".loc"); |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1572 |
} else { |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1573 |
if (!project->first("SYMBIANLOCFILESDIR").isEmpty()) { |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1574 |
filename.insert(0,project->first("SYMBIANLOCFILESDIR")); |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1575 |
} else { |
5
d3bac044e0f0
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
1576 |
filename.insert(0,"/epoc32/include/platform/mw/loc/"); |
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1577 |
} |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1578 |
filename.append(".loc"); |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1579 |
} |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1580 |
|
0 | 1581 |
QFile ft(filename); |
1582 |
if (ft.open(QIODevice::WriteOnly)) { |
|
1583 |
if (Option::mkfile::listgen) { |
|
1584 |
generatePrint(fileInfo(ft.fileName()).absoluteFilePath()); |
|
1585 |
} |
|
1586 |
generatedFiles << ft.fileName(); |
|
1587 |
QTextStream t(&ft); |
|
1588 |
t << "// ============================================================================" << endl; |
|
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1589 |
t << "// * Generated by qmake (" << qmake_version() << ") (Qt " QT_VERSION_STR ") on: "; |
0 | 1590 |
t << QDateTime::currentDateTime().toString(Qt::ISODate) << endl; |
1591 |
t << "// * This file is generated by qmake and should not be modified by the" << endl; |
|
1592 |
t << "// * user." << endl; |
|
1593 |
t << "// ============================================================================" << endl; |
|
1594 |
t << endl; |
|
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1595 |
if (project->values("SYMBIANTRANSLATIONS").isEmpty()) { |
0 | 1596 |
t << "#ifdef LANGUAGE_SC" << endl; |
1597 |
t << "#define STRING_r_short_caption \"" << fixedTarget << "\"" << endl; |
|
1598 |
t << "#define STRING_r_caption \"" << fixedTarget << "\"" << endl; |
|
1599 |
foreach(QString lang, symbianLangCodes) { |
|
1600 |
t << "#elif defined LANGUAGE_" << lang << endl; |
|
1601 |
t << "#define STRING_r_short_caption \"" << fixedTarget << "\"" << endl; |
|
1602 |
t << "#define STRING_r_caption \"" << fixedTarget << "\"" << endl; |
|
1603 |
} |
|
1604 |
t << "#else" << endl; |
|
1605 |
t << "#define STRING_r_short_caption \"" << fixedTarget << "\"" << endl; |
|
1606 |
t << "#define STRING_r_caption \"" << fixedTarget << "\"" << endl; |
|
1607 |
t << "#endif" << endl; |
|
1608 |
} else { |
|
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1609 |
t << "#if LANGUAGE_01" << endl; |
5
d3bac044e0f0
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
1610 |
t << "#include <" << "01/" << translationFileName << "_01.loc>" << endl; |
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1611 |
foreach(QString lang, symbianLangCodes) { |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1612 |
if (lang.localeAwareCompare("01") != 0) { |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1613 |
t << "#elif LANGUAGE_" << lang << endl; |
5
d3bac044e0f0
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
1614 |
t << "#include <" << lang << "/" << translationFileName << "_" << lang << ".loc" << ">" << endl; |
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1615 |
} |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1616 |
} |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1617 |
t << "#endif" << endl; |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1618 |
} |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1619 |
} else { |
0 | 1620 |
PRINT_FILE_CREATE_ERROR(filename); |
1621 |
} |
|
1622 |
} |
|
1623 |
||
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1624 |
void SymbianMakefileGenerator::writeSymbianLocFile(QStringList &symbianLangCodes) |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1625 |
{ |
5
d3bac044e0f0
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
1626 |
QString filename(translationFileName); |
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1627 |
foreach(QString lang, symbianLangCodes) { |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1628 |
|
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1629 |
QString tsFilename(filename); |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1630 |
QString language = qt2S60LangMapTable.key(lang, QString("en")); |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1631 |
tsFilename.append("_"+language+".ts"); |
5
d3bac044e0f0
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
1632 |
|
d3bac044e0f0
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
1633 |
tsFilename.insert(0,project->first("SYMBIANTRANSLATIONSRCDIR")); |
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1634 |
|
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1635 |
QString locFilename(filename); |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1636 |
locFilename.append("_"+lang+".loc"); |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1637 |
if (!project->first("SYMBIANLOCFILESDIR").isEmpty()) { |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1638 |
locFilename.insert(0,lang+"/"); |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1639 |
locFilename.insert(0,project->first("SYMBIANLOCFILESDIR")); |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1640 |
} else { |
5
d3bac044e0f0
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
1641 |
locFilename.insert(0,"/epoc32/include/platform/mw/loc/"+lang+"/"); |
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1642 |
} |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1643 |
|
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1644 |
QString shortCaption; |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1645 |
QString longCaption; |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1646 |
|
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1647 |
// get captions from ts file |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1648 |
QFile tsFile(tsFilename); |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1649 |
if (tsFile.exists()) { |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1650 |
if (tsFile.open(QIODevice::ReadOnly)) { |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1651 |
QString shortCaptionId = QLatin1String("txt_short_caption_"); |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1652 |
shortCaptionId.append(filename); |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1653 |
QString longCaptionId = QLatin1String("txt_long_caption_"); |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1654 |
longCaptionId.append(filename); |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1655 |
QXmlStreamReader xml(&tsFile); |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1656 |
while (!xml.atEnd()) { |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1657 |
xml.readNext(); |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1658 |
if (xml.isStartElement() && xml.name() == "context") { |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1659 |
while (!(xml.isEndElement() && xml.name() == "context") && !xml.atEnd()) { |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1660 |
xml.readNext(); |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1661 |
if (xml.isStartElement() && xml.name() == "message" && |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1662 |
xml.attributes().value("numerus") == "no" && |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1663 |
xml.attributes().value("id") == shortCaptionId) { |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1664 |
while (!(xml.isEndElement() && xml.name() == "message") && !xml.atEnd()) { |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1665 |
xml.readNext(); |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1666 |
if (xml.isStartElement() && xml.name() == "translation") { |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1667 |
shortCaption = xml.readElementText(); |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1668 |
} |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1669 |
} |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1670 |
} |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1671 |
if (xml.isStartElement() && xml.name() == "message" && |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1672 |
xml.attributes().value("numerus") == "no" && |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1673 |
xml.attributes().value("id") == longCaptionId) { |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1674 |
while (!(xml.isEndElement() && xml.name() == "message") && !xml.atEnd()) { |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1675 |
xml.readNext(); |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1676 |
if (xml.isStartElement() && xml.name() == "translation") { |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1677 |
longCaption = xml.readElementText(); |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1678 |
} |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1679 |
} |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1680 |
} |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1681 |
} |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1682 |
} |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1683 |
} |
5
d3bac044e0f0
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
1684 |
if (shortCaption.isEmpty()){ |
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1685 |
fprintf(stderr, "Warning: STRING_r_short_caption not generated from file '%s'.\n", qPrintable(tsFilename)); |
5
d3bac044e0f0
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
1686 |
fprintf(stderr, " : short caption generated from target name '#%s'.\n", qPrintable(fixedTarget)); |
d3bac044e0f0
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
1687 |
} |
d3bac044e0f0
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
1688 |
if (longCaption.isEmpty()){ |
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1689 |
fprintf(stderr, "Warning: STRING_r_caption not generated from file '%s'.\n", qPrintable(tsFilename)); |
5
d3bac044e0f0
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
1690 |
fprintf(stderr, " : caption generated from target name '#%s'.\n", qPrintable(fixedTarget)); |
d3bac044e0f0
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
1691 |
} |
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1692 |
if (xml.hasError()) |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1693 |
fprintf(stderr, "ERROR: \"%s\" when parsing ts file\n", qPrintable(xml.errorString())); |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1694 |
} else { |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1695 |
fprintf(stderr, "Could not open ts file (%s)\n", qPrintable(tsFilename)); |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1696 |
} |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1697 |
} else { |
5
d3bac044e0f0
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
1698 |
fprintf(stderr, "Warning: ts file does not exist: (%s)\n", qPrintable(tsFilename)); |
d3bac044e0f0
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
1699 |
fprintf(stderr, " : short and long caption generated from target name '#%s'.\n", qPrintable(fixedTarget)); |
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1700 |
} |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1701 |
|
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1702 |
// generate language specific caption loc file |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1703 |
QFile ft(locFilename); |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1704 |
if (ft.open(QIODevice::WriteOnly)) { |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1705 |
generatedFiles << ft.fileName(); |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1706 |
QTextStream t(&ft); |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1707 |
t << "// ============================================================================" << endl; |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1708 |
t << "// * Generated by qmake (" << qmake_version() << ") (Qt " << QT_VERSION_STR << ") on: "; |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1709 |
t << QDateTime::currentDateTime().toString(Qt::ISODate) << endl; |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1710 |
t << "// * This file is generated by qmake and should not be modified by the" << endl; |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1711 |
t << "// * user." << endl; |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1712 |
t << "// ============================================================================" << endl; |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1713 |
t << endl; |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1714 |
if (!shortCaption.isEmpty()) { |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1715 |
t << "#define STRING_r_short_caption \"" << shortCaption << "\"" << endl; |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1716 |
} else { |
5
d3bac044e0f0
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
1717 |
t << "#define STRING_r_short_caption \"" "#"<< fixedTarget << "\"" << endl; |
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1718 |
} |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1719 |
if (!longCaption.isEmpty()) { |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1720 |
t << "#define STRING_r_caption \"" << longCaption << "\"" << endl; |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1721 |
} else { |
5
d3bac044e0f0
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
1722 |
t << "#define STRING_r_caption \"" "#"<< fixedTarget << "\"" << endl; |
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1723 |
} |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1724 |
ft.close(); |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1725 |
} else { |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1726 |
PRINT_FILE_CREATE_ERROR(locFilename); |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1727 |
} |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1728 |
} |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1729 |
} |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1730 |
|
0 | 1731 |
void SymbianMakefileGenerator::readRssRules(QString &numberOfIcons, QString &iconFile, QStringList &userRssRules) |
1732 |
{ |
|
1733 |
for (QMap<QString, QStringList>::iterator it = project->variables().begin(); it != project->variables().end(); ++it) { |
|
1734 |
if (it.key().startsWith(RSS_RULES_BASE)) { |
|
1735 |
QString newKey = it.key().mid(sizeof(RSS_RULES_BASE) - 1); |
|
1736 |
if (newKey.isEmpty()) { |
|
1737 |
fprintf(stderr, "Warning: Empty RSS_RULES_BASE key encountered\n"); |
|
1738 |
continue; |
|
1739 |
} |
|
1740 |
QStringList newValues; |
|
1741 |
QStringList values = it.value(); |
|
1742 |
foreach(QString item, values) { |
|
1743 |
// If there is no stringlist defined for a rule, use rule name directly |
|
1744 |
// This is convenience for defining single line statements |
|
1745 |
if (project->values(item).isEmpty()) { |
|
1746 |
newValues << item; |
|
1747 |
} else { |
|
1748 |
foreach(QString itemRow, project->values(item)) { |
|
1749 |
newValues << itemRow; |
|
1750 |
} |
|
1751 |
} |
|
1752 |
} |
|
1753 |
// Verify thet there is exactly one value in RSS_TAG_NBROFICONS |
|
1754 |
if (newKey == RSS_TAG_NBROFICONS) { |
|
1755 |
if (newValues.count() == 1) { |
|
1756 |
numberOfIcons = newValues[0]; |
|
1757 |
} else { |
|
1758 |
fprintf(stderr, "Warning: There must be exactly one value in '%s%s'\n", |
|
1759 |
RSS_RULES_BASE, RSS_TAG_NBROFICONS); |
|
1760 |
continue; |
|
1761 |
} |
|
1762 |
// Verify thet there is exactly one value in RSS_TAG_ICONFILE |
|
1763 |
} else if (newKey == RSS_TAG_ICONFILE) { |
|
1764 |
if (newValues.count() == 1) { |
|
1765 |
iconFile = newValues[0]; |
|
1766 |
} else { |
|
1767 |
fprintf(stderr, "Warning: There must be exactly one value in '%s%s'\n", |
|
1768 |
RSS_RULES_BASE, RSS_TAG_ICONFILE); |
|
1769 |
continue; |
|
1770 |
} |
|
1771 |
} else { |
|
1772 |
fprintf(stderr, "Warning: Unsupported key:'%s%s'\n", |
|
1773 |
RSS_RULES_BASE, newKey.toLatin1().constData()); |
|
1774 |
continue; |
|
1775 |
} |
|
1776 |
} |
|
1777 |
} |
|
1778 |
||
1779 |
foreach(QString item, project->values(RSS_RULES)) { |
|
1780 |
// If there is no stringlist defined for a rule, use rule name directly |
|
1781 |
// This is convenience for defining single line mmp statements |
|
1782 |
if (project->values(item).isEmpty()) { |
|
1783 |
userRssRules << item; |
|
1784 |
} else { |
|
1785 |
userRssRules << project->values(item); |
|
1786 |
} |
|
1787 |
} |
|
1788 |
||
1789 |
// Validate that either both RSS_TAG_NBROFICONS and RSS_TAG_ICONFILE keys exist |
|
1790 |
// or neither of them exist |
|
1791 |
if (!((numberOfIcons.isEmpty() && iconFile.isEmpty()) || |
|
1792 |
(!numberOfIcons.isEmpty() && !iconFile.isEmpty()))) { |
|
1793 |
numberOfIcons.clear(); |
|
1794 |
iconFile.clear(); |
|
1795 |
fprintf(stderr, "Warning: Both or neither of '%s%s' and '%s%s' keys must exist.\n", |
|
1796 |
RSS_RULES_BASE, RSS_TAG_NBROFICONS, RSS_RULES_BASE, RSS_TAG_ICONFILE); |
|
1797 |
} |
|
1798 |
||
1799 |
// Validate that RSS_TAG_NBROFICONS contains only numbers |
|
1800 |
if (!numberOfIcons.isEmpty()) { |
|
1801 |
bool ok; |
|
1802 |
numberOfIcons = numberOfIcons.simplified(); |
|
5
d3bac044e0f0
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
1803 |
numberOfIcons.toInt(&ok); |
0 | 1804 |
if (!ok) { |
1805 |
numberOfIcons.clear(); |
|
1806 |
iconFile.clear(); |
|
1807 |
fprintf(stderr, "Warning: '%s%s' must be integer in decimal format.\n", |
|
1808 |
RSS_RULES_BASE, RSS_TAG_NBROFICONS); |
|
1809 |
} |
|
1810 |
} |
|
1811 |
} |
|
1812 |
||
1813 |
QStringList SymbianMakefileGenerator::symbianLangCodesFromTsFiles() |
|
1814 |
{ |
|
1815 |
QStringList tsfiles; |
|
1816 |
QStringList symbianLangCodes; |
|
1817 |
tsfiles << project->values("TRANSLATIONS"); |
|
1818 |
||
1819 |
fillQt2S60LangMapTable(); |
|
1820 |
||
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1821 |
if (project->values("SYMBIANTRANSLATIONS").isEmpty()) { |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1822 |
foreach(QString file, tsfiles) { |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1823 |
int extIndex = file.lastIndexOf("."); |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1824 |
int langIndex = file.lastIndexOf("_", (extIndex - file.length())); |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1825 |
langIndex += 1; |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1826 |
QString qtlang = file.mid(langIndex, extIndex - langIndex); |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1827 |
QString s60lang = qt2S60LangMapTable.value(qtlang, QString("SC")); |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1828 |
if (!symbianLangCodes.contains(s60lang) && s60lang != "SC") |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1829 |
symbianLangCodes += s60lang; |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1830 |
} |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1831 |
} else { |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1832 |
modifyQt2S60LangMapTable(); // Modify the table according to the system_languages.ini file |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1833 |
foreach(QString symbianTranslation, project->values("SYMBIANTRANSLATIONS")) { |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1834 |
QString s60lang = qt2S60LangMapTable.value(symbianTranslation, QString("SC")); |
0 | 1835 |
|
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1836 |
if (!symbianLangCodes.contains(s60lang) && s60lang != "SC") |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1837 |
symbianLangCodes += s60lang; |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1838 |
} |
0 | 1839 |
} |
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1840 |
|
0 | 1841 |
return symbianLangCodes; |
1842 |
} |
|
1843 |
||
1844 |
void SymbianMakefileGenerator::fillQt2S60LangMapTable() |
|
1845 |
{ |
|
1846 |
qt2S60LangMapTable.reserve(170); // 165 items at time of writing. |
|
1847 |
qt2S60LangMapTable.insert("ab", "SC"); //Abkhazian // |
|
1848 |
qt2S60LangMapTable.insert("om", "SC"); //Afan // |
|
1849 |
qt2S60LangMapTable.insert("aa", "SC"); //Afar // |
|
1850 |
qt2S60LangMapTable.insert("af", "34"); //Afrikaans //Afrikaans |
|
1851 |
qt2S60LangMapTable.insert("sq", "35"); //Albanian //Albanian |
|
1852 |
qt2S60LangMapTable.insert("am", "36"); //Amharic //Amharic |
|
1853 |
qt2S60LangMapTable.insert("ar", "37"); //Arabic //Arabic |
|
1854 |
qt2S60LangMapTable.insert("hy", "38"); //Armenian //Armenian |
|
1855 |
qt2S60LangMapTable.insert("as", "SC"); //Assamese // |
|
1856 |
qt2S60LangMapTable.insert("ay", "SC"); //Aymara // |
|
1857 |
qt2S60LangMapTable.insert("az", "SC"); //Azerbaijani // |
|
1858 |
qt2S60LangMapTable.insert("ba", "SC"); //Bashkir // |
|
1859 |
qt2S60LangMapTable.insert("eu", "SC"); //Basque // |
|
1860 |
qt2S60LangMapTable.insert("bn", "41"); //Bengali //Bengali |
|
1861 |
qt2S60LangMapTable.insert("dz", "SC"); //Bhutani // |
|
1862 |
qt2S60LangMapTable.insert("bh", "SC"); //Bihari // |
|
1863 |
qt2S60LangMapTable.insert("bi", "SC"); //Bislama // |
|
1864 |
qt2S60LangMapTable.insert("br", "SC"); //Breton // |
|
1865 |
qt2S60LangMapTable.insert("bg", "42"); //Bulgarian //Bulgarian |
|
1866 |
qt2S60LangMapTable.insert("my", "43"); //Burmese //Burmese |
|
1867 |
qt2S60LangMapTable.insert("be", "40"); //Byelorussian //Belarussian |
|
1868 |
qt2S60LangMapTable.insert("km", "SC"); //Cambodian // |
|
1869 |
qt2S60LangMapTable.insert("ca", "44"); //Catalan //Catalan |
|
1870 |
qt2S60LangMapTable.insert("zh", "SC"); //Chinese // |
|
1871 |
qt2S60LangMapTable.insert("co", "SC"); //Corsican // |
|
1872 |
qt2S60LangMapTable.insert("hr", "45"); //Croatian //Croatian |
|
1873 |
qt2S60LangMapTable.insert("cs", "25"); //Czech //Czech |
|
1874 |
qt2S60LangMapTable.insert("da", "07"); //Danish //Danish |
|
1875 |
qt2S60LangMapTable.insert("nl", "18"); //Dutch //Dutch |
|
1876 |
qt2S60LangMapTable.insert("en", "01"); //English //English(UK) |
|
1877 |
qt2S60LangMapTable.insert("eo", "SC"); //Esperanto // |
|
1878 |
qt2S60LangMapTable.insert("et", "49"); //Estonian //Estonian |
|
1879 |
qt2S60LangMapTable.insert("fo", "SC"); //Faroese // |
|
1880 |
qt2S60LangMapTable.insert("fj", "SC"); //Fiji // |
|
1881 |
qt2S60LangMapTable.insert("fi", "09"); //Finnish //Finnish |
|
1882 |
qt2S60LangMapTable.insert("fr", "02"); //French //French |
|
1883 |
qt2S60LangMapTable.insert("fy", "SC"); //Frisian // |
|
1884 |
qt2S60LangMapTable.insert("gd", "52"); //Gaelic //Gaelic |
|
1885 |
qt2S60LangMapTable.insert("gl", "SC"); //Galician // |
|
1886 |
qt2S60LangMapTable.insert("ka", "53"); //Georgian //Georgian |
|
1887 |
qt2S60LangMapTable.insert("de", "03"); //German //German |
|
1888 |
qt2S60LangMapTable.insert("el", "54"); //Greek //Greek |
|
1889 |
qt2S60LangMapTable.insert("kl", "SC"); //Greenlandic // |
|
1890 |
qt2S60LangMapTable.insert("gn", "SC"); //Guarani // |
|
1891 |
qt2S60LangMapTable.insert("gu", "56"); //Gujarati //Gujarati |
|
1892 |
qt2S60LangMapTable.insert("ha", "SC"); //Hausa // |
|
1893 |
qt2S60LangMapTable.insert("he", "57"); //Hebrew //Hebrew |
|
1894 |
qt2S60LangMapTable.insert("hi", "58"); //Hindi //Hindi |
|
1895 |
qt2S60LangMapTable.insert("hu", "17"); //Hungarian //Hungarian |
|
1896 |
qt2S60LangMapTable.insert("is", "15"); //Icelandic //Icelandic |
|
1897 |
qt2S60LangMapTable.insert("id", "59"); //Indonesian //Indonesian |
|
1898 |
qt2S60LangMapTable.insert("ia", "SC"); //Interlingua // |
|
1899 |
qt2S60LangMapTable.insert("ie", "SC"); //Interlingue // |
|
1900 |
qt2S60LangMapTable.insert("iu", "SC"); //Inuktitut // |
|
1901 |
qt2S60LangMapTable.insert("ik", "SC"); //Inupiak // |
|
1902 |
qt2S60LangMapTable.insert("ga", "60"); //Irish //Irish |
|
1903 |
qt2S60LangMapTable.insert("it", "05"); //Italian //Italian |
|
1904 |
qt2S60LangMapTable.insert("ja", "32"); //Japanese //Japanese |
|
1905 |
qt2S60LangMapTable.insert("jv", "SC"); //Javanese // |
|
1906 |
qt2S60LangMapTable.insert("kn", "62"); //Kannada //Kannada |
|
1907 |
qt2S60LangMapTable.insert("ks", "SC"); //Kashmiri // |
|
1908 |
qt2S60LangMapTable.insert("kk", "63"); //Kazakh //Kazakh |
|
1909 |
qt2S60LangMapTable.insert("rw", "SC"); //Kinyarwanda // |
|
1910 |
qt2S60LangMapTable.insert("ky", "SC"); //Kirghiz // |
|
1911 |
qt2S60LangMapTable.insert("ko", "65"); //Korean //Korean |
|
1912 |
qt2S60LangMapTable.insert("ku", "SC"); //Kurdish // |
|
1913 |
qt2S60LangMapTable.insert("rn", "SC"); //Kurundi // |
|
1914 |
qt2S60LangMapTable.insert("lo", "66"); //Laothian //Laothian |
|
1915 |
qt2S60LangMapTable.insert("la", "SC"); //Latin // |
|
1916 |
qt2S60LangMapTable.insert("lv", "67"); //Latvian //Latvian |
|
1917 |
qt2S60LangMapTable.insert("ln", "SC"); //Lingala // |
|
1918 |
qt2S60LangMapTable.insert("lt", "68"); //Lithuanian //Lithuanian |
|
1919 |
qt2S60LangMapTable.insert("mk", "69"); //Macedonian //Macedonian |
|
1920 |
qt2S60LangMapTable.insert("mg", "SC"); //Malagasy // |
|
1921 |
qt2S60LangMapTable.insert("ms", "70"); //Malay //Malay |
|
1922 |
qt2S60LangMapTable.insert("ml", "71"); //Malayalam //Malayalam |
|
1923 |
qt2S60LangMapTable.insert("mt", "SC"); //Maltese // |
|
1924 |
qt2S60LangMapTable.insert("mi", "SC"); //Maori // |
|
1925 |
qt2S60LangMapTable.insert("mr", "72"); //Marathi //Marathi |
|
1926 |
qt2S60LangMapTable.insert("mo", "73"); //Moldavian //Moldovian |
|
1927 |
qt2S60LangMapTable.insert("mn", "74"); //Mongolian //Mongolian |
|
1928 |
qt2S60LangMapTable.insert("na", "SC"); //Nauru // |
|
1929 |
qt2S60LangMapTable.insert("ne", "SC"); //Nepali // |
|
1930 |
qt2S60LangMapTable.insert("nb", "08"); //Norwegian //Norwegian |
|
1931 |
qt2S60LangMapTable.insert("oc", "SC"); //Occitan // |
|
1932 |
qt2S60LangMapTable.insert("or", "SC"); //Oriya // |
|
1933 |
qt2S60LangMapTable.insert("ps", "SC"); //Pashto // |
|
1934 |
qt2S60LangMapTable.insert("fa", "SC"); //Persian // |
|
1935 |
qt2S60LangMapTable.insert("pl", "27"); //Polish //Polish |
|
1936 |
qt2S60LangMapTable.insert("pt", "13"); //Portuguese //Portuguese |
|
1937 |
qt2S60LangMapTable.insert("pa", "77"); //Punjabi //Punjabi |
|
1938 |
qt2S60LangMapTable.insert("qu", "SC"); //Quechua // |
|
1939 |
qt2S60LangMapTable.insert("rm", "SC"); //RhaetoRomance // |
|
1940 |
qt2S60LangMapTable.insert("ro", "78"); //Romanian //Romanian |
|
1941 |
qt2S60LangMapTable.insert("ru", "16"); //Russian //Russian |
|
1942 |
qt2S60LangMapTable.insert("sm", "SC"); //Samoan // |
|
1943 |
qt2S60LangMapTable.insert("sg", "SC"); //Sangho // |
|
1944 |
qt2S60LangMapTable.insert("sa", "SC"); //Sanskrit // |
|
1945 |
qt2S60LangMapTable.insert("sr", "79"); //Serbian //Serbian |
|
1946 |
qt2S60LangMapTable.insert("sh", "SC"); //SerboCroatian // |
|
1947 |
qt2S60LangMapTable.insert("st", "SC"); //Sesotho // |
|
1948 |
qt2S60LangMapTable.insert("tn", "SC"); //Setswana // |
|
1949 |
qt2S60LangMapTable.insert("sn", "SC"); //Shona // |
|
1950 |
qt2S60LangMapTable.insert("sd", "SC"); //Sindhi // |
|
1951 |
qt2S60LangMapTable.insert("si", "80"); //Singhalese //Sinhalese |
|
1952 |
qt2S60LangMapTable.insert("ss", "SC"); //Siswati // |
|
1953 |
qt2S60LangMapTable.insert("sk", "26"); //Slovak //Slovak |
|
1954 |
qt2S60LangMapTable.insert("sl", "28"); //Slovenian //Slovenian |
|
1955 |
qt2S60LangMapTable.insert("so", "81"); //Somali //Somali |
|
1956 |
qt2S60LangMapTable.insert("es", "04"); //Spanish //Spanish |
|
1957 |
qt2S60LangMapTable.insert("su", "SC"); //Sundanese // |
|
1958 |
qt2S60LangMapTable.insert("sw", "84"); //Swahili //Swahili |
|
1959 |
qt2S60LangMapTable.insert("sv", "06"); //Swedish //Swedish |
|
1960 |
qt2S60LangMapTable.insert("tl", "39"); //Tagalog //Tagalog |
|
1961 |
qt2S60LangMapTable.insert("tg", "SC"); //Tajik // |
|
1962 |
qt2S60LangMapTable.insert("ta", "87"); //Tamil //Tamil |
|
1963 |
qt2S60LangMapTable.insert("tt", "SC"); //Tatar // |
|
1964 |
qt2S60LangMapTable.insert("te", "88"); //Telugu //Telugu |
|
1965 |
qt2S60LangMapTable.insert("th", "33"); //Thai //Thai |
|
1966 |
qt2S60LangMapTable.insert("bo", "89"); //Tibetan //Tibetan |
|
1967 |
qt2S60LangMapTable.insert("ti", "90"); //Tigrinya //Tigrinya |
|
1968 |
qt2S60LangMapTable.insert("to", "SC"); //Tonga // |
|
1969 |
qt2S60LangMapTable.insert("ts", "SC"); //Tsonga // |
|
1970 |
qt2S60LangMapTable.insert("tr", "14"); //Turkish //Turkish |
|
1971 |
qt2S60LangMapTable.insert("tk", "92"); //Turkmen //Turkmen |
|
1972 |
qt2S60LangMapTable.insert("tw", "SC"); //Twi // |
|
1973 |
qt2S60LangMapTable.insert("ug", "SC"); //Uigur // |
|
1974 |
qt2S60LangMapTable.insert("uk", "93"); //Ukrainian //Ukrainian |
|
1975 |
qt2S60LangMapTable.insert("ur", "94"); //Urdu //Urdu |
|
1976 |
qt2S60LangMapTable.insert("uz", "SC"); //Uzbek // |
|
1977 |
qt2S60LangMapTable.insert("vi", "96"); //Vietnamese //Vietnamese |
|
1978 |
qt2S60LangMapTable.insert("vo", "SC"); //Volapuk // |
|
1979 |
qt2S60LangMapTable.insert("cy", "97"); //Welsh //Welsh |
|
1980 |
qt2S60LangMapTable.insert("wo", "SC"); //Wolof // |
|
1981 |
qt2S60LangMapTable.insert("xh", "SC"); //Xhosa // |
|
1982 |
qt2S60LangMapTable.insert("yi", "SC"); //Yiddish // |
|
1983 |
qt2S60LangMapTable.insert("yo", "SC"); //Yoruba // |
|
1984 |
qt2S60LangMapTable.insert("za", "SC"); //Zhuang // |
|
1985 |
qt2S60LangMapTable.insert("zu", "98"); //Zulu //Zulu |
|
1986 |
qt2S60LangMapTable.insert("nn", "75"); //Nynorsk //NorwegianNynorsk |
|
1987 |
qt2S60LangMapTable.insert("bs", "SC"); //Bosnian // |
|
1988 |
qt2S60LangMapTable.insert("dv", "SC"); //Divehi // |
|
1989 |
qt2S60LangMapTable.insert("gv", "SC"); //Manx // |
|
1990 |
qt2S60LangMapTable.insert("kw", "SC"); //Cornish // |
|
1991 |
qt2S60LangMapTable.insert("ak", "SC"); //Akan // |
|
1992 |
qt2S60LangMapTable.insert("kok", "SC"); //Konkani // |
|
1993 |
qt2S60LangMapTable.insert("gaa", "SC"); //Ga // |
|
1994 |
qt2S60LangMapTable.insert("ig", "SC"); //Igbo // |
|
1995 |
qt2S60LangMapTable.insert("kam", "SC"); //Kamba // |
|
1996 |
qt2S60LangMapTable.insert("syr", "SC"); //Syriac // |
|
1997 |
qt2S60LangMapTable.insert("byn", "SC"); //Blin // |
|
1998 |
qt2S60LangMapTable.insert("gez", "SC"); //Geez // |
|
1999 |
qt2S60LangMapTable.insert("kfo", "SC"); //Koro // |
|
2000 |
qt2S60LangMapTable.insert("sid", "SC"); //Sidamo // |
|
2001 |
qt2S60LangMapTable.insert("cch", "SC"); //Atsam // |
|
2002 |
qt2S60LangMapTable.insert("tig", "SC"); //Tigre // |
|
2003 |
qt2S60LangMapTable.insert("kaj", "SC"); //Jju // |
|
2004 |
qt2S60LangMapTable.insert("fur", "SC"); //Friulian // |
|
2005 |
qt2S60LangMapTable.insert("ve", "SC"); //Venda // |
|
2006 |
qt2S60LangMapTable.insert("ee", "SC"); //Ewe // |
|
2007 |
qt2S60LangMapTable.insert("wa", "SC"); //Walamo // |
|
2008 |
qt2S60LangMapTable.insert("haw", "SC"); //Hawaiian // |
|
2009 |
qt2S60LangMapTable.insert("kcg", "SC"); //Tyap // |
|
2010 |
qt2S60LangMapTable.insert("ny", "SC"); //Chewa // |
|
2011 |
} |
|
2012 |
||
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
2013 |
void SymbianMakefileGenerator::modifyQt2S60LangMapTable() |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
2014 |
{ |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
2015 |
QString systemLanguagesIniFile = project->first("SYMBIANTRANSLATIONDIR"). |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
2016 |
append(QLatin1String("system_languages.ini")); |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
2017 |
QFileInfo systemLangFileInfo(systemLanguagesIniFile); |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
2018 |
if (systemLangFileInfo.exists()) { |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
2019 |
QSettings systemLanguages(systemLanguagesIniFile, QSettings::IniFormat); |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
2020 |
QStringList keys = systemLanguages.allKeys(); |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
2021 |
foreach (const QString &qtlang, keys){ |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
2022 |
QString s60lang = systemLanguages.value(qtlang).toString(); |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
2023 |
if (s60lang.localeAwareCompare(qt2S60LangMapTable.value(qtlang, QString("SC"))) != 0) { |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
2024 |
qt2S60LangMapTable.insert(qtlang, s60lang); |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
2025 |
fprintf(stderr, "Inserted: s60lang '%s' for qtlang '%s'.\n", qPrintable(s60lang), qPrintable(qtlang)); |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
2026 |
} |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
2027 |
} |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
2028 |
} |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
2029 |
} |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
2030 |
|
0 | 2031 |
void SymbianMakefileGenerator::appendIfnotExist(QStringList &list, QString value) |
2032 |
{ |
|
2033 |
if (!list.contains(value)) |
|
2034 |
list += value; |
|
2035 |
} |
|
2036 |
||
2037 |
void SymbianMakefileGenerator::appendIfnotExist(QStringList &list, QStringList values) |
|
2038 |
{ |
|
2039 |
foreach(QString item, values) |
|
2040 |
appendIfnotExist(list, item); |
|
2041 |
} |
|
2042 |
||
2043 |
QString SymbianMakefileGenerator::removePathSeparators(QString &file) |
|
2044 |
{ |
|
2045 |
QString ret = file; |
|
2046 |
while (ret.indexOf(QDir::separator()) > 0) { |
|
2047 |
ret.remove(0, ret.indexOf(QDir::separator()) + 1); |
|
2048 |
} |
|
2049 |
||
2050 |
return ret; |
|
2051 |
} |
|
2052 |
||
2053 |
||
2054 |
QString SymbianMakefileGenerator::removeTrailingPathSeparators(QString &file) |
|
2055 |
{ |
|
2056 |
QString ret = file; |
|
2057 |
if (ret.endsWith(QDir::separator())) { |
|
2058 |
ret.remove(ret.length() - 1, 1); |
|
2059 |
} |
|
2060 |
||
2061 |
return ret; |
|
2062 |
} |
|
2063 |
||
2064 |
void SymbianMakefileGenerator::generateCleanCommands(QTextStream& t, |
|
2065 |
const QStringList& toClean, |
|
2066 |
const QString& cmd, |
|
2067 |
const QString& cmdOptions, |
|
2068 |
const QString& itemPrefix, |
|
2069 |
const QString& itemSuffix) |
|
2070 |
{ |
|
2071 |
for (int i = 0; i < toClean.size(); ++i) { |
|
2072 |
QString item = toClean.at(i); |
|
2073 |
item.prepend(itemPrefix).append(itemSuffix); |
|
2074 |
#if defined(Q_OS_WIN) |
|
2075 |
t << "\t-@ if EXIST \"" << QDir::toNativeSeparators(item) << "\" "; |
|
2076 |
t << cmd << " " << cmdOptions << " \"" << QDir::toNativeSeparators(item) << "\"" << endl; |
|
2077 |
#else |
|
2078 |
t << "\t-if test -f " << QDir::toNativeSeparators(item) << "; then "; |
|
2079 |
t << cmd << " " << cmdOptions << " " << QDir::toNativeSeparators(item) << "; fi" << endl; |
|
2080 |
#endif |
|
2081 |
} |
|
2082 |
} |
|
2083 |
||
2084 |
void SymbianMakefileGenerator::removeSpecialCharacters(QString& str) |
|
2085 |
{ |
|
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
2086 |
// When modifying this method check also application_icon.prf |
0 | 2087 |
str.replace(QString("/"), QString("_")); |
2088 |
str.replace(QString("\\"), QString("_")); |
|
2089 |
str.replace(QString("-"), QString("_")); |
|
2090 |
str.replace(QString(":"), QString("_")); |
|
2091 |
str.replace(QString("."), QString("_")); |
|
2092 |
str.replace(QString(" "), QString("_")); |
|
2093 |
} |
|
2094 |
||
2095 |
void SymbianMakefileGenerator::writeSisTargets(QTextStream &t) |
|
2096 |
{ |
|
4
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
2097 |
t << "-include " MAKE_CACHE_NAME << endl; |
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
2098 |
t << endl; |
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
2099 |
|
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
2100 |
t << SIS_TARGET ":" << endl; |
0 | 2101 |
QString siscommand = QString("\t$(if $(wildcard %1_template.%2),$(if $(wildcard %3)," \ |
4
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
2102 |
"$(MAKE) -s -f $(MAKEFILE) %4," \ |
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
2103 |
"$(if $(QT_SIS_TARGET),$(MAKE) -s -f $(MAKEFILE) %4," \ |
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
2104 |
"$(MAKE) -s -f $(MAKEFILE) %5))," \ |
0 | 2105 |
"$(MAKE) -s -f $(MAKEFILE) %6)") |
2106 |
.arg(fixedTarget) |
|
2107 |
.arg("pkg") |
|
2108 |
.arg(MAKE_CACHE_NAME) |
|
2109 |
.arg(OK_SIS_TARGET) |
|
2110 |
.arg(FAIL_SIS_NOCACHE_TARGET) |
|
2111 |
.arg(FAIL_SIS_NOPKG_TARGET); |
|
2112 |
t << siscommand << endl; |
|
2113 |
t << endl; |
|
2114 |
||
2115 |
t << OK_SIS_TARGET ":" << endl; |
|
2116 |
||
2117 |
QString pkgcommand = QString("\tcreatepackage.bat $(QT_SIS_OPTIONS) %1_template.%2 $(QT_SIS_TARGET) " \ |
|
2118 |
"$(QT_SIS_CERTIFICATE) $(QT_SIS_KEY) $(QT_SIS_PASSPHRASE)") |
|
2119 |
.arg(fixedTarget) |
|
2120 |
.arg("pkg"); |
|
2121 |
t << pkgcommand << endl; |
|
2122 |
t << endl; |
|
2123 |
||
2124 |
t << FAIL_SIS_NOPKG_TARGET ":" << endl; |
|
2125 |
t << "\t$(error PKG file does not exist, 'SIS' target is only supported for executables or projects with DEPLOYMENT statement)" << endl; |
|
2126 |
t << endl; |
|
2127 |
||
2128 |
t << FAIL_SIS_NOCACHE_TARGET ":" << endl; |
|
4
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
2129 |
t << "\t$(error Project has to be built or QT_SIS_TARGET environment variable has to be set before calling 'SIS' target)" << endl; |
0 | 2130 |
t << endl; |
2131 |
} |
|
2132 |
||
2133 |
void SymbianMakefileGenerator::generateDistcleanTargets(QTextStream& t) |
|
2134 |
{ |
|
2135 |
t << "dodistclean:" << endl; |
|
2136 |
const QStringList &subdirs = project->values("SUBDIRS"); |
|
2137 |
foreach(QString item, subdirs) { |
|
2138 |
bool fromFile = false; |
|
2139 |
QString fixedItem; |
|
2140 |
if (!project->isEmpty(item + ".file")) { |
|
2141 |
fixedItem = project->first(item + ".file"); |
|
2142 |
fromFile = true; |
|
2143 |
} else if (!project->isEmpty(item + ".subdir")) { |
|
2144 |
fixedItem = project->first(item + ".subdir"); |
|
2145 |
fromFile = false; |
|
2146 |
} else { |
|
2147 |
fromFile = item.endsWith(Option::pro_ext); |
|
2148 |
fixedItem = item; |
|
2149 |
} |
|
2150 |
QFileInfo fi(fileInfo(fixedItem)); |
|
2151 |
if (!fromFile) { |
|
2152 |
t << "\t-$(MAKE) -f \"" << Option::fixPathToTargetOS(fi.absoluteFilePath() + "/Makefile") << "\" dodistclean" << endl; |
|
2153 |
} else { |
|
2154 |
QString itemName = fi.fileName(); |
|
2155 |
int extIndex = itemName.lastIndexOf(Option::pro_ext); |
|
2156 |
if (extIndex) |
|
2157 |
fixedItem = fi.absolutePath() + "/" + QString("Makefile.") + itemName.mid(0, extIndex); |
|
2158 |
t << "\t-$(MAKE) -f \"" << Option::fixPathToTargetOS(fixedItem) << "\" dodistclean" << endl; |
|
2159 |
} |
|
2160 |
||
2161 |
} |
|
2162 |
||
2163 |
generatedFiles << Option::fixPathToTargetOS(fileInfo(Option::output.fileName()).absoluteFilePath()); // bld.inf |
|
2164 |
generatedFiles << project->values("QMAKE_INTERNAL_PRL_FILE"); // Add generated prl files for cleanup |
|
2165 |
generatedFiles << project->values("QMAKE_DISTCLEAN"); // Add any additional files marked for distclean |
|
2166 |
QStringList fixedFiles; |
|
2167 |
QStringList fixedDirs; |
|
2168 |
foreach(QString item, generatedFiles) { |
|
2169 |
QString fixedItem = Option::fixPathToTargetOS(fileInfo(item).absoluteFilePath()); |
|
2170 |
if (!fixedFiles.contains(fixedItem)) { |
|
2171 |
fixedFiles << fixedItem; |
|
2172 |
} |
|
2173 |
} |
|
2174 |
foreach(QString item, generatedDirs) { |
|
2175 |
QString fixedItem = Option::fixPathToTargetOS(fileInfo(item).absoluteFilePath()); |
|
2176 |
if (!fixedDirs.contains(fixedItem)) { |
|
2177 |
fixedDirs << fixedItem; |
|
2178 |
} |
|
2179 |
} |
|
2180 |
generateCleanCommands(t, fixedFiles, "$(DEL_FILE)", "", "", ""); |
|
2181 |
generateCleanCommands(t, fixedDirs, "$(DEL_DIR)", "", "", ""); |
|
2182 |
t << endl; |
|
2183 |
||
2184 |
t << "distclean: clean dodistclean" << endl; |
|
2185 |
t << endl; |
|
2186 |
} |
|
4
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
2187 |
|
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
2188 |
void SymbianMakefileGenerator::generateExecutionTargets(QTextStream& t, const QStringList& platforms) |
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
2189 |
{ |
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
2190 |
// create execution targets |
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
2191 |
if (targetType == TypeExe) { |
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
2192 |
if (platforms.contains("winscw")) { |
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
2193 |
t << "run:" << endl; |
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
2194 |
t << "\t-call " << epocRoot() << "epoc32/release/winscw/udeb/" << fixedTarget << ".exe " << "$(QT_RUN_OPTIONS)" << endl; |
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
2195 |
} |
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
2196 |
t << "runonphone: sis" << endl; |
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
2197 |
t << "\trunonphone $(QT_RUN_ON_PHONE_OPTIONS) --sis " << fixedTarget << "_$(QT_SIS_TARGET).sis " << fixedTarget << ".exe " << "$(QT_RUN_OPTIONS)" << endl; |
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
2198 |
t << endl; |
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
2199 |
} |
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
2200 |
} |