source: trunk/qmake/generators/symbian/symmake.h@ 591

Last change on this file since 591 was 561, checked in by Dmitry A. Kuminov, 16 years ago

trunk: Merged in qt 4.6.1 sources.

  • Property svn:eol-style set to native
File size: 6.4 KB
Line 
1/****************************************************************************
2**
3** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
4** All rights reserved.
5** Contact: Nokia Corporation ([email protected])
6**
7** This file is part of the qmake application of the Qt Toolkit.
8**
9** $QT_BEGIN_LICENSE:LGPL$
10** Commercial Usage
11** Licensees holding valid Qt Commercial licenses may use this file in
12** accordance with the Qt Commercial License Agreement provided with the
13** Software or, alternatively, in accordance with the terms contained in
14** a written agreement between you and Nokia.
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** GNU General Public License Usage
29** Alternatively, this file may be used under the terms of the GNU
30** General Public License version 3.0 as published by the Free Software
31** Foundation and appearing in the file LICENSE.GPL included in the
32** packaging of this file. Please review the following information to
33** ensure the GNU General Public License version 3.0 requirements will be
34** met: http://www.gnu.org/copyleft/gpl.html.
35**
36** If you have questions regarding the use of this file, please contact
37** Nokia at [email protected].
38** $QT_END_LICENSE$
39**
40****************************************************************************/
41
42#ifndef SYMMAKEFILE_H
43#define SYMMAKEFILE_H
44
45#include <makefile.h>
46
47QT_BEGIN_NAMESPACE
48
49#define BLD_INF_FILENAME "bld.inf"
50#define MAKEFILE_DEPENDENCY_SEPARATOR " \\\n\t"
51
52#define QT_EXTRA_INCLUDE_DIR "tmp"
53#define MAKE_CACHE_NAME ".make.cache"
54
55class SymbianMakefileGenerator : public MakefileGenerator
56{
57protected:
58 enum TargetType {
59 TypeExe,
60 TypeDll,
61 TypeLib,
62 TypePlugin,
63 TypeSubdirs
64 };
65
66 QString platform;
67 QString uid2;
68 QString uid3;
69 QString privateDirUid;
70 TargetType targetType;
71 QMap<QString, QStringList> sources;
72 QMap<QString, QStringList> systeminclude;
73 QMap<QString, QStringList> library;
74 // (output file) (source , command)
75 QMap<QString, QStringList> makmakeCommands;
76 QStringList overriddenMmpKeywords;
77
78 QStringList generatedFiles;
79 QStringList generatedDirs;
80 QHash<QString, QString> qt2S60LangMapTable;
81
82 QString fixedTarget;
83
84 void removeSpecialCharacters(QString& str);
85 QString fixPathForMmp(const QString& origPath, const QDir& parentDir);
86 QString canonizePath(const QString& origPath);
87
88 virtual bool writeMakefile(QTextStream &t);
89 void generatePkgFile(const QString &iconFile);
90 bool containsStartWithItem(const QChar &c, const QStringList& src);
91
92 virtual void init();
93
94 QString getTargetExtension();
95
96 QString generateUID3();
97
98 void initMmpVariables();
99 void handleMmpRulesOverrides(QString &checkString,
100 bool &inResourceBlock,
101 QStringList &restrictedMmpKeywords,
102 const QStringList &restrictableMmpKeywords,
103 const QStringList &overridableMmpKeywords);
104 void appendKeywordIfMatchFound(QStringList &list,
105 const QStringList &keywordList,
106 QString &checkString);
107
108 void writeHeader(QTextStream &t);
109 void writeBldInfContent(QTextStream& t, bool addDeploymentExtension, const QString &iconFile);
110
111 static bool removeDuplicatedStrings(QStringList& stringList);
112
113 void writeMmpFileHeader(QTextStream &t);
114 void writeMmpFile(QString &filename, QStringList &symbianLangCodes);
115 void writeMmpFileMacrosPart(QTextStream& t);
116 void addMacro(QTextStream& t, const QString& value);
117 void writeMmpFileTargetPart(QTextStream& t);
118 void writeMmpFileResourcePart(QTextStream& t, QStringList &symbianLangCodes);
119 void writeMmpFileSystemIncludePart(QTextStream& t);
120 void writeMmpFileIncludePart(QTextStream& t);
121 void writeMmpFileLibraryPart(QTextStream& t);
122 void writeMmpFileCapabilityPart(QTextStream& t);
123 void writeMmpFileCompilerOptionPart(QTextStream& t);
124 void writeMmpFileBinaryVersionPart(QTextStream& t);
125 void writeMmpFileRulesPart(QTextStream& t);
126
127 void writeCustomDefFile();
128
129 void writeRegRssFile(QStringList &useritems);
130 void writeRssFile(QString &numberOfIcons, QString &iconfile);
131 void writeLocFile(QStringList &symbianLangCodes);
132 void readRssRules(QString &numberOfIcons, QString &iconFile, QStringList &userRssRules);
133
134 QStringList symbianLangCodesFromTsFiles();
135 void fillQt2S60LangMapTable();
136
137 void appendIfnotExist(QStringList &list, QString value);
138 void appendIfnotExist(QStringList &list, QStringList values);
139
140 QString removePathSeparators(QString &file);
141 QString removeTrailingPathSeparators(QString &file);
142 void generateCleanCommands(QTextStream& t,
143 const QStringList& toClean,
144 const QString& cmd,
145 const QString& cmdOptions,
146 const QString& itemPrefix,
147 const QString& itemSuffix);
148
149 void writeSisTargets(QTextStream &t);
150 void generateDistcleanTargets(QTextStream& t);
151 void generateExecutionTargets(QTextStream& t, const QStringList& platforms);
152
153 // Subclass implements
154 virtual void writeBldInfExtensionRulesPart(QTextStream& t, const QString &iconTargetFile) = 0;
155 virtual void writeBldInfMkFilePart(QTextStream& t, bool addDeploymentExtension) = 0;
156 virtual void writeMkFile(const QString& wrapperFileName, bool deploymentOnly) = 0;
157 virtual void writeWrapperMakefile(QFile& wrapperFile, bool isPrimaryMakefile) = 0;
158 virtual void appendAbldTempDirs(QStringList& sysincspaths, QString includepath) = 0;
159
160public:
161
162 SymbianMakefileGenerator();
163 ~SymbianMakefileGenerator();
164};
165
166#endif // SYMMAKEFILE_H
Note: See TracBrowser for help on using the repository browser.