cbp2make
Makefile generation tool for Code::Blocks IDE
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
cbproject.h
Go to the documentation of this file.
1 /*
2  cbp2make : Makefile generation tool for the Code::Blocks IDE
3  Copyright (C) 2010-2013 Mirai Computing (mirai.computing@gmail.com)
4 
5  This program is free software: you can redistribute it and/or modify
6  it under the terms of the GNU General Public License as published by
7  the Free Software Foundation, either version 3 of the License, or
8  (at your option) any later version.
9 
10  This program is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU General Public License for more details.
14 
15  You should have received a copy of the GNU General Public License
16  along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18 
19 //------------------------------------------------------------------------------
20 #ifndef CBPROJECT_H
21 #define CBPROJECT_H
22 //------------------------------------------------------------------------------
23 #include "stlstrings.h"
24 #include "stlconfig.h"
25 //#include "cbptarget.h"
26 //#include "cbpunit.h"
27 #include "depsearch.h"
28 #include "makefile.h"
29 //------------------------------------------------------------------------------
30 
31 class CBuildTarget;
32 class CVirtualTarget;
33 class CBuildUnit;
34 class CToolChain;
36 
37 class TiXmlElement;
38 
40 {
41  private:
42  //bool m_ValidProject;
59  std::vector<CBuildTarget*> m_BuildTargets;
60  std::vector<CVirtualTarget*> m_VirtualTargets;
61  std::vector<CBuildUnit*> m_Units;
64  //
66  std::vector<CBuildTarget*> m_BuildTargetIndex;
67  std::vector<CVirtualTarget*> m_VirtualTargetIndex;
68  std::vector<CBuildUnit*> m_UnitIndex;
69  std::vector<CToolChain*> m_ToolChainIndex;
70  std::vector<int> m_TargetToolChainIndex;
71  //
73  //CStringList m_MakefileText;
75  protected:
76  //void DecorateTargetNames(void);
77  void SortUnitsByWeight(void);
78  public:
79  void Clear(void);
80  void Read(const TiXmlElement *ProjectRoot);
81  bool LoadProject(const CString& FileName);
82  void Show(void);
83  private:
84  void UpdatePlatformIndex(const size_t Platform, CCodeBlocksBuildConfig& Config);
85  void UpdateTargetIndex(const int Target, CCodeBlocksBuildConfig& Config);
86  public:
87  static CString DecorateVariableName(const CString& VariableName, const int Case = 0);
88  static CString DecorateTargetName(const CString& TargetName, const int Case = 2);
89  CString ToolChainSuffix(const int ToolChainIndex, CCodeBlocksBuildConfig& Config);
90  //bool GenerateMakefileText(const CString& FileName, CCodeBlocksBuildConfig& Config);
91  bool GenerateMakefile(const CString& FileName, CCodeBlocksBuildConfig& Config);
92  public:
93  CCodeBlocksProject(void);
94  ~CCodeBlocksProject(void);
95 };
96 
97 #endif
98 //------------------------------------------------------------------------------