summaryrefslogtreecommitdiffstats
path: root/qmake/generators
diff options
context:
space:
mode:
authorTor Arne Vestbø <tor.arne.vestbo@nokia.com>2011-10-11 20:27:22 +0200
committerQt by Nokia <qt-info@nokia.com>2011-10-11 21:00:07 +0200
commiteba17baaed035e1e0848c71b485e4fede1ad398f (patch)
tree11af962168a829b3ca06ed035871606cdc4b99d8 /qmake/generators
parent82d897febfa948a011f194bd7c4255c42fa8b780 (diff)
Make CONFIG+=GNUmake respect shadow builds
Previously we were generating include lines based on the relative path of the source file, which resulted in the .d files being placed in the source dir as well. We now expect the .d files to live in the output dir, but keep the dependency from the .d file to the original source file. Before: .deps/%.d: %.cpp -include .deps/../../src/foo.d After: .deps/%.d: ../../src/%.cpp -include .deps/foo.d Change-Id: I749adeb671cf8424f0849521c5bb1489eb3e76d5 Reviewed-on: http://codereview.qt-project.org/6455 Sanity-Review: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Marius Storm-Olsen <marius.storm-olsen@nokia.com>
Diffstat (limited to 'qmake/generators')
-rw-r--r--qmake/generators/unix/unixmake2.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/qmake/generators/unix/unixmake2.cpp b/qmake/generators/unix/unixmake2.cpp
index 49300f3102..70a7d66a9b 100644
--- a/qmake/generators/unix/unixmake2.cpp
+++ b/qmake/generators/unix/unixmake2.cpp
@@ -282,14 +282,17 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
QString odir;
if(!project->values("OBJECTS_DIR").isEmpty())
odir = project->first("OBJECTS_DIR");
+
+ QString pwd = escapeFilePath(fileFixify(qmake_getpwd()));
+
t << "###### Dependencies" << endl << endl;
- t << odir << ".deps/%.d: %.cpp\n\t";
+ t << odir << ".deps/%.d: " << pwd << "/%.cpp\n\t";
if(project->isActiveConfig("echo_depend_creation"))
t << "@echo Creating depend for $<" << "\n\t";
t << mkdir_p_asstring("$(@D)") << "\n\t"
<< "@$(CXX) " << cmd << " $< | sed \"s,^\\($(*F).o\\):," << odir << "\\1:,g\" >$@" << endl << endl;
- t << odir << ".deps/%.d: %.c\n\t";
+ t << odir << ".deps/%.d: " << pwd << "/%.c\n\t";
if(project->isActiveConfig("echo_depend_creation"))
t << "@echo Creating depend for $<" << "\n\t";
t << mkdir_p_asstring("$(@D)") << "\n\t"
@@ -317,8 +320,9 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
}
}
}
+
if(!d_file.isEmpty()) {
- d_file = odir + ".deps/" + d_file + ".d";
+ d_file = odir + ".deps/" + fileFixify(d_file, pwd, Option::output_dir) + ".d";
QStringList deps = findDependencies((*it)).filter(QRegExp(Option::cpp_moc_ext + "$"));
if(!deps.isEmpty())
t << d_file << ": " << deps.join(" ") << endl;