summaryrefslogtreecommitdiffstats
path: root/qmake
diff options
context:
space:
mode:
authoraxis <qt-info@nokia.com>2010-02-16 11:53:07 (GMT)
committeraxis <qt-info@nokia.com>2010-02-16 11:53:07 (GMT)
commit15b08dffc1354bc816b04901a7442679382b0935 (patch)
tree783af85b75f9de3ab10902c5ba66cf5e22b2fe61 /qmake
parent9f5b02406f38fe02a27de7843b9f8a11232d2064 (diff)
parent9d174f13e48730ac06aa429e0f011a02b333025e (diff)
downloadQt-15b08dffc1354bc816b04901a7442679382b0935.zip
Qt-15b08dffc1354bc816b04901a7442679382b0935.tar.gz
Qt-15b08dffc1354bc816b04901a7442679382b0935.tar.bz2
Merge branch 'master' of scm.dev.nokia.troll.no:qt/qt-s60-public
Conflicts: configure mkspecs/common/symbian/symbian.conf mkspecs/features/symbian/application_icon.prf qmake/generators/makefile.cpp qmake/generators/symbian/initprojectdeploy_symbian.cpp qmake/generators/symbian/symmake.cpp tools/assistant/tools/assistant/assistant.pro
Diffstat (limited to 'qmake')
-rw-r--r--qmake/generators/makefile.cpp10
-rw-r--r--qmake/generators/symbian/symmake.cpp45
-rw-r--r--qmake/generators/symbian/symmake_abld.cpp48
-rw-r--r--qmake/generators/unix/unixmake.cpp1
-rw-r--r--qmake/option.cpp36
5 files changed, 108 insertions, 32 deletions
diff --git a/qmake/generators/makefile.cpp b/qmake/generators/makefile.cpp
index 7baccff..cac23cd 100644
--- a/qmake/generators/makefile.cpp
+++ b/qmake/generators/makefile.cpp
@@ -65,6 +65,12 @@
#include <sys/types.h>
#include <sys/stat.h>
+#ifdef Q_OS_WIN32
+#define NO_STDERR "2> NUL"
+#else
+#define NO_STDERR "2>/dev/null"
+#endif
+
QT_BEGIN_NAMESPACE
// Well, Windows doesn't have this, so here's the macro
@@ -1809,7 +1815,7 @@ MakefileGenerator::writeExtraCompilerTargets(QTextStream &t)
if(tmp_clean.indexOf("${QMAKE_") == -1) {
t << "\n\t" << "-$(DEL_FILE) " << tmp_clean;
if (Option::shellPath.isEmpty())
- t << " 2> NUL"; // Eliminate unnecessary warnings
+ t << " " << NO_STDERR; // Eliminate unnecessary warnings
wrote_clean = true;
}
if(!wrote_clean_cmds || !wrote_clean) {
@@ -1839,7 +1845,7 @@ MakefileGenerator::writeExtraCompilerTargets(QTextStream &t)
}
if(!cleans.isEmpty()) {
if (Option::shellPath.isEmpty())
- t << valGlue(cleans, "\n\t" + del_statement, " 2> NUL\n\t" + del_statement, " 2> NUL");
+ t << valGlue(cleans, "\n\t" + del_statement, " " NO_STDERR "\n\t" + del_statement, " " NO_STDERR);
else
t << valGlue(cleans, "\n\t" + del_statement, "\n\t" + del_statement, "");
}
diff --git a/qmake/generators/symbian/symmake.cpp b/qmake/generators/symbian/symmake.cpp
index 2ffc6c7..503e443 100644
--- a/qmake/generators/symbian/symmake.cpp
+++ b/qmake/generators/symbian/symmake.cpp
@@ -49,10 +49,17 @@
#include <stdlib.h>
#include <qdebug.h>
+#ifdef Q_OS_WIN
+#define SCRIPT_EXT ".bat"
+#else
+#define SCRIPT_EXT ".sh"
+#endif
+
#define RESOURCE_DIRECTORY_MMP "/resource/apps"
#define REGISTRATION_RESOURCE_DIRECTORY_HW "/private/10003a3f/import/apps"
#define PLUGIN_COMMON_DEF_FILE_FOR_MMP "./plugin_common.def"
-#define PLUGIN_COMMON_DEF_FILE_ACTUAL "plugin_commonU.def"
+#define PLUGIN_COMMON_DEF_FILE_ACTUAL "plugin_commonu.def"
+#define BLD_INF_FILENAME_LEN (sizeof(BLD_INF_FILENAME) - 1)
#define BLD_INF_RULES_BASE "BLD_INF_RULES."
#define BLD_INF_TAG_PLATFORMS "prj_platforms"
@@ -82,8 +89,10 @@
#define SIS_TARGET "sis"
#define INSTALLER_SIS_TARGET "installer_sis"
+#define ROM_STUB_SIS_TARGET "stub_sis"
#define OK_SIS_TARGET "ok_sis"
#define OK_INSTALLER_SIS_TARGET "ok_installer_sis"
+#define OK_ROM_STUB_SIS_TARGET "ok_stub_sis"
#define FAIL_SIS_NOPKG_TARGET "fail_sis_nopkg"
#define FAIL_SIS_NOCACHE_TARGET "fail_sis_nocache"
@@ -1157,7 +1166,7 @@ void SymbianMakefileGenerator::generateCleanCommands(QTextStream& t,
t << "\t-@ if EXIST \"" << QDir::toNativeSeparators(item) << "\" ";
t << cmd << " " << cmdOptions << " \"" << QDir::toNativeSeparators(item) << "\"" << endl;
#else
- t << "\t-if test -f " << QDir::toNativeSeparators(item) << "; then ";
+ t << "\t-if test -e " << QDir::toNativeSeparators(item) << "; then ";
t << cmd << " " << cmdOptions << " " << QDir::toNativeSeparators(item) << "; fi" << endl;
#endif
}
@@ -1169,7 +1178,7 @@ void SymbianMakefileGenerator::writeSisTargets(QTextStream &t)
t << endl;
t << SIS_TARGET ":" << endl;
- QString siscommand = QString("\t$(if $(wildcard %1_template.%2),$(if $(wildcard %3)," \
+ QString siscommand = QString::fromLatin1("\t$(if $(wildcard %1_template.%2),$(if $(wildcard %3)," \
"$(MAKE) -s -f $(MAKEFILE) %4," \
"$(if $(QT_SIS_TARGET),$(MAKE) -s -f $(MAKEFILE) %4," \
"$(MAKE) -s -f $(MAKEFILE) %5))," \
@@ -1185,7 +1194,7 @@ void SymbianMakefileGenerator::writeSisTargets(QTextStream &t)
t << OK_SIS_TARGET ":" << endl;
- QString pkgcommand = QString("\tcreatepackage.bat $(QT_SIS_OPTIONS) %1_template.%2 $(QT_SIS_TARGET) " \
+ QString pkgcommand = QString::fromLatin1("\tcreatepackage" SCRIPT_EXT " $(QT_SIS_OPTIONS) %1_template.%2 $(QT_SIS_TARGET) " \
"$(QT_SIS_CERTIFICATE) $(QT_SIS_KEY) $(QT_SIS_PASSPHRASE)")
.arg(fixedTarget)
.arg("pkg");
@@ -1198,8 +1207,32 @@ void SymbianMakefileGenerator::writeSisTargets(QTextStream &t)
t << sisName << ":" << endl;
t << "\t$(MAKE) -s -f $(MAKEFILE) " SIS_TARGET << endl << endl;
+ t << ROM_STUB_SIS_TARGET ":" << endl;
+ QString stubsiscommand = QString::fromLatin1("\t$(if $(wildcard %1_template.%2),$(if $(wildcard %3)," \
+ "$(MAKE) -s -f $(MAKEFILE) %4," \
+ "$(if $(QT_SIS_TARGET),$(MAKE) -s -f $(MAKEFILE) %4," \
+ "$(MAKE) -s -f $(MAKEFILE) %5))," \
+ "$(MAKE) -s -f $(MAKEFILE) %6)")
+ .arg(fixedTarget)
+ .arg("pkg")
+ .arg(MAKE_CACHE_NAME)
+ .arg(OK_ROM_STUB_SIS_TARGET)
+ .arg(FAIL_SIS_NOCACHE_TARGET)
+ .arg(FAIL_SIS_NOPKG_TARGET);
+ t << stubsiscommand << endl;
+ t << endl;
+
+ t << OK_ROM_STUB_SIS_TARGET ":" << endl;
+
+ QString stubpkgcommand = QString::fromLatin1("\tcreatepackage" SCRIPT_EXT " -s $(QT_SIS_OPTIONS) %1_template.%2 $(QT_SIS_TARGET) " \
+ "$(QT_SIS_CERTIFICATE) $(QT_SIS_KEY) $(QT_SIS_PASSPHRASE)")
+ .arg(fixedTarget)
+ .arg("pkg");
+ t << stubpkgcommand << endl;
+ t << endl;
+
t << INSTALLER_SIS_TARGET ": " << sisName << endl;
- siscommand = QString("\t$(if $(wildcard %1_installer.%2)," \
+ siscommand = QString::fromLatin1("\t$(if $(wildcard %1_installer.%2)," \
"$(MAKE) -s -f $(MAKEFILE) %3," \
"$(MAKE) -s -f $(MAKEFILE) %4)")
.arg(fixedTarget)
@@ -1211,7 +1244,7 @@ void SymbianMakefileGenerator::writeSisTargets(QTextStream &t)
t << OK_INSTALLER_SIS_TARGET ": " << endl;
- pkgcommand = QString("\tcreatepackage.bat $(QT_SIS_OPTIONS) %1_installer.%2 - " \
+ pkgcommand = QString::fromLatin1("\tcreatepackage.bat $(QT_SIS_OPTIONS) %1_installer.%2 - " \
"$(QT_SIS_CERTIFICATE) $(QT_SIS_KEY) $(QT_SIS_PASSPHRASE)")
.arg(fixedTarget)
.arg("pkg");
diff --git a/qmake/generators/symbian/symmake_abld.cpp b/qmake/generators/symbian/symmake_abld.cpp
index 572c742..00c05b7 100644
--- a/qmake/generators/symbian/symmake_abld.cpp
+++ b/qmake/generators/symbian/symmake_abld.cpp
@@ -195,16 +195,21 @@ void SymbianAbldMakefileGenerator::writeWrapperMakefile(QFile& wrapperFile, bool
t << "DEL_FILE = " << var("QMAKE_DEL_FILE") << endl;
t << "DEL_DIR = " << var("QMAKE_DEL_DIR") << endl;
t << "MOVE = " << var("QMAKE_MOVE") << endl;
+#ifdef Q_OS_WIN32
t << "XCOPY = xcopy /d /f /h /r /y /i" << endl;
t << "ABLD = ABLD.BAT" << endl;
+#else
+ t << "XCOPY = cp -u -v" << endl;
+ t << "ABLD = abld" << endl;
+#endif
t << "DEBUG_PLATFORMS = " << debugPlatforms.join(" ") << endl;
t << "RELEASE_PLATFORMS = " << releasePlatforms.join(" ") << endl;
t << "MAKE = make" << endl;
t << endl;
t << "ifeq (WINS,$(findstring WINS, $(PLATFORM)))" << endl;
- t << "ZDIR=$(EPOCROOT)epoc32\\release\\$(PLATFORM)\\$(CFG)\\Z" << endl;
+ t << "ZDIR=$(EPOCROOT)" << QDir::toNativeSeparators("epoc32/release/$(PLATFORM)/$(CFG)/z") << endl;
t << "else" << endl;
- t << "ZDIR=$(EPOCROOT)epoc32\\data\\z" << endl;
+ t << "ZDIR=$(EPOCROOT)" << QDir::toNativeSeparators("epoc32/data/z") << endl;
t << "endif" << endl;
t << endl;
t << "DEFINES" << '\t' << " = "
@@ -304,8 +309,13 @@ void SymbianAbldMakefileGenerator::writeWrapperMakefile(QFile& wrapperFile, bool
if (values.at(i).endsWith("/" QT_EXTRA_INCLUDE_DIR)) {
QString fixedValue(QDir::toNativeSeparators(values.at(i)));
dirsToClean << fixedValue;
+#ifdef Q_OS_WIN32
t << "\t-@ if NOT EXIST \"" << fixedValue << "\" mkdir \""
<< fixedValue << "\"" << endl;
+#else
+ t << "\t-@ if test ! -d \"" << fixedValue << "\"; then mkdir \""
+ << fixedValue << "\"" << "; fi" <<endl;
+#endif
}
}
}
@@ -314,7 +324,11 @@ void SymbianAbldMakefileGenerator::writeWrapperMakefile(QFile& wrapperFile, bool
// Note: EXTENSION_CLEAN will get called many times when doing reallyclean
// This is why the "2> NUL" gets appended to generated clean targets in makefile.cpp.
t << EXTENSION_CLEAN ": " COMPILER_CLEAN_TARGET << endl;
+#ifdef Q_OS_WIN32
generateCleanCommands(t, dirsToClean, var("QMAKE_DEL_DIR"), " /S /Q ", "", "");
+#else
+ generateCleanCommands(t, dirsToClean, "rm", " -rf ", "", "");
+#endif
t << endl;
t << PRE_TARGETDEPS_TARGET ":"
@@ -441,21 +455,31 @@ bool SymbianAbldMakefileGenerator::writeDeploymentTargets(QTextStream &t)
void SymbianAbldMakefileGenerator::writeStoreBuildTarget(QTextStream &t)
{
+#ifdef Q_OS_WIN
+#define HASH "#"
+#define EMPTYECHO "."
+#else
+#define HASH "\\#"
+#define EMPTYECHO
+#endif
+
t << STORE_BUILD_TARGET ":" << endl;
- t << "\t@echo # ============================================================================== > " MAKE_CACHE_NAME << endl;
- t << "\t@echo # This file is generated by make and should not be modified by the user >> " MAKE_CACHE_NAME << endl;
- t << "\t@echo # Name : " << MAKE_CACHE_NAME << " >> " MAKE_CACHE_NAME << endl;
- t << "\t@echo # Part of : " << project->values("TARGET").join(" ") << " >> " MAKE_CACHE_NAME << endl;
- t << "\t@echo # Description : This file is used to cache last build target for >> " MAKE_CACHE_NAME << endl;
- t << "\t@echo # make sis target. >> " MAKE_CACHE_NAME << endl;
- t << "\t@echo # Version : >> " MAKE_CACHE_NAME << endl;
- t << "\t@echo # >> " MAKE_CACHE_NAME << endl;
- t << "\t@echo # ============================================================================== >> " MAKE_CACHE_NAME << endl;
- t << "\t@echo. >> " MAKE_CACHE_NAME << endl;
+ t << "\t@echo " HASH " ============================================================================== > " MAKE_CACHE_NAME << endl;
+ t << "\t@echo " HASH " This file is generated by make and should not be modified by the user >> " MAKE_CACHE_NAME << endl;
+ t << "\t@echo " HASH " Name : " << MAKE_CACHE_NAME << " >> " MAKE_CACHE_NAME << endl;
+ t << "\t@echo " HASH " Part of : " << project->values("TARGET").join(" ") << " >> " MAKE_CACHE_NAME << endl;
+ t << "\t@echo " HASH " Description : This file is used to cache last build target for >> " MAKE_CACHE_NAME << endl;
+ t << "\t@echo " HASH " make sis target. >> " MAKE_CACHE_NAME << endl;
+ t << "\t@echo " HASH " Version : >> " MAKE_CACHE_NAME << endl;
+ t << "\t@echo " HASH " >> " MAKE_CACHE_NAME << endl;
+ t << "\t@echo " HASH " ============================================================================== >> " MAKE_CACHE_NAME << endl;
+ t << "\t@echo" EMPTYECHO " >> " MAKE_CACHE_NAME << endl;
t << "\t@echo QT_SIS_TARGET ?= $(QT_SIS_TARGET) >> " MAKE_CACHE_NAME << endl;
t << endl;
generatedFiles << MAKE_CACHE_NAME;
+#undef HASH
+#undef EMPTYECHO
}
void SymbianAbldMakefileGenerator::writeBldInfMkFilePart(QTextStream& t, bool addDeploymentExtension)
diff --git a/qmake/generators/unix/unixmake.cpp b/qmake/generators/unix/unixmake.cpp
index 3497ae7..3f92993 100644
--- a/qmake/generators/unix/unixmake.cpp
+++ b/qmake/generators/unix/unixmake.cpp
@@ -553,7 +553,6 @@ UnixMakefileGenerator::processPrlFiles()
{
QList<QMakeLocalFileName> libdirs, frameworkdirs;
frameworkdirs.append(QMakeLocalFileName("/System/Library/Frameworks"));
- frameworkdirs.append(QMakeLocalFileName("/Library/Frameworks"));
const QString lflags[] = { "QMAKE_LIBDIR_FLAGS", "QMAKE_FRAMEWORKPATH_FLAGS", "QMAKE_LFLAGS", "QMAKE_LIBS", QString() };
for(int i = 0; !lflags[i].isNull(); i++) {
QStringList &l = project->values(lflags[i]);
diff --git a/qmake/option.cpp b/qmake/option.cpp
index aa11ec1..ec3fea2 100644
--- a/qmake/option.cpp
+++ b/qmake/option.cpp
@@ -136,6 +136,20 @@ static Option::QMAKE_MODE default_mode(QString progname)
return Option::QMAKE_GENERATE_MAKEFILE;
}
+static QString detectProjectFile(const QString &path)
+{
+ QString ret;
+ QDir dir(path);
+ if(dir.exists(dir.dirName() + Option::pro_ext)) {
+ ret = dir.filePath(dir.dirName()) + Option::pro_ext;
+ } else { //last try..
+ QStringList profiles = dir.entryList(QStringList("*" + Option::pro_ext));
+ if(profiles.count() == 1)
+ ret = dir.filePath(profiles.at(0));
+ }
+ return ret;
+}
+
QString project_builtin_regx();
bool usage(const char *a0)
{
@@ -322,12 +336,18 @@ Option::parseCommandLine(int argc, char **argv, int skip)
if(!fi.makeAbsolute()) //strange
arg = fi.filePath();
if(Option::qmake_mode == Option::QMAKE_GENERATE_MAKEFILE ||
- Option::qmake_mode == Option::QMAKE_GENERATE_PRL)
+ Option::qmake_mode == Option::QMAKE_GENERATE_PRL) {
+ if(fi.isDir()) {
+ QString proj = detectProjectFile(arg);
+ if (!proj.isNull())
+ arg = proj;
+ }
Option::mkfile::project_files.append(arg);
- else if(Option::qmake_mode == Option::QMAKE_GENERATE_PROJECT)
+ } else if(Option::qmake_mode == Option::QMAKE_GENERATE_PROJECT) {
Option::projfile::project_dirs.append(arg);
- else
+ } else {
handled = false;
+ }
}
if(!handled) {
return Option::QMAKE_CMDLINE_SHOW_USAGE | Option::QMAKE_CMDLINE_ERROR;
@@ -495,15 +515,9 @@ Option::init(int argc, char **argv)
//try REALLY hard to do it for them, lazy..
if(Option::mkfile::project_files.isEmpty()) {
- QString pwd = qmake_getpwd(),
- proj = pwd + "/" + pwd.right(pwd.length() - (pwd.lastIndexOf('/') + 1)) + Option::pro_ext;
- if(QFile::exists(proj)) {
+ QString proj = detectProjectFile(qmake_getpwd());
+ if(!proj.isNull())
Option::mkfile::project_files.append(proj);
- } else { //last try..
- QStringList profiles = QDir(pwd).entryList(QStringList("*" + Option::pro_ext));
- if(profiles.count() == 1)
- Option::mkfile::project_files.append(pwd + "/" + profiles[0]);
- }
#ifndef QT_BUILD_QMAKE_LIBRARY
if(Option::mkfile::project_files.isEmpty()) {
usage(argv[0]);