]> git.saurik.com Git - apt.git/commitdiff
Documentation support
authorArch Librarian <arch@canonical.com>
Mon, 20 Sep 2004 16:50:46 +0000 (16:50 +0000)
committerArch Librarian <arch@canonical.com>
Mon, 20 Sep 2004 16:50:46 +0000 (16:50 +0000)
Author: jgg
Date: 1998-07-13 02:01:28 GMT
Documentation support

buildlib/debiandoc.mak [new file with mode: 0644]
buildlib/defaults.mak
buildlib/manpage.mak [new file with mode: 0644]
doc/makefile [new file with mode: 0644]

diff --git a/buildlib/debiandoc.mak b/buildlib/debiandoc.mak
new file mode 100644 (file)
index 0000000..5e08bda
--- /dev/null
@@ -0,0 +1,58 @@
+# -*- make -*-
+
+# This processes debian-doc sgml to produce html and plain text output
+
+# Input
+# $(SOURCE) - The documents to use
+
+# All output is writtin to files in the build doc directory
+
+# See defaults.mak for information about LOCAL
+
+# Some local definitions
+LOCAL := debiandoc-$(firstword $(SOURCE))
+$(LOCAL)-HTML := $(addsuffix .html,$(addprefix $(DOC)/,$(basename $(SOURCE))))
+$(LOCAL)-TEXT := $(addsuffix .text,$(addprefix $(DOC)/,$(basename $(SOURCE))))
+
+#---------
+
+# Rules to build HTML documentations
+ifdef DEBIANDOC_HTML
+
+# Install generation hooks
+doc: $($(LOCAL)-HTML)
+veryclean: veryclean/html/$(LOCAL)
+
+vpath %.sgml $(SUBDIRS)
+$(DOC)/%.html: %.sgml
+       echo Creating html for $< to $@
+       -rm -rf $@
+       (HERE=`pwd`; cd $(@D) && debiandoc2html $$HERE/$<)
+
+# Clean rule
+.PHONY: veryclean/html/$(LOCAL)
+veryclean/html/$(LOCAL):
+       -rm -rf $($(@F)-HTML)
+       
+endif
+
+#---------
+
+# Rules to build Text documentations
+ifdef DEBIANDOC_TEXT
+
+# Install generation hooks
+doc: $($(LOCAL)-TEXT)
+veryclean: veryclean/text/$(LOCAL)
+
+vpath %.sgml $(SUBDIRS)
+$(DOC)/%.text: %.sgml
+       echo Creating text for $< to $@
+       debiandoc2text -O $< > $@
+
+# Clean rule
+.PHONY: veryclean/text/$(LOCAL)
+veryclean/text/$(LOCAL):
+       -rm -rf $($(@F)-TEXT)
+       
+endif
index b268c4b9b998e44e6f56551a3443573ed69d6e7e..50f27de5a8ad17a6c1e1d6582f4dceee40d77ceb 100644 (file)
@@ -37,9 +37,12 @@ BIN := $(BUILD)/bin
 LIB := $(BIN)
 OBJ := $(BUILD)/obj
 DEP := $(OBJ)
+DOC := $(BUILD)/doc
 
 # Module types
-LIBRARY_H=$(BASE)/buildlib/library.mak
+LIBRARY_H = $(BASE)/buildlib/library.mak
+DEBIANDOC_H = $(BASE)/buildlib/debiandoc.mak
+MANPAGE_H = $(BASE)/buildlib/manpage.mak
 
 # Source location control
 # SUBDIRS specifies sub components of the module that
@@ -61,12 +64,15 @@ CXXFLAGS+= -Wall -g -fno-implicit-templates  -fno-exceptions
 PICFLAGS+= -fPIC -DPIC
 LFLAGS+= 
 INLINEDEPFLAG = -MD
+DEBIANDOC_HTML = yes
+DEBIANDOC_TEXT = yes
 
 # Phony rules. Other things hook these by appending to the dependency
 # list
-.PHONY: headers library clean veryclean all binary program
-all: binary
+.PHONY: headers library clean veryclean all binary program doc
+all: binary doc
 binary: library program
+maintainer-clean dist-clean: veryclean
 headers library clean veryclean program:
 
 # Header file control. We want all published interface headers to go
diff --git a/buildlib/manpage.mak b/buildlib/manpage.mak
new file mode 100644 (file)
index 0000000..d6a4ba3
--- /dev/null
@@ -0,0 +1,27 @@
+# -*- make -*-
+
+# This installs man pages into the doc directory
+
+# Input
+# $(SOURCE) - The documents to use
+
+# All output is writtin to files in the build doc directory
+
+# See defaults.mak for information about LOCAL
+
+# Some local definitions
+LOCAL := manpage-$(firstword $(SOURCE))
+$(LOCAL)-LIST := $(addprefix $(DOC)/,$(SOURCE))
+
+# Install generation hooks
+doc: $($(LOCAL)-LIST)
+veryclean: veryclean/$(LOCAL)
+
+$($(LOCAL)-LIST) : $(DOC)/% : %
+       echo Installing man page %< to $(@D)
+       cp $< $(@D)
+
+# Clean rule
+.PHONY: veryclean/$(LOCAL)
+veryclean/$(LOCAL):
+       -rm -rf $($(@F)-LIST)
diff --git a/doc/makefile b/doc/makefile
new file mode 100644 (file)
index 0000000..b53f4a0
--- /dev/null
@@ -0,0 +1,13 @@
+# -*- make -*-
+BASE=..
+
+# Bring in the default rules
+include ../buildlib/defaults.mak
+
+# SGML Documents
+SOURCE = dpkg-tech.sgml design.sgml files.sgml guide.sgml cache.sgml
+include $(DEBIANDOC_H)
+
+# Man pages
+SOURCE = apt-cache.8 apt-get.8 apt.8 ftp.conf.5 sources.list.5
+include $(MANPAGE_H)