makefiles: Automatically add missing source variables in make_makefiles.

This commit is contained in:
Alexandre Julliard 2011-01-01 17:46:56 +01:00
parent 5eee920441
commit 59ee6d83ab
3 changed files with 10 additions and 2 deletions

View File

@ -63,7 +63,7 @@ C_SRCS = \
type1afm.c \ type1afm.c \
type42.c type42.c
RC_SRCS= \ RC_SRCS = \
wps_Bg.rc \ wps_Bg.rc \
wps_Cs.rc \ wps_Cs.rc \
wps_Da.rc \ wps_Da.rc \

View File

@ -8,4 +8,6 @@ C_SRCS = \
RC_SRCS = iexplore.rc RC_SRCS = iexplore.rc
SVG_SRCS = iexplore.svg
@MAKE_PROG_RULES@ @MAKE_PROG_RULES@

View File

@ -241,6 +241,7 @@ sub replace_makefile_variable($$)
{ {
my ($file, $var) = @_; my ($file, $var) = @_;
my $make = $makefiles{$file}; my $make = $makefiles{$file};
my $replaced = 0;
return unless defined ${$make}{"=$var"}; return unless defined ${$make}{"=$var"};
@ -252,7 +253,7 @@ sub replace_makefile_variable($$)
open OLD_FILE, "$file.in" or die "cannot open $file.in"; open OLD_FILE, "$file.in" or die "cannot open $file.in";
while (<OLD_FILE>) while (<OLD_FILE>)
{ {
if (/^\s*($var\s+)=/) if (/^\s*($var\s*)=/)
{ {
# try to preserve formatting # try to preserve formatting
my $prefix = $1; my $prefix = $1;
@ -270,8 +271,13 @@ sub replace_makefile_variable($$)
{ {
print NEW_FILE "$prefix= @values\n"; print NEW_FILE "$prefix= @values\n";
} }
$replaced = 1;
next; next;
} }
if (/^\@MAKE/ && !$replaced)
{
print NEW_FILE "$var = \\\n\t" . join(" \\\n\t", sort @values) . "\n";
}
print NEW_FILE $_; print NEW_FILE $_;
} }
close OLD_FILE; close OLD_FILE;