2011-04-27 10:05:43 +00:00
|
|
|
/****************************************************************************
|
|
|
|
**
|
2013-01-02 11:13:29 +00:00
|
|
|
** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
|
2012-09-19 12:28:29 +00:00
|
|
|
** Contact: http://www.qt-project.org/legal
|
2011-04-27 10:05:43 +00:00
|
|
|
**
|
2013-05-29 07:38:56 +00:00
|
|
|
** This file is part of the qmake application of the Qt Toolkit.
|
2011-04-27 10:05:43 +00:00
|
|
|
**
|
|
|
|
** $QT_BEGIN_LICENSE:LGPL$
|
2012-09-19 12:28:29 +00:00
|
|
|
** Commercial License Usage
|
|
|
|
** Licensees holding valid commercial Qt licenses may use this file in
|
|
|
|
** accordance with the commercial license agreement provided with the
|
|
|
|
** Software or, alternatively, in accordance with the terms contained in
|
|
|
|
** a written agreement between you and Digia. For licensing terms and
|
|
|
|
** conditions see http://qt.digia.com/licensing. For further information
|
|
|
|
** use the contact form at http://qt.digia.com/contact-us.
|
|
|
|
**
|
2011-04-27 10:05:43 +00:00
|
|
|
** GNU Lesser General Public License Usage
|
2012-09-19 12:28:29 +00:00
|
|
|
** Alternatively, this file may be used under the terms of the GNU Lesser
|
|
|
|
** General Public License version 2.1 as published by the Free Software
|
|
|
|
** Foundation and appearing in the file LICENSE.LGPL included in the
|
|
|
|
** packaging of this file. Please review the following information to
|
|
|
|
** ensure the GNU Lesser General Public License version 2.1 requirements
|
|
|
|
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
2011-04-27 10:05:43 +00:00
|
|
|
**
|
2012-09-19 12:28:29 +00:00
|
|
|
** In addition, as a special exception, Digia gives you certain additional
|
|
|
|
** rights. These rights are described in the Digia Qt LGPL Exception
|
2011-04-27 10:05:43 +00:00
|
|
|
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
|
|
|
**
|
2011-05-24 09:34:08 +00:00
|
|
|
** GNU General Public License Usage
|
2012-09-19 12:28:29 +00:00
|
|
|
** Alternatively, this file may be used under the terms of the GNU
|
|
|
|
** General Public License version 3.0 as published by the Free Software
|
|
|
|
** Foundation and appearing in the file LICENSE.GPL included in the
|
|
|
|
** packaging of this file. Please review the following information to
|
|
|
|
** ensure the GNU General Public License version 3.0 requirements will be
|
|
|
|
** met: http://www.gnu.org/copyleft/gpl.html.
|
2011-04-27 10:05:43 +00:00
|
|
|
**
|
2012-01-24 06:17:24 +00:00
|
|
|
**
|
2011-04-27 10:05:43 +00:00
|
|
|
** $QT_END_LICENSE$
|
|
|
|
**
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
#include "gbuild.h"
|
|
|
|
#include "option.h"
|
|
|
|
#include "meta.h"
|
|
|
|
#include <qdir.h>
|
|
|
|
#include <qregexp.h>
|
|
|
|
#include <qdebug.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <time.h>
|
|
|
|
#ifdef Q_OS_UNIX
|
|
|
|
# include <sys/types.h>
|
|
|
|
# include <sys/stat.h>
|
|
|
|
#endif
|
|
|
|
|
|
|
|
QT_BEGIN_NAMESPACE
|
|
|
|
|
|
|
|
unsigned int dllbase = 0x01000000;
|
|
|
|
#define DLLOFFSET 0x600000
|
|
|
|
|
|
|
|
GBuildMakefileGenerator::GBuildMakefileGenerator() : MakefileGenerator()
|
|
|
|
{
|
|
|
|
nativebins << "moc" << "rcc" << "uic" << "bootstrap";
|
|
|
|
}
|
|
|
|
|
|
|
|
bool
|
|
|
|
GBuildMakefileGenerator::write()
|
|
|
|
{
|
|
|
|
QStringList tmp;
|
|
|
|
QString filename(Option::output.fileName());
|
|
|
|
QString pathtoremove(qmake_getpwd());
|
|
|
|
QString relpath(pathtoremove);
|
2012-09-06 10:21:38 +00:00
|
|
|
QString strtarget(project->first("TARGET").toQString());
|
2011-04-27 10:05:43 +00:00
|
|
|
bool isnativebin = nativebins.contains(strtarget);
|
|
|
|
relpath.replace(Option::output_dir, "");
|
|
|
|
|
|
|
|
/* correct output for non-prl, non-recursive case */
|
|
|
|
QString outname(qmake_getpwd());
|
|
|
|
outname += QDir::separator();
|
|
|
|
outname += fileInfo(Option::output.fileName()).baseName();
|
|
|
|
outname += projectSuffix();
|
|
|
|
Option::output.close();
|
|
|
|
Option::output.setFileName(outname);
|
|
|
|
MakefileGenerator::openOutput(Option::output, QString());
|
|
|
|
|
|
|
|
if (strtarget != fileInfo(project->projectFile()).baseName()) {
|
|
|
|
QString gpjname(strtarget);
|
|
|
|
QString outputName(qmake_getpwd());
|
|
|
|
outputName += QDir::separator();
|
|
|
|
outputName += fileInfo(project->projectFile()).baseName();
|
|
|
|
outputName += projectSuffix();
|
|
|
|
QFile f(outputName);
|
|
|
|
f.open(QIODevice::WriteOnly | QIODevice::Text | QIODevice::Truncate);
|
|
|
|
QTextStream t(&f);
|
|
|
|
t << "#!gbuild\n";
|
|
|
|
t << "[Project]\n";
|
|
|
|
t << gpjname << projectSuffix() << "\n";
|
|
|
|
if ((project->first("TEMPLATE") == "lib")
|
|
|
|
&& project->isActiveConfig("shared"))
|
|
|
|
t << gpjname << "_shared" << projectSuffix() << "\n";
|
|
|
|
t.flush();
|
|
|
|
gpjname += projectSuffix();
|
|
|
|
Option::output.close();
|
|
|
|
Option::output.setFileName(gpjname);
|
|
|
|
MakefileGenerator::openOutput(Option::output, QString());
|
|
|
|
}
|
|
|
|
|
|
|
|
if ((project->first("TEMPLATE") == "app")
|
|
|
|
&& (!isnativebin)) {
|
|
|
|
QTextStream t(&Option::output);
|
|
|
|
QString intname(strtarget);
|
|
|
|
intname += ".int";
|
|
|
|
/* 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 */
|
2013-07-04 09:25:16 +00:00
|
|
|
t << "#!gbuild\n";
|
|
|
|
t << "[INTEGRITY Application]\n";
|
2011-04-27 10:05:43 +00:00
|
|
|
t << "\t:binDirRelative=.\n";
|
|
|
|
t << "\t-o " << strtarget << "\n";
|
|
|
|
t << intname << "\n";
|
|
|
|
t << strtarget << "_app" << projectSuffix() << "\n";
|
|
|
|
t.flush();
|
|
|
|
|
|
|
|
/* generate integrate file */
|
|
|
|
QFile f(intname);
|
|
|
|
f.open(QIODevice::WriteOnly | QIODevice::Text | QIODevice::Truncate);
|
|
|
|
QTextStream ti(&f);
|
2013-07-04 09:25:16 +00:00
|
|
|
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";
|
2011-04-27 10:05:43 +00:00
|
|
|
ti << "\tName\t" << strtarget << "\n";
|
2013-07-04 09:25:16 +00:00
|
|
|
ti << "\tFilename\t" << strtarget << "_app\n";
|
|
|
|
ti << "\tMemoryPoolSize\t0x100000\n";
|
|
|
|
ti << "\tLanguage\tC++\n";
|
2011-04-27 10:05:43 +00:00
|
|
|
/* 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 */
|
2013-07-04 09:25:16 +00:00
|
|
|
ti << "\tHeapSize\t0x00D00000\n";
|
|
|
|
ti << "\tTask\tInitial\n";
|
|
|
|
ti << "\t\tStackSize\t0x30000\n";
|
|
|
|
ti << "\tEndTask\n";
|
|
|
|
ti << "EndAddressSpace\n";
|
2011-04-27 10:05:43 +00:00
|
|
|
ti.flush();
|
|
|
|
|
|
|
|
/* change current project file to <projectname>_app.gpj and continue
|
|
|
|
* generation */
|
|
|
|
filename.insert(filename.lastIndexOf("."), "_app");
|
|
|
|
Option::output.close();
|
|
|
|
Option::output.setFileName(filename);
|
|
|
|
MakefileGenerator::openOutput(Option::output, QString());
|
|
|
|
} else if ((project->first("TEMPLATE") == "lib")
|
|
|
|
&& project->isActiveConfig("shared")) {
|
|
|
|
QString gpjname(strtarget);
|
|
|
|
gpjname += "_shared";
|
|
|
|
gpjname += projectSuffix();
|
|
|
|
QFile f(gpjname);
|
|
|
|
f.open(QIODevice::WriteOnly | QIODevice::Text | QIODevice::Truncate);
|
|
|
|
QTextStream t(&f);
|
|
|
|
t << "#!gbuild\n"
|
|
|
|
"[Program]\n"
|
|
|
|
"\t-A libINTEGRITY.so\n"
|
|
|
|
"\t-A libc.so\n"
|
|
|
|
"\t-A libscxx.so\n"
|
|
|
|
"\t-A libQtCore.so\n"
|
|
|
|
"\t-e __ghsbegin_text\n"
|
|
|
|
"\t-startfile=-\n"
|
|
|
|
"\t:syslibraries=-\n"
|
|
|
|
"\t-Onolink\n";
|
|
|
|
t << "\t-o lib" << strtarget << ".so\n";
|
|
|
|
t << "\t-l" << strtarget << "\n";
|
|
|
|
t << "\t-extractall=-l" << strtarget << "\n";
|
|
|
|
t << "\t:outputDir=work/" << filename.section(QDir::separator(), 0, -1).remove(".gpj") << "\n";
|
|
|
|
t << strtarget << "_shared.ld\n";
|
|
|
|
t << "$(__OS_DIR)/intlib/sharedobjbssinit.c\n";
|
|
|
|
t.flush();
|
|
|
|
|
|
|
|
QFile fl(strtarget + "_shared.ld");
|
|
|
|
fl.open(QIODevice::WriteOnly | QIODevice::Text | QIODevice::Truncate);
|
|
|
|
QTextStream tl(&fl);
|
|
|
|
tl << "CONSTANTS {\n"
|
|
|
|
" __INTEGRITY_MinPageAlign = 16K\n"
|
|
|
|
" __INTEGRITY_MaxPageAlign = 16K\n"
|
|
|
|
" __INTEGRITY_LibCBaseAddress = \n";
|
|
|
|
tl << dllbase << "\n";
|
|
|
|
tl << "}\n"
|
|
|
|
"-sec\n"
|
|
|
|
"{\n"
|
|
|
|
" .picbase __INTEGRITY_LibCBaseAddress :\n"
|
|
|
|
" .text :\n"
|
|
|
|
" .syscall :\n"
|
|
|
|
" .intercall :\n"
|
|
|
|
" .interfunc :\n"
|
|
|
|
" .secinfo :\n"
|
|
|
|
" .rodata align(16) :\n"
|
|
|
|
" .fixaddr :\n"
|
|
|
|
" .fixtype :\n"
|
|
|
|
" .rombeg :\n"
|
|
|
|
" .textchecksum :\n"
|
|
|
|
" // The above sections may be large. Leave a bigger gap for large pages.\n"
|
|
|
|
" .pidbase align(__INTEGRITY_MaxPageAlign) :\n"
|
|
|
|
" .sdabase :\n"
|
|
|
|
" .data :\n"
|
|
|
|
" .toc :\n"
|
|
|
|
" .opd :\n"
|
|
|
|
" .datachecksum :\n"
|
|
|
|
" .bss align(__INTEGRITY_MinPageAlign) :\n"
|
|
|
|
" .heap :\n"
|
|
|
|
"}\n";
|
|
|
|
tl.flush();
|
|
|
|
dllbase += DLLOFFSET;
|
|
|
|
}
|
|
|
|
|
|
|
|
QTextStream t(&Option::output);
|
2012-09-06 10:21:38 +00:00
|
|
|
QString primaryTarget(project->values("QMAKE_CXX").at(0).toQString());
|
2011-04-27 10:05:43 +00:00
|
|
|
|
|
|
|
pathtoremove += QDir::separator();
|
|
|
|
filename.remove(qmake_getpwd());
|
|
|
|
|
|
|
|
//HEADER
|
2013-07-04 09:25:16 +00:00
|
|
|
t << "#!gbuild\n";
|
2011-04-27 10:05:43 +00:00
|
|
|
|
|
|
|
/* 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";
|
2013-07-04 09:25:16 +00:00
|
|
|
t << "primaryTarget=" << primaryTarget << "_integrity.tgt\n";
|
2011-04-27 10:05:43 +00:00
|
|
|
t << "customization=util/integrity/qt.bod\n";
|
|
|
|
}
|
|
|
|
/* project type */
|
|
|
|
if (project->first("TEMPLATE") == "app") {
|
2013-07-04 09:25:16 +00:00
|
|
|
t << "[Program]\n";
|
2011-04-27 10:05:43 +00:00
|
|
|
if (isnativebin) {
|
|
|
|
t << "\t:binDir=bin\n";
|
|
|
|
t << "\t-o " << strtarget << "\n";
|
|
|
|
} else {
|
|
|
|
t << "\t:binDirRelative=.\n";
|
|
|
|
t << "\t-o " << strtarget << "_app\n";
|
|
|
|
}
|
|
|
|
} else if (project->first("TEMPLATE") == "lib") {
|
2013-07-04 09:25:16 +00:00
|
|
|
t << "[Library]\n";
|
|
|
|
t << "\t:binDir=lib\n";
|
|
|
|
t << "\t-o lib" << strtarget << ".a\n";
|
2011-04-27 10:05:43 +00:00
|
|
|
} else if (project->first("TEMPLATE") == "subdirs")
|
2013-07-04 09:25:16 +00:00
|
|
|
t << "[Project]\n";
|
2011-04-27 10:05:43 +00:00
|
|
|
else
|
|
|
|
t << project->first("TEMPLATE") << "\n";
|
|
|
|
|
|
|
|
/* compilations options */
|
2013-07-04 09:25:16 +00:00
|
|
|
t << "\t:sourceDir=.\n";
|
2011-04-27 10:05:43 +00:00
|
|
|
|
|
|
|
t << "\t:outputDir=work" << relpath << "\n";
|
|
|
|
if (filename.endsWith("projects.gpj")) {
|
|
|
|
t << "\t:sourceDir=work\n";
|
|
|
|
t << "\t-Iwork\n";
|
|
|
|
t << "\t-Llib\n";
|
|
|
|
t << "\t";
|
2012-09-06 10:21:38 +00:00
|
|
|
const ProStringList &l = project->values("QMAKE_CXXFLAGS");
|
|
|
|
for (ProStringList::ConstIterator it = l.begin(); it != l.end(); ++it) {
|
2011-04-27 10:05:43 +00:00
|
|
|
if ((*it).startsWith("-"))
|
2013-07-04 09:25:16 +00:00
|
|
|
t << "\n\t" << (*it);
|
2011-04-27 10:05:43 +00:00
|
|
|
else
|
|
|
|
t << " " << (*it);
|
|
|
|
}
|
|
|
|
t << "\n";
|
|
|
|
}
|
|
|
|
t << "\n";
|
|
|
|
|
|
|
|
t << varGlue("DEFINES", "\t-D", "\n\t-D", "\n");
|
|
|
|
|
|
|
|
t << "\t-I.\n\t-I" << specdir() << "\n";
|
|
|
|
t << varGlue("INCLUDEPATH", "\t-I", "\n\t-I", "\n");
|
|
|
|
t << "\t--cxx_include_directory .\n\t--cxx_include_directory " << specdir() << "\n";
|
|
|
|
t << varGlue("INCLUDEPATH", "\t--cxx_include_directory ", "\n\t--cxx_include_directory ", "\n");
|
|
|
|
|
|
|
|
if (project->first("TEMPLATE") == "app") {
|
|
|
|
/* include linker flags if it's an application */
|
2012-08-20 11:04:39 +00:00
|
|
|
static const char * const src[] = { "QMAKE_LFLAGS", "QMAKE_LIBS", "LIBS", 0 };
|
|
|
|
for (int i = 0; src[i]; i++) {
|
2011-04-27 10:05:43 +00:00
|
|
|
/* skip target libraries for native tools */
|
|
|
|
if (isnativebin && (i == 0))
|
|
|
|
continue;
|
|
|
|
t << "\t";
|
2012-09-06 10:21:38 +00:00
|
|
|
const ProStringList &l = project->values(src[i]);
|
|
|
|
for (ProStringList::ConstIterator it = l.begin(); it != l.end(); ++it) {
|
2011-04-27 10:05:43 +00:00
|
|
|
if ((*it).startsWith("-"))
|
2013-07-04 09:25:16 +00:00
|
|
|
t << "\n\t" << (*it);
|
2011-04-27 10:05:43 +00:00
|
|
|
else
|
|
|
|
t << " " << (*it);
|
|
|
|
}
|
|
|
|
t << "\n";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* first subdirectories/subprojects */
|
|
|
|
{
|
2012-09-06 10:21:38 +00:00
|
|
|
const ProStringList &l = project->values("SUBDIRS");
|
|
|
|
for (ProStringList::ConstIterator it = l.begin(); it != l.end(); ++it) {
|
|
|
|
QString gpjname((*it).toQString());
|
2011-04-27 10:05:43 +00:00
|
|
|
/* avoid native tools */
|
|
|
|
if (nativebins.contains(gpjname.section("_", -1)))
|
|
|
|
continue;
|
2012-09-06 10:21:38 +00:00
|
|
|
const ProKey skey(*it + ".subdir");
|
|
|
|
if (!project->first(skey).isEmpty())
|
|
|
|
gpjname = project->first(skey).toQString();
|
2011-04-27 10:05:43 +00:00
|
|
|
else
|
|
|
|
gpjname.replace("_", QDir::separator());
|
|
|
|
gpjname += QDir::separator() + gpjname.section(QDir::separator(), -1);
|
|
|
|
gpjname += projectSuffix();
|
|
|
|
/* make relative */
|
|
|
|
if (!project->values("QT_SOURCE_TREE").isEmpty()) {
|
|
|
|
gpjname.replace(project->values("QT_SOURCE_TREE").first() + QDir::separator(), "");
|
|
|
|
}
|
|
|
|
t << gpjname << "\n";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
{
|
2012-09-06 10:21:38 +00:00
|
|
|
const ProStringList &l = project->values("RESOURCES");
|
|
|
|
for (ProStringList::ConstIterator it = l.begin(); it != l.end(); ++it) {
|
|
|
|
QString tmpstr((*it).toQString());
|
2012-04-23 14:20:30 +00:00
|
|
|
tmpstr.remove(pathtoremove);
|
2011-04-27 10:05:43 +00:00
|
|
|
t << tmpstr << "\t[Qt Resource]\n";
|
|
|
|
tmpstr = tmpstr.section(".", -2, -1).section(QDir::separator(), -1);
|
|
|
|
tmpstr.remove(".qrc");
|
|
|
|
t << "\t-name " << tmpstr << "\n";
|
|
|
|
tmpstr.insert(tmpstr.lastIndexOf(QDir::separator()) + 1, "qrc_");
|
|
|
|
tmpstr.append(".cpp");
|
|
|
|
t << "\t-o work/" << tmpstr << "\n";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
{
|
2012-09-06 10:21:38 +00:00
|
|
|
const ProStringList &l = project->values("FORMS");
|
|
|
|
for (ProStringList::ConstIterator it = l.begin(); it != l.end(); ++it) {
|
|
|
|
QString tmpstr((*it).toQString());
|
2012-04-23 14:20:30 +00:00
|
|
|
tmpstr.remove(pathtoremove);
|
2011-04-27 10:05:43 +00:00
|
|
|
t << tmpstr << "\t[Qt Dialog]\n";
|
|
|
|
tmpstr = tmpstr.section(".", 0, 0).section(QDir::separator(), -1);
|
|
|
|
tmpstr.insert(tmpstr.lastIndexOf(QDir::separator()) + 1, "ui_");
|
|
|
|
tmpstr.remove(".ui");
|
|
|
|
tmpstr.append(".h");
|
|
|
|
t << "\t-o work/" << tmpstr << "\n";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* source files for this project */
|
2012-08-20 11:04:39 +00:00
|
|
|
static const char * const src[] = { "HEADERS", "SOURCES", 0 };
|
|
|
|
for (int i = 0; src[i]; i++) {
|
2012-09-06 10:21:38 +00:00
|
|
|
const ProStringList &l = project->values(src[i]);
|
|
|
|
for (ProStringList::ConstIterator it = l.begin(); it != l.end(); ++it) {
|
2011-04-27 10:05:43 +00:00
|
|
|
if ((*it).isEmpty())
|
|
|
|
continue;
|
|
|
|
/* native tools aren't preprocessed */
|
|
|
|
if (!isnativebin)
|
2012-09-06 10:21:38 +00:00
|
|
|
t << writeOne((*it).toQString(), pathtoremove);
|
2011-04-27 10:05:43 +00:00
|
|
|
else
|
2012-09-06 10:21:38 +00:00
|
|
|
t << (*it).toQString().remove(pathtoremove) << "\n";
|
2011-04-27 10:05:43 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
t << "\n";
|
|
|
|
|
|
|
|
{
|
2012-09-06 10:21:38 +00:00
|
|
|
const ProStringList &l = project->values("GENERATED_SOURCES");
|
|
|
|
for (ProStringList::ConstIterator it = l.begin(); it != l.end(); ++it) {
|
|
|
|
t << "work/" << (*it).toQString().section(QDir::separator(), -1) << "\n";
|
2011-04-27 10:05:43 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
QString GBuildMakefileGenerator::writeOne(QString filename, QString pathtoremove)
|
|
|
|
{
|
|
|
|
QString s("");
|
|
|
|
s += filename.remove(pathtoremove);
|
|
|
|
if (filename.endsWith(Option::h_ext.first())) {
|
|
|
|
QString corename(filename.section(QDir::separator(), -1));
|
|
|
|
corename.remove(Option::h_ext.first());
|
|
|
|
corename.append(Option::cpp_ext.first());
|
|
|
|
corename.prepend(Option::h_moc_mod);
|
|
|
|
s += "\t[MOC/Qt Header]\n";
|
|
|
|
s += "\t-o ";
|
|
|
|
s += "work/";
|
|
|
|
s += corename;
|
|
|
|
s += "\n";
|
|
|
|
} else if (filename.section(QDir::separator(), -1).startsWith("qrc_")) {
|
|
|
|
QString tmpstr(filename.section("/", -1).section(".", 0, -1).remove("qrc_").remove(".cpp"));
|
|
|
|
s += "\n\t:depends=";
|
|
|
|
s += tmpstr;
|
|
|
|
s += ".qrc";
|
|
|
|
s += "\n";
|
|
|
|
} else if (filename.endsWith(Option::cpp_ext.first())) {
|
|
|
|
QString tmpstr(filename.section("/", -1));
|
|
|
|
QString filepath(pathtoremove);
|
|
|
|
if (!project->values("QT_SOURCE_TREE").isEmpty()) {
|
2012-09-06 10:21:38 +00:00
|
|
|
filepath.remove(project->first("QT_SOURCE_TREE").toQString());
|
2011-04-27 10:05:43 +00:00
|
|
|
filepath.remove(0, 1);
|
|
|
|
}
|
|
|
|
s += "\n\t:preexecShellSafe='${QT_BUILD_DIR}/bin/moc ";
|
2011-10-12 18:38:10 +00:00
|
|
|
s += "-nn ";
|
2011-04-27 10:05:43 +00:00
|
|
|
s += varGlue("DEFINES", "-D", " -D", " ");
|
|
|
|
s += varGlue("INCLUDEPATH", "-I", " -I", " ");
|
|
|
|
s += filepath;
|
|
|
|
s += filename;
|
|
|
|
s += " -o ";
|
|
|
|
tmpstr.replace(Option::cpp_ext.first(), Option::cpp_moc_ext);
|
|
|
|
s += "work/";
|
|
|
|
s += tmpstr;
|
|
|
|
s += "\n";
|
|
|
|
} else
|
|
|
|
s += "\n";
|
|
|
|
return s;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool
|
|
|
|
GBuildMakefileGenerator::openOutput(QFile &file, const QString &build) const
|
|
|
|
{
|
2013-10-31 15:15:51 +00:00
|
|
|
Q_UNUSED(build)
|
2011-04-27 10:05:43 +00:00
|
|
|
debug_msg(1, "file is %s", file.fileName().toLatin1().constData());
|
|
|
|
QFileInfo fi(file);
|
|
|
|
if (fi.filePath().isEmpty())
|
|
|
|
file.setFileName(qmake_getpwd() + QDir::separator() + file.fileName());
|
|
|
|
if (!file.fileName().endsWith(projectSuffix())) {
|
|
|
|
QString outputName(file.fileName());
|
|
|
|
outputName += QDir::separator();
|
|
|
|
outputName += fileInfo(project->projectFile()).baseName();
|
|
|
|
outputName += projectSuffix();
|
|
|
|
file.setFileName(outputName);
|
|
|
|
}
|
|
|
|
debug_msg(1, "file is %s", file.fileName().toLatin1().constData());
|
|
|
|
bool ret = MakefileGenerator::openOutput(file, QString());
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
QT_END_NAMESPACE
|