summaryrefslogtreecommitdiff
path: root/source4/build/smb_build/main.pm
blob: 950d02a2f67b9d2f4220852a49fe1c03880c0ee7 (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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
###########################################################
### SMB Build System					###
### - the main program					###
###							###
###  Copyright (C) Stefan (metze) Metzmacher 2004	###
###  Released under the GNU GPL				###
###########################################################

use smb_build::makefile;
use smb_build::smb_build_h;
use smb_build::input;
use smb_build::config_mk;
use smb_build::output;
use smb_build::dot;
use strict;

my $config_list = "config.list";

sub smb_build_main($$)
{
	my ($INPUT, $settings) = @_;

	open(IN, $config_list) or die("Can't open $config_list: $!");
	my @mkfiles = grep{!/^#/} <IN>;
	close(IN);

	$| = 1;

	foreach (@mkfiles) {
		s/\n//g;
		config_mk::import_file($INPUT, $_);
	}

	my $DEPEND = input::check($INPUT);
	
	my $OUTPUT = output::create_output($DEPEND);

	makefile::create_makefile_in($OUTPUT, $settings, "Makefile.in");

	smb_build_h::create_smb_build_h($OUTPUT, "include/smb_build.h");

	open DOTTY, ">samba4-deps.dot";
	print DOTTY dot::generate($DEPEND);
	close DOTTY;
}

1;