cbp2make
Makefile generation tool for Code::Blocks IDE
|
Makefile definition. More...
#include <makefile.h>
Public Member Functions | |
void | Clear (void) |
Resets the makefile to the initial state. More... | |
void | Show (void) |
Prints contents of the makefile to the standard output. More... | |
size_t | SectionCount (void) const |
Counts makefile sections. More... | |
CMakefileSection & | GetSection (const size_t Section) |
Returns a makefile section by a number. More... | |
CStringList & | Header (const size_t Section=0) |
Header of a makefile section number Section. More... | |
CMakefileSection & | AddSection (size_t *Section=0) |
Creates a new makefile section and adds it to the makefile. More... | |
CMakefileVariable & | AddMacro (const CString &Name, const CString &Value, const size_t Section=0) |
Creates a new macro variable and adds it to a section number Section. More... | |
CMakefileVariable & | AddEnvVar (const CString &Name, const CString &Value, const size_t Section=0) |
Creates a new environment variable and adds it to a section number Section. More... | |
size_t | RulesCount (const size_t Section=0) |
Counts makefile rules in a section number Section. More... | |
CMakefileRule & | GetRule (const size_t Index, const size_t Section=0) |
Returns makefile rule by the Index number in a section number Section. More... | |
CMakefileRule & | AddRule (const CString &TargetName, const size_t Section=0) |
Creates a new makefile rule and adds it to a section number Section. More... | |
CStringList & | GetText (void) |
Returns a plain text representation of the makefile. More... | |
CStringList & | Update (void) |
Creates plain text representation of the makefile from objects. More... | |
CMakefile (void) | |
Creates makefile. More... | |
~CMakefile (void) | |
Destroys makefile. More... | |
Private Attributes | |
std::vector< CMakefileSection * > | m_Sections |
A list of makefile sections. More... | |
CStringList | m_Text |
Plain text representation of the makefile. More... | |
Makefile definition.
Manages structured makefile and generates its text representation.
CMakefile::CMakefile | ( | void | ) |
Creates makefile.
CMakefile::~CMakefile | ( | void | ) |
Destroys makefile.
CMakefileVariable & CMakefile::AddEnvVar | ( | const CString & | Name, |
const CString & | Value, | ||
const size_t | Section = 0 |
||
) |
Creates a new environment variable and adds it to a section number Section.
Name | name of an environment variable. |
Value | default value of an environment variable. |
Section | number of a makefile section. |
If an environment variable with name Name already exists, a new variable will not be created.
CMakefileVariable & CMakefile::AddMacro | ( | const CString & | Name, |
const CString & | Value, | ||
const size_t | Section = 0 |
||
) |
Creates a new macro variable and adds it to a section number Section.
Name | name of a macro variable. |
Value | default value of a macro variable. |
Section | number of a makefile section. |
If a macro variable with name Name already exists, a new variable will not be created.
CMakefileRule & CMakefile::AddRule | ( | const CString & | TargetName, |
const size_t | Section = 0 |
||
) |
Creates a new makefile rule and adds it to a section number Section.
TargetName | name of makefile target for the rule. |
Section | number of a makefile section. |
If a makefile rule with target name TargetName already exists, a new rule will not be created.
CMakefileSection & CMakefile::AddSection | ( | size_t * | Section = 0 | ) |
Creates a new makefile section and adds it to the makefile.
Section | desired number for a makefile section. |
This function creates all sections through from the last existing section to a desired number Section.
void CMakefile::Clear | ( | void | ) |
Resets the makefile to the initial state.
CMakefileRule & CMakefile::GetRule | ( | const size_t | Index, |
const size_t | Section = 0 |
||
) |
Returns makefile rule by the Index number in a section number Section.
Index | number of a rule. |
Section | number of a makefile section. |
CMakefileSection & CMakefile::GetSection | ( | const size_t | Section | ) |
Returns a makefile section by a number.
Section | number of a makefile section. |
CStringList & CMakefile::GetText | ( | void | ) |
Returns a plain text representation of the makefile.
Make a call to CMakefile::Update(void) before using this function to convert object representation of the makefile to plain text.
CStringList & CMakefile::Header | ( | const size_t | Section = 0 | ) |
Header of a makefile section number Section.
Section | number of a makefile section. |
size_t CMakefile::RulesCount | ( | const size_t | Section = 0 | ) |
Counts makefile rules in a section number Section.
Section | number of a makefile section. |
size_t CMakefile::SectionCount | ( | void | ) | const |
Counts makefile sections.
void CMakefile::Show | ( | void | ) |
Prints contents of the makefile to the standard output.
CStringList & CMakefile::Update | ( | void | ) |
Creates plain text representation of the makefile from objects.
|
private |
A list of makefile sections.
A section is similar in structure to an elementary and complete makefile, so a minimal makefile consists of one regular makefile section. In order to maintain a good style of makefile text, leading sections of makefile should contain headers and variable definitions and trailing sections should contain headers and rules while middle one may contain all of section parts. Any part of any section is optional and may be omitted.
|
private |
Plain text representation of the makefile.