summaryrefslogtreecommitdiffstats
path: root/qmake
diff options
context:
space:
mode:
Diffstat (limited to 'qmake')
-rw-r--r--qmake/generators/makefile.cpp17
-rw-r--r--qmake/generators/makefiledeps.cpp34
-rw-r--r--qmake/generators/symbian/symmake.cpp72
-rw-r--r--qmake/generators/symbian/symmake_abld.cpp2
-rw-r--r--qmake/generators/symbian/symmake_sbsv2.cpp2
-rw-r--r--qmake/generators/win32/winmakefile.cpp3
-rw-r--r--qmake/meta.cpp5
-rw-r--r--qmake/option.cpp4
-rw-r--r--qmake/project.cpp2
9 files changed, 100 insertions, 41 deletions
diff --git a/qmake/generators/makefile.cpp b/qmake/generators/makefile.cpp
index 0f5bdcd..b0a8011 100644
--- a/qmake/generators/makefile.cpp
+++ b/qmake/generators/makefile.cpp
@@ -1519,6 +1519,19 @@ MakefileGenerator::replaceExtraCompilerVariables(const QString &orig_var, const
base = fi.fileName();
val += base;
}
+ } else if(var == QLatin1String("QMAKE_FILE_EXT")) {
+ filePath = true;
+ for(int i = 0; i < in.size(); ++i) {
+ QFileInfo fi(fileInfo(Option::fixPathToLocalOS(in.at(i))));
+ QString ext;
+ // Ensure complementarity with QMAKE_FILE_BASE
+ int baseLen = fi.completeBaseName().length();
+ if(baseLen == 0)
+ ext = fi.fileName();
+ else
+ ext = fi.fileName().remove(0, baseLen);
+ val += ext;
+ }
} else if(var == QLatin1String("QMAKE_FILE_PATH") || var == QLatin1String("QMAKE_FILE_IN_PATH")) {
filePath = true;
for(int i = 0; i < in.size(); ++i)
@@ -1830,11 +1843,12 @@ MakefileGenerator::writeExtraCompilerTargets(QTextStream &t)
cleans.append(files);
}
}
- if(!cleans.isEmpty())
+ if(!cleans.isEmpty()) {
if (isForSymbian())
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, "");
+ }
if(!wrote_clean_cmds) {
for(QStringList::ConstIterator input = tmp_inputs.begin(); input != tmp_inputs.end(); ++input) {
t << "\n\t" << replaceExtraCompilerVariables(tmp_clean_cmds, (*input),
@@ -2541,6 +2555,7 @@ MakefileGenerator::writeSubTargets(QTextStream &t, QList<MakefileGenerator::SubT
QString ofile = Option::fixPathToTargetOS(fileFixify(Option::output.fileName()));
if(!ofile.isEmpty())
t << "\t-$(DEL_FILE) " << ofile << endl;
+ t << varGlue("QMAKE_DISTCLEAN","\t-$(DEL_FILE) "," ","\n");
} else if(project->isActiveConfig("no_empty_targets")) {
t << "\t" << "@cd ." << endl;
}
diff --git a/qmake/generators/makefiledeps.cpp b/qmake/generators/makefiledeps.cpp
index 40304a6..21e1273 100644
--- a/qmake/generators/makefiledeps.cpp
+++ b/qmake/generators/makefiledeps.cpp
@@ -397,7 +397,7 @@ bool QMakeSourceFileInfo::findDeps(SourceFile *file)
buffer = getBuffer(fst.st_size);
for(int have_read = 0;
(have_read = QT_READ(fd, buffer + buffer_len, fst.st_size - buffer_len));
- buffer_len += have_read);
+ buffer_len += have_read) ;
QT_CLOSE(fd);
}
if(!buffer)
@@ -418,22 +418,22 @@ bool QMakeSourceFileInfo::findDeps(SourceFile *file)
++x;
if(buffer_len >= x + 12 && !strncmp(buffer + x, "includehint", 11) &&
(*(buffer + x + 11) == ' ' || *(buffer + x + 11) == '>')) {
- for(x += 11; *(buffer + x) != '>'; ++x);
+ for(x += 11; *(buffer + x) != '>'; ++x) ;
int inc_len = 0;
- for(x += 1 ; *(buffer + x + inc_len) != '<'; ++inc_len);
+ for(x += 1 ; *(buffer + x + inc_len) != '<'; ++inc_len) ;
*(buffer + x + inc_len) = '\0';
inc = buffer + x;
} else if(buffer_len >= x + 13 && !strncmp(buffer + x, "customwidget", 12) &&
(*(buffer + x + 12) == ' ' || *(buffer + x + 12) == '>')) {
- for(x += 13; *(buffer + x) != '>'; ++x); //skip up to >
+ for(x += 13; *(buffer + x) != '>'; ++x) ; //skip up to >
while(x < buffer_len) {
- for(x++; *(buffer + x) != '<'; ++x); //skip up to <
+ for(x++; *(buffer + x) != '<'; ++x) ; //skip up to <
x++;
if(buffer_len >= x + 7 && !strncmp(buffer+x, "header", 6) &&
(*(buffer + x + 6) == ' ' || *(buffer + x + 6) == '>')) {
- for(x += 7; *(buffer + x) != '>'; ++x); //skip up to >
+ for(x += 7; *(buffer + x) != '>'; ++x) ; //skip up to >
int inc_len = 0;
- for(x += 1 ; *(buffer + x + inc_len) != '<'; ++inc_len);
+ for(x += 1 ; *(buffer + x + inc_len) != '<'; ++inc_len) ;
*(buffer + x + inc_len) = '\0';
inc = buffer + x;
break;
@@ -448,10 +448,10 @@ bool QMakeSourceFileInfo::findDeps(SourceFile *file)
for(x += 8; *(buffer + x) != '>'; ++x) {
if(buffer_len >= x + 9 && *(buffer + x) == 'i' &&
!strncmp(buffer + x, "impldecl", 8)) {
- for(x += 8; *(buffer + x) != '='; ++x);
+ for(x += 8; *(buffer + x) != '='; ++x) ;
if(*(buffer + x) != '=')
continue;
- for(++x; *(buffer+x) == '\t' || *(buffer+x) == ' '; ++x);
+ for(++x; *(buffer+x) == '\t' || *(buffer+x) == ' '; ++x) ;
char quote = 0;
if(*(buffer+x) == '\'' || *(buffer+x) == '"') {
quote = *(buffer + x);
@@ -475,13 +475,13 @@ bool QMakeSourceFileInfo::findDeps(SourceFile *file)
}
}
int inc_len = 0;
- for(x += 1 ; *(buffer + x + inc_len) != '<'; ++inc_len);
+ for(x += 1 ; *(buffer + x + inc_len) != '<'; ++inc_len) ;
*(buffer + x + inc_len) = '\0';
inc = buffer + x;
}
}
//read past new line now..
- for(; x < buffer_len && !qmake_endOfLine(*(buffer + x)); ++x);
+ for(; x < buffer_len && !qmake_endOfLine(*(buffer + x)); ++x) ;
++line_count;
} else if(file->type == QMakeSourceFileInfo::TYPE_QRC) {
} else if(file->type == QMakeSourceFileInfo::TYPE_C) {
@@ -494,7 +494,7 @@ bool QMakeSourceFileInfo::findDeps(SourceFile *file)
++x;
if(buffer_len >= x) {
if(*(buffer+x) == '/') { //c++ style comment
- for(; x < buffer_len && !qmake_endOfLine(*(buffer + x)); ++x);
+ for(; x < buffer_len && !qmake_endOfLine(*(buffer + x)); ++x) ;
beginning = 1;
} else if(*(buffer+x) == '*') { //c style comment
for(++x; x < buffer_len; ++x) {
@@ -558,7 +558,7 @@ bool QMakeSourceFileInfo::findDeps(SourceFile *file)
*(buffer+x+keyword_len) != '_') {
for(x+=keyword_len; //skip spaces after keyword
x < buffer_len && (*(buffer+x) == ' ' || *(buffer+x) == '\t');
- x++);
+ x++) ;
break;
} else if(qmake_endOfLine(*(buffer+x+keyword_len))) {
x += keyword_len-1;
@@ -579,7 +579,7 @@ bool QMakeSourceFileInfo::findDeps(SourceFile *file)
x++;
int inc_len;
- for(inc_len = 0; *(buffer + x + inc_len) != term && !qmake_endOfLine(*(buffer + x + inc_len)); ++inc_len);
+ for(inc_len = 0; *(buffer + x + inc_len) != term && !qmake_endOfLine(*(buffer + x + inc_len)); ++inc_len) ;
*(buffer + x + inc_len) = '\0';
inc = buffer + x;
x += inc_len;
@@ -594,7 +594,7 @@ bool QMakeSourceFileInfo::findDeps(SourceFile *file)
int msg_len;
for(msg_len = 0; (term && *(buffer + x + msg_len) != term) &&
- !qmake_endOfLine(*(buffer + x + msg_len)); ++msg_len);
+ !qmake_endOfLine(*(buffer + x + msg_len)); ++msg_len) ;
*(buffer + x + msg_len) = '\0';
debug_msg(0, "%s:%d %s -- %s", file->file.local().toLatin1().constData(), line_count, keyword, buffer+x);
x += msg_len;
@@ -706,7 +706,7 @@ bool QMakeSourceFileInfo::findMocs(SourceFile *file)
buffer = getBuffer(fst.st_size);
for(int have_read = buffer_len = 0;
(have_read = QT_READ(fd, buffer + buffer_len, fst.st_size - buffer_len));
- buffer_len += have_read);
+ buffer_len += have_read) ;
QT_CLOSE(fd);
}
@@ -720,7 +720,7 @@ bool QMakeSourceFileInfo::findMocs(SourceFile *file)
++x;
if(buffer_len >= x) {
if(*(buffer + x) == '/') { //c++ style comment
- for(;x < buffer_len && !qmake_endOfLine(*(buffer + x)); ++x);
+ for(;x < buffer_len && !qmake_endOfLine(*(buffer + x)); ++x) ;
} else if(*(buffer + x) == '*') { //c style comment
for(++x; x < buffer_len; ++x) {
if(*(buffer + x) == 't' || *(buffer + x) == 'q') { //ignore
diff --git a/qmake/generators/symbian/symmake.cpp b/qmake/generators/symbian/symmake.cpp
index 2c1ce18..13c4fd4 100644
--- a/qmake/generators/symbian/symmake.cpp
+++ b/qmake/generators/symbian/symmake.cpp
@@ -100,6 +100,11 @@
#define PRINT_FILE_CREATE_ERROR(filename) fprintf(stderr, "Error: Could not create '%s'\n", qPrintable(filename));
+#define MANUFACTURER_NOTE_FILE "manufacturer_note.txt"
+#define DEFAULT_MANUFACTURER_NOTE \
+ "The package is not supported for devices from this manufacturer. Please try the selfsigned " \
+ "version of the package instead."
+
QString SymbianMakefileGenerator::fixPathForMmp(const QString& origPath, const QDir& parentDir)
{
static QString epocRootStr;
@@ -233,7 +238,9 @@ bool SymbianMakefileGenerator::writeMakefile(QTextStream &t)
QString wrapperFileName("Makefile");
QString outputFileName = fileInfo(Option::output.fileName()).fileName();
if (outputFileName != BLD_INF_FILENAME) {
- wrapperFileName.append(".").append((outputFileName.size() > BLD_INF_FILENAME_LEN && outputFileName.left(BLD_INF_FILENAME_LEN) == BLD_INF_FILENAME) ? outputFileName.mid(8) : outputFileName);
+ wrapperFileName.append(".").append(outputFileName.startsWith(BLD_INF_FILENAME)
+ ? outputFileName.mid(sizeof(BLD_INF_FILENAME))
+ : outputFileName);
isPrimaryMakefile = false;
}
@@ -267,7 +274,7 @@ bool SymbianMakefileGenerator::writeMakefile(QTextStream &t)
writeMmpFile(mmpFilename, symbianLangCodes);
if (targetType == TypeExe) {
- if (!project->values("CONFIG").contains("no_icon", Qt::CaseInsensitive)) {
+ if (!project->isActiveConfig("no_icon")) {
writeRegRssFile(userRssRules);
writeRssFile(numberOfIcons, iconFile);
writeLocFile(symbianLangCodes);
@@ -360,6 +367,17 @@ void SymbianMakefileGenerator::generatePkgFile(const QString &iconFile, Deployme
t << endl;
}
+ // Begin Manufacturer block
+ if (!project->values("DEPLOYMENT.manufacturers").isEmpty()) {
+ QString manufacturerStr("IF ");
+ foreach(QString manufacturer, project->values("DEPLOYMENT.manufacturers")) {
+ manufacturerStr.append(QString("(MANUFACTURER)=(%1) OR \n ").arg(manufacturer));
+ }
+ // Remove the final OR
+ manufacturerStr.chop(8);
+ t << manufacturerStr << endl;
+ }
+
// Install paths on the phone *** should be dynamic at some point
QString installPathBin = "!:\\sys\\bin";
QString installPathResource = "!:\\resource\\apps";
@@ -381,7 +399,7 @@ void SymbianMakefileGenerator::generatePkgFile(const QString &iconFile, Deployme
.arg(exeFile) << endl;
// deploy rsc & reg_rsc file
- if (!project->values("CONFIG").contains("no_icon", Qt::CaseInsensitive)) {
+ if (!project->isActiveConfig("no_icon")) {
t << QString("\"%1epoc32/data/z/resource/apps/%2\" - \"%3\\%4\"")
.arg(epocRoot())
.arg(fixedTarget + ".rsc")
@@ -434,6 +452,30 @@ void SymbianMakefileGenerator::generatePkgFile(const QString &iconFile, Deployme
t << endl;
}
}
+
+ // Close Manufacturer block
+ if (!project->values("DEPLOYMENT.manufacturers").isEmpty()) {
+ QString manufacturerFailNoteFile;
+ if (project->values("DEPLOYMENT.manufacturers.fail_note").isEmpty()) {
+ manufacturerFailNoteFile = QString("%1_" MANUFACTURER_NOTE_FILE).arg(uid3);
+ QFile ft(manufacturerFailNoteFile);
+ if (ft.open(QIODevice::WriteOnly)) {
+ generatedFiles << ft.fileName();
+ QTextStream t2(&ft);
+
+ t2 << QString(DEFAULT_MANUFACTURER_NOTE) << endl;
+ } else {
+ PRINT_FILE_CREATE_ERROR(manufacturerFailNoteFile)
+ }
+ } else {
+ manufacturerFailNoteFile = project->values("DEPLOYMENT.manufacturers.fail_note").join("");
+ }
+
+ t << "ELSEIF NOT(0) ; MANUFACTURER" << endl
+ << "\"" << fileInfo(manufacturerFailNoteFile).absoluteFilePath() << "\""
+ << " - \"\", FILETEXT, TEXTEXIT" << endl
+ << "ENDIF ; MANUFACTURER" << endl;
+ }
}
bool SymbianMakefileGenerator::containsStartWithItem(const QChar &c, const QStringList& src)
@@ -450,7 +492,7 @@ bool SymbianMakefileGenerator::containsStartWithItem(const QChar &c, const QStri
void SymbianMakefileGenerator::writeCustomDefFile()
{
- if (targetType == TypePlugin && !project->values("CONFIG").contains("stdbinary", Qt::CaseInsensitive)) {
+ if (targetType == TypePlugin && !project->isActiveConfig("stdbinary")) {
// Create custom def file for plugin
QFile ft(QLatin1String(PLUGIN_COMMON_DEF_FILE_ACTUAL));
@@ -515,9 +557,9 @@ void SymbianMakefileGenerator::init()
targetType = TypeExe;
else if ((project->values("TEMPLATE")).contains("lib")) {
// Check CONFIG to see if we are to build staticlib or dll
- if (project->values("CONFIG").contains("staticlib") || project->values("CONFIG").contains("static"))
+ if (project->isActiveConfig("staticlib") || project->isActiveConfig("static"))
targetType = TypeLib;
- else if (project->values("CONFIG").contains("plugin"))
+ else if (project->isActiveConfig("plugin"))
targetType = TypePlugin;
else
targetType = TypeDll;
@@ -527,7 +569,7 @@ void SymbianMakefileGenerator::init()
if (0 != project->values("TARGET.UID2").size()) {
uid2 = project->first("TARGET.UID2");
- } else if (project->values("CONFIG").contains("stdbinary", Qt::CaseInsensitive)) {
+ } else if (project->isActiveConfig("stdbinary")) {
uid2 = "0x20004C45";
} else {
if (targetType == TypeExe) {
@@ -794,7 +836,7 @@ void SymbianMakefileGenerator::writeMmpFile(QString &filename, QStringList &symb
}
t << endl;
- if (!project->values("CONFIG").contains("static") && !project->values("CONFIG").contains("staticlib")) {
+ if (!project->isActiveConfig("static") && !project->isActiveConfig("staticlib")) {
writeMmpFileLibraryPart(t);
}
@@ -847,7 +889,7 @@ void SymbianMakefileGenerator::writeMmpFileTargetPart(QTextStream& t)
if (targetType == TypeExe) {
t << MMP_TARGET "\t\t" << fixedTarget << ".exe" << endl;
if (!skipTargetType) {
- if (project->values("CONFIG").contains("stdbinary", Qt::CaseInsensitive))
+ if (project->isActiveConfig("stdbinary"))
t << MMP_TARGETTYPE "\t\tSTDEXE" << endl;
else
t << MMP_TARGETTYPE "\t\tEXE" << endl;
@@ -855,7 +897,7 @@ void SymbianMakefileGenerator::writeMmpFileTargetPart(QTextStream& t)
} else if (targetType == TypeDll || targetType == TypePlugin) {
t << MMP_TARGET "\t\t" << fixedTarget << ".dll" << endl;
if (!skipTargetType) {
- if (project->values("CONFIG").contains("stdbinary", Qt::CaseInsensitive))
+ if (project->isActiveConfig("stdbinary"))
t << MMP_TARGETTYPE "\t\tSTDDLL" << endl;
else
t << MMP_TARGETTYPE "\t\tDLL" << endl;
@@ -863,7 +905,7 @@ void SymbianMakefileGenerator::writeMmpFileTargetPart(QTextStream& t)
} else if (targetType == TypeLib) {
t << MMP_TARGET "\t\t" << fixedTarget << ".lib" << endl;
if (!skipTargetType) {
- if (project->values("CONFIG").contains("stdbinary", Qt::CaseInsensitive))
+ if (project->isActiveConfig("stdbinary"))
t << MMP_TARGETTYPE "\t\tSTDLIB" << endl;
else
t << MMP_TARGETTYPE "\t\tLIB" << endl;
@@ -899,7 +941,7 @@ void SymbianMakefileGenerator::writeMmpFileTargetPart(QTextStream& t)
if (0 != project->values("TARGET.EPOCALLOWDLLDATA").size())
t << MMP_EPOCALLOWDLLDATA << endl;
- if (targetType == TypePlugin && !project->values("CONFIG").contains("stdbinary", Qt::CaseInsensitive)) {
+ if (targetType == TypePlugin && !project->isActiveConfig("stdbinary")) {
// Use custom def file for Qt plugins
t << "DEFFILE " PLUGIN_COMMON_DEF_FILE_FOR_MMP << endl;
}
@@ -915,7 +957,7 @@ void SymbianMakefileGenerator::writeMmpFileTargetPart(QTextStream& t)
void SymbianMakefileGenerator::writeMmpFileResourcePart(QTextStream& t, QStringList &symbianLangCodes)
{
if ((targetType == TypeExe) &&
- !project->values("CONFIG").contains("no_icon", Qt::CaseInsensitive)) {
+ !project->isActiveConfig("no_icon")) {
QString locTarget = fixedTarget;
locTarget.append(".rss");
@@ -1273,7 +1315,7 @@ void SymbianMakefileGenerator::writeBldInfContent(QTextStream &t, bool addDeploy
// Add project mmps and old style extension makefiles
QString mmpTag;
- if (project->values("CONFIG").contains("symbian_test", Qt::CaseInsensitive))
+ if (project->isActiveConfig("symbian_test"))
mmpTag = QLatin1String(BLD_INF_TAG_TESTMMPFILES);
else
mmpTag = QLatin1String(BLD_INF_TAG_MMPFILES);
@@ -1520,7 +1562,7 @@ void SymbianMakefileGenerator::readRssRules(QString &numberOfIcons, QString &ico
if (!numberOfIcons.isEmpty()) {
bool ok;
numberOfIcons = numberOfIcons.simplified();
- int tmp = numberOfIcons.toInt(&ok);
+ numberOfIcons.toInt(&ok);
if (!ok) {
numberOfIcons.clear();
iconFile.clear();
diff --git a/qmake/generators/symbian/symmake_abld.cpp b/qmake/generators/symbian/symmake_abld.cpp
index 9954783..26dd3fd 100644
--- a/qmake/generators/symbian/symmake_abld.cpp
+++ b/qmake/generators/symbian/symmake_abld.cpp
@@ -172,7 +172,7 @@ void SymbianAbldMakefileGenerator::writeWrapperMakefile(QFile& wrapperFile, bool
releasePlatforms.removeAll("winscw"); // No release for emulator
QString testClause;
- if (project->values("CONFIG").contains("symbian_test", Qt::CaseInsensitive))
+ if (project->isActiveConfig("symbian_test"))
testClause = QLatin1String(" test");
else
testClause = QLatin1String("");
diff --git a/qmake/generators/symbian/symmake_sbsv2.cpp b/qmake/generators/symbian/symmake_sbsv2.cpp
index 5adf30d..e081b19 100644
--- a/qmake/generators/symbian/symmake_sbsv2.cpp
+++ b/qmake/generators/symbian/symmake_sbsv2.cpp
@@ -106,7 +106,7 @@ void SymbianSbsv2MakefileGenerator::writeWrapperMakefile(QFile& wrapperFile, boo
releasePlatforms.removeAll("winscw"); // No release for emulator
QString testClause;
- if (project->values("CONFIG").contains("symbian_test", Qt::CaseInsensitive))
+ if (project->isActiveConfig("symbian_test"))
testClause = QLatin1String(".test");
else
testClause = QLatin1String("");
diff --git a/qmake/generators/win32/winmakefile.cpp b/qmake/generators/win32/winmakefile.cpp
index efdf8ac..9d3b4c6 100644
--- a/qmake/generators/win32/winmakefile.cpp
+++ b/qmake/generators/win32/winmakefile.cpp
@@ -467,11 +467,12 @@ void Win32MakefileGenerator::processRcFileVar()
resFile.replace(".rc", Option::res_ext);
project->values("RES_FILE").prepend(fileInfo(resFile).fileName());
- if (!project->values("OBJECTS_DIR").isEmpty())
+ if (!project->values("OBJECTS_DIR").isEmpty()) {
if(project->isActiveConfig("staticlib"))
project->values("RES_FILE").first().prepend(fileInfo(project->values("DESTDIR").first()).absoluteFilePath() + Option::dir_sep);
else
project->values("RES_FILE").first().prepend(project->values("OBJECTS_DIR").first() + Option::dir_sep);
+ }
project->values("RES_FILE").first() = Option::fixPathToTargetOS(project->values("RES_FILE").first(), false, false);
project->values("POST_TARGETDEPS") += project->values("RES_FILE");
project->values("CLEAN_FILES") += project->values("RES_FILE");
diff --git a/qmake/meta.cpp b/qmake/meta.cpp
index 1c71d60..5b36682 100644
--- a/qmake/meta.cpp
+++ b/qmake/meta.cpp
@@ -119,10 +119,11 @@ QMakeMetaInfo::findLib(QString lib)
}
}
}
- if(ret.isNull())
+ if(ret.isNull()) {
debug_msg(2, "QMakeMetaInfo: Cannot find info file for %s", lib.toLatin1().constData());
- else
+ } else {
debug_msg(2, "QMakeMetaInfo: Found info file %s for %s", ret.toLatin1().constData(), lib.toLatin1().constData());
+ }
return ret;
}
diff --git a/qmake/option.cpp b/qmake/option.cpp
index 4eb14e2..5e06721 100644
--- a/qmake/option.cpp
+++ b/qmake/option.cpp
@@ -644,8 +644,8 @@ Option::fixString(QString string, uchar flags)
string = string.replace('/', Option::dir_sep).replace('\\', Option::dir_sep);
}
- if (string.startsWith("\"") && string.endsWith("\"") ||
- string.startsWith("\'") && string.endsWith("\'"))
+ if ((string.startsWith("\"") && string.endsWith("\"")) ||
+ (string.startsWith("\'") && string.endsWith("\'")))
string = string.mid(1, string.length()-2);
//cache
diff --git a/qmake/project.cpp b/qmake/project.cpp
index c2e033e..4ce8ba4 100644
--- a/qmake/project.cpp
+++ b/qmake/project.cpp
@@ -3067,7 +3067,7 @@ QStringList &QMakeProject::values(const QString &_var, QMap<QString, QStringList
place[var] = QStringList(pfile);
} else if(var == QLatin1String("_PRO_FILE_PWD_")) {
var = ".BUILTIN." + var;
- place[var] = QStringList(QFileInfo(pfile).absolutePath());
+ place[var] = QStringList(pfile.isEmpty() ? qmake_getpwd() : QFileInfo(pfile).absolutePath());
} else if(var == QLatin1String("_QMAKE_CACHE_")) {
var = ".BUILTIN." + var;
if(Option::mkfile::do_cache)