summaryrefslogtreecommitdiff
path: root/source4/build/smb_build/dot.pl
blob: 898d2cd0ffb26a9c96881bd5c7a3b843ffa454fc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/usr/bin/perl
# Samba4 Dependency Graph Generator
# (C) 2004-2005 Jelmer Vernooij <jelmer@samba.org>
# Published under the GNU GPL

use strict;
use lib 'build';
use smb_build::config_mk;

sub generate($)
{
	my $depend = shift;
	my $res = "digraph samba4 {\n";

	foreach my $part (values %{$depend}) {
		foreach my $elem (@{$part->{PUBLIC_DEPENDENCIES}},
				  @{$part->{PRIVATE_DEPENDENCIES}}) {
			$res .= "\t\"$part->{NAME}\" -> \"$elem\";\n";
		}
	}

	return $res . "}\n";
}

my $INPUT = {};
smb_build::config_mk::run_config_mk($INPUT, '.', '.', "main.mk");

print __FILE__.": creating samba4-deps.dot\n";
open DOTTY, ">samba4-deps.dot";
print DOTTY generate($INPUT);
close DOTTY;

1;