From: Stefano Lattarini Date: Mon, 2 Jul 2012 19:40:47 +0000 (+0200) Subject: Merge branch 'master' into ng/master X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cf2a81c0fc6579ce2fce57cea25fcac57e919c7a;p=thirdparty%2Fautomake.git Merge branch 'master' into ng/master * master: contrib: check-html: pass flags to rst2html invocations contrib: simple improvements to check-html coverage: check-html can be used recursively tests: tests for stuff in contrib goes in 'contrib/t' recursion: support user-defined recursive targets tests: rename 'recurs*.sh' to 'var-recurs*.sh' tests: minor improvements to 'recurs*.sh' Signed-off-by: Stefano Lattarini --- cf2a81c0fc6579ce2fce57cea25fcac57e919c7a diff --cc Makefile.am index c3be172f1,f05e82db5..0ac2338c9 --- a/Makefile.am +++ b/Makefile.am @@@ -241,7 -264,9 +241,8 @@@ dist_automake_ac_DATA = m4/cond.m4 \ m4/cond-if.m4 \ m4/depend.m4 \ - m4/depout.m4 \ m4/dmalloc.m4 \ + m4/extra-recurs.m4 \ m4/gcj.m4 \ m4/init.m4 \ m4/install-sh.m4 \ @@@ -378,18 -350,40 +379,23 @@@ AM_TESTS_ENVIRONMENT += AM_TESTS_REEXEC AM_TESTS_FD_REDIRECT = 9>&2 AM_TESTS_ENVIRONMENT += stderr_fileno_=9; export stderr_fileno_; -# Hand-written tests. - -include $(srcdir)/t/list-of-tests.mk - -TESTS += $(handwritten_TESTS) -EXTRA_DIST += $(handwritten_TESTS) - -# Automatically-generated tests wrapping hand-written ones. -# Also, automatically-computed dependencies for tests. - -include $(srcdir)/t/testsuite-part.am - -TESTS += $(generated_TESTS) -EXTRA_DIST += $(generated_TESTS) +# Automatically-computed dependencies for tests. +include $(srcdir)/testsuite-autodeps.am -$(srcdir)/t/testsuite-part.am: - $(AM_V_at)rm -f t/testsuite-part.tmp $@ - $(AM_V_GEN)$(PERL) $(srcdir)/gen-testsuite-part \ - --srcdir $(srcdir) > t/testsuite-part.tmp - $(AM_V_at)chmod a-w t/testsuite-part.tmp - $(AM_V_at)mv -f t/testsuite-part.tmp $@ -EXTRA_DIST += gen-testsuite-part - -## The dependecies declared here are not truly complete, but such +## The dependencies declared here are not truly complete, but such ## completeness would cause more issues than it would solve. See ## automake bug#11347. -$(generated_TESTS): $(srcdir)/gen-testsuite-part -$(srcdir)/t/testsuite-part.am: $(srcdir)/gen-testsuite-part Makefile.am +$(srcdir)/testsuite-autodeps.am: $(srcdir)/gen-testsuite-part + $(AM_V_at)rm -f $(@F)-t $@ + $(AM_V_GEN)$(PERL) $< --srcdir $(srcdir) > $(@F)-t + $(AM_V_at)chmod a-w $(@F)-t && mv -f $(@F)-t $@ +EXTRA_DIST += gen-testsuite-part + # Hand-written tests for stuff in 'contrib/'. + include $(srcdir)/contrib/t/local.am + TESTS += $(contrib_TESTS) + EXTRA_DIST += $(contrib_TESTS) + # Static dependencies valid for each test case. check_SCRIPTS = t/wrap/aclocal-$(APIVERSION) t/wrap/automake-$(APIVERSION) dist_check_DATA = \ diff --cc automake.in index 97ccdabfb,15d545d81..25314c0e8 --- a/automake.in +++ b/automake.in @@@ -3927,29 -4475,145 +3930,55 @@@ sub handle_foote # Generate 'make install' rules. sub handle_install () { - $output_rules .= &file_contents - ('install', - new Automake::Location, - maybe_BUILT_SOURCES => (set_seen ('BUILT_SOURCES') - ? (" \$(BUILT_SOURCES)\n" - . "\t\$(MAKE) \$(AM_MAKEFLAGS)") - : ''), - 'installdirs-local' => (user_phony_rule 'installdirs-local' - ? ' installdirs-local' : ''), - am__installdirs => variable_value ('am__installdirs') || ''); + $output_verbatim .= preprocess_file ("$libdir/am/install.am"); } - -# Deal with all and all-am. -sub handle_all ($) +# Generate "make all" and "make check" rules. +sub handle_all_and_check () { - 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. - unshift (@all, basename ($makefile)); - - foreach my $spec (@config_headers) - { - my ($out, @ins) = split_config_file_spec ($spec); - push (@all, basename ($out)) - if dirname ($out) eq $relative_dir; - } - - # Install 'all' hooks. - push (@all, "all-local") - if user_phony_rule "all-local"; - - &pretty_print_rule ("all-am:", "\t\t", @all); - &depend ('.PHONY', 'all-am', 'all'); - - - # Output 'all'. + my @local_headers = (); + foreach my $spec (@config_headers) + { + my ($out, @ins) = split_config_file_spec ($spec); + push (@local_headers, basename ($out)) + if dirname ($out) eq $relative_dir; + } - my @local_headers = (); - push @local_headers, '$(BUILT_SOURCES)' - if var ('BUILT_SOURCES'); - foreach my $spec (@config_headers) - { - my ($out, @ins) = split_config_file_spec ($spec); - push @local_headers, basename ($out) - if dirname ($out) eq $relative_dir; - } + $output_verbatim .= preprocess_file ("$libdir/am/all-target.am", + 'ALL-DEPS' => "@all", + 'LOCAL-HEADERS' => "@local_headers"); - 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: @local_headers" - . "\n\t" - . '$(MAKE) $(AM_MAKEFLAGS) ' - . (var ('SUBDIRS') ? 'all-recursive' : 'all-am') - . "\n\n"); - depend ('.MAKE', 'all'); - } - else - { - $output_all .= "all: " . (var ('SUBDIRS') - ? 'all-recursive' : 'all-am') . "\n\n"; - } + $output_verbatim .= preprocess_file ("$libdir/am/check-target.am", + 'CHECK-DEPS' => "@check", + 'CHECK-TESTS' => "@check_tests"); } + # Generate helper targets for user recursion, where needed. + sub handle_user_recursion () + { + return unless @extra_recursive_targets; + + define_pretty_variable ('am__extra_recursive_targets', TRUE, INTERNAL, + map { "$_-recursive" } @extra_recursive_targets); + my $aux = var ('SUBDIRS') ? 'recursive' : 'am'; + foreach my $target (@extra_recursive_targets) + { + # This allows the default target's rules to be overridden in + # Makefile.am. + user_phony_rule ($target); + depend ("$target", "$target-$aux"); + depend ("$target-am", "$target-local"); + # Every user-defined recursive target 'foo' *must* have a valid + # associated 'foo-local' rule; we define it as an empty rule by + # default, so that the user can transparently extend it in his + # own Makefile.am. + pretty_print_rule ("$target-local:"); + # $target-recursive might as well be undefined, so do not add + # it here; it's taken care of in subdirs.am anyway. + depend (".PHONY", "$target-am", "$target-local"); + } + } + - -# &do_check_merge_target () -# ------------------------- -# Handle check merge target specially. -sub do_check_merge_target () -{ - # Include user-defined local form of target. - push @check_tests, 'check-local' - if user_phony_rule 'check-local'; - - # The check target must depend on the local equivalent of - # 'all', to ensure all the primary targets are built. Then it - # must build the local check rules. - $output_rules .= "check-am: all-am\n"; - if (@check) - { - pretty_print_rule ("\t\$(MAKE) \$(AM_MAKEFLAGS)", "\t ", @check); - depend ('.MAKE', 'check-am'); - } - - if (@check_tests) - { - pretty_print_rule ("\t\$(MAKE) \$(AM_MAKEFLAGS)", "\t ", - @check_tests); - depend ('.MAKE', 'check-am'); - } - - depend '.PHONY', 'check', 'check-am'; - # Handle recursion. We have to honor BUILT_SOURCES like for 'all:'. - $output_rules .= ("check: " - . (var ('BUILT_SOURCES') - ? "\$(BUILT_SOURCES)\n\t\$(MAKE) \$(AM_MAKEFLAGS) " - : '') - . (var ('SUBDIRS') ? 'check-recursive' : 'check-am') - . "\n"); - depend ('.MAKE', 'check') - if var ('BUILT_SOURCES'); -} - # handle_clean ($MAKEFILE) # ------------------------ # Handle all 'clean' targets. @@@ -6907,15 -8032,10 +6941,16 @@@ sub generate_makefile ($$ handle_data; handle_headers; handle_subdirs; + handle_user_recursion; handle_tags; handle_minor_options; - # Must come after handle_programs so that %known_programs is up-to-date. + + # Must come after invocation of handle_programs, handle_libraries and + # handle_ltlibraries, so that %known_programs and %known_libraries are + # up-to-date. + define_variable 'am__all_progs', INTERNAL, sort keys %known_programs; + define_variable 'am__all_libs', INTERNAL, sort keys %known_libraries; + define_variable 'am__all_ltlibs', INTERNAL, sort keys %known_ltlibraries; handle_tests; # This must come after most other rules. diff --cc lib/am/subdirs.am index 98a7010f7,005483a9a..5040f554a --- a/lib/am/subdirs.am +++ b/lib/am/subdirs.am @@@ -17,12 -17,17 +17,17 @@@ RECURSIVE_TARGETS += all-recursive check-recursive installcheck-recursive RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive + + am__recursive_targets = \ + $(RECURSIVE_TARGETS) \ + $(RECURSIVE_CLEAN_TARGETS) \ + $(am__extra_recursive_targets) + ## All documented targets which invoke 'make' recursively, or depend - ## on targets that do so. - AM_RECURSIVE_TARGETS += $(RECURSIVE_TARGETS:-recursive=) \ - $(RECURSIVE_CLEAN_TARGETS:-recursive=) + ## on targets that do so. GNUmakefile from gnulib depends on this. + AM_RECURSIVE_TARGETS += $(am__recursive_targets:-recursive=) - .PHONY: $(RECURSIVE_TARGETS) $(RECURSIVE_CLEAN_TARGETS) -.PHONY .MAKE: $(am__recursive_targets) ++.PHONY: $(am__recursive_targets) # This directory's subdirectories are mostly independent; you can cd # into them and run 'make' without going through this Makefile. @@@ -31,7 -36,7 +36,7 @@@ # (which will cause the Makefiles to be regenerated when you run 'make'); # (2) otherwise, pass the desired values on the 'make' command line. - $(RECURSIVE_TARGETS) $(RECURSIVE_CLEAN_TARGETS): %-recursive: -$(am__recursive_targets): ++$(am__recursive_targets): %-recursive: ## Using $failcom allows "-k" to keep its natural meaning when running a ## recursive rule. @fail= failcom='exit 1'; \ @@@ -50,20 -56,20 +55,19 @@@ *) list='$(SUBDIRS)' ;; \ esac; \ for subdir in $$list; do \ - echo "Making $$target in $$subdir"; \ + echo "Making $* in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ - local_target="$$target-am"; \ + local_target=$*-am; \ else \ - local_target="$$target"; \ + local_target=$*; \ fi; \ - ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ - || eval $$failcom; \ + $(MAKE) -C "$$subdir" $$local_target || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ - $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ + $(MAKE) $*-am || exit 1; \ fi; test -z "$$fail" - mostlyclean: mostlyclean-recursive clean: clean-recursive distclean: distclean-recursive