Commit 440771ed authored by Alexandre Julliard's avatar Alexandre Julliard

makefiles: Remove support for obsolete source variables.

parent aea0d88a
...@@ -2,4 +2,5 @@ MODULE = apisetschema.dll ...@@ -2,4 +2,5 @@ MODULE = apisetschema.dll
EXTRADLLFLAGS = -Wb,--data-only EXTRADLLFLAGS = -Wb,--data-only
SOURCES = apisetschema.spec SOURCES = \
apisetschema.spec
...@@ -2,4 +2,5 @@ MODULE = icmp.dll ...@@ -2,4 +2,5 @@ MODULE = icmp.dll
EXTRADLLFLAGS = -Wb,--data-only EXTRADLLFLAGS = -Wb,--data-only
SOURCES = icmp.spec SOURCES = \
icmp.spec
...@@ -2,4 +2,5 @@ MODULE = mferror.dll ...@@ -2,4 +2,5 @@ MODULE = mferror.dll
EXTRADLLFLAGS = -Wb,--data-only EXTRADLLFLAGS = -Wb,--data-only
SOURCES = mferror.mc SOURCES = \
mferror.mc
...@@ -3,4 +3,5 @@ IMPORTLIB = normaliz ...@@ -3,4 +3,5 @@ IMPORTLIB = normaliz
EXTRADLLFLAGS = -Wb,--data-only EXTRADLLFLAGS = -Wb,--data-only
SOURCES = normaliz.spec SOURCES = \
normaliz.spec
...@@ -43,4 +43,5 @@ SOURCES = \ ...@@ -43,4 +43,5 @@ SOURCES = \
stg_stream.c \ stg_stream.c \
storage32.c \ storage32.c \
usrmarshal.c usrmarshal.c
dlldata_EXTRADEFS = -DENTRY_PREFIX=OLE32_ -DPROXY_CLSID=CLSID_PSFactoryBuffer -DWINE_REGISTER_DLL dlldata_EXTRADEFS = -DENTRY_PREFIX=OLE32_ -DPROXY_CLSID=CLSID_PSFactoryBuffer -DWINE_REGISTER_DLL
...@@ -3,4 +3,5 @@ IMPORTS = secur32 ...@@ -3,4 +3,5 @@ IMPORTS = secur32
EXTRADLLFLAGS = -Wb,--data-only EXTRADLLFLAGS = -Wb,--data-only
SOURCES = security.spec SOURCES = \
security.spec
...@@ -3,4 +3,5 @@ IMPORTLIB = sfc ...@@ -3,4 +3,5 @@ IMPORTLIB = sfc
EXTRADLLFLAGS = -Wb,--data-only -Wb,--prefer-native EXTRADLLFLAGS = -Wb,--data-only -Wb,--prefer-native
SOURCES = sfc.spec SOURCES = \
sfc.spec
...@@ -3,4 +3,5 @@ IMPORTLIB = usp10 ...@@ -3,4 +3,5 @@ IMPORTLIB = usp10
EXTRADLLFLAGS = -Wb,--data-only EXTRADLLFLAGS = -Wb,--data-only
SOURCES = usp10.spec SOURCES = \
usp10.spec
...@@ -12,4 +12,5 @@ SOURCES = \ ...@@ -12,4 +12,5 @@ SOURCES = \
opengl.c \ opengl.c \
window.c \ window.c \
wine.svg wine.svg
EXTRA_TARGETS = wine-debug.apk EXTRA_TARGETS = wine-debug.apk
...@@ -4,4 +4,5 @@ IMPORTS = advapi32 ...@@ -4,4 +4,5 @@ IMPORTS = advapi32
EXTRADLLFLAGS = -Wb,--data-only EXTRADLLFLAGS = -Wb,--data-only
SOURCES = wmi.spec SOURCES = \
wmi.spec
...@@ -19,4 +19,5 @@ SOURCES = \ ...@@ -19,4 +19,5 @@ SOURCES = \
src/FAudio_internal.c \ src/FAudio_internal.c \
src/FAudio_internal_simd.c \ src/FAudio_internal_simd.c \
src/FAudio_operationset.c \ src/FAudio_operationset.c \
src/FAudio_platform_win32.c src/FAudio_platform_win32.c \
src/matrix_defaults.inl
...@@ -44,24 +44,6 @@ my %ignored_source_files = ( ...@@ -44,24 +44,6 @@ my %ignored_source_files = (
"tools/makedep.c" => 1, "tools/makedep.c" => 1,
); );
my @source_vars = (
"BISON_SRCS",
"C_SRCS",
"FONT_SRCS",
"HEADER_SRCS",
"IDL_SRCS",
"IN_SRCS",
"LEX_SRCS",
"MANPAGES",
"MC_SRCS",
"OBJC_SRCS",
"PO_SRCS",
"RC_SRCS",
"SOURCES",
"SVG_SRCS",
"XTEMPLATE_SRCS"
);
my (@makefiles, %makefiles); my (@makefiles, %makefiles);
my @nls_files; my @nls_files;
...@@ -126,34 +108,19 @@ sub replace_makefile_variables($) ...@@ -126,34 +108,19 @@ sub replace_makefile_variables($)
{ {
my $file = shift; my $file = shift;
my $make = $makefiles{$file}; my $make = $makefiles{$file};
my $source_vars_regexp = join "|", @source_vars;
my %replaced;
my %files;
my $old; my $old;
my $new; my $new;
my $replaced = 0;
my $value = "";
$value = "\\\n\t" . join(" \\\n\t", sort @{${$make}{"=SOURCES"}}) if defined ${$make}{"=SOURCES"};
open OLD_FILE, $file or die "cannot open $file"; open OLD_FILE, $file or die "cannot open $file";
while (<OLD_FILE>) while (<OLD_FILE>)
{ {
$old .= $_; $old .= $_;
if (/^\s*($source_vars_regexp)(\s*)=/) if (/^\s*SOURCES\s*=/)
{
# try to preserve formatting
my $var = $1;
my $spaces = $2;
my $replaced = 0;
my @values;
if (defined ${$make}{"=$var"})
{ {
@values = @{${$make}{"=$var"}};
${$make}{$var} = \@values;
}
else
{
undef ${$make}{$var};
}
my $multiline = /\\$/ || (@values > 1);
my $old_str = $_; my $old_str = $_;
while (/\\$/) while (/\\$/)
{ {
...@@ -162,43 +129,15 @@ sub replace_makefile_variables($) ...@@ -162,43 +129,15 @@ sub replace_makefile_variables($)
$old .= $_; $old .= $_;
$old_str .= $_; $old_str .= $_;
} }
my $new_str = ""; $new .= "SOURCES = $value\n" if $value;
if (!@values) $replaced = 1;
{
# nothing
}
elsif ($multiline)
{
$new_str = "$var = \\\n\t" . join(" \\\n\t", sort @values) . "\n";
$new .= $new_str;
}
else
{
$new_str = "$var$spaces= @values\n";
$new .= $new_str;
}
$replaced{$var} = 1;
foreach my $val (@values)
{
die "$file: duplicate file $val" if defined $files{$val};
$files{$val} = 1;
}
next; next;
} }
$new .= $_; $new .= $_;
} }
# if we are using SOURCES, ignore the other variables unless ($replaced)
unless ($replaced{"SOURCES"})
{
foreach my $var (@source_vars)
{ {
next if defined $replaced{$var}; $new .= "\nSOURCES = $value\n" if $value;
next if $var eq "SOURCES";
next unless defined ${$make}{"=$var"};
my @values = @{${$make}{"=$var"}};
next unless @values;
$new .= "\n$var = \\\n\t" . join(" \\\n\t", sort @values) . "\n";
}
} }
close OLD_FILE; close OLD_FILE;
update_file($file, $new) if $old ne $new; update_file($file, $new) if $old ne $new;
...@@ -231,8 +170,7 @@ sub parse_makefile($) ...@@ -231,8 +170,7 @@ sub parse_makefile($)
$make{$var} = $2; $make{$var} = $2;
next; next;
} }
my $source_vars_regexp = join "|", @source_vars; if (/^\s*(SOURCES|PROGRAMS|EXTRA_TARGETS|EXTRA_OBJS|INSTALL_LIB|INSTALL_DEV)\s*=\s*(.*)/)
if (/^\s*($source_vars_regexp|PROGRAMS|EXTRA_TARGETS|EXTRA_OBJS|INSTALL_LIB|INSTALL_DEV)\s*=\s*(.*)/)
{ {
my $var = $1; my $var = $1;
my @list = split(/\s+/, $2); my @list = split(/\s+/, $2);
...@@ -303,19 +241,19 @@ sub get_parent_makefile($) ...@@ -303,19 +241,19 @@ sub get_parent_makefile($)
} }
# preserve shared source files that are listed in the existing makefile # preserve shared source files that are listed in the existing makefile
sub preserve_shared_source_files($$$) sub preserve_shared_source_files($$)
{ {
my ($make, $parent, $var) = @_; my ($make, $parent) = @_;
my %srcs; my %srcs;
return unless defined ${$parent}{"=$var"}; return unless defined ${$parent}{"=SOURCES"};
foreach my $file (@{${$parent}{"=$var"}}) { $srcs{$file} = 1; } foreach my $file (@{${$parent}{"=SOURCES"}}) { $srcs{$file} = 1; }
foreach my $file (@{${$make}{"=$var"}}) { $srcs{$file} = 0; } foreach my $file (@{${$make}{"=SOURCES"}}) { $srcs{$file} = 0; }
foreach my $file (@{${$make}{$var}}) foreach my $file (@{${$make}{SOURCES}})
{ {
next unless defined $srcs{$file} && $srcs{$file} == 1; next unless defined $srcs{$file} && $srcs{$file} == 1;
push @{${$make}{"=$var"}}, $file; push @{${$make}{"=SOURCES"}}, $file;
} }
} }
...@@ -338,20 +276,13 @@ sub assign_sources_to_makefiles(@) ...@@ -338,20 +276,13 @@ sub assign_sources_to_makefiles(@)
my $make = $makefiles{"$dir/Makefile.in"}; my $make = $makefiles{"$dir/Makefile.in"};
my $name = substr( $file, length($dir) + 1 ); my $name = substr( $file, length($dir) + 1 );
if ($name =~ /\.(c|in|l|m|mc|po|rc|sfd|svg|y)$/) if ($name =~ /\.h$/)
{
push @{${$make}{"=SOURCES"}}, $name;
next;
}
elsif ($name =~ /\.h$/ || $name =~ /\.rh$/ || $name =~ /\.inl$/ || $name =~ /\.x$/)
{ {
next if $dir ne "include"; next if $dir ne "include";
} }
elsif ($name =~ /\.idl$/) elsif ($name =~ /\.idl$/)
{ {
die "no makedep flags specified in $file" unless $dir eq "include" || get_makedep_flags($file); die "no makedep flags specified in $file" unless $dir eq "include" || get_makedep_flags($file);
push @{${$make}{"=SOURCES"}}, $name;
next;
} }
elsif ($name =~ /\.spec$/) elsif ($name =~ /\.spec$/)
{ {
...@@ -364,14 +295,13 @@ sub assign_sources_to_makefiles(@) ...@@ -364,14 +295,13 @@ sub assign_sources_to_makefiles(@)
{ {
push @nls_files, $name if $dir eq "nls"; push @nls_files, $name if $dir eq "nls";
} }
elsif ($name =~ /\.xml$/ && $dir eq "dlls/winewayland.drv") elsif ($name =~ /\.xml$/)
{ {
push @{${$make}{"=SOURCES"}}, $name; next unless $dir eq "dlls/winewayland.drv";
next;
} }
elsif ($dir ne "loader") # loader dir contains misc files elsif ($name !~ /\.(c|in|inl|l|m|mc|po|rc|rh|sfd|svg|x|y)$/)
{ {
next; next unless $dir eq "loader"; # loader dir contains misc files
} }
push @{${$make}{"=SOURCES"}}, $name; push @{${$make}{"=SOURCES"}}, $name;
} }
...@@ -382,7 +312,7 @@ sub assign_sources_to_makefiles(@) ...@@ -382,7 +312,7 @@ sub assign_sources_to_makefiles(@)
my $make = $makefiles{$file}; my $make = $makefiles{$file};
my $parent = get_parent_makefile( $file ); my $parent = get_parent_makefile( $file );
next unless $parent; next unless $parent;
preserve_shared_source_files( $makefiles{$file}, $makefiles{$parent}, "SOURCES" ); preserve_shared_source_files( $makefiles{$file}, $makefiles{$parent} );
} }
} }
......
...@@ -4195,26 +4195,6 @@ static void output_dependencies( struct makefile *make ) ...@@ -4195,26 +4195,6 @@ static void output_dependencies( struct makefile *make )
*/ */
static void load_sources( struct makefile *make ) static void load_sources( struct makefile *make )
{ {
static const char *source_vars[] =
{
"SOURCES",
"C_SRCS",
"OBJC_SRCS",
"RC_SRCS",
"MC_SRCS",
"IDL_SRCS",
"BISON_SRCS",
"LEX_SRCS",
"HEADER_SRCS",
"XTEMPLATE_SRCS",
"SVG_SRCS",
"FONT_SRCS",
"IN_SRCS",
"PO_SRCS",
"MANPAGES",
NULL
};
const char **var;
unsigned int i, arch; unsigned int i, arch;
struct strarray value; struct strarray value;
struct incl_file *file; struct incl_file *file;
...@@ -4302,11 +4282,8 @@ static void load_sources( struct makefile *make ) ...@@ -4302,11 +4282,8 @@ static void load_sources( struct makefile *make )
list_init( &make->sources ); list_init( &make->sources );
list_init( &make->includes ); list_init( &make->includes );
for (var = source_vars; *var; var++) value = get_expanded_make_var_array( make, "SOURCES" );
{
value = get_expanded_make_var_array( make, *var );
for (i = 0; i < value.count; i++) add_src_file( make, value.str[i] ); for (i = 0; i < value.count; i++) add_src_file( make, value.str[i] );
}
add_generated_sources( make ); add_generated_sources( make );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment