diff options
author | Oswald Buddenhagen <oswald.buddenhagen@digia.com> | 2012-12-04 21:17:24 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2012-12-05 17:29:46 +0100 |
commit | 9a07707996f8edb55daa1adae1d5231940ff10d2 (patch) | |
tree | 22564741e82a31da494d1a02540466a38215a15b | |
parent | 621b0e206268b0505971feb5722d803f01e6778f (diff) |
centralize MAKEFILE writeout better
nmake depends on a variable being assigned before it is referenced, so
just write it out to every Makefile as the very first thing.
this is nicer than the previous hack anyway.
Change-Id: I50f409919352f560f7ef6c848a2f7c51d1878148
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
-rw-r--r-- | qmake/generators/makefile.cpp | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/qmake/generators/makefile.cpp b/qmake/generators/makefile.cpp index 22772f8392..0456d6bab3 100644 --- a/qmake/generators/makefile.cpp +++ b/qmake/generators/makefile.cpp @@ -2192,11 +2192,6 @@ MakefileGenerator::writeStubMakefile(QTextStream &t) bool MakefileGenerator::writeMakefile(QTextStream &t) { - QString ofile = Option::fixPathToTargetOS(Option::output.fileName()); - if (ofile.lastIndexOf(Option::dir_sep) != -1) - ofile.remove(0, ofile.lastIndexOf(Option::dir_sep) +1); - t << "MAKEFILE = " << ofile << endl << endl; - t << "####### Compile" << endl << endl; writeObj(t, "SOURCES"); writeObj(t, "GENERATED_SOURCES"); @@ -2257,6 +2252,10 @@ MakefileGenerator::writeHeader(QTextStream &t) t << "# Command: " << build_args().replace("$(QMAKE)", var("QMAKE_QMAKE")) << endl; t << "#############################################################################" << endl; t << endl; + QString ofile = Option::fixPathToTargetOS(Option::output.fileName()); + if (ofile.lastIndexOf(Option::dir_sep) != -1) + ofile.remove(0, ofile.lastIndexOf(Option::dir_sep) +1); + t << "MAKEFILE = " << ofile << endl << endl; } QList<MakefileGenerator::SubTarget*> @@ -2415,10 +2414,6 @@ MakefileGenerator::writeSubTargets(QTextStream &t, QList<MakefileGenerator::SubT t << "include " << (*qeui_it) << endl; if (!(flags & SubTargetSkipDefaultVariables)) { - QString ofile = Option::fixPathToTargetOS(Option::output.fileName()); - if(ofile.lastIndexOf(Option::dir_sep) != -1) - ofile.remove(0, ofile.lastIndexOf(Option::dir_sep) +1); - t << "MAKEFILE = " << ofile << endl; /* Calling Option::fixPathToTargetOS() is necessary for MinGW/MSYS, which requires * back-slashes to be turned into slashes. */ t << "QMAKE = " << var("QMAKE_QMAKE") << endl; |