Skip to content

Commit

Permalink
Dev: Makefile: build all-in-one manpage crm.8 (ClusterLabs#1374)
Browse files Browse the repository at this point in the history
and delegate document building to doc/Makefile.
  • Loading branch information
nicholasyang2022 committed Apr 11, 2024
1 parent a369f9c commit f92942d
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 8 deletions.
12 changes: 9 additions & 3 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,18 @@ help_DATA = doc/crm.8.adoc
generated_docs =
generated_mans =
if BUILD_ASCIIDOC
generated_docs += $(ascii:%.adoc=%.html) $(asciiman:%.adoc=%.html)
generated_mans += $(asciiman:%.8.adoc=%.8)
$(generated_mans): $(asciiman)
generated_docs += doc/crmsh_crm_report.8.html doc/generated-sources/crm.8.html
generated_mans += $(generated_docs:%.8.html=%.8)
$(generated_docs): doc
$(generated_mans): doc
man8_MANS = $(generated_mans)
endif

.PHONY: doc

doc:
$(MAKE) -C doc man html

%.html: %.adoc
$(ASCIIDOC) --unsafe --backend=xhtml11 $<

Expand Down
25 changes: 20 additions & 5 deletions doc/Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.PHONY: all clean subdirs website website-clean
.PHONY: all clean subdirs website website-clean man html

all: crm.8.html generated-sources/crm.8.aio.adoc
all: generated-sources/crm.8.aio.adoc

generated-sources:
mkdir -p $@
Expand All @@ -20,14 +20,29 @@ generated-sources/crm.8.aio.adoc: generated-sources/crm.8.adoc generated-sources
generated-sources/profiles.adoc: profiles.adoc generated-sources
cp $< $@

crm.8.html: generated-sources/crm.8.aio.adoc
asciidoctor $<
generated-sources/crm.8.html: generated-sources/crm.8.aio.adoc
asciidoc --unsafe --backend=xhtml11 $<
mv generated-sources/crm.8.aio.html generated-sources/crm.8.html

website: generated-sources/crm.8.adoc
$(MAKE) -C website-v1 all

website-clean:
$(MAKE) -C website-v1 clean

man: crmsh_crm_report.8 generated_sources/crm.8

generated_sources/crm.8: generated-source/crm.8.aio.adoc
a2x -f manpage $<
mv generated-source/crm.8.aio generated-source/crm.8

crmsh_crm_report.8:
a2x -f manpage $<

html: generated-sources/crm.8.html crmsh_crm_report.8.html

crmsh_crm_report.8.html: crmsh_crm_report.8.adoc
asciidoc --unsafe --backend=xhtml11 $<

clean: website-clean
$(RM) -r generated-sources crm.8.html
$(RM) -r generated-sources crmsh_crm_report.8 crmsh_crm_report.8.html

0 comments on commit f92942d

Please sign in to comment.