gov.llnl.babel.backend
Class PackageMakeInfoGenerator
java.lang.Object
gov.llnl.babel.backend.PackageMakeInfoGenerator
- BuildGenerator, ContextAware, FileListener
public class PackageMakeInfoGenerator
extends java.lang.Object
This class is used to generate a makefile at the top
of the generated source tree (for an invocation of babel)
that tells about the other makefiles/setup.py files in
the tree. It thus has to be maintained consistently
with Makefile and Setup generators.
Gets the database of generated files from the
FileManager
. It then create makefiles
describing the package as generated.
It might be nice to expand this into a fully automatic
gmake based build generator later.
void | createAll() - Create all PackageMakeInfos in all the directories registered
with the
FileManager .
|
void | createMakefileInDirectory(String makefilename, String dirname) - Log that we created a single makefile in a specific directory.
|
protected String | defaultFilename() - Return the default file name.
|
protected String | defaultPackageFilename() - Return the default package file name.
|
Set | getLanguages() - Return the set of languages that this build generator serves.
|
void | newFile(SymbolID id, int type, String role, String dir, String name) - This method is called for each file created by the
FileManager .
|
protected void | recordMakefile(Map role2files, String dirname) - Generate the actual make file.
|
void | setContext(Context context) - Routine to notify extensions of the context.
|
protected void | writePackageMakeInfo(PrintWriter pw, String makefilename) - Generate the package make file.
|
PackageMakeInfoGenerator
public PackageMakeInfoGenerator()
createAll
public void createAll()
throws IOException
Create all PackageMakeInfos in all the directories registered
with the FileManager
.
- createAll in interface BuildGenerator
createMakefileInDirectory
public void createMakefileInDirectory(String makefilename,
String dirname)
throws IOException
Log that we created 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
defaultPackageFilename
protected String defaultPackageFilename()
Return the default package file name. This method can be
overridden in derived classes if a different default
name is preferred.
- value of the make file name
getLanguages
public Set getLanguages()
Return the set of languages that this build generator serves. Each build
generator serves a Set of languages.
- getLanguages in interface BuildGenerator
- a
java.util.Set
of strings. Each string in the set
represents a language supported by the build generator.
recordMakefile
protected void recordMakefile(Map role2files,
String dirname)
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.
writePackageMakeInfo
protected void writePackageMakeInfo(PrintWriter pw,
String makefilename)
Generate the package 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.