{
my ($makefile) = @_;
+ # Output `all-am'.
+
# Put this at the beginning for the sake of non-GNU makes. This
# is still wrong if these makes can run parallel jobs. But it is
# right enough.
if dirname ($one_name) eq $relative_dir;
}
- my $local_headers = '';
- $local_headers = '$(BUILT_SOURCES)'
- if &variable_defined ('BUILT_SOURCES');
- foreach my $one_name (@config_names)
- {
- if (dirname ($one_name) eq $relative_dir)
- {
- $local_headers .= ' ' if $local_headers;
- $local_headers .= basename ($one_name);
- }
- }
- if ($local_headers)
- {
- # We need to make sure config.h is built before we
- # recurse. We also want to make sure that built sources
- # are built before any ordinary `all' targets are run. We
- # can't do this by changing the order of dependencies to
- # the "all" because that breaks when using parallel makes.
- # Instead we handle things explicitly.
- $output_rules .= ("all-redirect: ${local_headers}"
- . "\n\t"
- . '$(MAKE) $(AM_MAKEFLAGS) '
- . (&variable_defined ('SUBDIRS')
- ? 'all-recursive' : 'all-am')
- . "\n\n");
- $all_target = 'all-redirect';
- &depend ('.PHONY', 'all-redirect');
- }
-
# Install `all' hooks.
if (&target_defined ("all-local"))
{
}
&pretty_print_rule ("all-am:", "\t\t", @all);
+ &depend ('.PHONY', 'all-am', 'all');
- # If we aren't using a redirect target then find the
- # appropriate actual redirect.
- if ($all_target eq '')
+
+ # Output `all'.
+
+ my @local_headers = ();
+ push @local_headers, '$(BUILT_SOURCES)'
+ if &variable_defined ('BUILT_SOURCES');
+ foreach my $one_name (@config_names)
{
- $all_target = (&variable_defined ('SUBDIRS')
- ? 'all-recursive' : 'all-am');
+ push @local_headers, basename ($one_name)
+ if dirname ($one_name) eq $relative_dir;
}
- $output_all = "all: $all_target\n";
- &depend ('.PHONY', 'all-am', 'all');
+ if (@local_headers)
+ {
+ # We need to make sure config.h is built before we recurse.
+ # We also want to make sure that built sources are built
+ # before any ordinary `all' targets are run. We can't do this
+ # by changing the order of dependencies to the "all" because
+ # that breaks when using parallel makes. Instead we handle
+ # things explicitly.
+ $output_all .= ("all: " . join (' ', @local_headers)
+ . "\n\t"
+ . '$(MAKE) $(AM_MAKEFLAGS) '
+ . (&variable_defined ('SUBDIRS')
+ ? 'all-recursive' : 'all-am')
+ . "\n\n");
+ }
+ else
+ {
+ $output_all .= "all: " . (&variable_defined ('SUBDIRS')
+ ? 'all-recursive' : 'all-am') . "\n\n";
+ }
}