a1943f581a14038f907a0db88da868d9d9b6c988
[samba.git] / source / build / smb_build / main.pm
1 ###########################################################
2 ### SMB Build System                                    ###
3 ### - the main program                                  ###
4 ###                                                     ###
5 ###  Copyright (C) Stefan (metze) Metzmacher 2004       ###
6 ###  Released under the GNU GPL                         ###
7 ###########################################################
8
9 use makefile;
10 use smb_build_h;
11 use input;
12 use config_mk;
13 use output;
14 use dot;
15 use strict;
16
17 sub smb_build_main($)
18 {
19         my $INPUT = shift;
20         my %SMB_BUILD_CTX = (
21                 INPUT => $INPUT
22         );
23
24         my @mkfiles = (
25                 "dsdb/config.mk",
26                 "gtk/config.mk",
27                 "smbd/config.mk",
28                 "smbd/process_model.mk",
29                 "libnet/config.mk",
30                 "auth/config.mk",
31                 "nsswitch/config.mk",
32                 "lib/basic.mk",
33                 "lib/socket/config.mk",
34                 "lib/ldb/config.mk",
35                 "lib/talloc/config.mk",
36                 "lib/tdb/config.mk",
37                 "lib/registry/config.mk",
38                 "lib/messaging/config.mk",
39                 "lib/events/config.mk",
40                 "lib/popt/config.mk",
41                 "lib/cmdline/config.mk",
42                 "lib/socket_wrapper/config.mk",
43                 "smb_server/config.mk",
44                 "rpc_server/config.mk",
45                 "ldap_server/config.mk",
46                 "winbind/config.mk",
47                 "nbt_server/config.mk",
48                 "cldap_server/config.mk",
49                 "auth/gensec/config.mk",
50                 "auth/kerberos/config.mk",
51                 "auth/ntlmssp/config.mk",
52                 "libcli/auth/config.mk",
53                 "libcli/ldap/config.mk",
54                 "libcli/config.mk",
55                 "utils/net/config.mk",
56                 "utils/config.mk",
57                 "ntvfs/posix/config.mk",
58                 "ntvfs/config.mk",
59                 "ntvfs/unixuid/config.mk",
60                 "torture/config.mk",
61                 "librpc/config.mk",
62                 "client/config.mk",
63                 "libcli/libsmb.mk",
64                 "libcli/config.mk",
65                 "libcli/security/config.mk",
66                 "lib/com/config.mk",
67                 "scripting/swig/config.mk",
68         );
69
70         $| = 1;
71
72         for my $mkfile (@mkfiles) {
73                 config_mk::import_file($SMB_BUILD_CTX{INPUT}, $mkfile);
74         }
75
76         %{$SMB_BUILD_CTX{DEPEND}} = input::check(\%SMB_BUILD_CTX);
77         
78         %{$SMB_BUILD_CTX{OUTPUT}} = output::create_output($SMB_BUILD_CTX{DEPEND});
79
80         makefile::create_makefile_in($SMB_BUILD_CTX{OUTPUT});
81
82         smb_build_h::create_smb_build_h($SMB_BUILD_CTX{OUTPUT});
83
84         open DOTTY, ">samba4-deps.dot";
85         print DOTTY dot::generate($SMB_BUILD_CTX{DEPEND});
86         close DOTTY;
87 }
88 1;