cbp2make
Makefile generation tool for Code::Blocks IDE
|
Project description. More...
#include <cbproject.h>
Public Member Functions | |
void | Clear (void) |
Resets the project to the initial state. More... | |
void | Read (const TiXmlElement *ProjectRoot) |
Reads the project settings from an XML document. More... | |
bool | LoadProject (const CString &FileName) |
Loads a project from a file specified by FileName. More... | |
void | Show (void) |
Prints the project contents to standard output. More... | |
CString | ToolChainSuffix (const int ToolChainIndex, CCodeBlocksBuildConfig &Config) |
bool | GenerateMakefile (const CString &FileName, CCodeBlocksBuildConfig &Config) |
Generates makefile text and writes it to the file specified by FileName. More... | |
CCodeBlocksProject (void) | |
Creates project. More... | |
~CCodeBlocksProject (void) | |
Destroys project. More... | |
Static Public Member Functions | |
static CString | DecorateVariableName (const CString &VariableName, const int Case=0) |
Makes a makefile-compatible macro variable name from the given name. More... | |
static CString | DecorateTargetName (const CString &TargetName, const int Case=2) |
Makes a makefile-compatible build target name from the given name. More... | |
Protected Member Functions | |
void | SortUnitsByWeight (void) |
Sorts project units by weight in ascending order. More... | |
Private Member Functions | |
void | UpdatePlatformIndex (const size_t Platform, CCodeBlocksBuildConfig &Config) |
Updates lists of build targets, virtual build targets and toolchains. More... | |
void | UpdateTargetIndex (const int Target, CCodeBlocksBuildConfig &Config) |
Updates list of build units. More... | |
Private Attributes | |
int | m_VersionMajor |
Major version number. More... | |
int | m_VersionMinor |
Minor version number. More... | |
CString | m_Title |
Title of the project. More... | |
CString | m_DefaultTarget |
Name of the default build target of the project. More... | |
CString | m_Compiler |
Name (alias) of the default toolchain for the project. More... | |
bool | m_ExtendedObjectNames |
Controls how object files are named. More... | |
CStringList | m_CompilerOptions |
Project-wide list of compiler options. More... | |
CStringList | m_CompilerDirectories |
Project-wide list of search directories for compiler(s). More... | |
CStringList | m_LinkerOptions |
Project-wide list of linker options. More... | |
CStringList | m_LinkerLibraries |
Project-wide list of libraries to link with the project. More... | |
CStringList | m_LinkerDirectories |
Project-wide list of search directories for linker. More... | |
CStringList | m_ResourceCompilerDirectories |
Project-wide list of search directories for resource compiler. More... | |
CStringList | m_BeforeBuildCommands |
Project-wide list of commands that should be executed prior to starting the build process. More... | |
CStringList | m_AfterBuildCommands |
Project-wide list of commands that should be executed after the build process is finished. More... | |
bool | m_ForceBeforeBuildCommands |
Makes the execution of the project-wide before-build commands unconditional. More... | |
bool | m_ForceAfterBuildCommands |
Makes the execution of the project-wide after-build commands unconditional. More... | |
std::vector< CBuildTarget * > | m_BuildTargets |
List of build targets of the project. More... | |
std::vector< CVirtualTarget * > | m_VirtualTargets |
List of virtual build targets of the project. More... | |
std::vector< CBuildUnit * > | m_Units |
List of build units of the project. More... | |
CConfiguration | m_Environment |
Symbol table for environment variables. More... | |
CStringList | m_Platforms |
List of platforms used in the project. More... | |
bool | m_SinglePlatform |
Indicates that makefile should be generated only for one platform. More... | |
std::vector< CBuildTarget * > | m_BuildTargetIndex |
List of build targets valid for a platform. More... | |
std::vector< CVirtualTarget * > | m_VirtualTargetIndex |
List of virtual build targets valid for a platform. More... | |
std::vector< CBuildUnit * > | m_UnitIndex |
List of build units valid for a build target. More... | |
std::vector< CToolChain * > | m_ToolChainIndex |
List of toolchains valid for a platform. More... | |
std::vector< int > | m_TargetToolChainIndex |
CDependencyInfo | m_Dependencies |
Stores dependencies of build units. More... | |
CMakefile | m_Makefile |
Contains object-based description of makefile for the project. More... | |
Project description.
Contains properties of a project and generates makefiles.
CCodeBlocksProject::CCodeBlocksProject | ( | void | ) |
Creates project.
CCodeBlocksProject::~CCodeBlocksProject | ( | void | ) |
Destroys project.
CCodeBlocksProject::Clear | ( | void | ) |
Resets the project to the initial state.
|
static |
Makes a makefile-compatible build target name from the given name.
TargetName | an unprepared build target name. |
Case | casing of the variable name:
|
This function uses MakefileFriendly(const CString& AString) for the job.
|
static |
Makes a makefile-compatible macro variable name from the given name.
VariableName | an unprepared macro variable name. |
Case | casing of the variable name:
|
This function uses MakefileFriendly(const CString& AString) for the job.
CCodeBlocksProject::GenerateMakefile | ( | const CString & | FileName, |
CCodeBlocksBuildConfig & | Config | ||
) |
Generates makefile text and writes it to the file specified by FileName.
FileName | a file name for makefile of the project. |
Config | build configuration. |
This function uses intermediate object-based makefile description CCodeBlocksProject::m_Makefile to generate plain text makefile.
CCodeBlocksProject::LoadProject | ( | const CString & | FileName | ) |
Loads a project from a file specified by FileName.
FileName | name of Code::Blocks project file. |
CCodeBlocksProject::Read | ( | const TiXmlElement * | ProjectRoot | ) |
Reads the project settings from an XML document.
ProjectRoot | an element of XML document. |
CCodeBlocksProject::Show | ( | void | ) |
Prints the project contents to standard output.
|
protected |
Sorts project units by weight in ascending order.
CString CCodeBlocksProject::ToolChainSuffix | ( | const int | ToolChainIndex, |
CCodeBlocksBuildConfig & | Config | ||
) |
|
private |
Updates lists of build targets, virtual build targets and toolchains.
Platform | index of a platform in the build configuration. |
Config | build configuration. |
Refreshes CCodeBlocksProject::m_BuildTargetIndex, CCodeBlocksProject::m_VirtualTargetIndex and CCodeBlocksProject::m_ToolChainIndex by selecting only items valid for the specified platform.
|
private |
Updates list of build units.
Target | index of a target in the build configuration. |
Config | build configuration. |
Refreshes CCodeBlocksProject::m_UnitIndex by selecting only units valid for the specified build target.
|
private |
Project-wide list of commands that should be executed after the build process is finished.
|
private |
Project-wide list of commands that should be executed prior to starting the build process.
|
private |
List of build targets valid for a platform.
Contains pointers to CBuildTarget objects but does not own them (i.e. objects sould not be destroyed before the list is cleared). This property is automatically refreshed by CCodeBlocksProject::UpdatePlatformIndex(const size_t Platform, CCodeBlocksBuildConfig& Config).
|
private |
List of build targets of the project.
Contains pointers to CBuildTarget objects and owns them (i.e. objects sould be destroyed before the list is cleared).
|
private |
Name (alias) of the default toolchain for the project.
|
private |
Project-wide list of search directories for compiler(s).
|
private |
Project-wide list of compiler options.
|
private |
Name of the default build target of the project.
|
private |
Stores dependencies of build units.
CDependencyInfo is used to store information about relationship between build units in order to generate makefule rules for unit dependencies.
See depsearch.h for additional information on gathering unit dependencies.
|
private |
Symbol table for environment variables.
|
private |
Controls how object files are named.
When set to true, an object file extension (e.g. ".o" or ".obj") is appended to a build unit file name (e.g. "unit.cpp" becomes "unit.cpp.o"), otherwise, when set to false, a build unit file extension is replaced by an object file extension (e.g. "unit.cpp" becomes "unit.o").
|
private |
Makes the execution of the project-wide after-build commands unconditional.
|
private |
Makes the execution of the project-wide before-build commands unconditional.
|
private |
Project-wide list of search directories for linker.
|
private |
Project-wide list of libraries to link with the project.
|
private |
Project-wide list of linker options.
|
private |
Contains object-based description of makefile for the project.
Contents of makefile are generated by CCodeBlocksProject::GenerateMakefile(const CString& FileName, CCodeBlocksBuildConfig& Config) before saving to a file.
|
private |
List of platforms used in the project.
Contains pointers to CPlatform objects and owns them (i.e. objects sould be destroyed before the list is cleared).
|
private |
Project-wide list of search directories for resource compiler.
|
private |
Indicates that makefile should be generated only for one platform.
This property is automatically refreshed by CCodeBlocksProject::GenerateMakefileText(const CString& FileName, CCodeBlocksBuildConfig& Config) or CCodeBlocksProject::GenerateMakefile(const CString& FileName, CCodeBlocksBuildConfig& Config).
|
private |
|
private |
Title of the project.
|
private |
List of toolchains valid for a platform.
Contains pointers to CPlatform objects but does not own them (i.e. objects sould not be destroyed before the list is cleared). This property is automatically refreshed by CCodeBlocksProject::UpdatePlatformIndex(const size_t Platform, CCodeBlocksBuildConfig& Config).
|
private |
List of build units valid for a build target.
Contains pointers to CBuildUnit objects but does not own them (i.e. objects sould not be destroyed before the list is cleared). This property is automatically refreshed by CCodeBlocksProject::UpdateTargetIndex(const int Target, CCodeBlocksBuildConfig& Config).
|
private |
List of build units of the project.
Contains pointers to CBuildUnit objects and owns them (i.e. objects sould be destroyed before the list is cleared).
|
private |
Major version number.
|
private |
Minor version number.
|
private |
List of virtual build targets valid for a platform.
Contains pointers to CVirtualTarget objects but does not own them (i.e. objects sould not be destroyed before the list is cleared). This property is automatically refreshed by CCodeBlocksProject::UpdatePlatformIndex(const size_t Platform, CCodeBlocksBuildConfig& Config).
|
private |
List of virtual build targets of the project.
Contains pointers to CVirtualTarget objects and owns them (i.e. objects sould be destroyed before the list is cleared).