[2] | 1 | /****************************************************************************
|
---|
| 2 | **
|
---|
| 3 | ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
|
---|
| 4 | ** Contact: Qt Software Information ([email protected])
|
---|
| 5 | **
|
---|
| 6 | ** This file is part of the qmake application of the Qt Toolkit.
|
---|
| 7 | **
|
---|
[21] | 8 | ** Copyright (C) 2009 netlabs.org. OS/2 parts.
|
---|
| 9 | **
|
---|
[2] | 10 | ** $QT_BEGIN_LICENSE:LGPL$
|
---|
| 11 | ** Commercial Usage
|
---|
| 12 | ** Licensees holding valid Qt Commercial licenses may use this file in
|
---|
| 13 | ** accordance with the Qt Commercial License Agreement provided with the
|
---|
| 14 | ** Software or, alternatively, in accordance with the terms contained in
|
---|
| 15 | ** a written agreement between you and Nokia.
|
---|
| 16 | **
|
---|
| 17 | ** GNU Lesser General Public License Usage
|
---|
| 18 | ** Alternatively, this file may be used under the terms of the GNU Lesser
|
---|
| 19 | ** General Public License version 2.1 as published by the Free Software
|
---|
| 20 | ** Foundation and appearing in the file LICENSE.LGPL included in the
|
---|
| 21 | ** packaging of this file. Please review the following information to
|
---|
| 22 | ** ensure the GNU Lesser General Public License version 2.1 requirements
|
---|
| 23 | ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
---|
| 24 | **
|
---|
| 25 | ** In addition, as a special exception, Nokia gives you certain
|
---|
| 26 | ** additional rights. These rights are described in the Nokia Qt LGPL
|
---|
| 27 | ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
|
---|
| 28 | ** package.
|
---|
| 29 | **
|
---|
| 30 | ** GNU General Public License Usage
|
---|
| 31 | ** Alternatively, this file may be used under the terms of the GNU
|
---|
| 32 | ** General Public License version 3.0 as published by the Free Software
|
---|
| 33 | ** Foundation and appearing in the file LICENSE.GPL included in the
|
---|
| 34 | ** packaging of this file. Please review the following information to
|
---|
| 35 | ** ensure the GNU General Public License version 3.0 requirements will be
|
---|
| 36 | ** met: http://www.gnu.org/copyleft/gpl.html.
|
---|
| 37 | **
|
---|
| 38 | ** If you are unsure which license is appropriate for your use, please
|
---|
| 39 | ** contact the sales department at [email protected].
|
---|
| 40 | ** $QT_END_LICENSE$
|
---|
| 41 | **
|
---|
| 42 | ****************************************************************************/
|
---|
| 43 |
|
---|
[10] | 44 | #ifndef GNUMAKE_H
|
---|
| 45 | #define GNUMAKE_H
|
---|
[2] | 46 |
|
---|
| 47 | #include "winmakefile.h"
|
---|
| 48 |
|
---|
| 49 | QT_BEGIN_NAMESPACE
|
---|
| 50 |
|
---|
[10] | 51 | class GNUMakefileGenerator : public Win32MakefileGenerator
|
---|
[2] | 52 | {
|
---|
| 53 | public:
|
---|
[10] | 54 | GNUMakefileGenerator();
|
---|
| 55 | ~GNUMakefileGenerator();
|
---|
[2] | 56 | protected:
|
---|
[39] | 57 | QString escapeFilePath(const QString &path) const;
|
---|
[44] | 58 | QString escapeDependencyPath(const QString &path) const;
|
---|
[2] | 59 | private:
|
---|
[29] | 60 | bool isDosLikeShell() const;
|
---|
[10] | 61 | void writeGNUParts(QTextStream &);
|
---|
[2] | 62 | void writeIncPart(QTextStream &t);
|
---|
| 63 | void writeLibsPart(QTextStream &t);
|
---|
| 64 | void writeLibDirPart(QTextStream &t);
|
---|
| 65 | bool writeMakefile(QTextStream &);
|
---|
| 66 | void writeObjectsPart(QTextStream &t);
|
---|
| 67 | void writeBuildRulesPart(QTextStream &t);
|
---|
[39] | 68 | void writeRcAndDefVariables(QTextStream &t);
|
---|
| 69 | void writeRcAndDefPart(QTextStream &t);
|
---|
[2] | 70 | void init();
|
---|
[39] | 71 | void processRcFileVar();
|
---|
[2] | 72 | void processPrlVariable(const QString &var, const QStringList &l);
|
---|
| 73 |
|
---|
| 74 | QStringList &findDependencies(const QString &file);
|
---|
[10] | 75 |
|
---|
[2] | 76 | QString preCompHeaderOut;
|
---|
| 77 |
|
---|
| 78 | virtual bool findLibraries();
|
---|
| 79 | void fixTargetExt();
|
---|
| 80 |
|
---|
[35] | 81 | void writeProjectVarToStream(QTextStream &t, const QString &var);
|
---|
| 82 | QString makeResponseFileName(const QString &base);
|
---|
| 83 | void createLinkerResponseFiles(QTextStream &t);
|
---|
| 84 | void createCompilerResponseFiles(QTextStream &t);
|
---|
[44] | 85 | QString escapeFileVars(const QString &base);
|
---|
[35] | 86 |
|
---|
[2] | 87 | bool init_flag;
|
---|
| 88 | QString quote;
|
---|
[42] | 89 |
|
---|
| 90 | enum Mode { App, DLL, StaticLib };
|
---|
| 91 | Mode mode;
|
---|
[2] | 92 | };
|
---|
| 93 |
|
---|
[10] | 94 | inline GNUMakefileGenerator::~GNUMakefileGenerator()
|
---|
[2] | 95 | { }
|
---|
| 96 |
|
---|
| 97 | QT_END_NAMESPACE
|
---|
| 98 |
|
---|
[10] | 99 | #endif // GNUMAKE_H
|
---|