summaryrefslogtreecommitdiff
path: root/source4/build/smb_build/cflags.pm
blob: 6dfe4fe94e3c6b96cc5d2205fa179de1f5a08fa4 (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
# SMB Build System
#
#  Copyright (C) Jelmer Vernooij 2006
#  Released under the GNU GPL

package cflags;
use strict;

sub create_cflags($$)
{
	my ($CTX, $file) = @_;

	open(CFLAGS_TXT,">$file") || die ("Can't open `$file'\n");

	foreach my $key (values %{$CTX}) {
		next unless defined ($key->{OBJ_LIST});
		next unless defined ($key->{CFLAGS});
		next if ($key->{CFLAGS} eq "");

		foreach (@{$key->{OBJ_LIST}}) {
			my $ofile = $_;
			my $dfile = $_;
			$dfile =~ s/\.o$/.d/;
			$dfile =~ s/\.ho$/.d/;
			print CFLAGS_TXT "$ofile $dfile: CFLAGS+=$key->{CFLAGS}\n";
		}
	}
	close(CFLAGS_TXT);

	print __FILE__.": creating $file\n";
}
1;