0
|
1 |
/****************************************************************************
|
|
2 |
**
|
|
3 |
** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
|
|
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_abld.h"
|
|
43 |
#include "initprojectdeploy_symbian.h"
|
|
44 |
|
|
45 |
#include <qstring.h>
|
|
46 |
#include <qstringlist.h>
|
|
47 |
#include <qdir.h>
|
|
48 |
#include <qdatetime.h>
|
|
49 |
#include <qdebug.h>
|
|
50 |
|
|
51 |
#define DO_NOTHING_TARGET "do_nothing"
|
|
52 |
#define CREATE_TEMPS_TARGET "create_temps"
|
|
53 |
#define EXTENSION_CLEAN "extension_clean"
|
|
54 |
#define PRE_TARGETDEPS_TARGET "pre_targetdeps"
|
|
55 |
#define COMPILER_CLEAN_TARGET "compiler_clean"
|
|
56 |
#define FINALIZE_TARGET "finalize"
|
|
57 |
#define GENERATED_SOURCES_TARGET "generated_sources"
|
|
58 |
#define ALL_SOURCE_DEPS_TARGET "all_source_deps"
|
|
59 |
//:QTP:QTPROD-92 Deployment of plugins requires WINSCW build before ARM build
|
|
60 |
#define DEPLOYMENT_TARGET "deployment"
|
|
61 |
#define DEPLOYMENT_CLEAN_TARGET "deployment_clean"
|
|
62 |
#define WINSCW_DEPLOYMENT_TARGET "winscw_deployment"
|
|
63 |
#define WINSCW_DEPLOYMENT_CLEAN_TARGET "winscw_deployment_clean"
|
|
64 |
/* :QTP:QTPROD-155: Don't write .make.cache during the compilation, it causes dependency problems in
|
|
65 |
* the parallel build clusters
|
|
66 |
*/
|
|
67 |
#define STORE_BUILD_TARGET ""
|
|
68 |
|
|
69 |
SymbianAbldMakefileGenerator::SymbianAbldMakefileGenerator() : SymbianMakefileGenerator() { }
|
|
70 |
SymbianAbldMakefileGenerator::~SymbianAbldMakefileGenerator() { }
|
|
71 |
|
|
72 |
void SymbianAbldMakefileGenerator::writeMkFile(const QString& wrapperFileName, bool deploymentOnly)
|
|
73 |
{
|
|
74 |
QString gnuMakefileName = QLatin1String("Makefile_") + uid3;
|
|
75 |
removeSpecialCharacters(gnuMakefileName);
|
|
76 |
gnuMakefileName.append(".mk");
|
|
77 |
|
|
78 |
QFile ft(gnuMakefileName);
|
|
79 |
if (ft.open(QIODevice::WriteOnly)) {
|
|
80 |
if (Option::mkfile::listgen) {
|
|
81 |
generatePrint(fileInfo(ft.fileName()).absoluteFilePath());
|
|
82 |
}
|
|
83 |
generatedFiles << ft.fileName();
|
|
84 |
QTextStream t(&ft);
|
|
85 |
|
|
86 |
t << "# ==============================================================================" << endl;
|
|
87 |
t << "# Generated by qmake (" << qmake_version() << ") (Qt " << QT_VERSION_STR << ") on: ";
|
|
88 |
t << QDateTime::currentDateTime().toString() << endl;
|
|
89 |
t << "# This file is generated by qmake and should not be modified by the" << endl;
|
|
90 |
t << "# user." << endl;
|
|
91 |
t << "# Name : " << gnuMakefileName << endl;
|
|
92 |
t << "# Part of : " << project->values("TARGET").join(" ") << endl;
|
|
93 |
t << "# Description : This file is used to call necessary targets on wrapper makefile" << endl;
|
|
94 |
t << "# during normal Symbian build process." << endl;
|
|
95 |
t << "# Version : " << endl;
|
|
96 |
t << "#" << endl;
|
|
97 |
t << "# ==============================================================================" << "\n" << endl;
|
|
98 |
|
|
99 |
t << endl << endl;
|
|
100 |
|
|
101 |
t << "MAKE = make" << endl;
|
|
102 |
t << endl;
|
|
103 |
|
|
104 |
t << "VISUAL_CFG = RELEASE" << endl;
|
|
105 |
t << "ifeq \"$(CFG)\" \"UDEB\"" << endl;
|
|
106 |
t << "VISUAL_CFG = DEBUG" << endl;
|
|
107 |
t << "endif" << endl;
|
|
108 |
t << endl;
|
|
109 |
|
|
110 |
t << DO_NOTHING_TARGET " :" << endl;
|
|
111 |
t << "\t" << "@rem " DO_NOTHING_TARGET << endl << endl;
|
|
112 |
|
|
113 |
QString buildDeps;
|
|
114 |
QString cleanDeps;
|
|
115 |
QString finalDeps;
|
|
116 |
QString cleanDepsWinscw;
|
|
117 |
QString finalDepsWinscw;
|
|
118 |
QStringList wrapperTargets;
|
|
119 |
//:QTP:QTPROD-92 Deployment of plugins requires WINSCW build before ARM build
|
|
120 |
if (deploymentOnly) {
|
|
121 |
buildDeps.append(STORE_BUILD_TARGET);
|
|
122 |
cleanDeps.append(DEPLOYMENT_CLEAN_TARGET);
|
|
123 |
cleanDepsWinscw.append(WINSCW_DEPLOYMENT_CLEAN_TARGET);
|
|
124 |
finalDeps.append(DEPLOYMENT_TARGET);
|
|
125 |
finalDepsWinscw.append(WINSCW_DEPLOYMENT_TARGET);
|
|
126 |
wrapperTargets << WINSCW_DEPLOYMENT_TARGET
|
|
127 |
<< WINSCW_DEPLOYMENT_CLEAN_TARGET
|
|
128 |
<< DEPLOYMENT_TARGET
|
|
129 |
<< DEPLOYMENT_CLEAN_TARGET
|
|
130 |
<< STORE_BUILD_TARGET;
|
|
131 |
} else {
|
|
132 |
buildDeps.append(CREATE_TEMPS_TARGET " " PRE_TARGETDEPS_TARGET " " STORE_BUILD_TARGET);
|
|
133 |
cleanDeps.append(EXTENSION_CLEAN " " DEPLOYMENT_CLEAN_TARGET);
|
|
134 |
cleanDepsWinscw.append(EXTENSION_CLEAN " " WINSCW_DEPLOYMENT_CLEAN_TARGET);
|
|
135 |
finalDeps.append(FINALIZE_TARGET " " DEPLOYMENT_TARGET);
|
|
136 |
finalDepsWinscw.append(FINALIZE_TARGET " " WINSCW_DEPLOYMENT_TARGET);
|
|
137 |
wrapperTargets << PRE_TARGETDEPS_TARGET
|
|
138 |
<< CREATE_TEMPS_TARGET
|
|
139 |
<< EXTENSION_CLEAN
|
|
140 |
<< FINALIZE_TARGET
|
|
141 |
<< WINSCW_DEPLOYMENT_CLEAN_TARGET
|
|
142 |
<< WINSCW_DEPLOYMENT_TARGET
|
|
143 |
<< DEPLOYMENT_CLEAN_TARGET
|
|
144 |
<< DEPLOYMENT_TARGET
|
|
145 |
<< STORE_BUILD_TARGET;
|
|
146 |
}
|
|
147 |
|
|
148 |
t << "MAKMAKE: " << buildDeps << endl << endl;
|
|
149 |
t << "LIB: " << buildDeps << endl << endl;
|
|
150 |
t << "BLD: " << buildDeps << endl << endl;
|
|
151 |
t << "ifeq \"$(PLATFORM)\" \"WINSCW\"" << endl;
|
|
152 |
t << "CLEAN: " << cleanDepsWinscw << endl;
|
|
153 |
t << "else" << endl;
|
|
154 |
t << "CLEAN: " << cleanDeps << endl;
|
|
155 |
t << "endif" << endl << endl;
|
|
156 |
t << "CLEANLIB: " DO_NOTHING_TARGET << endl << endl;
|
|
157 |
t << "RESOURCE: " DO_NOTHING_TARGET << endl << endl;
|
|
158 |
t << "FREEZE: " DO_NOTHING_TARGET << endl << endl;
|
|
159 |
t << "SAVESPACE: " DO_NOTHING_TARGET << endl << endl;
|
|
160 |
t << "RELEASABLES: " DO_NOTHING_TARGET << endl << endl;
|
|
161 |
t << "ifeq \"$(PLATFORM)\" \"WINSCW\"" << endl;
|
|
162 |
t << "FINAL: " << finalDepsWinscw << endl;
|
|
163 |
t << "else" << endl;
|
|
164 |
t << "FINAL: " << finalDeps << endl;
|
|
165 |
t << "endif" << endl << endl;
|
|
166 |
|
|
167 |
QString makefile(Option::fixPathToTargetOS(fileInfo(wrapperFileName).canonicalFilePath()));
|
|
168 |
foreach(QString target, wrapperTargets) {
|
|
169 |
t << target << " : " << makefile << endl;
|
|
170 |
t << "\t-$(MAKE) -f \"" << makefile << "\" " << target << " QT_SIS_TARGET=$(VISUAL_CFG)-$(PLATFORM)" << endl << endl;
|
|
171 |
}
|
|
172 |
|
|
173 |
t << endl;
|
|
174 |
} // if(ft.open(QIODevice::WriteOnly))
|
|
175 |
}
|
|
176 |
|
|
177 |
void SymbianAbldMakefileGenerator::writeWrapperMakefile(QFile& wrapperFile, bool isPrimaryMakefile)
|
|
178 |
{
|
|
179 |
QStringList allPlatforms;
|
|
180 |
foreach(QString platform, project->values("SYMBIAN_PLATFORMS")) {
|
|
181 |
allPlatforms << platform.toLower();
|
|
182 |
}
|
|
183 |
|
|
184 |
QStringList debugPlatforms = allPlatforms;
|
|
185 |
QStringList releasePlatforms = allPlatforms;
|
|
186 |
releasePlatforms.removeAll("winscw"); // No release for emulator
|
|
187 |
|
|
188 |
QString testClause;
|
|
189 |
if (project->values("CONFIG").contains("symbian_test", Qt::CaseInsensitive))
|
|
190 |
testClause = QLatin1String(" test");
|
|
191 |
else
|
|
192 |
testClause = QLatin1String("");
|
|
193 |
|
|
194 |
QTextStream t(&wrapperFile);
|
|
195 |
|
|
196 |
t << "# ==============================================================================" << endl;
|
|
197 |
t << "# Generated by qmake (" << qmake_version() << ") (Qt " << QT_VERSION_STR << ") on: ";
|
|
198 |
t << QDateTime::currentDateTime().toString() << endl;
|
|
199 |
t << "# This file is generated by qmake and should not be modified by the" << endl;
|
|
200 |
t << "# user." << endl;
|
|
201 |
t << "# Name : " << wrapperFile.fileName() << endl;
|
|
202 |
t << "# Description : Wrapper Makefile for calling Symbian build tools" << endl;
|
|
203 |
t << "#" << endl;
|
|
204 |
t << "# ==============================================================================" << "\n" << endl;
|
|
205 |
t << endl;
|
|
206 |
|
|
207 |
t << "MAKEFILE = " << wrapperFile.fileName() << endl;
|
|
208 |
t << "QMAKE = " << Option::fixPathToTargetOS(var("QMAKE_QMAKE")) << endl;
|
|
209 |
t << "DEL_FILE = " << var("QMAKE_DEL_FILE") << endl;
|
|
210 |
t << "DEL_DIR = " << var("QMAKE_DEL_DIR") << endl;
|
|
211 |
t << "MOVE = " << var("QMAKE_MOVE") << endl;
|
|
212 |
t << "XCOPY = xcopy /d /f /h /r /y /i" << endl;
|
|
213 |
t << "ABLD = ABLD.BAT" << endl;
|
|
214 |
t << "DEBUG_PLATFORMS = " << debugPlatforms.join(" ") << endl;
|
|
215 |
t << "RELEASE_PLATFORMS = " << releasePlatforms.join(" ") << endl;
|
|
216 |
t << "MAKE = make" << endl;
|
|
217 |
t << endl;
|
|
218 |
t << "ifeq (WINS,$(findstring WINS, $(PLATFORM)))" << endl;
|
|
219 |
t << "ZDIR=$(EPOCROOT)epoc32\\release\\$(PLATFORM)\\$(CFG)\\Z" << endl;
|
|
220 |
t << "else" << endl;
|
|
221 |
t << "ZDIR=$(EPOCROOT)epoc32\\data\\z" << endl;
|
|
222 |
t << "endif" << endl;
|
|
223 |
t << endl;
|
|
224 |
t << "DEFINES" << '\t' << " = "
|
|
225 |
<< varGlue("PRL_EXPORT_DEFINES","-D"," -D"," ")
|
|
226 |
<< varGlue("QMAKE_COMPILER_DEFINES", "-D", "-D", " ")
|
|
227 |
<< varGlue("DEFINES","-D"," -D","") << endl;
|
|
228 |
|
|
229 |
t << "INCPATH" << '\t' << " = ";
|
|
230 |
|
|
231 |
for (QMap<QString, QStringList>::iterator it = systeminclude.begin(); it != systeminclude.end(); ++it) {
|
|
232 |
QStringList values = it.value();
|
|
233 |
for (int i = 0; i < values.size(); ++i) {
|
|
234 |
t << " -I\"" << values.at(i) << "\"";
|
|
235 |
}
|
|
236 |
}
|
|
237 |
t << endl;
|
|
238 |
t << "first: default" << endl;
|
|
239 |
if (debugPlatforms.contains("winscw"))
|
|
240 |
t << "default: debug-winscw";
|
|
241 |
else if (debugPlatforms.contains("armv5"))
|
|
242 |
t << "default: debug-armv5";
|
|
243 |
else if (debugPlatforms.size())
|
|
244 |
t << "default: debug-" << debugPlatforms.first();
|
|
245 |
else
|
|
246 |
t << "default: all";
|
|
247 |
|
|
248 |
t << endl;
|
|
249 |
if (!isPrimaryMakefile) {
|
|
250 |
t << "all:" << endl;
|
|
251 |
} else {
|
|
252 |
t << "all: debug release" << endl;
|
|
253 |
t << endl;
|
|
254 |
t << "qmake:" << endl;
|
|
255 |
t << "\t$(QMAKE) -spec symbian-abld -o \"" << fileInfo(Option::output.fileName()).fileName()
|
|
256 |
<< "\" \"" << project->projectFile() << "\"" << endl;
|
|
257 |
t << endl;
|
|
258 |
t << BLD_INF_FILENAME ":" << endl;
|
|
259 |
t << "\t$(QMAKE)" << endl;
|
|
260 |
t << endl;
|
|
261 |
t << "$(ABLD): " BLD_INF_FILENAME << endl;
|
|
262 |
t << "\tbldmake bldfiles" << endl;
|
|
263 |
t << endl;
|
|
264 |
|
|
265 |
t << "debug: $(ABLD)" << endl;
|
|
266 |
foreach(QString item, debugPlatforms) {
|
|
267 |
t << "\t$(ABLD)" << testClause << " build " << item << " udeb" << endl;
|
|
268 |
}
|
|
269 |
t << endl;
|
|
270 |
t << "release: $(ABLD)" << endl;
|
|
271 |
foreach(QString item, releasePlatforms) {
|
|
272 |
t << "\t$(ABLD)" << testClause << " build " << item << " urel" << endl;
|
|
273 |
}
|
|
274 |
t << endl;
|
|
275 |
|
|
276 |
// For more specific builds, targets are in this form: build-platform, e.g. release-armv5
|
|
277 |
foreach(QString item, debugPlatforms) {
|
|
278 |
t << "debug-" << item << ": $(ABLD)" << endl;
|
|
279 |
t << "\t$(ABLD)" << testClause << " build " << item << " udeb" << endl;
|
|
280 |
}
|
|
281 |
|
|
282 |
foreach(QString item, releasePlatforms) {
|
|
283 |
t << "release-" << item << ": $(ABLD)" << endl;
|
|
284 |
t << "\t$(ABLD)" << testClause << " build " << item << " urel" << endl;
|
|
285 |
}
|
|
286 |
|
|
287 |
t << endl;
|
|
288 |
t << "export: $(ABLD)" << endl;
|
|
289 |
t << "\t$(ABLD)" << testClause << " export" << endl;
|
|
290 |
t << endl;
|
|
291 |
|
|
292 |
t << "cleanexport: $(ABLD)" << endl;
|
|
293 |
t << "\t$(ABLD)" << testClause << " cleanexport" << endl;
|
|
294 |
t << endl;
|
|
295 |
|
|
296 |
}
|
|
297 |
|
|
298 |
// pre_targetdeps target depends on:
|
|
299 |
// - all targets specified in PRE_TARGETDEPS
|
|
300 |
// - the GENERATED_SOURCES sources (so that they get generated)
|
|
301 |
// - all dependencies of sources targeted for compilation
|
|
302 |
// (mainly to ensure that any included UNUSED_SOURCES that need to be generated get generated)
|
|
303 |
//
|
|
304 |
// Unfortunately, Symbian build chain doesn't support linking generated objects to target,
|
|
305 |
// so supporting generating sources is the best we can do. This is enough for mocs.
|
|
306 |
|
|
307 |
if (targetType != TypeSubdirs) {
|
|
308 |
writeExtraTargets(t);
|
|
309 |
writeExtraCompilerTargets(t);
|
|
310 |
|
|
311 |
t << CREATE_TEMPS_TARGET ":" << endl;
|
|
312 |
// generate command lines like this ...
|
|
313 |
// -@ if NOT EXIST ".\somedir" mkdir ".\somedir"
|
|
314 |
QStringList dirsToClean;
|
|
315 |
for (QMap<QString, QStringList>::iterator it = systeminclude.begin(); it != systeminclude.end(); ++it) {
|
|
316 |
QStringList values = it.value();
|
|
317 |
for (int i = 0; i < values.size(); ++i) {
|
|
318 |
if (values.at(i).endsWith("/" QT_EXTRA_INCLUDE_DIR)) {
|
|
319 |
QString fixedValue(QDir::toNativeSeparators(values.at(i)));
|
|
320 |
dirsToClean << fixedValue;
|
|
321 |
t << "\t-@ if NOT EXIST \"" << fixedValue << "\" mkdir \""
|
|
322 |
<< fixedValue << "\"" << endl;
|
|
323 |
}
|
|
324 |
}
|
|
325 |
}
|
|
326 |
t << endl;
|
|
327 |
|
|
328 |
// Note: EXTENSION_CLEAN will get called many times when doing reallyclean
|
|
329 |
// This is why the "2> NUL" gets appended to generated clean targets in makefile.cpp.
|
|
330 |
t << EXTENSION_CLEAN ": " COMPILER_CLEAN_TARGET << endl;
|
|
331 |
generateCleanCommands(t, dirsToClean, var("QMAKE_DEL_DIR"), " /S /Q ", "", "");
|
|
332 |
t << endl;
|
|
333 |
|
|
334 |
t << PRE_TARGETDEPS_TARGET ":"
|
|
335 |
<< MAKEFILE_DEPENDENCY_SEPARATOR GENERATED_SOURCES_TARGET
|
|
336 |
<< MAKEFILE_DEPENDENCY_SEPARATOR ALL_SOURCE_DEPS_TARGET;
|
|
337 |
if (project->values("PRE_TARGETDEPS").size())
|
|
338 |
t << MAKEFILE_DEPENDENCY_SEPARATOR << project->values("PRE_TARGETDEPS").join(MAKEFILE_DEPENDENCY_SEPARATOR);
|
|
339 |
t << endl << endl;
|
|
340 |
t << GENERATED_SOURCES_TARGET ":";
|
|
341 |
if (project->values("GENERATED_SOURCES").size())
|
|
342 |
t << MAKEFILE_DEPENDENCY_SEPARATOR << project->values("GENERATED_SOURCES").join(MAKEFILE_DEPENDENCY_SEPARATOR);
|
|
343 |
t << endl << endl;
|
|
344 |
t << ALL_SOURCE_DEPS_TARGET ":";
|
|
345 |
|
|
346 |
QStringList allDeps;
|
|
347 |
for (QMap<QString, QStringList>::iterator it = sources.begin(); it != sources.end(); ++it) {
|
|
348 |
QString currentSourcePath = it.key();
|
|
349 |
QStringList values = it.value();
|
|
350 |
for (int i = 0; i < values.size(); ++i) {
|
|
351 |
// we need additional check
|
|
352 |
QString sourceFile = currentSourcePath + "/" + values.at(i);
|
|
353 |
QStringList deps = findDependencies(QDir::toNativeSeparators(sourceFile));
|
|
354 |
appendIfnotExist(allDeps, deps);
|
|
355 |
}
|
|
356 |
}
|
|
357 |
|
|
358 |
foreach(QString item, allDeps) {
|
|
359 |
t << MAKEFILE_DEPENDENCY_SEPARATOR << item;
|
|
360 |
}
|
|
361 |
t << endl << endl;
|
|
362 |
|
|
363 |
// Post link operations
|
|
364 |
t << FINALIZE_TARGET ":" << endl;
|
|
365 |
if (!project->isEmpty("QMAKE_POST_LINK")) {
|
|
366 |
t << '\t' << var("QMAKE_POST_LINK");
|
|
367 |
t << endl;
|
|
368 |
}
|
|
369 |
t << endl;
|
|
370 |
} else {
|
|
371 |
QList<MakefileGenerator::SubTarget*> subtargets = findSubDirsSubTargets();
|
|
372 |
writeSubTargets(t, subtargets, SubTargetSkipDefaultVariables | SubTargetSkipDefaultTargets);
|
|
373 |
qDeleteAll(subtargets);
|
|
374 |
}
|
|
375 |
|
|
376 |
writeDeploymentTargets(t);
|
|
377 |
//:QTP:QTPROD-92 Deployment of plugins requires WINSCW build before ARM build
|
|
378 |
writeDeploymentTargets(t, true);
|
|
379 |
|
|
380 |
writeSisTargets(t);
|
|
381 |
|
|
382 |
/* :QTP:QTPROD-155: Don't write .make.cache during the compilation, it causes dependency problems in
|
|
383 |
* the parallel build clusters
|
|
384 |
writeStoreBuildTarget(t);
|
|
385 |
*/
|
|
386 |
|
|
387 |
generateDistcleanTargets(t);
|
|
388 |
|
|
389 |
t << "clean: $(ABLD)" << endl;
|
|
390 |
t << "\t-$(ABLD)" << testClause << " reallyclean" << endl;
|
|
391 |
t << "\t-bldmake clean" << endl;
|
|
392 |
t << endl;
|
|
393 |
|
|
394 |
// Create execution target
|
|
395 |
if (debugPlatforms.contains("winscw") && targetType == TypeExe) {
|
|
396 |
t << "run:" << endl;
|
|
397 |
t << "\t-call " << epocRoot() << "epoc32\\release\\winscw\\udeb\\" << removePathSeparators(escapeFilePath(fileFixify(project->first("TARGET"))).append(".exe")) << endl << endl;
|
|
398 |
}
|
|
399 |
}
|
|
400 |
|
|
401 |
void SymbianAbldMakefileGenerator::writeBldInfExtensionRulesPart(QTextStream& t)
|
|
402 |
{
|
|
403 |
// We don't use extensions for anything in abld
|
|
404 |
Q_UNUSED(t);
|
|
405 |
}
|
|
406 |
|
|
407 |
//:QTP:QTPROD-92 Deployment of plugins requires WINSCW build before ARM build
|
|
408 |
bool SymbianAbldMakefileGenerator::writeDeploymentTargets(QTextStream &t, bool isRelease /*= false*/)
|
|
409 |
{
|
|
410 |
if (isRelease)
|
|
411 |
t << DEPLOYMENT_TARGET ":" << endl;
|
|
412 |
else
|
|
413 |
t << WINSCW_DEPLOYMENT_TARGET ":" << endl;
|
|
414 |
|
|
415 |
QString remoteTestPath = epocRoot() + QLatin1String( isRelease?"epoc32\\data\\z\\private\\":"epoc32\\winscw\\c\\private\\")
|
|
416 |
+ privateDirUid; // default 4 OpenC; 4 all Symbian too
|
|
417 |
DeploymentList depList;
|
|
418 |
|
|
419 |
initProjectDeploySymbian(project, depList, remoteTestPath, false, QLatin1String(isRelease?"armv5":"winscw"), QLatin1String(isRelease?"urel":"udeb"),
|
|
420 |
generatedDirs, generatedFiles);
|
|
421 |
|
|
422 |
if (depList.size())
|
|
423 |
t << "\t-echo Deploying changed files..." << endl;
|
|
424 |
for (int i = 0; i < depList.size(); ++i) {
|
|
425 |
// Xcopy prompts for selecting file or directory if target doesn't exist,
|
|
426 |
// and doesn't provide switch to force file selection. It does provide dir forcing, though,
|
|
427 |
// so strip the last part of the destination.
|
|
428 |
t << "\t-$(XCOPY) \"" << depList.at(i).from << "\" \"" << depList.at(i).to.left(depList.at(i).to.lastIndexOf("\\") + 1) << "\"" << endl;
|
|
429 |
}
|
|
430 |
|
|
431 |
t << endl;
|
|
432 |
|
|
433 |
if (isRelease)
|
|
434 |
t << DEPLOYMENT_CLEAN_TARGET ":" << endl;
|
|
435 |
else
|
|
436 |
t << WINSCW_DEPLOYMENT_CLEAN_TARGET ":" << endl;
|
|
437 |
|
|
438 |
QStringList cleanList;
|
|
439 |
for (int i = 0; i < depList.size(); ++i) {
|
|
440 |
cleanList.append(depList.at(i).to);
|
|
441 |
}
|
|
442 |
generateCleanCommands(t, cleanList, "$(DEL_FILE)", "", "", "");
|
|
443 |
|
|
444 |
// Note: If deployment creates any directories, they will not get deleted after cleanup.
|
|
445 |
// To do this in robust fashion could be quite complex.
|
|
446 |
|
|
447 |
t << endl;
|
|
448 |
|
|
449 |
return true;
|
|
450 |
}
|
|
451 |
|
|
452 |
void SymbianAbldMakefileGenerator::writeStoreBuildTarget(QTextStream &t)
|
|
453 |
{
|
|
454 |
t << STORE_BUILD_TARGET ":" << endl;
|
|
455 |
t << "\t@echo # ============================================================================== > " MAKE_CACHE_NAME << endl;
|
|
456 |
t << "\t@echo # This file is generated by make and should not be modified by the user >> " MAKE_CACHE_NAME << endl;
|
|
457 |
t << "\t@echo # Name : " << MAKE_CACHE_NAME << " >> " MAKE_CACHE_NAME << endl;
|
|
458 |
t << "\t@echo # Part of : " << project->values("TARGET").join(" ") << " >> " MAKE_CACHE_NAME << endl;
|
|
459 |
t << "\t@echo # Description : This file is used to cache last build target for >> " MAKE_CACHE_NAME << endl;
|
|
460 |
t << "\t@echo # make sis target. >> " MAKE_CACHE_NAME << endl;
|
|
461 |
t << "\t@echo # Version : >> " MAKE_CACHE_NAME << endl;
|
|
462 |
t << "\t@echo # >> " MAKE_CACHE_NAME << endl;
|
|
463 |
t << "\t@echo # ============================================================================== >> " MAKE_CACHE_NAME << endl;
|
|
464 |
t << "\t@echo. >> " MAKE_CACHE_NAME << endl;
|
|
465 |
t << "\t@echo QT_SIS_TARGET ?= $(QT_SIS_TARGET) >> " MAKE_CACHE_NAME << endl;
|
|
466 |
t << endl;
|
|
467 |
|
|
468 |
generatedFiles << MAKE_CACHE_NAME;
|
|
469 |
}
|
|
470 |
|
|
471 |
void SymbianAbldMakefileGenerator::writeBldInfMkFilePart(QTextStream& t, bool addDeploymentExtension)
|
|
472 |
{
|
|
473 |
// Normally emulator deployment gets done via regular makefile, but since subdirs
|
|
474 |
// do not get that, special deployment only makefile is generated for them if needed.
|
|
475 |
if (targetType != TypeSubdirs || addDeploymentExtension) {
|
|
476 |
QString gnuMakefileName = QLatin1String("Makefile_") + uid3;
|
|
477 |
removeSpecialCharacters(gnuMakefileName);
|
|
478 |
gnuMakefileName.append(".mk");
|
|
479 |
t << "gnumakefile " << gnuMakefileName << endl;
|
|
480 |
}
|
|
481 |
}
|