diff --git a/Documentation/Makefile b/Documentation/Makefile index 3c93ec8a4..aa5d3ebbf 100644 --- a/Documentation/Makefile +++ b/Documentation/Makefile @@ -2,8 +2,13 @@ __nmk_dir ?= ../scripts/nmk/scripts/ include $(__nmk_dir)include.mk include $(__nmk_dir)macro.mk +ifneq ($(USE_ASCIIDOCTOR),) +ASCIIDOC := asciidoctor +XMLTO := +else ASCIIDOC := asciidoc XMLTO := xmlto +endif FOOTER := footer.txt SRC1 += crit.txt @@ -44,13 +49,21 @@ $(FOOTER): ../Makefile.versions %.1: %.txt $(FOOTER) custom.xsl $(call msg-gen, $@) +ifneq ($(USE_ASCIIDOCTOR),) + $(Q) $(ASCIIDOC) -b manpage -d manpage -o $@ $< +else $(Q) $(ASCIIDOC) -b docbook -d manpage -o $(patsubst %.1,%.xml,$@) $< $(Q) $(XMLTO) man -m custom.xsl $(patsubst %.1,%.xml,$@) 2>/dev/null +endif %.8: %.txt $(FOOTER) custom.xsl $(call msg-gen, $@) +ifneq ($(USE_ASCIIDOCTOR),) + $(Q) $(ASCIIDOC) -b manpage -d manpage -o $@ $< +else $(Q) $(ASCIIDOC) -b docbook -d manpage -o $(patsubst %.8,%.xml,$@) $< $(Q) $(XMLTO) man -m custom.xsl $(patsubst %.8,%.xml,$@) 2>/dev/null +endif %.ps: %.1 $(call msg-gen, $@) diff --git a/scripts/nmk/Documentation/Makefile b/scripts/nmk/Documentation/Makefile index b7446e2f3..4c037de67 100644 --- a/scripts/nmk/Documentation/Makefile +++ b/scripts/nmk/Documentation/Makefile @@ -1,5 +1,10 @@ +ifneq ($(USE_ASCIIDOCTOR),) +ASCIIDOC := asciidoctor +XMLTO := +else ASCIIDOC := asciidoc XMLTO := xmlto +endif PS2PDF := ps2pdf SRC += nmk.txt @@ -25,8 +30,12 @@ check: %.8: %.txt $(call msg-gen, $@) +ifneq ($(USE_ASCIIDOCTOR),) + $(Q) $(ASCIIDOC) -b manpage -d manpage -o $@ $< +else $(Q) $(ASCIIDOC) -b docbook -d manpage -o $(patsubst %.8,%.xml,$@) $< $(Q) $(XMLTO) man --skip-validation $(patsubst %.8,%.xml,$@) 2>/dev/null +endif %.ps: %.8 $(call msg-gen, $@) diff --git a/test/others/bers/Makefile b/test/others/bers/Makefile index a1d689c35..3034d46e3 100644 --- a/test/others/bers/Makefile +++ b/test/others/bers/Makefile @@ -8,8 +8,13 @@ endif export E Q +ifneq ($(USE_ASCIIDOCTOR),) +ASCIIDOC := asciidoctor +XMLTO := +else ASCIIDOC := asciidoc XMLTO := xmlto +endif SRC += bers.txt XMLS := $(patsubst %.txt,%.xml,$(SRC)) @@ -17,8 +22,12 @@ MANS := $(patsubst %.txt,%.8,$(SRC)) %.8: %.txt $(E) " GEN " $@ +ifneq ($(USE_ASCIIDOCTOR),) + $(Q) $(ASCIIDOC) -b manpage -d manpage -o $@ $< +else $(Q) $(ASCIIDOC) -b docbook -d manpage -o $(patsubst %.8,%.xml,$@) $< $(Q) $(XMLTO) man --skip-validation $(patsubst %.8,%.xml,$@) 2>/dev/null +endif docs: $(MANS) @true