[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
18-depend.patch
From: |
Akim Demaille |
Subject: |
18-depend.patch |
Date: |
Wed, 31 Jan 2001 22:36:01 +0100 |
This patch gets rid of @phony, using only %dependencies. &depend
makes it somewhat more digest. It also fixes the problem Tom spotted,
where my version of @phony was improperly initialized globally.
There are other targets that can take advantage of this: clean etc.,
in fact, those which are initialized where @phony was.
And of course, a significant part of the remaining work consists in
spreading the adhoc code into the corresponding */am files.
Akim
PS/ This patch includes the diff of Automake's Makefile.ins, i.e.,
there are no diffs at all.
Index: ChangeLog
from Akim Demaille <address@hidden>
* automake.in (%dependencies): Don't be initialize globally for
all the files, but in...
(&initialize_per_input): here.
(&depend): New.
(@phony): Replace all occurrences with the corresponding &depend
invocation.
Index: automake.in
--- automake.in Wed, 31 Jan 2001 02:47:38 +0100 akim (am/f/39_automake.i 1.23
755)
+++ automake.in Wed, 31 Jan 2001 20:39:11 +0100 akim (am/f/39_automake.i 1.23
755)
@@ -324,16 +324,6 @@
# discovered while scanning configure.ac. We might distribute these
# in the top-level Makefile.in.
%configure_dist_common = ();
-
-# Holds the dependencies of target which dependencies are factored.
-# Typically, `.PHONY' will appear in plenty of *.am files, but must
-# be output once. Arguably all pure dependencies could be subject
-# to this factorization, but it is not unpleasant to have paragraphs
-# in Makefile: keeping related stuff altogether.
-%dependencies =
-(
- ".PHONY" => []
-);
# Initialize global constants and our list of languages that are
@@ -2522,12 +2512,12 @@ sub handle_man_pages
$output_rules .= ("install-man: \$(MANS)\n"
. "address@hidden(NORMAL_INSTALL)\n");
&pretty_print_rule ("\t\$(MAKE) \$(AM_MAKEFLAGS)", "\t ", @namelist);
- push (@phony, 'install-man');
+ &depend ('.PHONY', 'install-man');
$output_rules .= "uninstall-man:address@hidden(NORMAL_UNINSTALL)\n";
grep ($_ = 'un' . $_, @namelist);
&pretty_print_rule ("\t\$(MAKE) \$(AM_MAKEFLAGS)", "\t ", @namelist);
- push (@phony, 'uninstall-man');
+ &depend ('.PHONY', 'uninstall-man');
$output_vars .= &file_contents ('mans-vars');
@@ -2561,7 +2551,7 @@ sub handle_tags
. " && \$(MAKE) \$(AM_MAKEFLAGS) tags); \\\n"
. "\tdone\n");
push (@tag_deps, 'tags-recursive');
- push (@phony, 'tags-recursive');
+ &depend ('.PHONY', 'tags-recursive');
}
if (&saw_sources_p (1)
@@ -2792,7 +2782,7 @@ sub handle_dist_worker
. " distdir=\"\$(distdir)\" $targ\n");
}
- push (@phony, 'distdir');
+ &depend ('.PHONY', 'distdir');
}
# Handle 'dist' target.
@@ -3709,13 +3699,13 @@ sub handle_installdirs
# rule will work correctly.
$output_rules .= ("installdirs: installdirs-recursive\n"
. "installdirs-am:\n");
- push (@phony, 'installdirs-am');
+ &depend ('.PHONY', 'installdirs-am');
}
else
{
$output_rules .= "installdirs:\n";
}
- push (@phony, 'installdirs');
+ &depend ('.PHONY', 'installdirs');
if (@installdirs)
{
&pretty_print_rule ("\t" . '$(mkinstalldirs) ', "\t\t",
@@ -3814,7 +3804,7 @@ sub handle_merge_targets
. " all-recursive"
. "\n\n");
$all_target = 'all-recursive-am';
- push (@phony, 'all-recursive-am');
+ &depend ('.PHONY', 'all-recursive-am');
}
}
@@ -3840,7 +3830,7 @@ sub handle_merge_targets
$output_rules .= ("install-strip:\n\t"
. '$(MAKE) $(AM_MAKEFLAGS) INSTALL_STRIP_FLAG=-s install'
. "\n");
- push (@phony, 'install-strip');
+ &depend ('.PHONY', 'install-strip');
}
# Helper for handle_merge_targets. Note that handle_merge_targets
@@ -3853,7 +3843,7 @@ sub do_one_merge_target
{
# User defined local form of target. So include it.
push (@values, $name . '-local');
- push (@phony, $name . '-local');
+ &depend ('.PHONY', $name . '-local');
}
&pretty_print_rule ($name . "-am:", "\t\t", @values);
@@ -3884,11 +3874,11 @@ sub do_one_merge_target
{
$tname = 'all-redirect';
$lname = $all_target if $recursive_install;
- push (@phony, 'all-redirect');
+ &depend ('.PHONY', 'all-redirect');
$output_all = "all: all-redirect\n";
}
&pretty_print_rule ($tname . ":", "\t\t", $lname);
- push (@phony, $name . '-am', $name);
+ &depend ('.PHONY', $name . '-am', $name);
}
# Handle check merge target specially.
@@ -3898,7 +3888,7 @@ sub do_check_merge_target
{
# User defined local form of target. So include it.
push (@check_tests, 'check-local');
- push (@phony, 'check-local');
+ &depend ('.PHONY', 'check-local');
}
# In --cygnus mode, check doesn't depend on all.
@@ -3921,7 +3911,7 @@ sub do_check_merge_target
@check_tests)
if @check_tests;
- push (@phony, 'check', 'check-am');
+ &depend ('.PHONY', 'check', 'check-am');
$output_rules .= ("check: "
. ($recursive_install ? 'check-recursive' : 'check-am')
. "\n");
@@ -3977,7 +3967,7 @@ sub handle_clean
&do_one_clean_target ('clean', 'dist', '', @clean);
&do_one_clean_target ('clean', 'maintainer-', 'dist', @clean);
- push (@phony, 'clean', 'mostlyclean', 'distclean', 'maintainer-clean');
+ &depend ('.PHONY', 'clean', 'mostlyclean', 'distclean',
'maintainer-clean');
}
# Helper for handle_clean.
@@ -4036,13 +4026,25 @@ sub do_one_clean_target
$output_rules .= "\n";
}
+
+# &depend ($CATEGORY, @DEPENDENDEES)
+# ----------------------------------
+sub depend
+{
+ my ($category, @dependendees) = @_;
+ {
+ push (@{${dependencies{$category}}}, @dependendees);
+ }
+}
+
+
+
+# &handle_factored_dependencies ()
+# --------------------------------
# Handle .PHONY target.
sub handle_factored_dependencies
{
- # FIXME: @PHONY must die!
- push (@{${dependencies{".PHONY"}}}, @phony);
-
- my ($category);
+ my $category;
foreach $category (sort keys %dependencies)
{
&pretty_print_rule ("$category:", "",
@@ -4052,8 +4054,8 @@ sub handle_factored_dependencies
}
-# handle_tests_dejagnu()
-# ----------------------
+# &handle_tests_dejagnu ()
+# ------------------------
sub handle_tests_dejagnu
{
push (@check_tests, 'check-DEJAGNU');
@@ -6890,7 +6892,15 @@ sub initialize_per_input
@installcheck = ();
@clean = ();
- @phony = ();
+ # Holds the dependencies of target which dependencies are factored.
+ # Typically, `.PHONY' will appear in plenty of *.am files, but must
+ # be output once. Arguably all pure dependencies could be subject
+ # to this factorization, but it is not unpleasant to have paragraphs
+ # in Makefile: keeping related stuff altogether.
+ %dependencies =
+ (
+ '.PHONY' => []
+ );
# A list of files deleted by `maintainer-clean'.
@maintainer_clean_files = ();
@@ -7083,8 +7093,7 @@ sub file_contents
{
if (defined $dependencies{$_})
{
- print STDERR "Pushing $dependees into $_\n";
- push (@{$dependencies{$_}}, split (/\s/, $dependees));
+ &depend ($_, split (/\s/, $dependees));
}
else
{
@@ -7462,17 +7471,17 @@ sub am_install_var
. $subdir_xform);
push (@uninstall, 'uninstall-' . $X . $primary);
- push (@phony, 'uninstall-' . $X . $primary);
+ &depend ('.PHONY', 'uninstall-' . $X . $primary);
push (@installdirs, '$(DESTDIR)$(' . $X . 'dir)');
if (defined $exec_dir_p{$X} ? $exec_dir_p{$X} : ($X =~ /exec/))
{
push (@install_exec, 'install-' . $X . $primary);
- push (@phony, 'install-' . $X . $primary);
+ &depend ('.PHONY', 'install-' . $X . $primary);
}
else
{
push (@install_data, 'install-' . $X . $primary);
- push (@phony, 'install-' . $X . $primary);
+ &depend ('.PHONY', 'install-' . $X . $primary);
}
}
}
@@ -7797,7 +7806,7 @@ sub push_phony_cleaners
local ($target);
foreach $target ('mostly', 'dist', '', 'maintainer-')
{
- push (@phony, $target . 'clean-' . $base);
+ &depend ('.PHONY', $target . 'clean-' . $base);
}
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- 18-depend.patch,
Akim Demaille <=