static bool enable_version_header;
static bool disable_version_header;
static bool fatal_warnings;
+ static string dependencies;
static string entry_point;
{ "internal-vapi", 0, 0, OptionArg.FILENAME, ref internal_vapi_filename, "Output vapi with internal api", "FILE" },
{ "fast-vapi", 0, 0, OptionArg.STRING, ref fast_vapi_filename, "Output vapi without performing symbol resolution", null },
{ "use-fast-vapi", 0, 0, OptionArg.STRING_ARRAY, ref fast_vapis, "Use --fast-vapi output during this compile", null },
+ { "deps", 0, 0, OptionArg.STRING, ref dependencies, "Write make-style dependency information to this file", null },
{ "symbols", 0, 0, OptionArg.FILENAME, ref symbols_filename, "Output symbols file", "FILE" },
{ "compile", 'c', 0, OptionArg.NONE, ref compile_only, "Compile but do not link", null },
{ "output", 'o', 0, OptionArg.FILENAME, ref output, "Place output in file FILE", "FILE" },
internal_vapi_filename = null;
}
+ if (dependencies != null) {
+ context.write_dependencies (dependencies);
+ }
+
if (!ccode_only) {
var ccompiler = new CCodeCompiler ();
if (cc_command == null && Environment.get_variable ("CC") != null) {
return null;
}
+
+ public void write_dependencies (string filename) {
+ var stream = FileStream.open (filename, "w");
+
+ if (stream == null) {
+ Report.error (null, "unable to open `%s' for writing".printf (filename));
+ return;
+ }
+
+ stream.printf ("%s:", filename);
+ foreach (var src in source_files) {
+ if (src.file_type == SourceFileType.FAST && src.used) {
+ stream.printf (" %s", src.filename);
+ }
+ }
+ stream.printf ("\n\n");
+ }
}
Report.error (unresolved_symbol.inner.source_reference, "The symbol `%s' could not be found".printf (unresolved_symbol.inner.name));
return null;
}
+ parent_symbol.used = true;
return parent_symbol.scope.lookup (unresolved_symbol.name);
}
type.source_reference = unresolved_type.source_reference;
type.value_owned = unresolved_type.value_owned;
+ sym.used = true;
if (type is GenericType) {
// type parameters are always considered nullable