From: Martin Mares Date: Sat, 21 Apr 2012 21:03:13 +0000 (+0200) Subject: Bits of infrastructure for building documentation with AsciiDoc X-Git-Url: http://mj.ucw.cz/gitweb/?a=commitdiff_plain;h=6188d2495942caaca75892e7634e7ecc826d8e84;p=eval.git Bits of infrastructure for building documentation with AsciiDoc I had to hack around the doc rules in the UCW build system. This needs cleanup one day. --- diff --git a/Makefile b/Makefile index 9480ae5..49a55b1 100644 --- a/Makefile +++ b/Makefile @@ -20,8 +20,10 @@ include $(BUILDSYS)/Maketop ifdef CONFIG_UCW_LIBS include $(s)/ucw/Makefile include $(s)/sherlock/Makefile -# Disable built-in tests of these libraries +# Disable built-in tests and documentation of these libraries TESTS= +DOCS= +DOC_INDICES= endif include $(s)/box/Makefile diff --git a/build/Makebottom b/build/Makebottom index e2c8402..7f1236c 100644 --- a/build/Makebottom +++ b/build/Makebottom @@ -204,22 +204,22 @@ $(DATAFILES): $(o)/%: $(s)/% # Rules for documentation -$(o)/%.html: $(o)/%.txt $(BUILDSYS)/asciidoc.conf $(BUILDSYS)/asciidoc-xhtml.conf run/$(DOCDIR)/$(DOC_MODULE)/.dir-stamp - $(M)"DOC-HTML $<" - $(Q)asciidoc -e -f $(BUILDSYS)/asciidoc.conf -f $(BUILDSYS)/asciidoc-xhtml.conf -f $(HOST_PREFIX)/etc/asciidoc/asciidoc.conf -f $(HOST_PREFIX)/etc/asciidoc/xhtml11.conf $< - $(Q)$(call symlink,$@,run/$(DOCDIR)/$(DOC_MODULE)) - -# In reality, we do not depend on the .txt files, but on the corresponding .deflist's. -# However, the Makefile language cannot express that doc-extract generates both .txt -# and .deflist, so we always use the .txt's in dependencies. -$(patsubst %.html,%.txt,$(DOC_INDICES)): $(o)/%.txt: $(patsubst %.html,%.txt,$(DOCS)) $(BUILDSYS)/doc-defs - $(M)"DOC-DEFS $@" - $(Q)echo $@: $(DOC_HEAD) $(DOC_LIST) >> $(o)/depend.new - $(Q)$(BUILDSYS)/doc-defs $(DOC_HEAD) $@ $(DOC_LIST) - -$(patsubst %.html,%.txt,$(DOCS)): $(o)/%.txt: $(s)/%.txt $(BUILDSYS)/doc-extract - $(M)"DOC-EXT $<" - $(Q)$(BUILDSYS)/doc-extract $< $@ $(o)/depend.new $(s) $(patsubst %.txt,%.deflist,$@) +## $(o)/%.html: $(o)/%.txt $(BUILDSYS)/asciidoc.conf $(BUILDSYS)/asciidoc-xhtml.conf run/$(DOCDIR)/$(DOC_MODULE)/.dir-stamp +## $(M)"DOC-HTML $<" +## $(Q)asciidoc -e -f $(BUILDSYS)/asciidoc.conf -f $(BUILDSYS)/asciidoc-xhtml.conf -f $(HOST_PREFIX)/etc/asciidoc/asciidoc.conf -f $(HOST_PREFIX)/etc/asciidoc/xhtml11.conf $< +## $(Q)$(call symlink,$@,run/$(DOCDIR)/$(DOC_MODULE)) +## +## # In reality, we do not depend on the .txt files, but on the corresponding .deflist's. +## # However, the Makefile language cannot express that doc-extract generates both .txt +## # and .deflist, so we always use the .txt's in dependencies. +## $(patsubst %.html,%.txt,$(DOC_INDICES)): $(o)/%.txt: $(patsubst %.html,%.txt,$(DOCS)) $(BUILDSYS)/doc-defs +## $(M)"DOC-DEFS $@" +## $(Q)echo $@: $(DOC_HEAD) $(DOC_LIST) >> $(o)/depend.new +## $(Q)$(BUILDSYS)/doc-defs $(DOC_HEAD) $@ $(DOC_LIST) +## +## $(patsubst %.html,%.txt,$(DOCS)): $(o)/%.txt: $(s)/%.txt $(BUILDSYS)/doc-extract +## $(M)"DOC-EXT $<" +## $(Q)$(BUILDSYS)/doc-extract $< $@ $(o)/depend.new $(s) $(patsubst %.txt,%.deflist,$@) # Don't delete intermediate targets. There shouldn't be any, but due to bugs # in GNU Make rules with targets in not-yet-existing directories are ignored diff --git a/configure b/configure index b772db0..dbd86f7 100755 --- a/configure +++ b/configure @@ -30,6 +30,7 @@ Include Get("CONFIG"); require UCW::Configure::Paths; require UCW::Configure::C; require UCW::Configure::LibUCW; +require UCW::Configure::Doc; if (Get("CONFIG_SUBMIT") || Get("CONFIG_MOP")) { # Build libucw only if it is needed diff --git a/isolate/Makefile b/isolate/Makefile index a4aeff7..0017463 100644 --- a/isolate/Makefile +++ b/isolate/Makefile @@ -3,5 +3,10 @@ DIRS+=isolate PROGS+=$(o)/isolate/isolate +DOCS+=$(o)/isolate/isolate.1 $(o)/isolate/isolate: $(o)/isolate/isolate.o + +$(o)/isolate/isolate.1: $(s)/isolate/isolate.1.txt + $(M)"MAN $<" + $(Q)a2x -f manpage -D $(o)/isolate $<