Commit a360e934 authored by Alexandre Julliard's avatar Alexandre Julliard

configure: Generate the makefiles list in configure instead of make_makefiles.

parent b990e60a
...@@ -153,6 +153,32 @@ dnl ...@@ -153,6 +153,32 @@ dnl
AC_DEFUN([WINE_CONFIG_EXTRA_DIR], AC_DEFUN([WINE_CONFIG_EXTRA_DIR],
[AC_CONFIG_COMMANDS([$1],[test -d "$1" || (AC_MSG_NOTICE([creating $1]) && mkdir "$1")])]) [AC_CONFIG_COMMANDS([$1],[test -d "$1" || (AC_MSG_NOTICE([creating $1]) && mkdir "$1")])])
dnl **** Create a make rules file from config.status ****
dnl
dnl Usage: WINE_CONFIG_MAKERULES(file,var,deps)
dnl
AC_DEFUN([WINE_CONFIG_MAKERULES],
[ALL_MAKERULES="$ALL_MAKERULES \\
$1"
ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS
$1: m4_ifval([$3],[$1.in $3],[$1.in])"
$2=$1
AC_SUBST_FILE([$2])dnl
AC_CONFIG_FILES([$1])])
dnl **** Create a makefile from config.status ****
dnl
dnl Usage: WINE_CONFIG_MAKEFILE(file,deps)
dnl
AC_DEFUN([WINE_CONFIG_MAKEFILE],
[m4_pushdef([ac_dir],m4_bpatsubst([$1],[/?Makefile$],[]))dnl
m4_ifval(ac_dir,[ALL_MAKEFILES="$ALL_MAKEFILES \\
$1"])
ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS
[$1: ]m4_ifval([$2],[$1.in $2],[$1.in])"
AC_CONFIG_FILES([$1])dnl
m4_popdef([ac_dir])])
dnl **** Add a message to the list displayed at the end **** dnl **** Add a message to the list displayed at the end ****
dnl dnl
dnl Usage: WINE_NOTICE(notice) dnl Usage: WINE_NOTICE(notice)
......
...@@ -227,14 +227,6 @@ sub parse_makefile($) ...@@ -227,14 +227,6 @@ sub parse_makefile($)
################################################################ ################################################################
# update the makefile list in configure.ac
sub update_makerules(@)
{
}
################################################################
# update the tests list in programs/winetest/Makefile.in and programs/winetest/winetest.rc # update the tests list in programs/winetest/Makefile.in and programs/winetest/winetest.rc
sub update_winetest(@) sub update_winetest(@)
...@@ -267,56 +259,30 @@ sub update_winetest(@) ...@@ -267,56 +259,30 @@ sub update_winetest(@)
################################################################ ################################################################
# update the makefile list in configure.ac and Makefile.in # update the makefile list in configure.ac
sub update_makefiles(@) sub update_makefiles(@)
{ {
my (@targets, @depends, @lines); my (@lines);
foreach my $var (sort { $makerules{$a} cmp $makerules{$b}; } keys %makerules) foreach my $var (sort { $makerules{$a} cmp $makerules{$b}; } keys %makerules)
{ {
push @lines, "$var=$makerules{$var}\n"; my $file = $makerules{$var};
push @lines, "AC_SUBST_FILE($var)\n\n";
}
foreach my $var ((sort values %makerules), (sort @_))
{
push @lines, "AC_CONFIG_FILES([$var])\n";
}
push @lines, "\nAC_OUTPUT\n";
replace_in_file( "configure.ac", '^MAKE_RULES', '^AC_OUTPUT$', @lines);
foreach my $file (sort values %makerules)
{
push @targets, $file;
my %make = %{$makefiles{$file}}; my %make = %{$makefiles{$file}};
if (!defined($make{"=rules"})) { push @depends, "$file: $file.in"; } my $rules = $make{"=rules"} ? ",[$make{\"=rules\"}]" : "";
else { push @depends, "$file: $file.in Make.rules"; } push @lines, "WINE_CONFIG_MAKERULES([$file],[$var]$rules)\n";
} }
push @lines, "\n";
foreach my $file (sort @_) foreach my $file (sort @_)
{ {
push @targets, $file unless $file eq "Makefile"; my %make = %{$makefiles{$file}};
my %makefile = %{$makefiles{$file}}; my $rules = $make{"=rules"};
my $dep = $makefile{"=rules"}; push @lines, "WINE_CONFIG_MAKEFILE([$file],[$rules])\n";
push @depends, "$file: $file.in $dep";
} }
push @lines, "\nAC_OUTPUT\n";
@lines = (); replace_in_file( "configure.ac", '^WINE_CONFIG_MAKERULES', '^AC_OUTPUT$', @lines);
push @lines, "ALL_MAKEFILES = \\\n\t";
push @lines, join (" \\\n\t", @targets ), "\n\n";
push @lines, "Makefile \$(ALL_MAKEFILES): config.status\n";
push @lines, "\t\@./config.status \$\@\n";
push @lines, ".INIT: Makefile\n";
push @lines, ".BEGIN: Makefile\n\n";
push @lines, "\$(RECURSE_TARGETS) \$(MAKEDEP): \$(ALL_MAKEFILES)\n\n";
push @lines, "distclean::\n";
push @lines, "\t\$(RM) Makefile \$(ALL_MAKEFILES)\n\n";
push @lines, join ("\n", @depends ), "\n";
replace_in_file( "Makefile.in", '^ALL_MAKEFILES\s*=', undef, @lines );
} }
......
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