370 void MingwMakefileGenerator::writeObjectsPart(QTextStream &t) |
370 void MingwMakefileGenerator::writeObjectsPart(QTextStream &t) |
371 { |
371 { |
372 if (project->values("OBJECTS").count() < var("QMAKE_LINK_OBJECT_MAX").toInt()) { |
372 if (project->values("OBJECTS").count() < var("QMAKE_LINK_OBJECT_MAX").toInt()) { |
373 objectsLinkLine = "$(OBJECTS)"; |
373 objectsLinkLine = "$(OBJECTS)"; |
374 } else if (project->isActiveConfig("staticlib") && project->first("TEMPLATE") == "lib") { |
374 } else if (project->isActiveConfig("staticlib") && project->first("TEMPLATE") == "lib") { |
375 QString ar_script_file = var("QMAKE_LINK_OBJECT_SCRIPT") + "." + var("TARGET"); |
375 QString ar_script_file = var("QMAKE_LINK_OBJECT_SCRIPT") + "." + var("TARGET"); |
376 if (!var("BUILD_NAME").isEmpty()) { |
376 if (!var("BUILD_NAME").isEmpty()) { |
377 ar_script_file += "." + var("BUILD_NAME"); |
377 ar_script_file += "." + var("BUILD_NAME"); |
378 } |
378 } |
379 createArObjectScriptFile(ar_script_file, var("DEST_TARGET"), project->values("OBJECTS")); |
379 createArObjectScriptFile(ar_script_file, var("DEST_TARGET"), project->values("OBJECTS")); |
380 if(!project->isEmpty("QMAKE_AR")) { |
380 // QMAKE_LIB is used for win32, including mingw, whereas QMAKE_AR is used on Unix. |
381 objectsLinkLine = var("QMAKE_AR") + " -M < " + ar_script_file; |
381 // Strip off any options since the ar commands will be read from file. |
382 } else { |
382 QString ar_cmd = var("QMAKE_LIB").section(" ", 0, 0);; |
383 objectsLinkLine = "ar -M < " + ar_script_file; |
383 if (ar_cmd.isEmpty()) |
384 } |
384 ar_cmd = "ar"; |
|
385 objectsLinkLine = ar_cmd + " -M < " + ar_script_file; |
385 } else { |
386 } else { |
386 QString ld_script_file = var("QMAKE_LINK_OBJECT_SCRIPT") + "." + var("TARGET"); |
387 QString ld_script_file = var("QMAKE_LINK_OBJECT_SCRIPT") + "." + var("TARGET"); |
387 if (!var("BUILD_NAME").isEmpty()) { |
388 if (!var("BUILD_NAME").isEmpty()) { |
388 ld_script_file += "." + var("BUILD_NAME"); |
389 ld_script_file += "." + var("BUILD_NAME"); |
389 } |
390 } |