From d0171d66193659cad5871e90867bd460e12b7f34 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Sat, 18 Mar 2006 22:02:31 +0000 Subject: [PATCH] r14549: Use make-compatible syntax in extra_cflags.txt so we can avoid cflags.pl when using GNU make --- source/build/smb_build/cflags.pm | 5 ++++- source/script/cflags.pl | 6 ++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/source/build/smb_build/cflags.pm b/source/build/smb_build/cflags.pm index 2cf64538415..b5525173a07 100755 --- a/source/build/smb_build/cflags.pm +++ b/source/build/smb_build/cflags.pm @@ -18,7 +18,10 @@ sub create_cflags($$) next if ($key->{EXTRA_CFLAGS} eq ""); foreach (@{$key->{OBJ_LIST}}) { - print CFLAGS_TXT "$_: $key->{EXTRA_CFLAGS}\n"; + my $ofile = $_; + my $dfile = $_; + $dfile =~ s/\.o$/.d/; + print CFLAGS_TXT "$ofile $dfile: CFLAGS+=$key->{EXTRA_CFLAGS}\n"; } } close(CFLAGS_TXT); diff --git a/source/script/cflags.pl b/source/script/cflags.pl index 476960db5db..c848b56e7d0 100755 --- a/source/script/cflags.pl +++ b/source/script/cflags.pl @@ -13,8 +13,10 @@ sub check_flags($) my ($name)=@_; open (IN, "extra_cflags.txt"); while ( =~ /^([^:]+): (.*)$/) { - next unless ($1 eq $target); - print "$2 "; + next unless (grep(/^$target$/, (split / /, $1))); + $_ = $2; + s/^CFLAGS\+=//; + print "$_ "; } close(IN); print "\n"; -- 2.11.4.GIT