gov.llnl.babel.backend
Class MakefileGenerator
java.lang.Object
gov.llnl.babel.backend.MakefileGenerator
- BuildGenerator, ContextAware, FileListener
public class MakefileGenerator
extends java.lang.Object
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
MakefileGenerator
public MakefileGenerator()
createAll
public void createAll()
throws IOException
Create all Makefiles in all the directories registered
with the FileManager
.
- createAll in interface BuildGenerator
createMakefileInDirectory
public void createMakefileInDirectory(String makefilename,
String dirname)
throws IOException
Create a single makefile in a specific directory.
This will do nothing if there are no files defined
in that directory according to the FileManager
class.
makefilename
- set makefile name, if null or "", defaults to
<make-prefix> + "babel.make"dirname
- directory to look for
defaultFilename
protected String defaultFilename()
Return the default file name. This method can be
overridden in derived classes if a different default
name is preferred.
- value of the make file name
excludeGroup
public void excludeGroup(String groupname)
Add a file group to be excluded from generation.
By default no group is excluded when the MakefileGenerator
is constructed.
groupname
- string name of a file group
readmitExcludedGroup
public void readmitExcludedGroup(String groupname)
Remove a group name from those excluded from generation;
groupname
- string name of a file group
writeMakefile
protected void writeMakefile(PrintWriter pw,
Map role2files)
Generate the actual make file.
This method can be overridden for tools other than make
provided that whatever files are generated exist in
the same directory as the sourcecode.