diff options
author | Janne Anttila <janne.anttila@digia.com> | 2009-08-27 05:14:03 (GMT) |
---|---|---|
committer | Janne Anttila <janne.anttila@digia.com> | 2009-08-27 05:14:03 (GMT) |
commit | c2bfd3a4e13515bc9507250a71e2f04612d78a04 (patch) | |
tree | 3a1eaf10a6aa30d8f04389415b4df449a04adbe5 /qmake/generators/symbian/symmake.cpp | |
parent | f189e00fb98f3f5cf5353c69ffe77f206304666b (diff) | |
download | Qt-c2bfd3a4e13515bc9507250a71e2f04612d78a04.zip Qt-c2bfd3a4e13515bc9507250a71e2f04612d78a04.tar.gz Qt-c2bfd3a4e13515bc9507250a71e2f04612d78a04.tar.bz2 |
Added support for 'make sisx' target in Symbian OS.
Commit f189e00 added support for template PKG file. This commit extends
the template PKG file usage with new make target, i.e. the commit adds
a new make target called sisx, which can be used to generate signed sisx
files.
The sisx target is basically wrapper for calling createpackage.bat,
but it also adds support for default platform/target and environment
variables. Default platform/target feature means that SIS packages are
automatically created for last build target. For example:
>qmake
>make release-armv5
>make sisx <- Creates sisx for release-armv5
It is also possible to override the platform and target for which the
SISX is created as follows:
>qmake
>make release-armv5 debug-winscw
>make sisx PLATFORM=ARMV5 TARGET=UREL <- Creates sisx for release-armv5
Since PLATFORM and TARGET are make variables they can also be defined
as an environment variables instead of passing them for make. I.e. the
following is indentical to previous example:
>set PLATFORM=ARMV5
>set TARGET=UREL
>qmake
>make release-armv5 debug-winscw
>make sisx <- Creates sisx for release-armv5
The environment variables are also useful if you have your own developer
certificate what you want to use for signing SIS files. For example:
>set CERTIFICATE=mycert.cer
>set KEY=mykey.key
>qmake
>make release-armv5
>make sisx
The above example creates release-armv5 SIS package with custom
certificate and key (key without password). If certificate and key are
not defined, the same logic as in old createpackage.bat will be used i.e.
if RD cert is available in Qt root it will be used, and if not self-signed
cerfificate will be used.
The environment variables supported by 'make sisx' are:
PLATFORM
TARGET
CERTIFICATE
KEY
PASSPHRASE
The createpackage.bat can still be called directly but preferred way is
to use new make target directly as examples above demonstrated.
Task: 259037
RevBy: Miikka Heikkinen
Diffstat (limited to 'qmake/generators/symbian/symmake.cpp')
-rw-r--r-- | qmake/generators/symbian/symmake.cpp | 42 |
1 files changed, 41 insertions, 1 deletions
diff --git a/qmake/generators/symbian/symmake.cpp b/qmake/generators/symbian/symmake.cpp index b4d693c..13feb25 100644 --- a/qmake/generators/symbian/symmake.cpp +++ b/qmake/generators/symbian/symmake.cpp @@ -72,6 +72,12 @@ #define MMP_TARGETTYPE "TARGETTYPE" #define MMP_SECUREID "SECUREID" +#define SISX_TARGET "sisx" +#define OK_SISX_TARGET "ok_sisx" +#define FAIL_SISX_NOPKG_TARGET "fail_sisx_nopkg" +#define FAIL_SISX_NOCACHE_TARGET "fail_sisx_nocache" +#define RESTORE_BUILD_TARGET "restore_build" + #define PRINT_FILE_CREATE_ERROR(filename) fprintf(stderr, "Error: Could not create '%s'\n", qPrintable(filename)); QString SymbianMakefileGenerator::fixPathForMmp(const QString& origPath, const QDir& parentDir) @@ -1624,6 +1630,41 @@ void SymbianMakefileGenerator::removeSpecialCharacters(QString& str) str.replace(QString(" "), QString("_")); } +void SymbianMakefileGenerator::writeSisxTargets(QTextStream &t) +{ + t << SISX_TARGET ": " RESTORE_BUILD_TARGET << endl; + QString sisxcommand = QString("\t$(if $(wildcard %1_template.%2),$(if $(wildcard %3),$(MAKE) -s %4,$(MAKE) -s %5),$(MAKE) -s %6)") + .arg(fileInfo(project->projectFile()).completeBaseName()) + .arg("pkg") + .arg(MAKE_CACHE_NAME) + .arg(OK_SISX_TARGET) + .arg(FAIL_SISX_NOCACHE_TARGET) + .arg(FAIL_SISX_NOPKG_TARGET); + t << sisxcommand << endl; + t << endl; + + t << OK_SISX_TARGET ":" << endl; + + QString pkgcommand = QString("\tcreatepackage.bat %1_template.%2 $(PLATFORM) $(TARGET) $(CERTIFICATE) $(KEY) $(PASSPHRASE)") + .arg(fileInfo(project->projectFile()).completeBaseName()) + .arg("pkg"); + t << pkgcommand << endl; + t << endl; + + t << FAIL_SISX_NOPKG_TARGET ":" << endl; + t << "\t$(error PKG file does not exist, 'SISX' target is only supported for executables or projects with DEPLOYMENT statement)" << endl; + t << endl; + + t << FAIL_SISX_NOCACHE_TARGET ":" << endl; + t << "\t$(error Project has to be build before calling 'SISX' target)" << endl; + t << endl; + + + t << RESTORE_BUILD_TARGET ":" << endl; + t << "-include " MAKE_CACHE_NAME << endl; + t << endl; +} + void SymbianMakefileGenerator::generateDistcleanTargets(QTextStream& t) { t << "dodistclean:" << endl; @@ -1677,4 +1718,3 @@ void SymbianMakefileGenerator::generateDistcleanTargets(QTextStream& t) t << "distclean: clean dodistclean" << endl; t << endl; } - |