cbp2make
Makefile generation tool for Code::Blocks IDE
|
Contains platform-specific settings and generates commands from templates. More...
#include <platforms.h>
Public Types | |
enum | OS_Type { OS_Other, OS_Unix, OS_Windows, OS_Mac, OS_Count } |
Type of Operating System for a platform. More... | |
Public Member Functions | |
bool & | Active (void) |
Indicates that this platform is used by a build target. More... | |
OS_Type | OS (void) const |
Type of operating system for this platform. More... | |
CString | Name (void) |
Returns the name of this platform. More... | |
CString & | Cmd_Copy (void) |
File copying command template. More... | |
CString & | Cmd_Move (void) |
File moving command template. More... | |
CString & | Cmd_Make (void) |
Make tool invocation template. More... | |
CString & | Tool_Make (void) |
File name of the 'make' tool. More... | |
CString & | Cmd_RemoveFile (void) |
File removing (deleting) command template. More... | |
CString & | Cmd_ForceRemoveFile (void) |
Forced file removing command template. More... | |
CString & | Cmd_MakeDir (void) |
Directory creation command template. More... | |
CString & | Cmd_TestMakeDir (void) |
Directory existence checking and creation command template. More... | |
CString & | Cmd_ForceMakeDir (void) |
Forced directory creation (including parent directories) command template. More... | |
CString & | Cmd_RemoveDir (void) |
Directory removing command template. More... | |
CString & | Cmd_PrintWorkDir (void) |
Template of command to print working directory. More... | |
CString & | Cmd_EvalWorkDir (void) |
Template of command that evaluates working directory to assign it to a variable. More... | |
CString & | Cmd_ChangeDir (void) |
Current directory changing command template. More... | |
char | Pd (void) const |
Returns path delimiter (separator) for this platform. More... | |
CString | Pd (const CString &Path) const |
Converts path separators in given path to valid for this platform. More... | |
CString | SpecialChars (void) const |
CString | ProtectPath (const CString &Path, const int QuoteMode=QUOTE_AUTO) |
CString | Copy (const CString &Source, const CString &Destination) const |
Generates file copying command from template. More... | |
CString | Move (const CString &Source, const CString &Destination) const |
Generates file moving command from template. More... | |
CString | Make (const CString &Options, const CString &Path) const |
Generates command to invoke make tool from template. More... | |
CString | RemoveFile (const CString &Path) const |
Generates file removing command from template. More... | |
CString | ForceRemoveFile (const CString &Path) const |
Generates forced file removing command from template. More... | |
CString | MakeDir (const CString &Path) const |
Generates directory creation command from template. More... | |
CString | TestMakeDir (const CString &Path) const |
Generates conditional (by existence) directory creation command from template. More... | |
CString | ForceMakeDir (const CString &Path) const |
Generates forced directory creation command from template. More... | |
CString | RemoveDir (const CString &Path) const |
Generates directory removing command from template. More... | |
CString | PrintWorkDir (void) const |
Generates command to print current working directory from template. More... | |
CString | EvalWorkDir (void) const |
Generates command to evaluate working directory value from template. More... | |
CString | ChangeDir (const CString &Path) const |
Generates current directory changing command from template. More... | |
CString | MakefileCmd (const CString &Command) const |
Converts raw command text to makefile-compatible form. More... | |
bool | IsStaticLibraryExtension (const CString &Ext) const |
bool | IsDynamicLibraryExtension (const CString &Ext) const |
void | Assign (const CPlatform &Platform) |
Copies another platform to this platform. More... | |
void | Clear (void) |
Resets the platform to the initial state. More... | |
void | Reset (const CPlatform::OS_Type OS) |
Resets the platform to default settings for specified OS. More... | |
void | Read (const TiXmlElement *PlatformRoot) |
Reads the platform settings from an XML document. More... | |
void | Write (TiXmlElement *PlatformRoot) |
Writes the platform settings to an XML document. More... | |
void | Show (void) |
Prints the platform settings to the standard output. More... | |
CPlatform & | operator= (const CPlatform &Platform) |
Copies another platform to this platform. More... | |
CPlatform (void) | |
Creates platform description. More... | |
CPlatform (const CPlatform &Platform) | |
Copies another platform to this platform. More... | |
~CPlatform (void) | |
Static Public Member Functions | |
static CString | Name (const OS_Type PlatformOS) |
Returns name of platform for type PlatformOS. More... | |
static OS_Type | OS (CString &PlatformName) |
Returns platform type for name PlatformName. More... | |
Private Member Functions | |
void | Read (const TiXmlElement *Root, const CString &Name, CString &Value) |
Reads template of command Name to Value from an XML document. More... | |
void | Write (TiXmlElement *Root, const CString &Name, const CString &Value) |
Writes template of command Name to Value from an XML document. More... | |
Private Attributes | |
bool | m_Active |
Indicates that this platform is used by a build target. More... | |
OS_Type | m_OS_Type |
Type of operating system for this platform. More... | |
CString | m_Cmd_Null |
Name of the NULL device (/dev/null etc). More... | |
CString | m_Cmd_Copy |
File copying command template. More... | |
CString | m_Cmd_Move |
File moving command template. More... | |
CString | m_Cmd_Make |
Make tool invocation template. More... | |
CString | m_Tool_Make |
File name of the make tool. More... | |
CString | m_Cmd_RemoveFile |
File removing (deleting) command template. More... | |
CString | m_Cmd_ForceRemoveFile |
Forced file removing command template. More... | |
CString | m_Cmd_MakeDir |
Directory creation command template. More... | |
CString | m_Cmd_TestMakeDir |
Directory existence checking and creation command template. More... | |
CString | m_Cmd_ForceMakeDir |
Forced directory creation (including parent directories) command template. More... | |
CString | m_Cmd_RemoveDir |
Directory removing command template. More... | |
CString | m_Cmd_PrintWorkDir |
Template of command to print working directory. More... | |
CString | m_Cmd_EvalWorkDir |
Template of command that evaluates working directory to assign it to a variable. More... | |
CString | m_Cmd_ChangeDir |
Current directory changing command template. More... | |
char | m_PathDelimiter |
File system path delimiter (separator). More... | |
CStringList | m_StaticLibraryExtensions |
CStringList | m_DynamicLibraryExtensions |
Contains platform-specific settings and generates commands from templates.
Command templates use few special macros that should be substituted to get a working command:
A command template looks like this: "make $opts -f $file"
(make tool invocation).
enum CPlatform::OS_Type |
CPlatform::CPlatform | ( | void | ) |
Creates platform description.
CPlatform::CPlatform | ( | const CPlatform & | Platform | ) |
Copies another platform to this platform.
Platform | another platform. |
CPlatform::~CPlatform | ( | void | ) |
|
inline |
Indicates that this platform is used by a build target.
void CPlatform::Assign | ( | const CPlatform & | Platform | ) |
Copies another platform to this platform.
Platform | another platform. |
Generates current directory changing command from template.
Path | a directory path. |
void CPlatform::Clear | ( | void | ) |
Resets the platform to the initial state.
|
inline |
Current directory changing command template.
|
inline |
File copying command template.
|
inline |
Template of command that evaluates working directory to assign it to a variable.
|
inline |
Forced directory creation (including parent directories) command template.
|
inline |
Forced file removing command template.
|
inline |
Make tool invocation template.
|
inline |
Directory creation command template.
|
inline |
File moving command template.
|
inline |
Template of command to print working directory.
|
inline |
Directory removing command template.
|
inline |
File removing (deleting) command template.
|
inline |
Directory existence checking and creation command template.
Generates file copying command from template.
Source | source file. |
Destination | target file. |
CString CPlatform::EvalWorkDir | ( | void | ) | const |
Generates command to evaluate working directory value from template.
Generates forced directory creation command from template.
Path | a directory path. |
Generates forced file removing command from template.
Path | a file path. |
bool CPlatform::IsDynamicLibraryExtension | ( | const CString & | Ext | ) | const |
bool CPlatform::IsStaticLibraryExtension | ( | const CString & | Ext | ) | const |
Generates command to invoke make tool from template.
Options | make tool options. |
Path | path to a makefile. |
Generates directory creation command from template.
Path | a directory path. |
Converts raw command text to makefile-compatible form.
Command | a command text. |
In Windows, it is required to prepend commands with "cmd /c" in order to make them work as intended from the makefile, while in UNIX is is not required to change commands anyhow. This function is invented to deal with compatibility issues for other platforms as well.
Generates file moving command from template.
Source | source file. |
Destination | target file. |
Returns name of platform for type PlatformOS.
PlatformOS | a platform / operating system type. |
CString CPlatform::Name | ( | void | ) |
Returns the name of this platform.
Copies another platform to this platform.
Platform | another platform. |
|
static |
Returns platform type for name PlatformName.
PlatformName | a name of platform / operating system. |
|
inline |
Type of operating system for this platform.
|
inline |
Returns path delimiter (separator) for this platform.
Converts path separators in given path to valid for this platform.
Path | a file path. |
CString CPlatform::PrintWorkDir | ( | void | ) | const |
Generates command to print current working directory from template.
CString CPlatform::ProtectPath | ( | const CString & | Path, |
const int | QuoteMode = QUOTE_AUTO |
||
) |
Reads template of command Name to Value from an XML document.
Root | an element of an XML document. |
Name | name of a command. |
Value | command template. |
void CPlatform::Read | ( | const TiXmlElement * | PlatformRoot | ) |
Reads the platform settings from an XML document.
PlatformRoot | an element of an XML document. |
Generates directory removing command from template.
Path | a directory path. |
Generates file removing command from template.
Path | a file path. |
void CPlatform::Reset | ( | const CPlatform::OS_Type | OS | ) |
Resets the platform to default settings for specified OS.
OS | operating system type. |
void CPlatform::Show | ( | void | ) |
Prints the platform settings to the standard output.
CString CPlatform::SpecialChars | ( | void | ) | const |
Generates conditional (by existence) directory creation command from template.
Path | a directory path. |
|
inline |
File name of the 'make' tool.
Writes template of command Name to Value from an XML document.
Root | an element of an XML document. |
Name | name of a command. |
Value | command template. |
void CPlatform::Write | ( | TiXmlElement * | PlatformRoot | ) |
Writes the platform settings to an XML document.
PlatformRoot | an element of an XML document. |
|
private |
Indicates that this platform is used by a build target.
This property is modified by CCodeBlocksProject during makefile creation.
|
private |
Current directory changing command template.
|
private |
File copying command template.
|
private |
Template of command that evaluates working directory to assign it to a variable.
|
private |
Forced directory creation (including parent directories) command template.
|
private |
Forced file removing command template.
|
private |
Make tool invocation template.
|
private |
Directory creation command template.
|
private |
File moving command template.
|
private |
Name of the NULL device (/dev/null etc).
|
private |
Template of command to print working directory.
|
private |
Directory removing command template.
|
private |
File removing (deleting) command template.
|
private |
Directory existence checking and creation command template.
|
private |
|
private |
Type of operating system for this platform.
|
private |
File system path delimiter (separator).
|
private |
|
private |
File name of the make tool.