--- /dev/null
+# -*- 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
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
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
--- /dev/null
+# -*- 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)
--- /dev/null
+# -*- 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)