author | Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> |
Fri, 19 Feb 2010 23:40:16 +0200 | |
branch | RCL_3 |
changeset 4 | 3b1da2848fc7 |
parent 3 | 41300fa6a67c |
child 5 | d3bac044e0f0 |
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 |
#ifndef SYMMAKEFILE_H |
|
43 |
#define SYMMAKEFILE_H |
|
44 |
||
4
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
45 |
#include "initprojectdeploy_symbian.h" |
0 | 46 |
#include <makefile.h> |
47 |
||
48 |
QT_BEGIN_NAMESPACE |
|
49 |
||
50 |
#define BLD_INF_FILENAME "bld.inf" |
|
51 |
#define MAKEFILE_DEPENDENCY_SEPARATOR " \\\n\t" |
|
52 |
||
53 |
#define QT_EXTRA_INCLUDE_DIR "tmp" |
|
54 |
#define MAKE_CACHE_NAME ".make.cache" |
|
55 |
||
56 |
class SymbianMakefileGenerator : public MakefileGenerator |
|
57 |
{ |
|
58 |
protected: |
|
59 |
enum TargetType { |
|
60 |
TypeExe, |
|
61 |
TypeDll, |
|
62 |
TypeLib, |
|
63 |
TypePlugin, |
|
64 |
TypeSubdirs |
|
65 |
}; |
|
66 |
||
67 |
QString platform; |
|
68 |
QString uid2; |
|
69 |
QString uid3; |
|
70 |
QString privateDirUid; |
|
71 |
TargetType targetType; |
|
72 |
QMap<QString, QStringList> sources; |
|
73 |
QMap<QString, QStringList> systeminclude; |
|
74 |
QMap<QString, QStringList> library; |
|
75 |
// (output file) (source , command) |
|
76 |
QMap<QString, QStringList> makmakeCommands; |
|
77 |
QStringList overriddenMmpKeywords; |
|
78 |
||
79 |
QStringList generatedFiles; |
|
80 |
QStringList generatedDirs; |
|
81 |
QHash<QString, QString> qt2S60LangMapTable; |
|
82 |
||
83 |
QString fixedTarget; |
|
84 |
||
85 |
void removeSpecialCharacters(QString& str); |
|
86 |
QString fixPathForMmp(const QString& origPath, const QDir& parentDir); |
|
87 |
QString canonizePath(const QString& origPath); |
|
88 |
||
89 |
virtual bool writeMakefile(QTextStream &t); |
|
4
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
90 |
void generatePkgFile(const QString &iconFile, DeploymentList &depList); |
0 | 91 |
bool containsStartWithItem(const QChar &c, const QStringList& src); |
92 |
||
93 |
virtual void init(); |
|
94 |
||
95 |
QString getTargetExtension(); |
|
96 |
||
97 |
QString generateUID3(); |
|
98 |
||
99 |
void initMmpVariables(); |
|
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
100 |
void handleMmpRulesOverrides(QString &checkString, |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
101 |
bool &inResourceBlock, |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
102 |
QStringList &restrictedMmpKeywords, |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
103 |
const QStringList &restrictableMmpKeywords, |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
104 |
const QStringList &overridableMmpKeywords); |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
105 |
void appendKeywordIfMatchFound(QStringList &list, |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
106 |
const QStringList &keywordList, |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
107 |
QString &checkString); |
0 | 108 |
|
109 |
void writeHeader(QTextStream &t); |
|
110 |
void writeExportPart(QTextStream &t); |
|
4
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
111 |
void writeBldInfContent(QTextStream& t, bool addDeploymentExtension, const QString &iconFile, DeploymentList &depList); |
0 | 112 |
|
113 |
static bool removeDuplicatedStrings(QStringList& stringList); |
|
114 |
||
115 |
void writeMmpFileHeader(QTextStream &t); |
|
116 |
void writeMmpFile(QString &filename, QStringList &symbianLangCodes); |
|
117 |
void writeMmpFileMacrosPart(QTextStream& t); |
|
118 |
void addMacro(QTextStream& t, const QString& value); |
|
119 |
void writeMmpFileTargetPart(QTextStream& t); |
|
120 |
void writeMmpFileResourcePart(QTextStream& t, QStringList &symbianLangCodes); |
|
121 |
void writeMmpFileSystemIncludePart(QTextStream& t); |
|
122 |
void writeMmpFileIncludePart(QTextStream& t); |
|
123 |
void writeMmpFileLibraryPart(QTextStream& t); |
|
124 |
void writeMmpFileCapabilityPart(QTextStream& t); |
|
125 |
void writeMmpFileCompilerOptionPart(QTextStream& t); |
|
126 |
void writeMmpFileBinaryVersionPart(QTextStream& t); |
|
127 |
void writeMmpFileRulesPart(QTextStream& t); |
|
128 |
||
129 |
void writeCustomDefFile(); |
|
130 |
||
131 |
void writeRegRssFile(QStringList &useritems); |
|
132 |
void writeRssFile(QString &numberOfIcons, QString &iconfile); |
|
133 |
void writeLocFile(QStringList &symbianLangCodes); |
|
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
134 |
void writeSymbianLocFile(QStringList &symbianLangCodes); |
0 | 135 |
void readRssRules(QString &numberOfIcons, QString &iconFile, QStringList &userRssRules); |
136 |
||
137 |
QStringList symbianLangCodesFromTsFiles(); |
|
138 |
void fillQt2S60LangMapTable(); |
|
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
139 |
void modifyQt2S60LangMapTable(); |
0 | 140 |
|
141 |
void appendIfnotExist(QStringList &list, QString value); |
|
142 |
void appendIfnotExist(QStringList &list, QStringList values); |
|
143 |
||
144 |
QString removePathSeparators(QString &file); |
|
145 |
QString removeTrailingPathSeparators(QString &file); |
|
146 |
void generateCleanCommands(QTextStream& t, |
|
147 |
const QStringList& toClean, |
|
148 |
const QString& cmd, |
|
149 |
const QString& cmdOptions, |
|
150 |
const QString& itemPrefix, |
|
151 |
const QString& itemSuffix); |
|
152 |
||
153 |
void writeSisTargets(QTextStream &t); |
|
154 |
void generateDistcleanTargets(QTextStream& t); |
|
4
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
155 |
void generateExecutionTargets(QTextStream& t, const QStringList& platforms); |
0 | 156 |
|
157 |
// Subclass implements |
|
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
158 |
virtual void writeBldInfExtensionRulesPart(QTextStream& t, const QString &iconTargetFile) = 0; |
0 | 159 |
virtual void writeBldInfMkFilePart(QTextStream& t, bool addDeploymentExtension) = 0; |
160 |
virtual void writeMkFile(const QString& wrapperFileName, bool deploymentOnly) = 0; |
|
161 |
virtual void writeWrapperMakefile(QFile& wrapperFile, bool isPrimaryMakefile) = 0; |
|
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
162 |
virtual void appendAbldTempDirs(QStringList& sysincspaths, QString includepath) = 0; |
0 | 163 |
|
164 |
public: |
|
165 |
||
166 |
SymbianMakefileGenerator(); |
|
167 |
~SymbianMakefileGenerator(); |
|
168 |
}; |
|
169 |
||
170 |
#endif // SYMMAKEFILE_H |