# handling on a per-language basis.
my %lang_specific_files;
-# List of distributed files to be put in DIST_COMMON.
-my @dist_common;
++# List of the "auto-discovered" distributed files.
++my @dist_common = ();
+
# This is set when 'handle_dist' has finished. Once this happens,
# we should no longer push on dist_common.
my $handle_dist_run;
@dist_targets = ();
+ @dist_common = ();
+ $handle_dist_run = 0;
+
%known_programs = ();
- %known_libraries= ();
- %known_ltlibraries= ();
+ %known_libraries = ();
++ %known_ltlibraries = ();
%extension_seen = ();
push_dist_common ($file)
if ($dir eq '.' || ! is_make_dir ($dir));
}
- @configure_dist_common = ();
+ @configure_dist_common = ();
}
- # $(am__DIST_COMMON): files to be distributed automatically. Will be
- # appended to $(DIST_COMMON) in the generated Makefile.
- # Use 'sort' so that the expansion of $(DIST_COMMON) in the generated
- # Makefile is deterministic, in face of m4 and/or perl randomizations
- # (see automake bug#17908).
- define_pretty_variable ('am__DIST_COMMON', TRUE, INTERNAL,
- uniq (sort @dist_common));
-
- # Now that we've processed @dist_common, disallow further attempts
- # to modify it.
+ # We don't expected further attempts to modify @dist_common
+ # after this point, so disallow it, for extra safety.
$handle_dist_run = 1;
- $transform{'DISTCHECK-HOOK'} = !! rule 'distcheck-hook';
- $transform{'GETTEXT'} = $seen_gettext && !$seen_gettext_external;
+ define_variable ('am.dist.handle-distcheck-hook', INTERNAL,
+ rule ('distcheck-hook') ? 'yes' : '');
+ define_variable ('am.dist.handle-gettext', INTERNAL,
+ $seen_gettext && !$seen_gettext_external ? 'yes' : '');
+
+ my $flm = option 'filename-length-max';
+ define_variable ('am.dist.filename-filter', INTERNAL,
+ $flm ? ('.' x $flm->[1]) : '');
# If the target 'dist-hook' exists, make sure it is run. This
# allows users to do random weird things to the distribution
## (Not configure.ac, because not all setups define the version number
## in this file.)
%STAMPVTI%: %TEXI% $(top_srcdir)/configure
-## It is wrong to have %STAMPVTI% dependent on %DIRSTAMP%, because
-## %STAMPVTI% is distributed and %DIRSTAMP% isn't: a distributed file
-## should never be dependent upon a non-distributed built file.
-## Therefore we ensure that %DIRSTAMP% exists in the rule.
-## Use cp + mv so that the update of %VTEXI% is atomic even if
-## the source directory is on a different file system.
-?DIRSTAMP? @test -f %DIRSTAMP% || $(MAKE) $(AM_MAKEFLAGS) %DIRSTAMP%
- @(dir=.; test -f ./%TEXI% || dir=$(srcdir); \
- set `$(SHELL) %MDDIR%mdate-sh $$dir/%TEXI%`; \
- echo "@set UPDATED $$1 $$2 $$3"; \
- echo "@set UPDATED-MONTH $$2 $$3"; \
- echo "@set EDITION $(VERSION)"; \
- echo "@set VERSION $(VERSION)") > %VTI%.tmp$$$$ && \
- (cmp -s %VTI%.tmp$$$$ %VTEXI% \
- || (echo "Updating %VTEXI%" && \
- cp %VTI%.tmp$$$$ %VTEXI%.tmp$$$$ && \
- mv %VTEXI%.tmp$$$$ %VTEXI%)) && \
- rm -f %VTI%.tmp$$$$ %VTEXI%.$$$$
+ @$(am.cmd.ensure-target-dir-exists)
- @(set `$(SHELL) $(am.conf.aux-dir)/mdate-sh $<`; \
- echo "@set UPDATED $$1 $$2 $$3"; \
- echo "@set UPDATED-MONTH $$2 $$3"; \
- echo "@set EDITION $(VERSION)"; \
- echo "@set VERSION $(VERSION)") > %VTI%.$$$$.tmp
- @if cmp -s %VTI%.$$$$.tmp %VTEXI%; then \
++ @(set `$(SHELL) $(am.conf.aux-dir)/mdate-sh $<` \
++ && echo "@set UPDATED $$1 $$2 $$3" \
++ && echo "@set UPDATED-MONTH $$2 $$3" \
++ && echo "@set EDITION $(VERSION)" \
++ && echo "@set VERSION $(VERSION)") > %VTI%.$$$$.tmp || exit; \
++ if cmp -s %VTI%.$$$$.tmp %VTEXI%; then \
+ rm -f %VTI%.$$$$.tmp; \
+ else \
+ echo "Updating %VTEXI%" && mv -f %VTI%.$$$$.tmp %VTEXI%; \
- fi;
++ fi
@cp %VTEXI% $@
-mostlyclean-am: mostlyclean-%VTI%
-mostlyclean-%VTI%:
- -rm -f %VTI%.tmp* %VTEXI%.tmp*
-
-maintainer-clean-am: maintainer-clean-%VTI%
-maintainer-clean-%VTI%:
-%MAINTAINER-MODE% -rm -f %STAMPVTI% %VTEXI%
-
-.PHONY: mostlyclean-%VTI% maintainer-clean-%VTI%
+am.clean.mostly.f += %VTI%.[0-9]*.tmp
+am.clean.maint.f += %STAMPVTI% %VTEXI%
# in case it is given with a relative name containing no slashes.
AM_TESTS_ENVIRONMENT += \
if test $(srcdir) != .; then \
- PATH='$(abs_srcdir)/%D%/ax'$(PATH_SEPARATOR)$$PATH; \
+ PATH='$(abs_srcdir)/%D%/ax$(PATH_SEPARATOR)'$$PATH; \
fi; \
- PATH='$(abs_builddir)/%D%/ax'$(PATH_SEPARATOR)$$PATH; \
+ PATH='$(abs_builddir)/%D%/ax$(PATH_SEPARATOR)'$$PATH; \
export PATH;
-# Hand-written tests.
-
-include $(srcdir)/%D%/list-of-tests.mk
-
-TESTS += $(handwritten_TESTS)
-EXTRA_DIST += $(handwritten_TESTS)
-
-# Automatically-generated tests wrapping hand-written ones.
-# Also, automatically-computed dependencies for tests.
+# Automatically-computed dependencies for tests.
+include $(srcdir)/testsuite-autodeps.am
-include $(srcdir)/%D%/testsuite-part.am
-
-TESTS += $(generated_TESTS)
-EXTRA_DIST += $(generated_TESTS)
-
-$(srcdir)/%D%/testsuite-part.am:
- $(AM_V_at)rm -f %D%/testsuite-part.tmp $@
- $(AM_V_GEN)$(PERL) $(srcdir)/gen-testsuite-part \
- --srcdir $(srcdir) > %D%/testsuite-part.tmp
- $(AM_V_at)chmod a-w %D%/testsuite-part.tmp
- $(AM_V_at)mv -f %D%/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)/%D%/testsuite-part.am: $(srcdir)/gen-testsuite-part
-$(srcdir)/%D%/testsuite-part.am: Makefile.am
-
-# Hand-written tests for stuff in 'contrib/'.
-include $(srcdir)/contrib/%D%/Makefile.inc
-TESTS += $(contrib_TESTS)
-EXTRA_DIST += $(contrib_TESTS)
+$(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
# Static dependencies valid for each test case (also further
# extended later). Note that use 'noinst_' rather than 'check_'