[ng] clean: drop minor DOS-related cruft in libtool support
* automake.in (handle_libtool): Do not bother cleaning '_libs'
directories, they are only used by Libtool on MS-DOS (and we
don't support that anymore).
It's so small and dumb that it's easier and cleaner to just inline
it in the automake script.
* lib/am/clean-hdr.am: Delete.
* Makefile.am (dist_am_DATA): Remove it.
* automake.in (handle_configure): Just add the header configs and their
stamp files to '%clean_files', instead of processing the now-removed
'clean-hdr.am' to obtain the same effect.
[ng] check: keep cleaning of '.log' and '.trs' files near other rules
* lib/am/parallel-tests.am: Add $(am__test_results), $(am__test_logs)
and $(TEST_SUITE_LOGS) to the list of files removed by "make mostlyclean"
here ...
* automake.in (handle_tests): ... rather than here.
It's so small and dumb that it's easier and cleaner to just inline
it in the automake script.
* lib/am/libtool.am: Delete.
* Makefile.am (dist_am_DATA): Remove it.
* automake.in (handle_libtool): Just add the list of all the '.libs'
directories to '%libtool_clean_directories', instead of processing the
now-removed 'libtool.am' to obtain the same effect. Similarly, when
processing the Makefile in the top-level directory, add 'libtool' and
'config.lt' to '%clean_files'.
[ng] refactoring: no "cleaning" rules in compile.am
* automake.in (handle_compile): To ensure the compiled objects are
removed, simply merge the contents of '%compile_clean_files' into
'%clean_files' here, instead of ...
* lib/am/compile.am (am__mostlyclean_files): ... appending them to
this variable here. While we are at it, remove a stray declaration
of the already-deleted target 'mostlyclean-compile' as ".PHONY".
[ng] clean: don't remove object files in '.' unconditionally
Do that only if some source file is actually present in the current
directory (which might not be the case for, say, projects that use
a non-recursive make setup and have all sources in the 'src' and 'lib'
subdirectories).
* lib/am/compile.am (am__mostlyclean_files): Don't append '*.$(OBJEXT)'
unconditionally.
* lib/am/libtool.am (am__mostlyclean_files): Don't append '*.lo'
unconditionally.
* automake.in (handle_single_transform): Update '%compile_clean_files'
also for sources in the current directory. Some related adjustments.
Remove obsolete comments while we are at it.
(handle_LIBOBJS_or_ALLOCA): Update '%compile_clean_files' to list
all the object files in the directory of the extra sources brought
in. Adjust comments accordingly.
It's so small and dumb that it's easier and cleaner to just inline
it in the automake script.
* lib/am/depend.am: Delete.
* Makefile.am (dist_am_DATA): Remove it.
* automake.in (handle_languages): Just add the list of all the '.deps'
directories to %clean_dirs, instead of processing the now-removed
'depend.am' to obtain the same effect.
Similar to the '%clean_files' variable, but it will allow us to declare
directories (rather than regular files) that are to be cleaned by the
four flavours of cleaning targets ('mostlyclean', 'clean', 'distclean',
'maintainer-clean'). This will be especially useful in later changes.
* automake.in (%clean_dirs): New global.
(initialize_per_input): Reset it.
* automake.in (handle_clean), lib/am/clean.am: Extend to clean the
directories registered in '%clean_dirs'.
[ng] clean: do not ignore errors while removing files
Possible culprits have been identified with the command "git grep '-rm\b'".
* NG-NEWS: Update.
* lib/am/tags.am, lib/am/distdir.am, lib/am/dejagnu.am, lib/am/clean.am: Do
not prefix recipes invoking "rm" with the "-" recipe modifier: we now want
the cleaning recipes to fail if rm encounters an error.
[ng] clean: revamp recipes and APIs to extend cleaning rules
This change it introduces eight new internal variables, which all
can been appended to by our Makefile fragments to declare stuff that
should be cleaned upon the various "make *clean" targets; these new
variables are:
This change also ensures that the contents of the $(MOSTLYCLEANFILES),
$(CLEANFILES), $(DISTCLEANFILES) and $(MAINTAINERCLEANFILES) variables
will be cleaned even if those variables were not defined in the
Makefile.am (so that it is now possible to, e.g., define them in a
wrapper GNUmakefile including the Automake-generated Makefile, and
still have the relevant '*clean' targets remove them).
* am/clean.am (distclean): Revamp to implement the new API.
* lib/am/compile.am, lib/am/configure.am, lib/am/dejagnu.am,
lib/am/depend.am, lib/am/clean-hdr.am, lib/am/java.am, lib/am/libs.am,
lib/am/libtool.am, lib/am/lisp.am, lib/am/ltlib.am, lib/am/progs.am,
lib/am/tags.am, lib/am/texi-vers.am, lib/am/texinfos.am: Where possible
and easy, adjust to append to those variables instead of tweaking
or extending the various '*clean' or '*clean-am' targets or their
dependencies.
* automake.in (handle_compile, handle_libtool, handle_clean): Adjust.
* t/cleanvars.sh: New test.
* t/libtoo10.sh: Extend.
* t/libtool.sh, t/libtool2.sh: Remove as obsolete.
* syntax-checks.am: Extend to catch possible typos in the use of
the new variables (for example, it is easy to erroneously write
'am__cleanfiles' instead of 'am__clean_files').
* automake.in (handle_compile): Compiled objects are always to be
removed upon "make mostlyclean", never requiring a much stronger
"make distclean" to be cleaned. Simplify accordingly.
* am/compile.am: Simplify accordingly, and do not bother cleaning
'*.tab.c' files, that shouldn't be left behind by Automake-generated
Makefiles anyway.
[ng] deptrack: clean depdirs using *clean-am targets
* lib/am/depend.am (am--clean-depdirs): New target, removing the
$(DEPDIR) directory.
(distclean, maintainer-clean): Renamed ...
(distclean-am, maintainer-clean-am): ... to these, and depend on the new
target above to clean the $(DEPDIR) directory. Given the current status
of the Automake internals, this shouldn't cause any change in the automake
behaviour, but the new form of these declarations will be useful in future
refactorings.
* lib/am/depend.am: Since in Automake-NG the generated Makefile calls
'-include' (not 'include') on the dependency tracking '.Po' files, 'make'
will never fail simply because a '.Po' file is not found. Remove a
comment regarding the now-impossible include failure.
Co-authored-by: Dave Hart <davehart@gmail.com> Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
This fixes several weaknesses and buglets in the 'bootstrap' convenience
target offered in GNUmakefile (and its supporting code). Refer to the
extensive code comments in there for more details.
* doc/automake.texi: Fix the reported warnings and informative messages
from automake to quote 'like this' rather than as `like this'. Do the
same for comments and some text in our examples.
[ng] maintcheck: remove a test that can't work for Automake-NG
* syntax-checks.mk (sc_tests_makefile_variable_order): Remove. This
rule checked that all variables definitions were listed before rules
in the automake-generated Makefile.in files; but this invariant is not
guaranteed anymore by Automake-NG, and in fact it will break more and
more as our work proceeds.
(syntax_check_rules): Update.
* master:
maintcheck: guard against obsolete $required entries
tests: drop requirement 'makeinfo-html'; 'makeinfo' is enough
tests: drop requirement 'texi2dvi-o'; 'texi2dvi' is enough
texi: require Texinfo >= 4.9, related enhancements
docs: it's not true that DISTCHECK_CONFIGURE_FLAGS is maintainer-reserved
+ Extra non-trivial edits:
* t/silent-texi.sh ($required): Simply use 'makeinfo and 'texi2dvi',
instead of (respectively) 'makeinfo-html' and 'texi2dvi-o'.
* t/texinfo21b.sh: Fix a minor typo in heading comments.
($required): Simply use 'makeinfo instead of 'makeinfo-html'
* lib/am/texibuild.am: Merge the changes done in the master branch to
the ".texi -> .dvi" and ".texi -> .pdf" recipes into the definition
of the '$(am__texibuild_dvi_or_pdf)' make function, as well as into ...
(%.dvi: %.texi), (%.pdf: %.texi): ... calls to that function into these
pattern rules.
tests: drop requirement 'makeinfo-html'; 'makeinfo' is enough
* defs: Since we now require Texinfo 4.9 or later in the Automake
generated Makefiles, and since the '--html' option of makeinfo, as
well as its capability to generate HTML output, has been supported
since Texinfo 4.0 (according to the Texinfo NEWS file), the
requirement 'makeinfo-html' is obsolete -- the simpler requirement
'makeinfo' is enough.
* t/instdir-texi.sh ($required): Adjust by using simply 'makeinfo'
instead of 'makeinfo-html'.
* t/silent8.sh: Likewise.
* t/txinfo21.sh: Likewise.
tests: drop requirement 'texi2dvi-o'; 'texi2dvi' is enough
* defs: Since we now require Texinfo 4.9 or later in the Automake
generated Makefiles, and since the '-o' option of texi2dvi has been
supported since Texinfo 4.1, the requirement 'texi2dvi-o' is
obsolete -- the simpler requirement 'texi2dvi' is enough.
* t/silent8.sh ($required): Adjust by using simply 'texi2dvi'
instead of 'texi2dvi-o'
* t/txinfo-no-clutter.sh: Likewise.
* t/txinfo13.sh: Likewise.
* t/txinfo23.sh: Likewise.
* t/txinfo24.sh: Likewise.
* t/txinfo25.sh: Likewise.
* t/txinfo28.sh: Likewise.
* t/txinfo33.sh: Likewise.
* t/vtexi4.sh: Likewise.
texi: require Texinfo >= 4.9, related enhancements
We start passing the '--build-dir' option to the texi2dvi and texi2pdf
invocations done in our Texinfo-related rules. The argument for this
option will be specific for each info_TEXINFOS entry, to work around a
texi2dvi bug that could otherwise cause racy failures in parallel make
builds:
<http://lists.gnu.org/archive/html/automake-patches/2012-06/msg00073.html>
That bug seems already fixed in the development version of texi2dvi,
though:
<http://lists.gnu.org/archive/html/automake-patches/2012-06/msg00074.html>
so the details of our '--build-dir' usage can be revisited once we can
assume Texinfo 5.0 or later.
Since the '--build-dir' options has been only supported since Texinfo
4.9, we lose compatibility with all older Texinfo versions.
But we also get some real improvements.
First, the '--build-dir' option implies the '--tidy' option; this, like
the '--clean' option that we were formerly using, prevents cluttering of
the build directory with all the TeX and Texinfo auxiliary files and
build by-products, but, differently from '--clean', keeps them around
for later re-runs to use; this shortens the rebuild times considerably.
Second, the use of '--build-dir' also allows us to specify different
build directories for the PDF and DVI output, preventing the rules
building them from stomping on each other's feet when run in parallel.
This is demonstrated by the test cases 'txinfo-no-clutter.sh' and
'txinfo33.sh', which before this change used to fail when run with
MAKE="make -j4", but now succeed even in that case.
* NEWS: Update.
* lib/am/texibuilds.am: Do not try to avoid texi2dvi/texi2pdf option
'-o'; it has been supported since Texinfo 4.1, and we now require
Texinfo >= 4.9. Remove an obsolete comment. Modify calls to texi2dvi
and texi2pdf to use the '--build-dir' option, so that TeX auxiliary
files and build by-products for a 'foo.texi' input will be placed in
a 'foo.t2d' directory (for texi2dvi) or in a 'foo.t2p' directory (for
texi2pdf).
* automake.in (scan_texinfo_file): Greatly simplify the implementation,
since we don't need anymore to keep track of the TeX auxiliary files and
build by-products to clean. Drop the '@CLEAN_FILES' part of the return
value.
(handle_texinfo_helper): Adjust the 'scan_texinfo_file()' call to its
new signature. Append the "work directories" now created by texi2dvi
and texi2pdf invocation to the list of files/directories removed upon
"make mostlyclean".
* lib/am/texinfos.am: Update the cleaning rules (and comments)
accordingly.
* t/txinfo-no-clutter.sh: Minimal adjustment to avoid spurious failures.
* .gitignore: Update.
[ng] general: simpler workaround for CDPATH issues
With this change, we also get rid of the $(am__cd) make variable.
* lib/am/header-vars.am (am__cd): Remove.
To ensure a CDPATH exported in the environment doesn't interfere with
our scripts and recipes, we can simply un-export it here (using the GNU
make "unexport" directive), rather than having to rely on $(am__cd) ...
* Makefile.am, automake.in, lib/am/configure.am, lib/am/distdir.am,
lib/am/header-vars.am, lib/am/inst-vars.am, lib/am/remake-hdr.am,
lib/am/tags.am, lib/am/texibuild.am, t/ax/distcheck-hook-m4.am: ... in
several places of these files.
* GNUmakefile, HACKING: Adjust.
* syntax-checks.mk (sc_cd_in_backquotes, sc_cd_relative_dir): Remove,
superseded by ...
(sc_no_am_cd): ... this new target, which has contrary semantics, and
looks *against* the use of the now-obsolete $(am__cd).
(syntax_check_rules): Adjust.
* ng/texinfo-work: (29 commits)
[ng] texi: drop support for '.txi' and '.texinfo' suffixes
[ng] coverage: texinfo silent rules with a subdir texinfo file
[ng] tests: rename silent8.sh -> silent-texi.sh
[ng] texi: remove some crufty code to support obsolete environment
[ng] texi: move more code from automake to Makefile
[ng] texi: "de-prettify" makeinfo command line
[ng] automake: merge handle_texinfo_source() -> handle_texinfo_helper()
[ng] texi: simplify handle_texinfo_source by assuming '.info' suffix ...
[ng] texi: move some more knowledge from automake to texi-spec.am
[ng] texi: in texi-spec.am, assume suffix for info files is always '.info'
[ng] automake: remove two unused variables from '&handle_texinfo_source'
[ng] coverage: texinfo input files using @include directives
[ng] texi: always look for mdate-sh in the build-aux directory ...
[ng] refactor: more proper name for a subroutine in automake
[ng] texi: drop a useless transform when processing texinfos.am
[ng] texi: adjust names of vars used for silent rules support
[ng] texi: drop transforms when reading texibuild.am
[ng] texi: reorganize '.am' fragments even more
[ng] texi: reorganize '.am' fragments a bit
[ng] texi: reduce code duplication in output Makefile
[ng] texi: refactoring in texibuild.am
[ng] texi: reduce code duplication in texibuild.am
[ng] texi: read 'texibuild' rules more verbatim
[ng] texi: be sure to only emit generic pattern rules once
[ng] texi: drop support for suffix-less info files
[ng] texi: more target-specific variables use in '.info' build rules
[ng] texi: reimplement '.info' build using target-specific variables
[ng] texi: tweak rules for HTML generation to spawn only one shell
[ng] texi: simplify by always assuming generic rules
[bg] silent: simplify by taking advantage of GNU make semantics
In particular, taking advantage of the fact that, in GNU make, command
line override of variables is propagated to recursive make invocations.
This change offers us a small but nice size reduction bot in Automake's
code and in the generated Makefiles. It also improves the API to define
custom silent "tags", by turning it from:
* NG-NEWS: Update.
* doc/automake-ng.texi (Automake Silent Rules): Update w.r.t. the
API for user-defined silent rules.
* automake.in: Simplify, by removing the indirections involving
$(AM_DEFAULT_VERBOSITY); some other changes and simplifications.
(verbose_private_var): Delete, its calls from &define_verbose_var
deleted (and those were its only calls).
* lib/am/header-vars.am: Define '$(V)' to 0 if it's not already
defined.
* m4/silent.m4: Initialize and AC_SUBST the variable 'V' directly,
instead of of the indirect 'AM_DEFAULT_VERBOSITY'. Do not set nor
AC_SUBST the variable 'AM_BACKSLASH', it's not used anymore (and
hasn't been since out overhauling and simplification of the compile
rules).
* GNUmakefile: Simplify a little.
* t/silent6.sh, t/silent-configsite.sh: Adjust.
[ng] texi: drop support for '.txi' and '.texinfo' suffixes
The former was only needed to cater to 8+3 file systems (for which
we have dropped support anyway), and the latter was hardly used in
practice, it's extra "eye-candy" not worth complicating the code.
We now only accept and handle files with a '.texi' suffix.
* NG-NEWS: Update.
* automake.in (handle_texinfo_helper): Drop support for '.txi'
and '.texinfo' suffixes.
(scan_texinfo_files): Likewise.
* lib/am/texibuild.am: Simplify accordingly, assuming '.texi'
as the only valid suffix for Texinfo input files.
* t/txinfo-rules-once.sh: Resurrect this test, and enhance it
a little, also merging in the suitably adapted contents of ...
* t/txinfo9.sh: ... this test, now deleted.
* t/txinfo6.sh: Remove as obsolete.
[ng] texi: remove some crufty code to support obsolete environment
* lib/am/texi-vers.am (%STAMPVTI%): We don't really care anymore about
older systems whose 'mv' program can't move across file systems, nor do
we care about past problems of GNU mv in the AmigaDOS environment. So
simplify the code accordingly.
[ng] texi: move more code from automake to Makefile
The previous changes left us with this low-hanging fruit to pick.
* automake.in (handle_texinfo_helper): Since the $makeinfoflags contents
are now static, we don't need to define that variable anymore, nor to
pass the '%MAKEINFOFLAGS%' transform to 'texi-spec.am', nor ...
* lib/am/texi-spec.am: ... to use that transform here to define the target
specific variable '$(am__makeflags)'; we can just ...
* lib/am/texibuild.am: .. inline the static content in the appropriate
rules here.
This will make some future changes easier. And anyway, it's usually not
worth to add code complexity to have a slightly pretty output from make;
people who want pretty output should be using "make V=0" anyway ;-)
* automake.in (handle_texinfo_helper): Make definition of $makeinfoflags
less pretty but more easy.
[ng] texi: move some more knowledge from automake to texi-spec.am
* automake.in (handle_texinfo_source): Do not define '$dipfx',
nor use it for the transform '%DEST_INFO_PREFIX%'.
* lib/am/texi-spec.am: Adjust the prefix of the output info file
by adding '$(srcdir)' to it if the '?INSRC?' transform is true.
[ng] texi: in texi-spec.am, assume suffix for info files is always '.info'
This has been the case since an earlier patch.
* lib/am/texi-spec.am: Simply use '.info' instead of '%DEST_SUFFIX%'.
* automake.in (handle_texinfo_source): Drop the now-useless transform
'%DEST_SUFFIX%' for texi-spec.am
[ng] texi: always look for mdate-sh in the build-aux directory ...
... rather than in the current directory if the path of the build-aux
directory had been determined automatically and not explicitly specified
through an AC_CONFIG_AUX_DIR invocation. This rid us of an ugly
inconsistency wart that was only present for historical reasons.
* automake.in (handle_texinfo_helper): Do not look for the required file
'mdate-sh' in the current directory if $config_aux_dir_set_in_configure_ac
is false; unconditionally look for it in the build-aux directory.
* lib/am/texi-vers.am: Simplify accordingly, getting rid of the (now
undefined by automake) transform %MDDIR%.
* t/mdate4.sh: Remove as obsolete.
* t/vtexi.sh: Remove an hairy and obsolescent grepping check, to avoid
spurious failures.
* t/reqd.sh: Adjust not to check for multiple installations of mdate-sh;
these don't take place anymore.
[ng] texi: adjust names of vars used for silent rules support
* lib/am/texibuild.am, automake.in (define_verbose_texinfo): Modify
so that the variables $(AV_texinfo) and $(AM_texidevnull) get renamed
with the much clearer and more proper names $(AM_TEXI_QUIETOPTS) and
$(AM_TEXI_DEVNULL_REDIRECT).
* t/silent8.sh: Enhance.
* lib/am/texinfos.am (TEXI2DVI, TEXI2PDF, DVIPS, MAKEINFOHTML,
AM_MAKEINFOHTMLFLAGS): Move these variables' definitions ...
* lib/am/texibuild.am: ... in here, since their only uses are
here.
* lib/am/texinfos.am (%.ps: %.dvi): Move ...
* lib/am/texibuild.am: ... here, which is a more appropriate place
for such a rule.
* automake.in (handle_texinfo): Drop '%AM_V_DVIPS%' when processing
'texinfos.am'; instead, use it when processing 'texibuild.am'.
[ng] texi: reduce code duplication in output Makefile
No semantic change is intended.
* lib/am/texibuild.am: Use a make-runtime $(foreach) loop to define the
conversion rules for all the accepted Texinfo suffixes ('.txi', '.texi',
'.texinfo'), with the help of ...
(am__texi_rules_for_suffix): ... this new internal make function.
* automake.in (handle_texinfo): Adjust.
* t/txinfo6.sh: Adjust and extend.
* t/txinfo-rules-once.sh: Remove as obsolete.
This is only to simplify future changes; no semantic change is
intended.
* lib/am/texibuild.am
(am__texibuild_info): New internal make function.
(%.info: %.%TEXI-SUFFIX%): Use it for the recipe.
(am__texibuild_html): New internal make function.
(%.html: %.%TEXI-SUFFIX%): Use it for the recipe.
[ng] texi: reduce code duplication in texibuild.am
No semantic change is intended.
* lib/am/texibuild.am (am__texibuild_dvi_or_pdf): New internal
make function.
(%.dvi: %.%TEXI-SUFFIX%): Use it for the recipe.
(%.pdf: %.%TEXI-SUFFIX%): Likewise.
[ng] texi: be sure to only emit generic pattern rules once
* lib/am/texibuild.am: Only hold generic pattern rules now, the
stuff specific to single '.texi' files moved out ...
* lib/am/texi-spec.am: ... to this new file.
* Makefile.am (dist_am_DATA): Add it.
* automake.in (output_texinfo_build_rules): Process 'texi-spec.am'
rather than 'texbuild.am', and adjust transforms accordingly.
(handle_texinfo): Process 'texibuild.am', once for each valid Texinfo
extension (.texi, .txi, .texinfo).
* t/txinfo-rules-once.sh: New test.
[ng] texi: drop support for suffix-less info files
Such support is seldom used, and will get in the way of future, useful
refactorings. We can still re-introduce it at a later time, after the
dust is settled, if there are users' requests in this direction.
* automake.in (scan_texinfo_file): Error out if a input '.texi' file
specifies an output (in the '@setfilename' directive) that doesn't have
a '.info' extension.
(output_texinfo_build_rules): Simplify, by assuming generated info
files ought to have the '.info' extension.
* lib/am/texibuild.am: Likewise.
* NG-NEWS: Update
* t/txinfo3.sh: Remove as obsolete.
* t/txinfo-unrecognized-extension-2.sh: New test.
* t/primary-prefix-valid-couples.sh: Adjust to avoid spurious failures.
* t/txinfo17.sh: Likewise.
* t/txinfo20.sh: Likewise.
* t/vtexi2.sh: Likewise.
* t/mdate2.sh: Likewise.
[ng] texi: more target-specific variables use in '.info' build rules
* lib/am/texibuild.am: Rewrite '.info' targets' recipes and dependencies
to use the target-specific variable 'am__makeinfoflags', set from the
'%MAKEINFOFLAGS%' transform.
[ng] texi: reimplement '.info' build using target-specific variables
This refactoring will be useful in later changes.
* lib/am/texibuild.am (%DEST_SUFFIX%: %%SOURCE_SUFFIX%): Rewrite recipe
to use the target-specific variable 'am__info_insrc', which expands to
"yes" when the '?INSRC?' transform is true, and to the empty string
otherwise.
[ng] texi: tweak rules for HTML generation to spawn only one shell
* lib/am/texibuild.am: Rewrite the recipe for .texi -> .html conversion
to use only one shell invocation, mostly for consistency with the other
recipes (e.g., .texi -> .pdf). This also offers a micro-optimization.
And while we are at it, throw in few other micro-optimizations, and fix
botched indentation.
[ng] texi: simplify by always assuming generic rules
They are assured to work with GNU make even when the '.texi' source
lies in a subdirectory, because in that case also the corresponding
output files ('.pdf', '.ps', '.dvi' and '.html') lies in the same
subdirectory.
* automake.in (output_texinfo_build_rules): Don't define the Boolean
'$generic' anymore. Related simplifications. Drop the 'SOURCE' and
'GENERIC' transforms when processing the 'texibuild.am' file. Remove
obsolete comments.
* lib/am/texibuild.am: Adjust by always assuming that '?GENERIC?'
is true.
docs: it's not true that DISTCHECK_CONFIGURE_FLAGS is maintainer-reserved
At least, not anymore since commit 'v1.11-372-g9760039' of 2001-06-10,
"distcheck: add support for AM_DISTCHECK_CONFIGURE_FLAGS". See also
automake bug#8784.
* doc/automake.texi (Flag Variables Ordering): Do not report
'DISTCHECK_CONFIGURE_FLAGS' as a "variables that are only useful
to the maintainer that has no user counterpart": now it is a
user-reserved variable, its maintainer-reserved counterpart
being 'AM_DISTCHECK_CONFIGURE_FLAGS' .
and cleaned by the new 'am--distclean-amdir' recipe (prerequisite of
'distclean-am'). It is not created by default; recipes needing it
should add an order-only dependency on it, as in:
am-rule: am-prereq | $(am__dir)
[recipe creating/using files in $(am__dir)]
* lib/am/am-dir.am: New file, define internal make variables that point
to a sandbox directory where we can play freely to implement internal
details that require interaction with the filesystem, and the rules to
properly clean them. This file is not used yet, it's simply put here
so that future rules will be able to use it when and if it's needed.
* automake.in (generate_makefile): Include the new file, through the
'&preprocess_file' subroutine.
* Makefile.am (dist_am_DATA): List the new file.
* t/am-dir.sh: New test.
[ng] texinfo: pattern rules with empty suffixes are OK
So we can remove a workaround required by Solaris make from our
texinfo rules.
* automake.in (output_texinfo_build_rules): Don't define the boolean
'$generic_info' anymore. Drop the 'SOURCE_INFO' and 'GENERIC_INFO'
transforms when processing the 'texibuild.am' file. Remove obsolete
comments, and adjust some of the remaining ones.
* lib/am/texibuild.am: Adjust by always assuming that '?GENERIC_INFO?'
is true.
* t/txinfo3.sh: Adjust and extend.
[ng] subdirs: use static pattern rules to define *-recursive targets
* lib/am/subdirs.am ($(RECURSIVE_TARGETS), $(RECURSIVE_CLEAN_TARGETS)):
Rewrite as static pattern rules. This will also simplify their recipes,
avoid extra processing by the shell, and shave off a couple of forks.
[ng] subdirs: prefer "make -C dir" over "cd dir && make"
* lib/am/subdirs.am ($(RECURSIVE_TARGETS), $(RECURSIVE_CLEAN_TARGETS)):
Prefer "$(MAKE) -C $$dir ..." over "($(am__cd) $$dir && $(MAKE) ...".
This allows us to remove a subshell invocation.
* master:
automake: stop supporting "%KEY?iftrue:iffalse%" transforms
am: stop using "%KEY:iffalse?iftrue%" transforms
tests: minor reorganization of few tests
fixup: adjust t/list-of-tests.mk for renamed/added tests
subdirs: enhance coverage, tweak and rename few tests
sync: update files from upstream with "make fetch"
py-compile: consistently quote 'like this', not `like this'.
docs: recursive make considered harmful
docs: clean rules are not run in reverse order of build rules anymore
silent: new $(AM_V_P) variable, tell if we're running in silent mode
refactor: silent rules handling (a little)
refactor: &define_verbose_var: accept a third optional argument
+ Extra non-trivial edits:
* t/dir-named-obj-is-bad.sh, t/sourcefile-in-subdir.sh: Delete, it's how
the old (and in Automake-NG obsolete and removed) tests 't/subdir3.sh'
and 't/subdir7.sh' have been respectively renamed in mainline Automake.
* t/silent6.sh: Don't disable the 'portability-recursive' warnings, they
are not anymore used nor supported by Automake-NG.
* automake.in: Adjust calls to subroutines '&Automake::Variable::define'
and '&define_variable' to the different Automake-NG APIs and signature.
* maint:
tests: minor reorganization of few tests
fixup: adjust t/list-of-tests.mk for renamed/added tests
subdirs: enhance coverage, tweak and rename few tests
sync: update files from upstream with "make fetch"
py-compile: consistently quote 'like this', not `like this'.
docs: recursive make considered harmful
docs: clean rules are not run in reverse order of build rules anymore
silent: new $(AM_V_P) variable, tell if we're running in silent mode
refactor: silent rules handling (a little)
refactor: &define_verbose_var: accept a third optional argument
+ Extra non-trivial edits:
These are due to the fact that support for silent rules is enabled
unconditionally these days (since commit 'v1.12-34-g14141f2' of
2012-05-01, "silent rules: support for them is always active now").
* automake.in: In the new silent related code, do not ever check
whether the 'silent-rules' option is active; just assume support
for silent rules is enabled.
* t/silent-obsolescent-warns.sh: Remove as obsolete.
* t/list-of-tests.mk: Adjust.
* silent-custom:
silent: new $(AM_V_P) variable, tell if we're running in silent mode
refactor: silent rules handling (a little)
refactor: &define_verbose_var: accept a third optional argument
[ng] all, check, install: move more processing at make runtime
A welcome collateral effect of this change is that now the 'check-local',
'all-local' and 'installdirs-local' targets can also be defined in
wrapper Makefiles or in Makefile fragments only included at make (not
automake) runtime, without their definition ever having to be seen by
Automake.
* lib/am/all-target.am: New file, implementing the 'all' target.
* lib/am/check-target.am: New file, implementing the 'check' target.
* automake.in (handle_install): Adjust by processing it simply with
'&preprocess_file', and placing its content in '$output_verbatim'
rather than in '$output_rules'.
(handle_all, )
* lib/am/install.am: Largely rewritten to rely on GNU make runtime
capabilities rather than on automake-runtime preprocessing.
* automake.in (handle_install): Adjust by processing it simply with
'&preprocess_file', and placing its content in '$output_verbatim'
rather than in '$output_rules'.
* automake.in (handle_all, do_check_merge_target): Merged into ...
(handle_all_and_check): ... this, and largely rewritten to rely
on the new 'lib/am/{all,check}-target.am' files.
(generate_makefile): Adjust.
* Makefile.am (dist_am_DATA): Add the new '.am' files.
(XFAIL_TESTS): Add test 't/override-suggest-local.sh', that has been
broken by this change (we consider this an acceptable trade-off).
* doc/automake-ng.texi: Remove reference to removed test.
* lib/am/header-vars.am: Sanitize $(SUBDIRS), by setting it to the
empty value if it is not set, but not from the Makefile not any
command-line override.
* t/built-sources-check.sh: Remove obsolete grepping checks.
* t/remake-all-1.sh: Likewise.
* t/bsource.sh: Adjust and enhance.
* t/check.sh: Remove as basically obsolete.
* t/check2.sh: Relax grepping checks.
* t/doc-parsing-buglets-tabs.sh: Remove as too brittle.
* t/local-targets.sh: New test.
* t/tap-diagnostic.sh: Fix grepping of "make check" stdout to avoid
spurious errors.
* t/phony.sh: Tweak, to avoid spurious failure.
* t/vartar.sh: Likewise.
This will be useful to better check the correctness of later changes.
* t/built-sources.sh: New test, checks basic functionality for
BUILT_SOURCES.
* t/built-sources.sh: New test, checks basic interaction between
BUILT_SOURCES and Automake conditionals.
* t/check3.sh: Split this out ...
* t/built-sources-check.sh, t/built-sources-install.sh: ... into
these tests, to offer more granularity and make the purpose of the
tests immediately clear from their names.
* t/subdirbuiltsources.sh: Rename this ...
* t/built-sources-subdir.sh: ... to this, for consistency. Since
we are at it, fix a couple of typos and remove redundant stuff.
And the similar "reduced forms" "%KEY:iffalse%" and "%KEY?iftrue%"
as well.
They are convoluted, never used (after the previous change), and will
get in the way in the Automake-NG branch, where we'll soon want to use
GNU make static pattern rules in our internal '*.am' fragments.
* automake.in (preprocess_file, transform): Simplify not to support
those transform patterns.
And the similar "reduced forms" "%KEY:iffalse%" and "%KEY?iftrue%"
as well.
They are harder to grasp, can be easily reformulated in function of
other "plainer" transforms ("?KEY?" and "?!KEY?"), and we'll remove
support for them anyway in a later change.
* lib/am/data.am, lib/am/libs.am, lib/am/lisp.am, lib/am/ltlib.am,
lib/am/progs.am, lib/am/python.am, lib/am/scripts.am: Adjusted not
to rely on those kinds of transforms.
In the documentation, we shouldn't confuse "packages using subdirectories"
with "packages using recursive make invocations". A package can have a
careful organization in subdirectories, make no (or almost no) use of make
recursion (examples of such packages are GNU bison, GNU cppi, and Automake
itself).
In fact, make recursion should be used as seldom as possible, because it
makes the build system more brittle and dependency declarations less
faithful. See Peter Miller's article "Recursive Make Considered Harmful"
for more a more in-depth discussion:
http://miller.emu.id.au/pmiller/books/rmch/
* doc/automake.texi (Directories): Clarify how a build system based on
make recursion does. Observe that such a system, albeit being very
widespread, has its own issues and drawbacks, and that one can have a
non-recursive setup also for projects using complex directory layout.
(Recursing subdirectories): Speak of "packages that use make recursion"
rather than of "packages with subdirectories".
[ng]: tests: don't check whether $MAKE is GNU make -- of course it is
Revealed by "make maintcheck".
* t/subobj-clean-pr10697.sh: Don't call 'using_gmake' to determine
whether $MAKE is GNU make, and just assume GNU make semantics for
automatic Makefile rebuilding.
* t/subobj-clean-lt-pr10697.sh: Likewise.
* master:
maintcheck: fix failures, both real and spurious
subdir tests: avoid an use of "make -j4", for portability
tests: avoid failure due to libtool quirks in C++ demo test
tests: fix spurious failures due to missing '$sleep'
subdirs: unify rules for "cleaning" and "normal" recursive targets
tests: add a "demo" test on C support
tests: look for '.lo' rather than '.o' object when using Libtool with C++
cosmetics: few typofixes in older ChangeLogs, suggested by "codespell.py"
maint: grammar fixes: s/all these/all of these/
subdir-objects: improve "make mostlyclean" efficiency and flexibility
* maint:
maintcheck: fix failures, both real and spurious
subdir tests: avoid an use of "make -j4", for portability
tests: avoid failure due to libtool quirks in C++ demo test
tests: fix spurious failures due to missing '$sleep'
subdirs: unify rules for "cleaning" and "normal" recursive targets
tests: add a "demo" test on C support
tests: look for '.lo' rather than '.o' object when using Libtool with C++
cosmetics: few typofixes in older ChangeLogs, suggested by "codespell.py"
maint: grammar fixes: s/all these/all of these/
subdir-objects: improve "make mostlyclean" efficiency and flexibility
* syntax-checks.mk (sc_rm_minus_f): Whitelist the
't/subobj-clean*-pr10697.sh' tests.
* t/subobj-clean-pr10697.sh: When redefining PATH,
use '$PATH_SEPARATOR', not hard-coded ':'.
* t/subobj-clean-lt-pr10697.sh: Likewise.
subdir tests: avoid an use of "make -j4", for portability
Otherwise, a spurious failure with Solaris CCS make can be triggered.
The coverage is not actually reduced, since the code path is still
covered when one runs the testsuite with AM_TESTSUITE_MAKE="make -jN"
(as should be done periodically).
tests: avoid failure due to libtool quirks in C++ demo test
Revealed by failures on NetBSD 5.1.
* t/cxx-lt-demo.sh: In "make distcheck" invocation, don't define 'CC'
to "false", as that value would be exported and passed to the child
./configure invocation, and some configure checks generated by libtool
autoconf macros can still require a C preprocessor even for packages
using only C++, and bail out if it's not found. The problem was not
apparent on Solaris and GNU/Linux because those systems have a
'/lib/cpp' program, and configure detected and used that as a fallback
C preprocessor.
tests: fix spurious failures due to missing '$sleep'
Revealed by failures on NetBSD 5.1.
* t/subobj-clean-pr10697.sh: Call '$sleep' before modifying the
files that should trigger an automatic remake.
* t/subobj-clean-lt-pr10697.sh: Likewise.
Merge branches 'subdirs-simplify' and 'subdir-objects-pr10697' into maint
* subdirs-simplify:
subdirs: unify rules for "cleaning" and "normal" recursive targets
tests: add a "demo" test on C support
* subdir-objects-pr10697:
subdir-objects: improve "make mostlyclean" efficiency and flexibility
tests: look for '.lo' rather than '.o' object when using Libtool with C++
cosmetics: few typofixes in older ChangeLogs, suggested by "codespell.py"
subdirs: unify rules for "cleaning" and "normal" recursive targets
Before this change, the recursive invocation of cleaning targets in
the $(SUBDIRS) where done in inverse order, i.e., starting from the
last $(SUBDIRS) entry and proceeding towards the first. According
to the code comments, this was done ...
... in an attempt to alleviate a problem that can happen when
dependencies are enabled. In this case, the .P file in one
directory can depend on some automatically generated header
in an earlier directory. Since the dependencies are required
before any target is examined, make bombs.
But this comment does not apply anymore to the current implementation
of automatic dependency tracking: the '.Po' and '.Plo' files does not
depend on any C header or source file, ever!
So it seems that the distinction between "normal" and "cleaning"
recursive targets is a stale leftover of an older implementation of
the automatic dependency tracking. In fact, the Automake History
manual seems to confirm this suspect; the section "First Take on
Dependency Tracking" reads:
Because each .P file was a dependency of Makefile, this meant
that dependency tracking was done eagerly by make. For instance,
"make clean" would cause all the dependency files to be updated,
and then immediately removed. This eagerness also caused problems
with some configurations; if a certain source file could not be
compiled on a given architecture for some reason, dependency
tracking would fail, aborting the entire build.
and the following section "Dependencies As Side Effects" reads:
In this approach, the .P files were included using the -include
command, which let us create these files lazily. This avoided
the "make clean" problem.
So the distinction between "normal" and "cleaning" recursive targets
has likely been obsolete since by then already. We can thus remove
such distinction, thus reducing some complications and duplication in
our rules. Doing so, the whole testsuite still passes (both with GCC
and Sun C 5.9), even the test 'c-demo.sh', which, among the other
things, exercise the setup described in the obsolete code comment
referenced above.
Finally, note that we still keep '$(RECURSIVE_CLEAN_TARGETS)' and
'$(RECURSIVE_TARGETS)' as two distinct variables, to ensure a better
backward-compatibility for any user-defined rules that happen to use
those variables.
* NEWS: Update.
* lib/am/subdirs.am ($(RECURSIVE_CLEAN_TARGETS), $(CLEAN_TARGETS)):
Merge their recipes.
* t/subdir-distclean.sh: New test, check that "./configure && make
&& make distclean" is actually a no-op, even when conditional SUBDIRS
are involved.
* t/list-of-tests.mk: Add it.
silent: new $(AM_V_P) variable, tell if we're running in silent mode
Addresses part of automake bug#8665.
* automake.in (handle_silent): Define a new make variable '$(AM_V_P)',
that expands to a shell conditional that can be used in make recipes to
determine whether they are being run in silent mode or not. The choice
of the name derives from the LISP convention of appending the letter
'P' to denote a predicate (see also "the '-P' convention" in the Jargon
File); we do so for lack of a better convention.
* t/automake.texi, NEWS: Document the new variable.
* t/silent6.sh: Adjust and extend. Move out the checks that didn't
actually deal with user extension of silent rules ...
* t/silent-obsolescent-warns.sh: ... into this test (bound to be
removed once 'maint' is merged into the 'master' branch).
* t/list-of-tests.mk: Add the new test.
* automake.in (handle_languages): Move definition of $(AM_V_GEN)
variable ...
(define_verbose_tagvar): ... and of '$(AM_V_at)' variable ...
(handle_silent): ... in this new subroutine.
(generate_makefile): Call it.