gov.llnl.babel.backend
Class Dependencies
java.lang.Object
gov.llnl.babel.backend.Dependencies
- FileListener
public class Dependencies
extends java.lang.Object
Make depends info calculator for all languages.
We have a nested map structure:
d_dirMap contains elements indexed by dirname
and with hashmaps as values. The hashmap values
are themselves hashmaps keyed by filename with
a value the vector of filenames of prerequisites.
Note on terminology: this is about makefile dependency rules of the form
output : input
where input and output may be lists and may be path qualified or not.
It turns out that without a more restrictive definition of the C/C++/fortran
code generation, we cannot determine the directory in which the included
headers will exist because, for example, the IOR headers may be kept
canonically elsewhere and generated by an alternate invocation of babel.
Similarly, headers from other sidl packages not included in the same
generation step be be anywhere in the filesystem. Thus, the best dependency
we can generate is by filenames only on the rhs of the : in a make rule and
the rest of the work must be provided by VPATH in gnu make or equivalent.
On the whole, the difficulties stem from a deep inconsistency in how various
languages are handled. E.g. xml files can always determine the full path to
other xml files at babel invocation time. In python and java there is some
package structure, but not enough to guarantee anything. In C, etc, the
user can pretty much do anything they want.
Dependencies
public Dependencies(Context context)
addInput
public void addInput(String input)
addTargetFile
public void addTargetFile(String dirName,
String fileName)
dumpData
public void dumpData()
getDirectoryData
public HashMap getDirectoryData(String dirName)
recordDependency
public void recordDependency(Symbol symbol)
recordDependency
public void recordDependency(SymbolID id)
Method for recording makefile dependencies. Do not
use unless you know exactly what you are doing.
setOutputDir
public void setOutputDir(String outdir)