1 | /****************************************************************************
|
---|
2 | **
|
---|
3 | ** Copyright (C) 2011 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 "initprojectdeploy_symbian.h"
|
---|
46 | #include "symbiancommon.h"
|
---|
47 | #include <makefile.h>
|
---|
48 |
|
---|
49 | QT_BEGIN_NAMESPACE
|
---|
50 |
|
---|
51 | #define BLD_INF_FILENAME "bld.inf"
|
---|
52 | #define MAKEFILE_DEPENDENCY_SEPARATOR " \\\n\t"
|
---|
53 | #define QT_EXTRA_INCLUDE_DIR "tmp"
|
---|
54 | #define MAKE_CACHE_NAME ".make.cache"
|
---|
55 | #define SYMBIAN_TEST_CONFIG "symbian_test"
|
---|
56 |
|
---|
57 | class SymbianMakefileGenerator : public MakefileGenerator, public SymbianCommonGenerator
|
---|
58 | {
|
---|
59 | protected:
|
---|
60 | QString platform;
|
---|
61 | QString uid2;
|
---|
62 | QString mmpFileName;
|
---|
63 | QMap<QString, QStringList> sources;
|
---|
64 | QMap<QString, QStringList> systeminclude;
|
---|
65 | QMap<QString, QStringList> library;
|
---|
66 | // (output file) (source , command)
|
---|
67 | QMap<QString, QStringList> makmakeCommands;
|
---|
68 | QStringList overriddenMmpKeywords;
|
---|
69 |
|
---|
70 | QString fixPathForMmp(const QString& origPath, const QDir& parentDir);
|
---|
71 | QString absolutizePath(const QString& origPath);
|
---|
72 |
|
---|
73 | virtual bool writeMakefile(QTextStream &t);
|
---|
74 |
|
---|
75 | virtual void init();
|
---|
76 |
|
---|
77 | QString getTargetExtension();
|
---|
78 |
|
---|
79 | QString generateUID3();
|
---|
80 |
|
---|
81 | void initMmpVariables();
|
---|
82 | void generateMmpFileName();
|
---|
83 | void handleMmpRulesOverrides(QString &checkString,
|
---|
84 | bool &inResourceBlock,
|
---|
85 | QStringList &restrictedMmpKeywords,
|
---|
86 | const QStringList &restrictableMmpKeywords,
|
---|
87 | const QStringList &overridableMmpKeywords);
|
---|
88 | void appendKeywordIfMatchFound(QStringList &list,
|
---|
89 | const QStringList &keywordList,
|
---|
90 | QString &checkString);
|
---|
91 |
|
---|
92 | void writeHeader(QTextStream &t);
|
---|
93 | void writeBldInfContent(QTextStream& t,
|
---|
94 | bool addDeploymentExtension,
|
---|
95 | const QString &iconFile);
|
---|
96 |
|
---|
97 | static bool removeDuplicatedStrings(QStringList& stringList);
|
---|
98 |
|
---|
99 | void writeMmpFileHeader(QTextStream &t);
|
---|
100 | void writeMmpFile(QString &filename, const SymbianLocalizationList &symbianLocalizationList);
|
---|
101 | void writeMmpFileMacrosPart(QTextStream& t);
|
---|
102 | void addMacro(QTextStream& t, const QString& value);
|
---|
103 | void writeMmpFileTargetPart(QTextStream& t);
|
---|
104 | void writeMmpFileResourcePart(QTextStream& t, const SymbianLocalizationList &symbianLocalizationList);
|
---|
105 | void writeMmpFileSystemIncludePart(QTextStream& t);
|
---|
106 | void writeMmpFileIncludePart(QTextStream& t);
|
---|
107 | void writeMmpFileLibraryPart(QTextStream& t);
|
---|
108 | void writeMmpFileCapabilityPart(QTextStream& t);
|
---|
109 | void writeMmpFileConditionalOptions(QTextStream& t,
|
---|
110 | const QString &optionType,
|
---|
111 | const QString &optionTag,
|
---|
112 | const QString &variableBase);
|
---|
113 | void writeMmpFileSimpleOption(QTextStream& t,
|
---|
114 | const QString &optionType,
|
---|
115 | const QString &optionTag,
|
---|
116 | const QString &options);
|
---|
117 | void appendMmpFileOptions(QString &options, const QStringList &list);
|
---|
118 | void writeMmpFileCompilerOptionPart(QTextStream& t);
|
---|
119 | void writeMmpFileBinaryVersionPart(QTextStream& t);
|
---|
120 | void writeMmpFileRulesPart(QTextStream& t);
|
---|
121 |
|
---|
122 | void appendIfnotExist(QStringList &list, QString value);
|
---|
123 | void appendIfnotExist(QStringList &list, QStringList values);
|
---|
124 |
|
---|
125 | QString removeTrailingPathSeparators(QString &file);
|
---|
126 | void generateCleanCommands(QTextStream& t,
|
---|
127 | const QStringList& toClean,
|
---|
128 | const QString& cmd,
|
---|
129 | const QString& cmdOptions,
|
---|
130 | const QString& itemPrefix,
|
---|
131 | const QString& itemSuffix);
|
---|
132 |
|
---|
133 | void generateDistcleanTargets(QTextStream& t);
|
---|
134 | QString generateLocFileTarget(QTextStream& t, const QString& locCmd);
|
---|
135 |
|
---|
136 | // Subclass implements
|
---|
137 | virtual void writeBldInfExtensionRulesPart(QTextStream& t, const QString &iconTargetFile) = 0;
|
---|
138 | virtual void writeBldInfMkFilePart(QTextStream& t, bool addDeploymentExtension) = 0;
|
---|
139 | virtual void writeMkFile(const QString& wrapperFileName, bool deploymentOnly) = 0;
|
---|
140 | virtual void writeWrapperMakefile(QFile& wrapperFile, bool isPrimaryMakefile) = 0;
|
---|
141 | virtual void appendAbldTempDirs(QStringList& sysincspaths, QString includepath) = 0;
|
---|
142 |
|
---|
143 | public:
|
---|
144 |
|
---|
145 | SymbianMakefileGenerator();
|
---|
146 | ~SymbianMakefileGenerator();
|
---|
147 | };
|
---|
148 |
|
---|
149 | #endif // SYMMAKEFILE_H
|
---|