|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--gov.llnl.babel.backend.MakefileGenerator
This class is used to generate makefiles but may
be amenable to extension to other types of build files.
gets the database of generated files from the
FileManager
. It then create makefiles
FileManager
Constructor Summary | |
MakefileGenerator()
|
Method Summary | |
void |
createAll()
Create all Makefiles in all the directories registered with the FileManager . |
void |
createMakefileInDirectory(java.lang.String makefilename,
java.lang.String dirname)
Create a single makefile in a specific directory. |
protected java.lang.String |
defaultFilename()
Return the default file name. |
void |
excludeGroup(java.lang.String groupname)
Add a file group to be excluded from generation. |
java.util.Set |
getLanguages()
Return the set of languages that this build generator serves. |
void |
newFile(SymbolID id,
int type,
java.lang.String role,
java.lang.String dir,
java.lang.String name)
This method is called for each file created by the FileManager . |
void |
readmitExcludedGroup(java.lang.String groupname)
Remove a group name from those excluded from generation; |
protected void |
writeMakefile(java.io.PrintWriter pw,
java.util.Map role2files)
Generate the actual make file. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public MakefileGenerator()
Method Detail |
public void newFile(SymbolID id, int type, java.lang.String role, java.lang.String dir, java.lang.String name)
FileManager
.
newFile
in interface FileListener
id
- the file is related to this symbol id.type
- this indicates the type of the symbol. A constant
from Type
.role
- this describes the role the file plays. For example,
the file could be a STUBSRCS
file or a
IMPLSRCS
file. The role strings used
are determined by the backend.dir
- the path (relative or absolute) of the directory where
the file will be created.name
- the name of the file not including any directory
information. The complete name of the file should
be dir + name
.public void excludeGroup(java.lang.String groupname)
MakefileGenerator
is constructed.
groupname
- string name of a file grouppublic void readmitExcludedGroup(java.lang.String groupname)
groupname
- string name of a file grouppublic void createAll() throws java.io.IOException
FileManager
.
createAll
in interface BuildGenerator
java.io.IOException
- the message contained is the concatenation of
all IOExceptions thrown by createMakefileInDirectory
java.io.IOException
- this is a exception that contains
all the I/O exceptions that occurred during file generation.FileManager
public void createMakefileInDirectory(java.lang.String makefilename, java.lang.String dirname) throws java.io.IOException
FileManager
class.
makefilename
- set makefile name, if null or "", defaults to
"babel.make"dirname
- directory to look for
java.io.IOException
- if problems are encountered with the file system.FileManager
,
defaultFilename()
protected void writeMakefile(java.io.PrintWriter pw, java.util.Map role2files)
protected java.lang.String defaultFilename()
public java.util.Set getLanguages()
BuildGenerator
getLanguages
in interface BuildGenerator
Set
of strings. Each string in the set
represents a language supported by the build generator.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |