+2001-02-12 Tom Tromey <tromey@redhat.com>
+
+ Fix for subdirbuiltsources.test:
+ * automake.in (initialize_per_input): [all_target] Initialize to
+ empty string.
+ (handle_merge_targets): Use all-redirect target to handle built
+ sources.
+ (do_one_merge_target): Don't generate all-redirect rule.
+
+2001-02-11 Peter Muir <iyhi@yahoo.com>
+
+ * tests/subdirbuiltsources.test: New file.
+ * tests/Makefile.am (TESTS): Added new file.
+
2001-02-10 Tom Tromey <tromey@redhat.com>
* tests/condlib.test: New file.
}
if ($local_headers)
{
- # This is kind of a hack, but I couldn't see a better way
- # to handle it. In this particular case, we need to make
- # sure config.h is built before we recurse. 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-recursive-am: ${local_headers}"
- . "\n\t"
- . '$(MAKE) $(AM_MAKEFLAGS)'
- . " all-recursive"
- . "\n\n");
- $all_target = 'all-recursive-am';
- &depend ('.PHONY', 'all-recursive-am');
+ # 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) '
+ . ($recursive_install
+ ? 'all-recursive' : 'all-am')
+ . "\n\n");
+ $all_target = 'all-redirect';
+ &depend ('.PHONY', 'all-redirect');
}
}
. "\n");
}
- local ($lname) = $name . ($recursive_install ? '-recursive' : '-am');
- local ($tname) = $name;
# To understand this special case, see handle_merge_targets.
if ($name eq 'all')
{
- $tname = 'all-redirect';
- $lname = $all_target if $recursive_install;
- &depend ('.PHONY', 'all-redirect');
- $output_all = "all: all-redirect\n";
+ # If we aren't using a redirect target then find the
+ # appropriate actual redirect.
+ if ($all_target eq '')
+ {
+ $all_target = $recursive_install ? 'all-recursive' : 'all-am';
+ }
+
+ $output_all = "all: $all_target\n";
+ }
+ else
+ {
+ local ($lname) = $name . ($recursive_install ? '-recursive' : '-am');
+ &pretty_print_rule ($name . ":", "\t\t", $lname);
+ &depend ('.PHONY', $name . '-am', $name);
}
- &pretty_print_rule ($tname . ":", "\t\t", $lname);
- &depend ('.PHONY', $name . '-am', $name);
}
# Handle check merge target specially.
# position of a suffix rule.
$source_suffix_pattern = '';
- # This is the name of the recursive `all' target to use.
- $all_target = 'all-recursive';
+ # This is the name of the redirect `all' target to use.
+ $all_target = '';
# This keeps track of which extensions we've seen (that we care
# about).
--- /dev/null
+#! /bin/sh
+
+set -e
+# Make sure when using SUBDIR that all BUILT_SOURCES are built.
+# A bug occurred where subdirs do not have all-recursive or
+# all-recursive-am which depended on BUILT_SOURCES.
+
+. $srcdir/defs || exit 1
+
+mkdir lib
+
+cat > configure.in << 'END'
+AC_INIT
+AM_INIT_AUTOMAKE(nonesuch, nonesuch)
+AC_ARG_PROGRAM
+AC_PROG_MAKE_SET
+AC_PROG_INSTALL
+AC_PROG_RANLIB
+AC_PROG_CC
+AC_OUTPUT(Makefile lib/Makefile)
+END
+
+# Files required because we are using `--gnu'.
+: > INSTALL
+: > NEWS
+: > README
+: > COPYING
+: > AUTHORS
+: > ChangeLog
+
+cat > Makefile.am << 'END'
+SUBDIRS = lib
+END
+
+cat > lib/Makefile.am << 'END'
+pkgdata_DATA =
+noinst_LIBRARIES = libfoo.a
+libfoo_a_SOURCES = foo.c
+BUILT_SOURCES=foo.h
+foo.h:
+ echo \#define FOO_DEFINE 1 >$@
+END
+
+cat > lib/foo.c << 'END'
+#include <foo.h>
+int foo () { return !FOO_DEFINE;}
+END
+
+
+$ACLOCAL
+
+$AUTOCONF
+
+$AUTOMAKE --include-deps --copy --force-missing --add-missing --gnu
+
+./configure
+
+# Remove the comment to get a successful test.
+# $MAKE -C lib foo.h
+$MAKE
+
+exit 0