mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 02:01:24 +01:00
docs/Makefile: Introduce GENERATE_PANDOC_RULE_RAW
We are going to want to format SUPPORT.md which does not match the filename patterns in docs/. So provide a way to make an ad-hoc rule using pandoc with the standard options. No functional change in this patch. Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com> Release-acked-by: Juergen Gross <jgross@suse.com> Acked-by: Lars Kurth <lars.kurth@citrix.com>
This commit is contained in:
1 parent
1e4a834a8f
commit
539f93945c
1 file changed
+6
-5
+6
-5
@@ -237,17 +237,18 @@ txt/%.txt: %.markdown
|
||||
$(INSTALL_DATA) $< $@
|
||||
|
||||
# Metarule for generating pandoc rules.
|
||||
define GENERATE_PANDOC_RULE
|
||||
# $(1) is the target documentation format. $(2) is the source format.
|
||||
|
||||
$(1)/%.$(1): %.$(2)
|
||||
define GENERATE_PANDOC_RULE_RAW
|
||||
$(1): $(2)
|
||||
ifneq ($(PANDOC),)
|
||||
@$(INSTALL_DIR) $$(@D)
|
||||
$(PANDOC) --number-sections --toc --standalone $$< --output $$@
|
||||
else
|
||||
@echo "pandoc not installed; skipping $$@"
|
||||
endif
|
||||
|
||||
endef
|
||||
define GENERATE_PANDOC_RULE
|
||||
# $(1) is the target documentation format. $(2) is the source format.
|
||||
$(call GENERATE_PANDOC_RULE_RAW,$(1)/%.$(1),%.$(2))
|
||||
endef
|
||||
$(eval $(call GENERATE_PANDOC_RULE,pdf,pandoc)) # pdf/%.pdf: %.pandoc
|
||||
$(eval $(call GENERATE_PANDOC_RULE,txt,pandoc)) # txt/%.txt: %.pandoc
|
||||
|
||||