merge string literals

makes for less visual noise and a tiny bit more efficient code.

Change-Id: I587707fa4e2dc9bead9435bf5caf3a98ab680725
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
This commit is contained in:
Oswald Buddenhagen 2013-07-04 11:25:16 +02:00 committed by The Qt Project
parent d149ceef4a
commit 51980595e1
7 changed files with 540 additions and 540 deletions

View File

@ -113,8 +113,8 @@ GBuildMakefileGenerator::write()
/* this is for bulding an INTEGRITY application.
* generate the .int integrate file and the .gpj INTEGRITY Application
* project file, then go on with regular files */
t << "#!gbuild" << "\n";
t << "[INTEGRITY Application]" << "\n";
t << "#!gbuild\n";
t << "[INTEGRITY Application]\n";
t << "\t:binDirRelative=.\n";
t << "\t-o " << strtarget << "\n";
t << intname << "\n";
@ -125,24 +125,24 @@ GBuildMakefileGenerator::write()
QFile f(intname);
f.open(QIODevice::WriteOnly | QIODevice::Text | QIODevice::Truncate);
QTextStream ti(&f);
ti << "# This is a file automatically generated by qmake" << "\n";
ti << "# Modifications will be lost next time you run qmake" << "\n";
ti << "Kernel" << "\n";
ti << "\tFilename\tDynamicDownload" << "\n";
ti << "EndKernel" << "\n" << "\n";
ti << "AddressSpace" << "\n";
ti << "# This is a file automatically generated by qmake\n";
ti << "# Modifications will be lost next time you run qmake\n";
ti << "Kernel\n";
ti << "\tFilename\tDynamicDownload\n";
ti << "EndKernel\n\n";
ti << "AddressSpace\n";
ti << "\tName\t" << strtarget << "\n";
ti << "\tFilename\t" << strtarget << "_app" << "\n";
ti << "\tMemoryPoolSize\t0x100000" << "\n";
ti << "\tLanguage\tC++" << "\n";
ti << "\tFilename\t" << strtarget << "_app\n";
ti << "\tMemoryPoolSize\t0x100000\n";
ti << "\tLanguage\tC++\n";
/* FIXME : heap size is huge to be big enough for every example
* it should probably be tailored for each example, btu there is no
* good way to guess that */
ti << "\tHeapSize\t0x00D00000" << "\n";
ti << "\tTask\tInitial" << "\n";
ti << "\t\tStackSize\t0x30000" << "\n";
ti << "\tEndTask" << "\n";
ti << "EndAddressSpace" << "\n";
ti << "\tHeapSize\t0x00D00000\n";
ti << "\tTask\tInitial\n";
ti << "\t\tStackSize\t0x30000\n";
ti << "\tEndTask\n";
ti << "EndAddressSpace\n";
ti.flush();
/* change current project file to <projectname>_app.gpj and continue
@ -220,19 +220,19 @@ GBuildMakefileGenerator::write()
filename.remove(qmake_getpwd());
//HEADER
t << "#!gbuild" << "\n";
t << "#!gbuild\n";
/* find the architecture out of the compiler name */
if (filename.endsWith("projects.gpj")) {
primaryTarget.remove(0, 5);
t << "macro QT_BUILD_DIR=%expand_path(.)\n";
t << "macro __OS_DIR=" << project->values("INTEGRITY_DIR").first() << "\n";
t << "primaryTarget=" << primaryTarget << "_integrity.tgt" << "\n";
t << "primaryTarget=" << primaryTarget << "_integrity.tgt\n";
t << "customization=util/integrity/qt.bod\n";
}
/* project type */
if (project->first("TEMPLATE") == "app") {
t << "[Program]" << "\n";
t << "[Program]\n";
if (isnativebin) {
t << "\t:binDir=bin\n";
t << "\t-o " << strtarget << "\n";
@ -241,16 +241,16 @@ GBuildMakefileGenerator::write()
t << "\t-o " << strtarget << "_app\n";
}
} else if (project->first("TEMPLATE") == "lib") {
t << "[Library]" << "\n";
t << "\t:binDir=lib" << "\n";
t << "\t-o lib" << strtarget << ".a" << "\n";
t << "[Library]\n";
t << "\t:binDir=lib\n";
t << "\t-o lib" << strtarget << ".a\n";
} else if (project->first("TEMPLATE") == "subdirs")
t << "[Project]" << "\n";
t << "[Project]\n";
else
t << project->first("TEMPLATE") << "\n";
/* compilations options */
t << "\t:sourceDir=." << "\n";
t << "\t:sourceDir=.\n";
t << "\t:outputDir=work" << relpath << "\n";
if (filename.endsWith("projects.gpj")) {
@ -261,7 +261,7 @@ GBuildMakefileGenerator::write()
const ProStringList &l = project->values("QMAKE_CXXFLAGS");
for (ProStringList::ConstIterator it = l.begin(); it != l.end(); ++it) {
if ((*it).startsWith("-"))
t << "\n" << "\t" << (*it);
t << "\n\t" << (*it);
else
t << " " << (*it);
}
@ -287,7 +287,7 @@ GBuildMakefileGenerator::write()
const ProStringList &l = project->values(src[i]);
for (ProStringList::ConstIterator it = l.begin(); it != l.end(); ++it) {
if ((*it).startsWith("-"))
t << "\n" << "\t" << (*it);
t << "\n\t" << (*it);
else
t << " " << (*it);
}

File diff suppressed because it is too large Load Diff

View File

@ -1041,7 +1041,7 @@ MakefileGenerator::writeProjectMakefile()
}
}
if(project->isActiveConfig("build_all")) {
t << "first: all" << endl;
t << "first: all\n";
QList<SubTarget*>::Iterator it;
//install
@ -1057,8 +1057,8 @@ MakefileGenerator::writeProjectMakefile()
t << endl;
} else {
t << "first: " << targets.first()->target << endl
<< "install: " << targets.first()->target << "-install" << endl
<< "uninstall: " << targets.first()->target << "-uninstall" << endl;
<< "install: " << targets.first()->target << "-install\n"
<< "uninstall: " << targets.first()->target << "-uninstall\n";
}
writeSubTargets(t, targets, SubTargetsNoFlags);
@ -1397,7 +1397,7 @@ MakefileGenerator::writeInstalls(QTextStream &t, bool noBuild)
t << "uninstall_" << (*it) << ": FORCE";
for (int i = uninst.size(); --i >= 0; )
t << "\n\t" << uninst.at(i);
t << "\n\t-$(DEL_DIR) " << filePrefixRoot(root, dst) << " " << endl << endl;
t << "\n\t-$(DEL_DIR) " << filePrefixRoot(root, dst) << " \n\n";
}
t << endl;
@ -1910,7 +1910,7 @@ MakefileGenerator::writeExtraCompilerTargets(QTextStream &t)
if(tmp_clean.isEmpty())
tmp_clean = tmp_out;
if(tmp_clean.indexOf("${QMAKE_") == -1) {
t << "\n\t" << "-$(DEL_FILE) " << tmp_clean;
t << "\n\t-$(DEL_FILE) " << tmp_clean;
wrote_clean = true;
}
if(!wrote_clean_cmds || !wrote_clean) {
@ -2146,7 +2146,7 @@ MakefileGenerator::writeExtraCompilerVariables(QTextStream &t)
const ProStringList &vars = project->values(ProKey(*it + ".variables"));
for (ProStringList::ConstIterator varit = vars.begin(); varit != vars.end(); ++varit) {
if(first) {
t << "\n####### Custom Compiler Variables" << endl;
t << "\n####### Custom Compiler Variables\n";
first = false;
}
t << "QMAKE_COMP_" << (*varit) << " = "
@ -2173,7 +2173,7 @@ MakefileGenerator::writeExtraVariables(QTextStream &t)
}
}
if (!outlist.isEmpty()) {
t << "####### Custom Variables" << endl;
t << "####### Custom Variables\n";
t << outlist.join("\n") << endl << endl;
}
}
@ -2186,24 +2186,24 @@ MakefileGenerator::writeStubMakefile(QTextStream &t)
for (ProStringList::ConstIterator it = qut.begin(); it != qut.end(); ++it)
t << *it << " ";
//const QString ofile = Option::fixPathToTargetOS(fileFixify(Option::output.fileName()));
t << "first all clean install distclean uninstall: " << "qmake" << endl
<< "qmake_all:" << endl;
t << "first all clean install distclean uninstall: qmake\n"
<< "qmake_all:\n";
writeMakeQmake(t);
t << "FORCE:" << endl << endl;
t << "FORCE:\n\n";
return true;
}
bool
MakefileGenerator::writeMakefile(QTextStream &t)
{
t << "####### Compile" << endl << endl;
t << "####### Compile\n\n";
writeObj(t, "SOURCES");
writeObj(t, "GENERATED_SOURCES");
t << "####### Install" << endl << endl;
t << "####### Install\n\n";
writeInstalls(t);
t << "FORCE:" << endl << endl;
t << "FORCE:\n\n";
return true;
}
@ -2246,7 +2246,7 @@ QString MakefileGenerator::build_args(const QString &outdir)
void
MakefileGenerator::writeHeader(QTextStream &t)
{
t << "#############################################################################" << endl;
t << "#############################################################################\n";
t << "# Makefile for building: " << escapeFilePath(var("TARGET")) << endl;
t << "# Generated by qmake (" QMAKE_VERSION_STR ") (Qt " QT_VERSION_STR ") on: ";
t << QDateTime::currentDateTime().toString() << endl;
@ -2254,7 +2254,7 @@ MakefileGenerator::writeHeader(QTextStream &t)
t << "# Template: " << var("TEMPLATE") << endl;
if(!project->isActiveConfig("build_pass"))
t << "# Command: " << build_args().replace("$(QMAKE)", var("QMAKE_QMAKE")) << endl;
t << "#############################################################################" << endl;
t << "#############################################################################\n";
t << endl;
QString ofile = Option::fixPathToTargetOS(Option::output.fileName());
if (ofile.lastIndexOf(Option::dir_sep) != -1)
@ -2379,7 +2379,7 @@ void
MakefileGenerator::writeSubDirs(QTextStream &t)
{
QList<SubTarget*> targets = findSubDirsSubTargets();
t << "first: make_first" << endl;
t << "first: make_first\n";
int flags = SubTargetInstalls;
if(project->isActiveConfig("ordered"))
flags |= SubTargetOrdered;
@ -2539,10 +2539,10 @@ MakefileGenerator::writeSubTargets(QTextStream &t, QList<MakefileGenerator::SubT
if(!targets.isEmpty()) {
for(QList<SubTarget*>::Iterator it = targets.begin(); it != targets.end(); ++it) {
if(!(*it)->profile.isEmpty())
t << " " << (*it)->target << "-" << "qmake_all";
t << " " << (*it)->target << "-qmake_all";
}
}
t << " FORCE" << endl << endl;
t << " FORCE\n\n";
}
for(int s = 0; s < targetSuffixes.size(); ++s) {
@ -2571,7 +2571,7 @@ MakefileGenerator::writeSubTargets(QTextStream &t, QList<MakefileGenerator::SubT
t << varGlue("ALL_DEPS"," "," ","");
if(suffix == "clean")
t << varGlue("CLEAN_DEPS"," "," ","");
t << " FORCE" << endl;
t << " FORCE\n";
if(suffix == "clean") {
t << fileVarGlue("QMAKE_CLEAN", "\t-$(DEL_FILE) ", "\n\t-$(DEL_FILE) ", "\n");
} else if(suffix == "distclean") {
@ -2672,7 +2672,7 @@ MakefileGenerator::writeSubTargets(QTextStream &t, QList<MakefileGenerator::SubT
project->values("UNINSTALLDEPS") += "uninstall_subtargets";
writeInstalls(t, true);
}
t << "FORCE:" << endl << endl;
t << "FORCE:\n\n";
}
void
@ -2681,7 +2681,7 @@ MakefileGenerator::writeMakeQmake(QTextStream &t, bool noDummyQmakeAll)
QString ofile = Option::fixPathToTargetOS(fileFixify(Option::output.fileName()));
if(project->isEmpty("QMAKE_FAILED_REQUIREMENTS") && !project->isEmpty("QMAKE_INTERNAL_PRL_FILE")) {
QStringList files = fileFixify(Option::mkfile::project_files);
t << escapeDependencyPath(project->first("QMAKE_INTERNAL_PRL_FILE").toQString()) << ": " << "\n\t"
t << escapeDependencyPath(project->first("QMAKE_INTERNAL_PRL_FILE").toQString()) << ": \n\t"
<< "@$(QMAKE) -prl " << buildArgs() << " " << files.join(' ') << endl;
}
@ -2705,13 +2705,13 @@ MakefileGenerator::writeMakeQmake(QTextStream &t, bool noDummyQmakeAll)
for(int include = 0; include < included.size(); ++include) {
const ProString &i = included.at(include);
if(!i.isEmpty())
t << i << ":" << endl;
t << i << ":\n";
}
}
if(project->first("QMAKE_ORIG_TARGET") != "qmake") {
t << "qmake: FORCE\n\t@" << qmake << endl << endl;
if (!noDummyQmakeAll)
t << "qmake_all: FORCE" << endl << endl;
t << "qmake_all: FORCE\n\n";
}
}
@ -3254,7 +3254,7 @@ MakefileGenerator::writePkgConfigFile()
if (project->isActiveConfig("shared"))
pkgConfiglibName += project->first("TARGET_VERSION_EXT").toQString();
}
t << pkgConfiglibDir << " " << pkgConfiglibName << " " << endl;
t << pkgConfiglibDir << " " << pkgConfiglibName << " \n";
ProStringList libs;
if(!project->isEmpty("QMAKE_INTERNAL_PRL_LIBS")) {
@ -3278,7 +3278,7 @@ MakefileGenerator::writePkgConfigFile()
<< varGlue("PRL_EXPORT_CXXFLAGS", "", " ", " ")
<< varGlue("QMAKE_PKGCONFIG_CFLAGS", "", " ", " ")
// << varGlue("DEFINES","-D"," -D"," ")
<< "-I${includedir}" << endl;
<< "-I${includedir}\n";
// requires
const QString requires = project->values("QMAKE_PKGCONFIG_REQUIRES").join(' ');

View File

@ -85,12 +85,12 @@ UnixMakefileGenerator::writeMakefile(QTextStream &t)
const ProStringList &qut = project->values("QMAKE_EXTRA_TARGETS");
for (ProStringList::ConstIterator it = qut.begin(); it != qut.end(); ++it)
t << *it << " ";
t << "first all clean install distclean uninstall qmake_all:" << "\n\t"
t << "first all clean install distclean uninstall qmake_all:\n\t"
<< "@echo \"Some of the required modules ("
<< var("QMAKE_FAILED_REQUIREMENTS") << ") are not available.\"" << "\n\t"
<< "@echo \"Skipped.\"" << endl << endl;
<< var("QMAKE_FAILED_REQUIREMENTS") << ") are not available.\"\n\t"
<< "@echo \"Skipped.\"\n\n";
writeMakeQmake(t);
t << "FORCE:" << endl << endl;
t << "FORCE:\n\n";
return true;
}
@ -118,15 +118,15 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
(!project->isActiveConfig("staticlib")))),
src_incremental=false;
t << "####### Compiler, tools and options" << endl << endl;
t << "####### Compiler, tools and options\n\n";
t << "CC = " << var("QMAKE_CC") << endl;
t << "CXX = " << var("QMAKE_CXX") << endl;
t << "DEFINES = "
<< varGlue("PRL_EXPORT_DEFINES","-D"," -D"," ")
<< varGlue("DEFINES","-D"," -D","") << endl;
t << "CFLAGS = " << var("QMAKE_CFLAGS") << " $(DEFINES)" << endl;
t << "CXXFLAGS = " << var("QMAKE_CXXFLAGS") << " $(DEFINES)" << endl;
t << "INCPATH = " << "-I" << specdir();
t << "CFLAGS = " << var("QMAKE_CFLAGS") << " $(DEFINES)\n";
t << "CXXFLAGS = " << var("QMAKE_CXXFLAGS") << " $(DEFINES)\n";
t << "INCPATH = -I" << specdir();
if(!project->isActiveConfig("no_include_pwd")) {
QString pwd = escapeFilePath(fileFixify(qmake_getpwd()));
if(pwd.isEmpty())
@ -138,7 +138,7 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
for(int i = 0; i < incs.size(); ++i) {
ProString inc = escapeFilePath(incs.at(i));
if(!inc.isEmpty())
t << " " << "-I" << inc;
t << " -I" << inc;
}
}
if(!project->isEmpty("QMAKE_FRAMEWORKPATH_FLAGS"))
@ -148,7 +148,7 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
if(!project->isActiveConfig("staticlib")) {
t << "LINK = " << var("QMAKE_LINK") << endl;
t << "LFLAGS = " << var("QMAKE_LFLAGS") << endl;
t << "LIBS = " << "$(SUBLIBS) " << var("QMAKE_LIBS") << " " << var("QMAKE_LIBS_PRIVATE") << endl;
t << "LIBS = $(SUBLIBS) " << var("QMAKE_LIBS") << " " << var("QMAKE_LIBS_PRIVATE") << endl;
}
t << "AR = " << var("QMAKE_AR") << endl;
@ -176,15 +176,15 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
t << endl;
t << "####### Output directory" << endl << endl;
t << "####### Output directory\n\n";
if (! project->values("OBJECTS_DIR").isEmpty())
t << "OBJECTS_DIR = " << var("OBJECTS_DIR") << endl;
else
t << "OBJECTS_DIR = ./" << endl;
t << "OBJECTS_DIR = ./\n";
t << endl;
/* files */
t << "####### Files" << endl << endl;
t << "####### Files\n\n";
t << "SOURCES = " << valList(escapeFilePaths(project->values("SOURCES"))) << " "
<< valList(escapeFilePaths(project->values("GENERATED_SOURCES"))) << endl;
if(do_incremental) {
@ -225,7 +225,7 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
// would be interpreted as line continuation. The lack of spacing between the value and the
// comment is also important as otherwise quoted use of "$(DESTDIR)" would include this
// spacing.
t << "DESTDIR = " << var("DESTDIR") << "#avoid trailing-slash linebreak" << endl;
t << "DESTDIR = " << var("DESTDIR") << "#avoid trailing-slash linebreak\n";
if(project->isActiveConfig("compile_libtool"))
t << "TARGETL = " << var("TARGET_la") << endl;
t << "TARGET = " << escapeFilePath(var("TARGET")) << endl;
@ -257,8 +257,8 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
t << "include " << (*it) << endl;
/* rules */
t << "first: all" << endl;
t << "####### Implicit rules" << endl << endl;
t << "first: all\n";
t << "####### Implicit rules\n\n";
t << ".SUFFIXES: " << Option::obj_ext;
for(QStringList::Iterator cit = Option::c_ext.begin(); cit != Option::c_ext.end(); ++cit)
t << " " << (*cit);
@ -290,18 +290,18 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
QString pwd = escapeFilePath(fileFixify(qmake_getpwd()));
t << "###### Dependencies" << endl << endl;
t << "###### Dependencies\n\n";
t << odir << ".deps/%.d: " << pwd << "/%.cpp\n\t";
if(project->isActiveConfig("echo_depend_creation"))
t << "@echo Creating depend for $<" << "\n\t";
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;
<< "@$(CXX) " << cmd << " $< | sed \"s,^\\($(*F).o\\):," << odir << "\\1:,g\" >$@\n\n";
t << odir << ".deps/%.d: " << pwd << "/%.c\n\t";
if(project->isActiveConfig("echo_depend_creation"))
t << "@echo Creating depend for $<" << "\n\t";
t << "@echo Creating depend for $<\n\t";
t << mkdir_p_asstring("$(@D)") << "\n\t"
<< "@$(CC) " << cmd << " $< | sed \"s,^\\($(*F).o\\):," << odir << "\\1:,g\" >$@" << endl << endl;
<< "@$(CC) " << cmd << " $< | sed \"s,^\\($(*F).o\\):," << odir << "\\1:,g\" >$@\n\n";
static const char * const src[] = { "SOURCES", "GENERATED_SOURCES", 0 };
for (int x = 0; src[x]; x++) {
@ -341,7 +341,7 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
}
}
t << "####### Build rules" << endl << endl;
t << "####### Build rules\n\n";
if(!project->values("SUBLIBS").isEmpty()) {
ProString libdir = "tmp/";
if(!project->isEmpty("SUBLIBS_DIR"))
@ -371,9 +371,9 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
t << ":\n\t@echo \"Creating '";
else
t << ": FORCE\n\t@echo \"Creating/updating '";
t << targ << "'\"" << "\n\t"
t << targ << "'\"\n\t"
<< "(cd " << libinfo.first("QMAKE_PRL_BUILD_DIR") << ";"
<< "$(MAKE))" << endl;
<< "$(MAKE))\n";
}
}
}
@ -397,8 +397,8 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
if(project->first("QMAKE_INCREMENTAL_STYLE") == "ld") {
QString incr_target_dir = var("OBJECTS_DIR") + incr_target + Option::obj_ext;
//actual target
t << incr_target_dir << ": $(OBJECTS)" << "\n\t"
<< "ld -r -o "<< incr_target_dir << " $(OBJECTS)" << endl;
t << incr_target_dir << ": $(OBJECTS)\n\t"
<< "ld -r -o "<< incr_target_dir << " $(OBJECTS)\n";
//communicated below
deps.prepend(incr_target_dir + " ");
incr_deps = "$(INCREMENTAL_OBJECTS)";
@ -414,11 +414,11 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
incr_lflags += var("QMAKE_LFLAGS_DEBUG");
else
incr_lflags += var("QMAKE_LFLAGS_RELEASE");
t << incr_target_dir << ": $(INCREMENTAL_OBJECTS)" << "\n\t";
t << incr_target_dir << ": $(INCREMENTAL_OBJECTS)\n\t";
if(!destdir.isEmpty())
t << "\n\t" << mkdir_p_asstring(destdir) << "\n\t";
t << "$(LINK) " << incr_lflags << " -o "<< incr_target_dir <<
" $(INCREMENTAL_OBJECTS)" << endl;
" $(INCREMENTAL_OBJECTS)\n";
//communicated below
if(!destdir.isEmpty()) {
if(!incr_objs.isEmpty())
@ -509,11 +509,11 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
incr_lflags += var("QMAKE_LFLAGS_DEBUG");
else
incr_lflags += var("QMAKE_LFLAGS_RELEASE");
t << incr_target_dir << ": $(INCREMENTAL_OBJECTS)" << "\n\t";
t << incr_target_dir << ": $(INCREMENTAL_OBJECTS)\n\t";
if(!destdir.isEmpty())
t << mkdir_p_asstring(destdir) << "\n\t";
t << "$(LINK) " << incr_lflags << " " << var("QMAKE_LINK_O_FLAG") << incr_target_dir <<
" $(INCREMENTAL_OBJECTS)" << endl;
" $(INCREMENTAL_OBJECTS)\n";
//communicated below
ProStringList &cmd = project->values("QMAKE_LINK_SHLIB_CMD");
if(!destdir.isEmpty())
@ -523,15 +523,15 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
incr_deps = "$(OBJECTS)";
}
t << "all: " << " " << escapeDependencyPath(deps) << " " << valGlue(escapeDependencyPaths(project->values("ALL_DEPS")),""," "," ")
<< " " << destdir << "$(TARGET)" << endl << endl;
t << "all: " << escapeDependencyPath(deps) << " " << valGlue(escapeDependencyPaths(project->values("ALL_DEPS")),""," "," ")
<< " " << destdir << "$(TARGET)\n\n";
//real target
t << destdir << "$(TARGET): " << var("PRE_TARGETDEPS") << " "
<< incr_deps << " $(SUBLIBS) " << target_deps << " " << var("POST_TARGETDEPS");
} else {
t << "all: " << escapeDependencyPath(deps) << " " << valGlue(escapeDependencyPaths(project->values("ALL_DEPS")),""," "," ") << " " <<
destdir << "$(TARGET)" << endl << endl;
destdir << "$(TARGET)\n\n";
t << destdir << "$(TARGET): " << var("PRE_TARGETDEPS")
<< " $(OBJECTS) $(SUBLIBS) $(OBJCOMP) " << target_deps
<< " " << var("POST_TARGETDEPS");
@ -546,7 +546,7 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
<< var("QMAKE_LINK_SHLIB_CMD");
} else if(project->isActiveConfig("plugin")) {
t << "\n\t"
<< "-$(DEL_FILE) $(TARGET)" << "\n\t"
<< "-$(DEL_FILE) $(TARGET)\n\t"
<< var("QMAKE_LINK_SHLIB_CMD");
if(!destdir.isEmpty())
t << "\n\t"
@ -556,15 +556,15 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
t << endl << endl;
} else if(!project->isEmpty("QMAKE_BUNDLE")) {
t << "\n\t"
<< "-$(DEL_FILE) $(TARGET) $(TARGET0) $(DESTDIR)$(TARGET0)" << "\n\t"
<< "-$(DEL_FILE) $(TARGET) $(TARGET0) $(DESTDIR)$(TARGET0)\n\t"
<< var("QMAKE_LINK_SHLIB_CMD") << "\n\t"
<< mkdir_p_asstring("\"`dirname $(DESTDIR)$(TARGETD)`\"", false) << "\n\t"
<< "-$(MOVE) $(TARGET) $(DESTDIR)$(TARGETD)" << "\n\t"
<< "-$(MOVE) $(TARGET) $(DESTDIR)$(TARGETD)\n\t"
<< mkdir_p_asstring("\"`dirname $(DESTDIR)$(TARGET0)`\"", false) << "\n\t"
<< varGlue("QMAKE_LN_SHLIB","-"," "," Versions/" +
project->first("QMAKE_FRAMEWORK_VERSION") +
"/$(TARGET) $(DESTDIR)$(TARGET0)") << "\n\t"
<< "-$(DEL_FILE) " << destdir << "Versions/Current" << "\n\t"
<< "-$(DEL_FILE) " << destdir << "Versions/Current\n\t"
<< varGlue("QMAKE_LN_SHLIB","-"," ", " " + project->first("QMAKE_FRAMEWORK_VERSION") +
" " + destdir + "Versions/Current") << "\n\t";
if(!project->isEmpty("QMAKE_POST_LINK"))
@ -572,7 +572,7 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
t << endl << endl;
} else if(project->isEmpty("QMAKE_HPUX_SHLIB")) {
t << "\n\t"
<< "-$(DEL_FILE) $(TARGET) $(TARGET0) $(TARGET1) $(TARGET2)" << "\n\t"
<< "-$(DEL_FILE) $(TARGET) $(TARGET0) $(TARGET1) $(TARGET2)\n\t"
<< var("QMAKE_LINK_SHLIB_CMD") << "\n\t";
t << varGlue("QMAKE_LN_SHLIB","-"," "," $(TARGET) $(TARGET0)") << "\n\t"
<< varGlue("QMAKE_LN_SHLIB","-"," "," $(TARGET) $(TARGET1)") << "\n\t"
@ -592,7 +592,7 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
t << endl << endl;
} else {
t << "\n\t"
<< "-$(DEL_FILE) $(TARGET) $(TARGET0)" << "\n\t"
<< "-$(DEL_FILE) $(TARGET) $(TARGET0)\n\t"
<< var("QMAKE_LINK_SHLIB_CMD") << "\n\t";
t << varGlue("QMAKE_LN_SHLIB",""," "," $(TARGET) $(TARGET0)");
if(!destdir.isEmpty())
@ -608,38 +608,38 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
t << endl << endl;
if (! project->isActiveConfig("plugin")) {
t << "staticlib: $(TARGETA)" << endl << endl;
t << "staticlib: $(TARGETA)\n\n";
t << "$(TARGETA): " << var("PRE_TARGETDEPS") << " $(OBJECTS) $(OBJCOMP)";
if(do_incremental)
t << " $(INCREMENTAL_OBJECTS)";
t << " " << var("POST_TARGETDEPS") << "\n\t"
<< "-$(DEL_FILE) $(TARGETA) " << "\n\t"
<< "-$(DEL_FILE) $(TARGETA) \n\t"
<< var("QMAKE_AR_CMD");
if(do_incremental)
t << " $(INCREMENTAL_OBJECTS)";
if(!project->isEmpty("QMAKE_RANLIB"))
t << "\n\t" << "$(RANLIB) $(TARGETA)";
t << "\n\t$(RANLIB) $(TARGETA)";
t << endl << endl;
}
} else {
QString destdir = project->first("DESTDIR").toQString();
t << "all: " << escapeDependencyPath(deps) << " " << valGlue(escapeDependencyPaths(project->values("ALL_DEPS")),""," "," ") << destdir << "$(TARGET) "
<< varGlue("QMAKE_AR_SUBLIBS", destdir, " " + destdir, "") << "\n\n"
<< "staticlib: " << destdir << "$(TARGET)" << "\n\n";
<< "staticlib: " << destdir << "$(TARGET)\n\n";
if(project->isEmpty("QMAKE_AR_SUBLIBS")) {
t << destdir << "$(TARGET): " << var("PRE_TARGETDEPS")
<< " $(OBJECTS) $(OBJCOMP) " << var("POST_TARGETDEPS") << "\n\t";
if(!destdir.isEmpty())
t << mkdir_p_asstring(destdir) << "\n\t";
t << "-$(DEL_FILE) $(TARGET)" << "\n\t"
t << "-$(DEL_FILE) $(TARGET)\n\t"
<< var("QMAKE_AR_CMD") << "\n";
if(!project->isEmpty("QMAKE_POST_LINK"))
t << "\t" << var("QMAKE_POST_LINK") << "\n";
if(!project->isEmpty("QMAKE_RANLIB"))
t << "\t" << "$(RANLIB) $(TARGET)" << "\n";
t << "\t$(RANLIB) $(TARGET)\n";
if(!destdir.isEmpty())
t << "\t" << "-$(DEL_FILE) " << destdir << "$(TARGET)" << "\n"
<< "\t" << "-$(MOVE) $(TARGET) " << destdir << " \n";
t << "\t-$(DEL_FILE) " << destdir << "$(TARGET)\n"
<< "\t-$(MOVE) $(TARGET) " << destdir << " \n";
} else {
int max_files = project->first("QMAKE_MAX_FILES_PER_AR").toInt();
ProStringList objs = project->values("OBJECTS") + project->values("OBJCOMP"),
@ -667,10 +667,10 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
if(!project->isEmpty("QMAKE_POST_LINK"))
t << "\t" << var("QMAKE_POST_LINK") << "\n";
if(!project->isEmpty("QMAKE_RANLIB"))
t << "\t" << "$(RANLIB) " << (*libit) << "\n";
t << "\t$(RANLIB) " << (*libit) << "\n";
if(!destdir.isEmpty())
t << "\t" << "-$(DEL_FILE) " << destdir << (*libit) << "\n"
<< "\t" << "-$(MOVE) " << (*libit) << " " << destdir << " \n";
t << "\t-$(DEL_FILE) " << destdir << (*libit) << "\n"
<< "\t-$(MOVE) " << (*libit) << " " << destdir << " \n";
}
}
t << endl << endl;
@ -687,14 +687,14 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
meta_files += pkgConfigFileName();
}
if(!meta_files.isEmpty())
t << escapeDependencyPaths(meta_files).join(" ") << ": " << "\n\t"
t << escapeDependencyPaths(meta_files).join(" ") << ": \n\t"
<< "@$(QMAKE) -prl " << buildArgs() << " " << project->projectFile() << endl;
}
if(!project->first("QMAKE_PKGINFO").isEmpty()) {
ProString pkginfo = escapeFilePath(project->first("QMAKE_PKGINFO"));
QString destdir = escapeFilePath(project->first("DESTDIR") + project->first("QMAKE_BUNDLE") + "/Contents");
t << pkginfo << ": " << "\n\t";
t << pkginfo << ": \n\t";
if(!destdir.isEmpty())
t << mkdir_p_asstring(destdir) << "\n\t";
t << "@$(DEL_FILE) " << pkginfo << "\n\t"
@ -705,16 +705,16 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
if(!project->first("QMAKE_BUNDLE_RESOURCE_FILE").isEmpty()) {
ProString resources = escapeFilePath(project->first("QMAKE_BUNDLE_RESOURCE_FILE"));
QString destdir = escapeFilePath(project->first("DESTDIR") + project->first("QMAKE_BUNDLE") + "/Contents/Resources");
t << resources << ": " << "\n\t";
t << resources << ": \n\t";
t << mkdir_p_asstring(destdir) << "\n\t";
t << "@touch " << resources << "\n\t" << endl;
t << "@touch " << resources << "\n\t\n";
}
if(!project->isEmpty("QMAKE_BUNDLE")) {
//copy the plist
QString info_plist = escapeFilePath(fileFixify(project->first("QMAKE_INFO_PLIST").toQString())),
info_plist_out = escapeFilePath(project->first("QMAKE_INFO_PLIST_OUT").toQString());
QString destdir = info_plist_out.section(Option::dir_sep, 0, -2);
t << info_plist_out << ": " << "\n\t";
t << info_plist_out << ": \n\t";
if(!destdir.isEmpty())
t << mkdir_p_asstring(destdir) << "\n\t";
ProStringList commonSedArgs;
@ -765,7 +765,7 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
if (!project->isEmpty(vkey)) {
QString version = project->first(vkey) + "/" +
project->first("QMAKE_FRAMEWORK_VERSION") + "/";
t << Option::fixPathToLocalOS(path + project->first(pkey)) << ": " << "\n\t"
t << Option::fixPathToLocalOS(path + project->first(pkey)) << ": \n\t"
<< mkdir_p_asstring(path) << "\n\t"
<< "@$(SYMLINK) " << version << project->first(pkey) << " " << path << endl;
path += version;
@ -805,7 +805,7 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
QString ddir_c = escapeFilePath(fileFixify((project->isEmpty("OBJECTS_DIR") ? ProString(".tmp/") :
project->first("OBJECTS_DIR")) + ddir,
Option::output_dir, Option::output_dir));
t << "dist: " << "\n\t"
t << "dist: \n\t"
<< mkdir_p_asstring(ddir_c) << "\n\t"
<< "$(COPY_FILE) --parents $(SOURCES) $(DIST) " << ddir_c << Option::dir_sep << " && ";
if(!project->isEmpty("QMAKE_EXTRA_COMPILERS")) {
@ -833,18 +833,18 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
QString clean_targets = "compiler_clean " + var("CLEAN_DEPS");
if(do_incremental) {
t << "incrclean:" << "\n";
t << "incrclean:\n";
if(src_incremental)
t << "\t-$(DEL_FILE) $(INCREMENTAL_OBJECTS)" << "\n";
t << "\t-$(DEL_FILE) $(INCREMENTAL_OBJECTS)\n";
t << endl;
}
t << "clean:" << clean_targets << "\n\t";
if(!project->isEmpty("OBJECTS")) {
if(project->isActiveConfig("compile_libtool"))
t << "-$(LIBTOOL) --mode=clean $(DEL_FILE) $(OBJECTS)" << "\n\t";
t << "-$(LIBTOOL) --mode=clean $(DEL_FILE) $(OBJECTS)\n\t";
else
t << "-$(DEL_FILE) $(OBJECTS)" << "\n\t";
t << "-$(DEL_FILE) $(OBJECTS)\n\t";
}
if(doPrecompiledHeaders() && !project->isEmpty("PRECOMPILED_HEADER")) {
ProStringList precomp_files;
@ -891,11 +891,11 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
if(!project->isEmpty("IMAGES"))
t << varGlue("QMAKE_IMAGE_COLLECTION", "\t-$(DEL_FILE) ", " ", "") << "\n\t";
if(src_incremental)
t << "-$(DEL_FILE) $(INCREMENTAL_OBJECTS)" << "\n\t";
t << "-$(DEL_FILE) $(INCREMENTAL_OBJECTS)\n\t";
t << varGlue("QMAKE_CLEAN","-$(DEL_FILE) "," ","\n\t")
<< "-$(DEL_FILE) *~ core *.core" << "\n"
<< "-$(DEL_FILE) *~ core *.core\n"
<< varGlue("CLEAN_FILES","\t-$(DEL_FILE) "," ","") << endl << endl;
t << "####### Sub-libraries" << endl << endl;
t << "####### Sub-libraries\n\n";
if (!project->values("SUBLIBS").isEmpty()) {
ProString libdir = "tmp/";
if(!project->isEmpty("SUBLIBS_DIR"))
@ -910,19 +910,19 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
ProString destdir = project->first("DESTDIR");
if (!destdir.isEmpty() && !destdir.endsWith(Option::dir_sep))
destdir += Option::dir_sep;
t << "distclean: " << "clean\n";
t << "distclean: clean\n";
if(!project->isEmpty("QMAKE_BUNDLE")) {
QString bundlePath = escapeFilePath(destdir + project->first("QMAKE_BUNDLE"));
t << "\t-$(DEL_FILE) -r " << bundlePath << endl;
} else if(project->isActiveConfig("compile_libtool")) {
t << "\t-$(LIBTOOL) --mode=clean $(DEL_FILE) " << "$(TARGET)" << endl;
t << "\t-$(LIBTOOL) --mode=clean $(DEL_FILE) $(TARGET)\n";
} else if(!project->isActiveConfig("staticlib") && project->values("QMAKE_APP_FLAG").isEmpty() &&
!project->isActiveConfig("plugin")) {
t << "\t-$(DEL_FILE) " << destdir << "$(TARGET)" << " " << endl;
t << "\t-$(DEL_FILE) " << destdir << "$(TARGET) \n";
t << "\t-$(DEL_FILE) " << destdir << "$(TARGET0) " << destdir << "$(TARGET1) "
<< destdir << "$(TARGET2) $(TARGETA)" << endl;
<< destdir << "$(TARGET2) $(TARGETA)\n";
} else {
t << "\t-$(DEL_FILE) " << "$(TARGET)" << " " << endl;
t << "\t-$(DEL_FILE) $(TARGET) \n";
}
t << varGlue("QMAKE_DISTCLEAN","\t-$(DEL_FILE) "," ","\n");
{
@ -934,7 +934,7 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
if(doPrecompiledHeaders() && !project->isEmpty("PRECOMPILED_HEADER")) {
QString pchInput = project->first("PRECOMPILED_HEADER").toQString();
t << "###### Prefix headers" << endl;
t << "###### Prefix headers\n";
QString comps[] = { "C", "CXX", "OBJC", "OBJCXX", QString() };
for(int i = 0; !comps[i].isNull(); i++) {
QString pchFlags = var(ProKey("QMAKE_" + comps[i] + "FLAGS_PRECOMPILE"));

View File

@ -115,10 +115,10 @@ bool MingwMakefileGenerator::writeMakefile(QTextStream &t)
{
writeHeader(t);
if(!project->values("QMAKE_FAILED_REQUIREMENTS").isEmpty()) {
t << "all clean:" << "\n\t"
t << "all clean:\n\t"
<< "@echo \"Some of the required modules ("
<< var("QMAKE_FAILED_REQUIREMENTS") << ") are not available.\"" << "\n\t"
<< "@echo \"Skipped.\"" << endl << endl;
<< var("QMAKE_FAILED_REQUIREMENTS") << ") are not available.\"\n\t"
<< "@echo \"Skipped.\"\n\n";
writeMakeQmake(t);
return true;
}
@ -134,10 +134,10 @@ bool MingwMakefileGenerator::writeMakefile(QTextStream &t)
const ProStringList &qut = project->values("QMAKE_EXTRA_TARGETS");
for (ProStringList::ConstIterator it = qut.begin(); it != qut.end(); ++it)
t << *it << " ";
t << "first all clean install distclean uninstall: qmake" << endl
<< "qmake_all:" << endl;
t << "first all clean install distclean uninstall: qmake\n"
<< "qmake_all:\n";
writeMakeQmake(t);
t << "FORCE:" << endl << endl;
t << "FORCE:\n\n";
return true;
}
writeMingwParts(t);
@ -156,7 +156,7 @@ void createLdObjectScriptFile(const QString &fileName, const ProStringList &objL
QFile file(filePath);
if (file.open(QIODevice::WriteOnly | QIODevice::Text)) {
QTextStream t(&file);
t << "INPUT(" << endl;
t << "INPUT(\n";
for (ProStringList::ConstIterator it = objList.constBegin(); it != objList.constEnd(); ++it) {
QString path = (*it).toQString();
if (QDir::isRelativePath(path))
@ -164,7 +164,7 @@ void createLdObjectScriptFile(const QString &fileName, const ProStringList &objL
else
t << path << endl;
}
t << ");" << endl;
t << ");\n";
t.flush();
file.close();
}
@ -180,7 +180,7 @@ void createArObjectScriptFile(const QString &fileName, const QString &target, co
for (ProStringList::ConstIterator it = objList.constBegin(); it != objList.constEnd(); ++it) {
t << "ADDMOD " << *it << endl;
}
t << "SAVE" << endl;
t << "SAVE\n";
t.flush();
file.close();
}
@ -214,13 +214,13 @@ void MingwMakefileGenerator::writeMingwParts(QTextStream &t)
t << escapeDependencyPath(cHeader) << ": " << escapeDependencyPath(header) << " "
<< escapeDependencyPaths(findDependencies(header)).join(" \\\n\t\t")
<< "\n\t" << mkdir_p_asstring(preCompHeaderOut)
<< "\n\t" << "$(CC) -x c-header -c $(CFLAGS) $(INCPATH) -o " << cHeader << " " << header
<< "\n\t$(CC) -x c-header -c $(CFLAGS) $(INCPATH) -o " << cHeader << " " << header
<< endl << endl;
QString cppHeader = preCompHeaderOut + Option::dir_sep + "c++";
t << escapeDependencyPath(cppHeader) << ": " << escapeDependencyPath(header) << " "
<< escapeDependencyPaths(findDependencies(header)).join(" \\\n\t\t")
<< "\n\t" << mkdir_p_asstring(preCompHeaderOut)
<< "\n\t" << "$(CXX) -x c++-header -c $(CXXFLAGS) $(INCPATH) -o " << cppHeader << " " << header
<< "\n\t$(CXX) -x c++-header -c $(CXXFLAGS) $(INCPATH) -o " << cppHeader << " " << header
<< endl << endl;
}
}
@ -393,19 +393,19 @@ void MingwMakefileGenerator::writeObjectsPart(QTextStream &t)
void MingwMakefileGenerator::writeBuildRulesPart(QTextStream &t)
{
t << "first: all" << endl;
t << "all: " << escapeDependencyPath(fileFixify(Option::output.fileName())) << " " << valGlue(escapeDependencyPaths(project->values("ALL_DEPS"))," "," "," ") << " $(DESTDIR_TARGET)" << endl << endl;
t << "first: all\n";
t << "all: " << escapeDependencyPath(fileFixify(Option::output.fileName())) << " " << valGlue(escapeDependencyPaths(project->values("ALL_DEPS"))," "," "," ") << " $(DESTDIR_TARGET)\n\n";
t << "$(DESTDIR_TARGET): " << var("PRE_TARGETDEPS") << " $(OBJECTS) " << var("POST_TARGETDEPS");
if(!project->isEmpty("QMAKE_PRE_LINK"))
t << "\n\t" <<var("QMAKE_PRE_LINK");
if(project->isActiveConfig("staticlib") && project->first("TEMPLATE") == "lib") {
if (project->values("OBJECTS").count() < var("QMAKE_LINK_OBJECT_MAX").toInt()) {
t << "\n\t" << "$(LIB) $(DESTDIR_TARGET) " << objectsLinkLine << " " ;
t << "\n\t$(LIB) $(DESTDIR_TARGET) " << objectsLinkLine << " " ;
} else {
t << "\n\t" << objectsLinkLine << " " ;
}
} else if (project->first("TEMPLATE") != "aux") {
t << "\n\t" << "$(LINKER) $(LFLAGS) " << var("QMAKE_LINK_O_FLAG") << "$(DESTDIR_TARGET) " << objectsLinkLine << " " << " $(LIBS)";
t << "\n\t$(LINKER) $(LFLAGS) " << var("QMAKE_LINK_O_FLAG") << "$(DESTDIR_TARGET) " << objectsLinkLine << " $(LIBS)";
}
if(!project->isEmpty("QMAKE_POST_LINK"))
t << "\n\t" <<var("QMAKE_POST_LINK");
@ -432,7 +432,7 @@ void MingwMakefileGenerator::writeRcFilePart(QTextStream &t)
if (!rc_file.isEmpty()) {
t << escapeDependencyPath(var("RES_FILE")) << ": " << rc_file << "\n\t"
<< var("QMAKE_RC") << " -i " << rc_file << " -o " << var("RES_FILE")
<< incPathStr << " $(DEFINES)" << endl << endl;
<< incPathStr << " $(DEFINES)\n\n";
}
}

View File

@ -62,10 +62,10 @@ NmakeMakefileGenerator::writeMakefile(QTextStream &t)
const ProStringList &qut = project->values("QMAKE_EXTRA_TARGETS");
for (ProStringList::ConstIterator it = qut.begin(); it != qut.end(); ++it)
t << *it << " ";
t << "all first clean:" << "\n\t"
t << "all first clean:\n\t"
<< "@echo \"Some of the required modules ("
<< var("QMAKE_FAILED_REQUIREMENTS") << ") are not available.\"" << "\n\t"
<< "@echo \"Skipped.\"" << endl << endl;
<< var("QMAKE_FAILED_REQUIREMENTS") << ") are not available.\"\n\t"
<< "@echo \"Skipped.\"\n\n";
writeMakeQmake(t);
return true;
}
@ -193,7 +193,7 @@ void NmakeMakefileGenerator::writeNmakeParts(QTextStream &t)
if(usePCH) {
QString precompRule = QString("-c -Yc -Fp%1 -Fo%2").arg(precompPch).arg(precompObj);
t << precompObj << ": " << precompH << " " << escapeDependencyPaths(findDependencies(precompH)).join(" \\\n\t\t")
<< "\n\t" << "$(CXX) " + precompRule +" $(CXXFLAGS) $(INCPATH) -TP " << precompH << endl << endl;
<< "\n\t$(CXX) " + precompRule +" $(CXXFLAGS) $(INCPATH) -TP " << precompH << endl << endl;
}
}
@ -359,10 +359,10 @@ void NmakeMakefileGenerator::writeImplicitRulesPart(QTextStream &t)
objDir = "";
for(QStringList::Iterator cppit = Option::cpp_ext.begin(); cppit != Option::cpp_ext.end(); ++cppit)
t << "{" << it.key() << "}" << (*cppit) << "{" << objDir << "}" << Option::obj_ext << "::\n\t"
<< var("QMAKE_RUN_CXX_IMP_BATCH").replace(QRegExp("\\$@"), var("OBJECTS_DIR")) << endl << "\t$<" << endl << "<<" << endl << endl;
<< var("QMAKE_RUN_CXX_IMP_BATCH").replace(QRegExp("\\$@"), var("OBJECTS_DIR")) << endl << "\t$<\n<<\n\n";
for(QStringList::Iterator cit = Option::c_ext.begin(); cit != Option::c_ext.end(); ++cit)
t << "{" << it.key() << "}" << (*cit) << "{" << objDir << "}" << Option::obj_ext << "::\n\t"
<< var("QMAKE_RUN_CC_IMP_BATCH").replace(QRegExp("\\$@"), var("OBJECTS_DIR")) << endl << "\t$<" << endl << "<<" << endl << endl;
<< var("QMAKE_RUN_CC_IMP_BATCH").replace(QRegExp("\\$@"), var("OBJECTS_DIR")) << endl << "\t$<\n<<\n\n";
}
} else {
for(QStringList::Iterator cppit = Option::cpp_ext.begin(); cppit != Option::cpp_ext.end(); ++cppit)
@ -377,14 +377,14 @@ void NmakeMakefileGenerator::writeBuildRulesPart(QTextStream &t)
{
const ProString templateName = project->first("TEMPLATE");
t << "first: all" << endl;
t << "all: " << fileFixify(Option::output.fileName()) << " " << varGlue("ALL_DEPS"," "," "," ") << "$(DESTDIR_TARGET)" << endl << endl;
t << "first: all\n";
t << "all: " << fileFixify(Option::output.fileName()) << " " << varGlue("ALL_DEPS"," "," "," ") << "$(DESTDIR_TARGET)\n\n";
t << "$(DESTDIR_TARGET): " << var("PRE_TARGETDEPS") << " $(OBJECTS) " << var("POST_TARGETDEPS");
if(!project->isEmpty("QMAKE_PRE_LINK"))
t << "\n\t" <<var("QMAKE_PRE_LINK");
if(project->isActiveConfig("staticlib")) {
t << "\n\t" << "$(LIBAPP) $(LIBFLAGS) " << var("QMAKE_LINK_O_FLAG") << "$(DESTDIR_TARGET) @<<" << "\n\t "
t << "\n\t$(LIBAPP) $(LIBFLAGS) " << var("QMAKE_LINK_O_FLAG") << "$(DESTDIR_TARGET) @<<\n\t "
<< "$(OBJECTS)"
<< "\n<<";
} else if (templateName != "aux") {
@ -433,7 +433,7 @@ void NmakeMakefileGenerator::writeBuildRulesPart(QTextStream &t)
writeLinkCommand(t, extraLFlags, manifest_res);
t << "\n\tif exist " << manifest_bak << " del " << manifest_bak;
} else {
t << "\n\t" << "rc.exe /fo" << manifest_res << " " << manifest_rc;
t << "\n\trc.exe /fo" << manifest_res << " " << manifest_rc;
t << "\n\t";
writeLinkCommand(t, extraLFlags, manifest_res);
}
@ -441,7 +441,7 @@ void NmakeMakefileGenerator::writeBuildRulesPart(QTextStream &t)
// directly embed the manifest in the executable after linking
t << "\n\t";
writeLinkCommand(t, extraLFlags);
t << "\n\t" << "mt.exe /nologo /manifest " << manifest
t << "\n\tmt.exe /nologo /manifest " << manifest
<< " /outputresource:$(DESTDIR_TARGET);" << resourceId;
}
} else {

View File

@ -423,56 +423,56 @@ void Win32MakefileGenerator::processRcFileVar()
int rcLang = project->intValue("RC_LANG", 1033); // default: English(USA)
int rcCodePage = project->intValue("RC_CODEPAGE", 1200); // default: Unicode
ts << "# if defined(UNDER_CE)" << endl;
ts << "# include <winbase.h>" << endl;
ts << "# else" << endl;
ts << "# include <winver.h>" << endl;
ts << "# endif" << endl;
ts << "# if defined(UNDER_CE)\n";
ts << "# include <winbase.h>\n";
ts << "# else\n";
ts << "# include <winver.h>\n";
ts << "# endif\n";
ts << endl;
if (!rcIcons.isEmpty()) {
for (int i = 0; i < rcIcons.size(); ++i)
ts << QString("IDI_ICON%1\tICON\tDISCARDABLE\t%2").arg(i + 1).arg(cQuoted(rcIcons[i])) << endl;
ts << endl;
}
ts << "VS_VERSION_INFO VERSIONINFO" << endl;
ts << "VS_VERSION_INFO VERSIONINFO\n";
ts << "\tFILEVERSION " << QString(versionString).replace(".", ",") << endl;
ts << "\tPRODUCTVERSION " << QString(versionString).replace(".", ",") << endl;
ts << "\tFILEFLAGSMASK 0x3fL" << endl;
ts << "#ifdef _DEBUG" << endl;
ts << "\tFILEFLAGS VS_FF_DEBUG" << endl;
ts << "#else" << endl;
ts << "\tFILEFLAGS 0x0L" << endl;
ts << "#endif" << endl;
ts << "\tFILEOS VOS__WINDOWS32" << endl;
ts << "\tFILEFLAGSMASK 0x3fL\n";
ts << "#ifdef _DEBUG\n";
ts << "\tFILEFLAGS VS_FF_DEBUG\n";
ts << "#else\n";
ts << "\tFILEFLAGS 0x0L\n";
ts << "#endif\n";
ts << "\tFILEOS VOS__WINDOWS32\n";
if (project->isActiveConfig("shared"))
ts << "\tFILETYPE VFT_DLL" << endl;
ts << "\tFILETYPE VFT_DLL\n";
else
ts << "\tFILETYPE VFT_APP" << endl;
ts << "\tFILESUBTYPE 0x0L" << endl;
ts << "\tBEGIN" << endl;
ts << "\t\tBLOCK \"StringFileInfo\"" << endl;
ts << "\t\tBEGIN" << endl;
ts << "\tFILETYPE VFT_APP\n";
ts << "\tFILESUBTYPE 0x0L\n";
ts << "\tBEGIN\n";
ts << "\t\tBLOCK \"StringFileInfo\"\n";
ts << "\t\tBEGIN\n";
ts << "\t\t\tBLOCK \""
<< QString("%1%2").arg(rcLang, 4, 16, QLatin1Char('0')).arg(rcCodePage, 4, 16, QLatin1Char('0'))
<< "\"" << endl;
ts << "\t\t\tBEGIN" << endl;
ts << "\t\t\t\tVALUE \"CompanyName\", \"" << companyName << "\\0\"" << endl;
ts << "\t\t\t\tVALUE \"FileDescription\", \"" << description << "\\0\"" << endl;
ts << "\t\t\t\tVALUE \"FileVersion\", \"" << versionString << "\\0\"" << endl;
ts << "\t\t\t\tVALUE \"LegalCopyright\", \"" << copyright << "\\0\"" << endl;
ts << "\t\t\t\tVALUE \"OriginalFilename\", \"" << originalName << "\\0\"" << endl;
ts << "\t\t\t\tVALUE \"ProductName\", \"" << productName << "\\0\"" << endl;
ts << "\t\t\t\tVALUE \"ProductVersion\", \"" << versionString << "\\0\"" << endl;
ts << "\t\t\tEND" << endl;
ts << "\t\tEND" << endl;
ts << "\t\tBLOCK \"VarFileInfo\"" << endl;
ts << "\t\tBEGIN" << endl;
<< "\"\n";
ts << "\t\t\tBEGIN\n";
ts << "\t\t\t\tVALUE \"CompanyName\", \"" << companyName << "\\0\"\n";
ts << "\t\t\t\tVALUE \"FileDescription\", \"" << description << "\\0\"\n";
ts << "\t\t\t\tVALUE \"FileVersion\", \"" << versionString << "\\0\"\n";
ts << "\t\t\t\tVALUE \"LegalCopyright\", \"" << copyright << "\\0\"\n";
ts << "\t\t\t\tVALUE \"OriginalFilename\", \"" << originalName << "\\0\"\n";
ts << "\t\t\t\tVALUE \"ProductName\", \"" << productName << "\\0\"\n";
ts << "\t\t\t\tVALUE \"ProductVersion\", \"" << versionString << "\\0\"\n";
ts << "\t\t\tEND\n";
ts << "\t\tEND\n";
ts << "\t\tBLOCK \"VarFileInfo\"\n";
ts << "\t\tBEGIN\n";
ts << "\t\t\tVALUE \"Translation\", "
<< QString("0x%1").arg(rcLang, 4, 16, QLatin1Char('0'))
<< ", " << QString("%1").arg(rcCodePage, 4) << endl;
ts << "\t\tEND" << endl;
ts << "\tEND" << endl;
ts << "/* End of Version info */" << endl;
ts << "\t\tEND\n";
ts << "\tEND\n";
ts << "/* End of Version info */\n";
ts << endl;
ts.flush();
@ -598,7 +598,7 @@ void Win32MakefileGenerator::writeCleanParts(QTextStream &t)
}
}
}
t << "\n\t-$(DEL_FILE) $(DESTDIR_TARGET)" << endl;
t << "\n\t-$(DEL_FILE) $(DESTDIR_TARGET)\n";
{
QString ofile = Option::fixPathToTargetOS(fileFixify(Option::output.fileName()));
if(!ofile.isEmpty())
@ -617,7 +617,7 @@ void Win32MakefileGenerator::writeIncPart(QTextStream &t)
inc.replace(QRegExp("\\\\$"), "");
inc.replace(QRegExp("\""), "");
if(!inc.isEmpty())
t << "-I" << "\"" << inc << "\" ";
t << "-I\"" << inc << "\" ";
}
t << "-I\"" << specdir() << "\""
<< endl;
@ -625,14 +625,14 @@ void Win32MakefileGenerator::writeIncPart(QTextStream &t)
void Win32MakefileGenerator::writeStandardParts(QTextStream &t)
{
t << "####### Compiler, tools and options" << endl << endl;
t << "####### Compiler, tools and options\n\n";
t << "CC = " << var("QMAKE_CC") << endl;
t << "CXX = " << var("QMAKE_CXX") << endl;
t << "DEFINES = "
<< varGlue("PRL_EXPORT_DEFINES","-D"," -D"," ")
<< varGlue("DEFINES","-D"," -D","") << endl;
t << "CFLAGS = " << var("QMAKE_CFLAGS") << " $(DEFINES)" << endl;
t << "CXXFLAGS = " << var("QMAKE_CXXFLAGS") << " $(DEFINES)" << endl;
t << "CFLAGS = " << var("QMAKE_CFLAGS") << " $(DEFINES)\n";
t << "CXXFLAGS = " << var("QMAKE_CXXFLAGS") << " $(DEFINES)\n";
writeIncPart(t);
writeLibsPart(t);
@ -659,14 +659,14 @@ void Win32MakefileGenerator::writeStandardParts(QTextStream &t)
t << "INSTALL_DIR = " << var("QMAKE_INSTALL_DIR") << endl;
t << endl;
t << "####### Output directory" << endl << endl;
t << "####### Output directory\n\n";
if(!project->values("OBJECTS_DIR").isEmpty())
t << "OBJECTS_DIR = " << var("OBJECTS_DIR").replace(QRegExp("\\\\$"),"") << endl;
else
t << "OBJECTS_DIR = . " << endl;
t << "OBJECTS_DIR = . \n";
t << endl;
t << "####### Files" << endl << endl;
t << "####### Files\n\n";
t << "SOURCES = " << valList(escapeFilePaths(project->values("SOURCES")))
<< " " << valList(escapeFilePaths(project->values("GENERATED_SOURCES"))) << endl;
@ -688,21 +688,21 @@ void Win32MakefileGenerator::writeStandardParts(QTextStream &t)
t << "QMAKE_TARGET = " << var("QMAKE_ORIG_TARGET") << endl;
// The comment is important to maintain variable compatibility with Unix
// Makefiles, while not interpreting a trailing-slash as a linebreak
t << "DESTDIR = " << escapeFilePath(destDir) << " #avoid trailing-slash linebreak" << endl;
t << "DESTDIR = " << escapeFilePath(destDir) << " #avoid trailing-slash linebreak\n";
t << "TARGET = " << escapeFilePath(target) << endl;
t << "DESTDIR_TARGET = " << escapeFilePath(var("DEST_TARGET")) << endl;
t << endl;
t << "####### Implicit rules" << endl << endl;
t << "####### Implicit rules\n\n";
writeImplicitRulesPart(t);
t << "####### Build rules" << endl << endl;
t << "####### Build rules\n\n";
writeBuildRulesPart(t);
if(project->isActiveConfig("shared") && !project->values("DLLDESTDIR").isEmpty()) {
const ProStringList &dlldirs = project->values("DLLDESTDIR");
for (ProStringList::ConstIterator dlldir = dlldirs.begin(); dlldir != dlldirs.end(); ++dlldir) {
t << "\t" << "-$(COPY_FILE) \"$(DESTDIR_TARGET)\" "
t << "\t-$(COPY_FILE) \"$(DESTDIR_TARGET)\" "
<< Option::fixPathToTargetOS((*dlldir).toQString(), false) << endl;
}
}
@ -725,8 +725,8 @@ void Win32MakefileGenerator::writeStandardParts(QTextStream &t)
dist_files << ui_h;
}
}
t << "dist:" << "\n\t"
<< "$(ZIP) " << var("QMAKE_ORIG_TARGET") << ".zip " << "$(SOURCES) $(DIST) "
t << "dist:\n\t"
<< "$(ZIP) " << var("QMAKE_ORIG_TARGET") << ".zip $(SOURCES) $(DIST) "
<< dist_files.join(' ') << " " << var("TRANSLATIONS") << " ";
if(!project->isEmpty("QMAKE_EXTRA_COMPILERS")) {
const ProStringList &quc = project->values("QMAKE_EXTRA_COMPILERS");