Ver código fonte

Documentation support
Author: jgg
Date: 1998-07-13 02:01:28 GMT
Documentation support

Arch Librarian 22 anos atrás
pai
commit
ac96654175
4 arquivos alterados com 107 adições e 3 exclusões
  1. 58 0
      buildlib/debiandoc.mak
  2. 9 3
      buildlib/defaults.mak
  3. 27 0
      buildlib/manpage.mak
  4. 13 0
      doc/makefile

+ 58 - 0
buildlib/debiandoc.mak

@@ -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

+ 9 - 3
buildlib/defaults.mak

@@ -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

+ 27 - 0
buildlib/manpage.mak

@@ -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)

+ 13 - 0
doc/makefile

@@ -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)