Skip to content

Commit d79042b

Browse files
yann-morin-1998jacmet
authored andcommitted
doc/asciidoc: always apply Buildroot's AsciiDoc config
As suggested by Thomas: the AsciiDoc options we use ensure we get a sane output of the document. We want that configuration to be applied to other documents as well. Up until now, it was implicit that the configuration was applied to our manual, becasue we only supported document-specific configuration, and the configuration we had was in our manual dir, so we got to use it. But now, we can render other documents, especially ones from br2-external, and we want those to also use the default configuration from Buildroot, but still be able to provide their own customisation. So, always add Buildroot's configuration first, if available, before we append the document's configuration. Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Cc: Samuel Martin <s.martin49@gmail.com> Cc: Thomas De Schampheleire <patrickdepinguin@gmail.com> Reviewed-by: Samuel Martin <s.martin49@gmail.com> Reviewed-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com> Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
1 parent 3c40c9e commit d79042b

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed
File renamed without changes.

package/doc-asciidoc.mk

+17-1
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@ asciidoc-check-dependencies-pdf:
3131
GENDOC_XSLTPROC_IS_BROKEN = \
3232
$(shell xsltproc --maxvars 0 >/dev/null 2>/dev/null || echo y)
3333

34+
# Apply this configuration to all documents
35+
BR_ASCIIDOC_CONF = docs/conf/asciidoc.conf
36+
3437
################################################################################
3538
# ASCIIDOC_INNER -- generates the make targets needed to build a specific type of
3639
# asciidoc documentation.
@@ -60,10 +63,23 @@ asciidoc-check-dependencies-$(5):
6063
$(1)-check-dependencies-$(5): asciidoc-check-dependencies-$(5)
6164
$$(Q)$$(foreach hook,$$($(2)_CHECK_DEPENDENCIES_$$(call UPPERCASE,$(5))_HOOKS),$$(call $$(hook))$$(sep))
6265

66+
# Include Buildroot's AsciiDoc configuration first:
67+
# - generic configuration,
68+
# - then output-specific configuration
69+
ifneq ($$(wildcard $$(BR_ASCIIDOC_CONF)),)
70+
$(2)_$(4)_ASCIIDOC_OPTS += -f $$(BR_ASCIIDOC_CONF)
71+
endif
72+
BR_$(4)_ASCIIDOC_CONF = docs/conf/asciidoc-$(4).conf
73+
ifneq ($$(wildcard $$(BR_$(4)_ASCIIDOC_CONF)),)
74+
$(2)_$(4)_ASCIIDOC_OPTS += -f $$(BR_$(4)_ASCIIDOC_CONF)
75+
endif
76+
77+
# Then include the document's AsciiDoc configuration:
78+
# - generic configuration,
79+
# - then output-specific configuration
6380
ifneq ($$(wildcard $$($(2)_ASCIIDOC_CONF)),)
6481
$(2)_$(4)_ASCIIDOC_OPTS += -f $$($(2)_ASCIIDOC_CONF)
6582
endif
66-
6783
$(2)_$(4)_ASCIIDOC_CONF = $(3)/asciidoc-$(4).conf
6884
ifneq ($$(wildcard $$($(2)_$(4)_ASCIIDOC_CONF)),)
6985
$(2)_$(4)_ASCIIDOC_OPTS += -f $$($(2)_$(4)_ASCIIDOC_CONF)

0 commit comments

Comments
 (0)