Commit Graph

6 Commits (29e5596eb8f82015ddb8666079039ae851b8d182)

Author SHA1 Message Date
Patrick Steinhardt 9219325be7 Documentation: allow sourcing generated includes from separate dir
Our documentation uses "include::" directives to include parts that are
either reused across multiple documents or parts that we generate at
build time. Unfortunately, top-level includes are only ever resolved
relative to the base directory, which is typically the directory of the
including document. Most importantly, it is not possible to have either
asciidoc or asciidoctor search multiple directories.

It follows that both kinds of includes must live in the same directory.
This is of course a bummer for out-of-tree builds, because here the
dynamically-built includes live in the build directory whereas the
static includes live in the source directory.

Introduce a `build_dir` attribute and prepend it to all of our includes
for dynamically-built files. This attribute gets set to the build
directory and thus converts the include path to an absolute path, which
asciidoc and asciidoctor know how to resolve.

Note that this change also requires us to update "build-docdep.perl",
which tries to figure out included files such our Makefile can set up
proper build-time dependencies. This script simply scans through the
source files for any lines that match "^include::" and treats the
remainder of the line as included file path. But given that those may
now contain the "{build_dir}" variable we have to teach the script to
replace that attribute with the actual build directory.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2024-12-07 07:52:12 +09:00
SZEDER Gábor 3dc6b4e027 Documentation/build-docdep.perl: generate sorted output
To make sure that our manpages are rebuilt when any of the included
source files change and only the affected manpages are rebuilt,
'build-docdep.perl' scans our documentation source files for include
directives, and outputs 'make' dependencies to be included by
'Documentation/Makefile'.  This script relies on Perl's hash data
structures, and generates its output while iterating over them, and
since hashes in Perl are very much unordered, the output varies
greatly from run to run, both the order of targets and the order of
dependencies of each target.

This lack of ordering doesn't matter for 'make', because it cares
neither about the order of targets in a Makefile nor about the order
of a target's dependencies.  However, it does matter to developers
looking into build issues potentially involving these generated
dependencies, as it's rather hard to tell whether there are any
relevant (i.e. not order-only) changes among the dependencies compared
to the previous run.

So let's make 'build-docdep.perl's output stable and ordered by
sorting the keys of the hashes before iterating over them.

Signed-off-by: SZEDER Gábor <szeder.dev@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-10-21 11:39:38 -07:00
Sergey Vlasov 2ba91e9698 Documentation/build-docdep.perl: Fix dependencies for included asciidoc files
Adding dependencies on included files to the generated man pages is
wrong - includes are processed by asciidoc, therefore the intermediate
Docbook XML files really depend on included files.  Because of these
wrong dependencies the man pages were not rebuilt properly if the
intermediate XML files were left in the tree.

Signed-off-by: Sergey Vlasov <vsu@altlinux.ru>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-03-01 13:24:54 -08:00
Junio C Hamano f8d294f0a4 Clean build annoyance.
As Pasky pointed out, building in templates directory showed
list of built template files which was unneeded.  This commit
also fixes another build annoyance I recently left in by
accident.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-11-08 08:58:52 -08:00
Junio C Hamano fb612d54c1 Documentation: fix dependency generation.
The previous rule misses the case where git.txt or tutorial.txt
includes new files.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-11-08 00:23:12 -08:00
Junio C Hamano a5ae8e64cf Fix documentation dependency generation.
Documentation/Makefile spent a lot of time to generate include
dependencies, which was quite noticeable especially during "make clean".

Rewrite it to generate just a single dependency file.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-11-07 18:21:51 -08:00