Commit 9a2df7de authored by Alexandre Julliard's avatar Alexandre Julliard

make_progs: Update the directory list in configure.ac too.

parent 39f357f8
...@@ -22,8 +22,6 @@ ...@@ -22,8 +22,6 @@
use strict; use strict;
my $makefiles = `find . -name Makefile.in -print`;
my %directories = (); my %directories = ();
# Programs that we want to install in the bin directory too # Programs that we want to install in the bin directory too
...@@ -55,12 +53,30 @@ my %dont_install = ...@@ -55,12 +53,30 @@ my %dont_install =
"winetest" => 1, "winetest" => 1,
); );
sub update_file($)
{
my $file = shift;
if (!system "cmp $file $file.new >/dev/null")
{
unlink "$file.new";
print "$file is unchanged\n";
}
else
{
rename "$file.new", "$file";
print "$file updated\n";
}
}
# if we are inside the programs dir, go up one level
if (! -f "configure.ac" && -f "../configure.ac") { chdir(".."); }
my $makefiles = `find programs -name Makefile.in -print`;
foreach my $i (split(/\s/,$makefiles)) foreach my $i (split(/\s/,$makefiles))
{ {
my $module; my $module;
next if $i =~ /\/tests\/Makefile.in/;
open MAKE,$i; open MAKE,$i;
$module = undef; $module = undef;
...@@ -75,7 +91,7 @@ foreach my $i (split(/\s/,$makefiles)) ...@@ -75,7 +91,7 @@ foreach my $i (split(/\s/,$makefiles))
{ {
$module = $1; $module = $1;
next if ($module eq "none"); next if ($module eq "none");
($directories{$module} = $i) =~ s/^\.\/(.*)\/[^\/]+$/$1/; ($directories{$module} = $i) =~ s/^programs\/(.*)\/[^\/]+$/$1/;
die "invalid module $module in dir $directories{$module}\n" if "$directories{$module}.exe" ne $module; die "invalid module $module in dir $directories{$module}\n" if "$directories{$module}.exe" ne $module;
last; last;
} }
...@@ -93,7 +109,7 @@ foreach my $i (split(/\s/,$makefiles)) ...@@ -93,7 +109,7 @@ foreach my $i (split(/\s/,$makefiles))
close MAKE; close MAKE;
} }
open NEWMAKE,">Makefile.in.new" or die "cannot create Makefile.in.new"; open NEWMAKE,">programs/Makefile.in.new" or die "cannot create programs/Makefile.in.new";
################################################################ ################################################################
# makefile header # makefile header
...@@ -140,6 +156,8 @@ foreach my $dir (sort keys %alldirs) ...@@ -140,6 +156,8 @@ foreach my $dir (sort keys %alldirs)
print NEWMAKE <<EOF; print NEWMAKE <<EOF;
INSTALLDIRS = \$(DESTDIR)\$(bindir)
\@MAKE_RULES\@ \@MAKE_RULES\@
all: wineapploader winelauncher \$(SUBDIRS) all: wineapploader winelauncher \$(SUBDIRS)
...@@ -154,8 +172,7 @@ winelauncher: winelauncher.in ...@@ -154,8 +172,7 @@ winelauncher: winelauncher.in
.PHONY: install-apploader install-progs install-progs.so \$(INSTALLPROGS:%=%/__installprog__) .PHONY: install-apploader install-progs install-progs.so \$(INSTALLPROGS:%=%/__installprog__)
install-apploader: wineapploader dummy install-apploader: wineapploader \$(INSTALLDIRS) dummy
\$(MKINSTALLDIRS) \$(DESTDIR)\$(bindir)
\$(INSTALL_SCRIPT) wineapploader \$(DESTDIR)\$(bindir)/wineapploader \$(INSTALL_SCRIPT) wineapploader \$(DESTDIR)\$(bindir)/wineapploader
\$(INSTALLPROGS:%=%/__installprog__): install-apploader \$(INSTALLPROGS:%=%/__installprog__): install-apploader
...@@ -166,8 +183,7 @@ install-progs.so: \$(INSTALLPROGS:%=%/__installprog__) ...@@ -166,8 +183,7 @@ install-progs.so: \$(INSTALLPROGS:%=%/__installprog__)
install-progs: # nothing to do here install-progs: # nothing to do here
install:: winelauncher install-progs\$(DLLEXT) install:: winelauncher install-progs\$(DLLEXT) \$(INSTALLDIRS)
\$(MKINSTALLDIRS) \$(DESTDIR)\$(bindir)
\$(INSTALL_SCRIPT) winelauncher \$(DESTDIR)\$(bindir)/winelauncher \$(INSTALL_SCRIPT) winelauncher \$(DESTDIR)\$(bindir)/winelauncher
uninstall:: uninstall::
...@@ -185,13 +201,12 @@ check test:: \$(SUBDIRS:%=%/__test__) ...@@ -185,13 +201,12 @@ check test:: \$(SUBDIRS:%=%/__test__)
EOF EOF
close NEWMAKE; close NEWMAKE;
rename "Makefile.in.new", "Makefile.in"; update_file("programs/Makefile.in");
printf "Successfully updated Makefile.in\n";
################################################################ ################################################################
# .gitignore file # .gitignore file
open GITIGNORE, ">.gitignore.new" or die "cannot create .gitignore.new"; open GITIGNORE, ">programs/.gitignore.new" or die "cannot create programs/.gitignore.new";
print GITIGNORE "# Automatically generated by make_dlls; DO NOT EDIT!!\n"; print GITIGNORE "# Automatically generated by make_dlls; DO NOT EDIT!!\n";
my @ignores = my @ignores =
...@@ -209,5 +224,32 @@ foreach my $dir (sort keys %alldirs) ...@@ -209,5 +224,32 @@ foreach my $dir (sort keys %alldirs)
print GITIGNORE join("\n", sort @ignores) . "\n"; print GITIGNORE join("\n", sort @ignores) . "\n";
close GITIGNORE; close GITIGNORE;
rename ".gitignore.new", ".gitignore"; update_file("programs/.gitignore");
printf "Successfully updated .gitignore\n";
################################################################
# configure.ac file
open OLD_CONFIG, "configure.ac" or die "cannot open configure.ac";
open NEW_CONFIG, ">configure.ac.new" or die "cannot create configure.ac.new";
while (<OLD_CONFIG>)
{
print NEW_CONFIG $_;
last if /^programs\/Makefile/;
}
foreach my $dir (sort values %directories)
{
print NEW_CONFIG "programs/$dir/Makefile\n";
}
my $skip=1;
while (<OLD_CONFIG>)
{
$skip = 0 unless /^programs\//;
print NEW_CONFIG $_ unless $skip;
}
close OLD_CONFIG;
close NEW_CONFIG;
update_file("configure.ac");
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