openldev/openldev-settings/openldev-makefile-parser.h File Reference

Makefile, MakefileBuffer, MakefileVariable, MakefileScript, MakefileTarget, MakefilePrefix. More...

#include "../openldev-utils.h"
#include <glib.h>
#include <iostream>
#include <vector>
#include <string>
#include <fstream>

Data Structures

struct  MakefileBuffer
 Simple list of all of the elements in a Makefile.am. More...
struct  MakefileVariable
 Variable element in a Makefile.am (Used by Makefile). More...
struct  MakefileScript
 Script element in a Makefile.am (Used by Makefile). More...
struct  MakefilePrefix
 Prefix element in a Makefile.am (Used by Makefile). More...
struct  MakefileTarget
 Target element in a Makefile.am (Used by Makefile). More...
struct  Makefile
 Fully parsed structure of all of the elements in a Makefile.am. More...

Enumerations

enum  TargetType
 Specify the target type as PROGRAMS, LIBRARIES or LTLIBRARIES.

Functions

MakefileBufferopenldev_makefile_buffer_read (string file)
Makefileopenldev_makefile_new (string file)
void openldev_makefile_write (Makefile *mf)
vector< string > openldev_makefile_get_subdirs (Makefile *mf)
vector< string > openldev_makefile_get_sources (Makefile *mf)


Detailed Description


Function Documentation

MakefileBuffer* openldev_makefile_buffer_read string  file  ) 
 

This will create a new MakefileBuffer object out of the Makefile.am file. This is useful if you want to parse manually through the list of objects.

Parameters:
file The location of the Makefile.am file.
Returns:
A newly loaded MakefileBuffer object or an empty one if the file is not found.

vector<string> openldev_makefile_get_sources Makefile mf  ) 
 

This will retrieve all of the sources from each of the targets in the project. You can also achieve this result by parsing manually through all of the target objects.

Parameters:
A Makefile object.
Returns:
A full list of sources in the Makefile.am.

vector<string> openldev_makefile_get_subdirs Makefile mf  ) 
 

You can use this function to retrieve the list of SUBDIRS in a Makfile.am, although it is somewhat arbitrary since that object is now public.

Parameters:
A Makefile object.
Returns:
The list of subdirectories in the Makefile.am.

Makefile* openldev_makefile_new string  file  ) 
 

This will create a new Makefile object out of the specified Makefile.am. This object has already sorted out the different types of elements, so it is a lot easier to work with than MakefileBuffer objects.

Parameters:
file The location of the Makefile.am file.
Returns:
A newly loaded Makefile object or an empty one if the file is not found.

void openldev_makefile_write Makefile mf  ) 
 

Write the current content of a Makefile object to the file it was loaded from. Use this so changes are not lost.

Parameters:
A Makefile object.


Generated on Sun May 14 14:57:41 2006 for OpenLDev by  doxygen 1.4.6