+#include "file-path.hh"
+#include "file-results.hh"
+#include "my-lily-parser.hh"
+#include "source.hh"
+#include "lily-version.hh"
+
+Sources* source_global_l = 0;
+Array<String> inclusion_global_array;
+Array<String> target_str_global_array;
+Link_array<Score> score_global_array;
+Scope * header_global_p;
+
+
+void write_dependency_file (String fn, Array<String> targets,
+ Array<String> deps)
+{
+ const int WRAPWIDTH = 65;
+
+ progress_indication (_f ("Writing dependency file: `%s'...", fn.ch_C ()));
+ progress_indication ("\n");
+ ofstream f (fn.ch_C ());
+ if (!f)
+ warning (_f ("can't open file: `%s'", fn));
+
+ f << "# Automatically generated by " << gnu_lilypond_version_str () << '\n';
+ String out;
+ for (int i=0; i < targets.size (); i ++)
+ out += targets[i] + " ";
+ out += ": ";
+ for (int i=0; i < deps.size (); i ++)
+ {
+ if (out.length_i() > WRAPWIDTH)
+ {
+ f << out << "\\\n";
+ out = " ";
+ }
+ out += " " + deps[i];
+ }
+ f << out << endl;
+}
+
+void
+do_deps()
+{
+ if (dependency_global_b)
+ {
+ write_dependency_file (default_outname_base_global + ".dep", target_str_global_array,
+ inclusion_global_array);
+ }
+}