]> mj.ucw.cz Git - moe.git/commitdiff
Bits of infrastructure for building documentation with AsciiDoc
authorMartin Mares <mj@ucw.cz>
Sat, 21 Apr 2012 21:03:13 +0000 (23:03 +0200)
committerMartin Mares <mj@ucw.cz>
Sat, 21 Apr 2012 21:03:13 +0000 (23:03 +0200)
I had to hack around the doc rules in the UCW build system.
This needs cleanup one day.

Makefile
build/Makebottom
configure
isolate/Makefile

index 9480ae52e689f9fd3c83b391cbfc6e2b2250ef0d..49a55b17ff5fa8018be2717cff74a4c4707312c6 100644 (file)
--- 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
index e2c840270933077bbf012b1a6ac67a5a99c64755..7f1236ccadc6fbc074a196ccd94f2de0334b4e54 100644 (file)
@@ -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
index b772db090c0d91ee6094f271df50f7f1f1c4cc74..dbd86f76793e924f3bc8fb9d03a0d7ef708803a1 100755 (executable)
--- 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
index a4aeff7d07e37f32ccf1e68bb8d6074b22779f64..00174634758c11bb90eec01e5fdd6f5fd243f6fa 100644 (file)
@@ -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 $<